@webex/test-helper-appid 2.59.8-next.1 → 2.60.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"names":["require","makeLocalUrl","module","exports","createUser","options","fetch","method","headers","Headers","body","_stringify","default","then","res","json","jwt"],"sources":["create-user.browser.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nrequire('whatwg-fetch');\nconst makeLocalUrl = require('@webex/test-helper-make-local-url');\n\n/* eslint-env browser */\n\nmodule.exports = function createUser(options) {\n return fetch(makeLocalUrl('/jwt'), {\n method: 'POST',\n headers: new Headers({\n 'content-type': 'application/json',\n }),\n body: JSON.stringify(options),\n })\n .then((res) => res.json())\n .then((body) => body.jwt);\n};\n"],"mappings":";;;;AAAA;AACA;AACA;;AAEAA,OAAO,CAAC,cAAc,CAAC;AACvB,IAAMC,YAAY,GAAGD,OAAO,CAAC,mCAAmC,CAAC;;AAEjE;;AAEAE,MAAM,CAACC,OAAO,GAAG,SAASC,UAAUA,CAACC,OAAO,EAAE;EAC5C,OAAOC,KAAK,CAACL,YAAY,CAAC,MAAM,CAAC,EAAE;IACjCM,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE,IAAIC,OAAO,CAAC;MACnB,cAAc,EAAE;IAClB,CAAC,CAAC;IACFC,IAAI,EAAE,IAAAC,UAAA,CAAAC,OAAA,EAAeP,OAAO;EAC9B,CAAC,CAAC,CACCQ,IAAI,CAAC,UAACC,GAAG;IAAA,OAAKA,GAAG,CAACC,IAAI,EAAE;EAAA,EAAC,CACzBF,IAAI,CAAC,UAACH,IAAI;IAAA,OAAKA,IAAI,CAACM,GAAG;EAAA,EAAC;AAC7B,CAAC"}
1
+ {"version":3,"names":["require","makeLocalUrl","module","exports","createUser","options","fetch","method","headers","Headers","body","_stringify","default","then","res","json","jwt"],"sources":["create-user.browser.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nrequire('whatwg-fetch');\nconst makeLocalUrl = require('@webex/test-helper-make-local-url');\n\n/* eslint-env browser */\n\nmodule.exports = function createUser(options) {\n return fetch(makeLocalUrl('/jwt'), {\n method: 'POST',\n headers: new Headers({\n 'content-type': 'application/json',\n }),\n body: JSON.stringify(options),\n })\n .then((res) => res.json())\n .then((body) => body.jwt);\n};\n"],"mappings":";;;;AAAA;AACA;AACA;;AAEAA,OAAO,CAAC,cAAc,CAAC;AACvB,IAAMC,YAAY,GAAGD,OAAO,CAAC,mCAAmC,CAAC;;AAEjE;;AAEAE,MAAM,CAACC,OAAO,GAAG,SAASC,UAAUA,CAACC,OAAO,EAAE;EAC5C,OAAOC,KAAK,CAACL,YAAY,CAAC,MAAM,CAAC,EAAE;IACjCM,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE,IAAIC,OAAO,CAAC;MACnB,cAAc,EAAE;IAClB,CAAC,CAAC;IACFC,IAAI,EAAE,IAAAC,UAAA,CAAAC,OAAA,EAAeP,OAAO;EAC9B,CAAC,CAAC,CACCQ,IAAI,CAAC,UAACC,GAAG;IAAA,OAAKA,GAAG,CAACC,IAAI,CAAC,CAAC;EAAA,EAAC,CACzBF,IAAI,CAAC,UAACH,IAAI;IAAA,OAAKA,IAAI,CAACM,GAAG;EAAA,EAAC;AAC7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["jwt","require","uuid","_require","Buffer","module","exports","createUser","_ref","displayName","expiresInSeconds","issuer","userId","payload","name","options","expiresIn","process","env","WEBEX_APPID_ORGID","subject","v4","secret","from","WEBEX_APPID_SECRET","jwtToken","sign","_promise","default","resolve","e","reject"],"sources":["create-user.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nconst jwt = require('jsonwebtoken');\nconst uuid = require('uuid');\nconst {Buffer} = require('safe-buffer');\n\n/**\n * Creates a jwt user token\n * @param {object} options\n * @param {String} options.displayName *required*\n * @param {Number} options.expiresInSeconds\n * @param {String} options.issuer Guest Issuer ID\n * @param {String} options.userId *no spaces*\n * @returns {Promise<object>}\n */\nmodule.exports = function createUser({displayName, expiresInSeconds, issuer, userId}) {\n const payload = {\n name: displayName,\n };\n const options = {\n expiresIn: expiresInSeconds || 90 * 60,\n issuer: issuer || process.env.WEBEX_APPID_ORGID,\n subject: userId || uuid.v4(),\n };\n const secret = Buffer.from(process.env.WEBEX_APPID_SECRET, 'base64');\n\n try {\n const jwtToken = jwt.sign(payload, secret, options);\n\n return Promise.resolve({\n jwt: jwtToken,\n secret: process.env.WEBEX_APPID_SECRET,\n });\n } catch (e) {\n return Promise.reject(e);\n }\n};\n"],"mappings":";;;;AAAA;AACA;AACA;;AAEA,IAAMA,GAAG,GAAGC,OAAO,CAAC,cAAc,CAAC;AACnC,IAAMC,IAAI,GAAGD,OAAO,CAAC,MAAM,CAAC;AAC5B,IAAAE,QAAA,GAAiBF,OAAO,CAAC,aAAa,CAAC;EAAhCG,MAAM,GAAAD,QAAA,CAANC,MAAM;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAC,MAAM,CAACC,OAAO,GAAG,SAASC,UAAUA,CAAAC,IAAA,EAAkD;EAAA,IAAhDC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAEC,gBAAgB,GAAAF,IAAA,CAAhBE,gBAAgB;IAAEC,MAAM,GAAAH,IAAA,CAANG,MAAM;IAAEC,MAAM,GAAAJ,IAAA,CAANI,MAAM;EACjF,IAAMC,OAAO,GAAG;IACdC,IAAI,EAAEL;EACR,CAAC;EACD,IAAMM,OAAO,GAAG;IACdC,SAAS,EAAEN,gBAAgB,IAAI,EAAE,GAAG,EAAE;IACtCC,MAAM,EAAEA,MAAM,IAAIM,OAAO,CAACC,GAAG,CAACC,iBAAiB;IAC/CC,OAAO,EAAER,MAAM,IAAIV,IAAI,CAACmB,EAAE;EAC5B,CAAC;EACD,IAAMC,MAAM,GAAGlB,MAAM,CAACmB,IAAI,CAACN,OAAO,CAACC,GAAG,CAACM,kBAAkB,EAAE,QAAQ,CAAC;EAEpE,IAAI;IACF,IAAMC,QAAQ,GAAGzB,GAAG,CAAC0B,IAAI,CAACb,OAAO,EAAES,MAAM,EAAEP,OAAO,CAAC;IAEnD,OAAOY,QAAA,CAAAC,OAAA,CAAQC,OAAO,CAAC;MACrB7B,GAAG,EAAEyB,QAAQ;MACbH,MAAM,EAAEL,OAAO,CAACC,GAAG,CAACM;IACtB,CAAC,CAAC;EACJ,CAAC,CAAC,OAAOM,CAAC,EAAE;IACV,OAAOH,QAAA,CAAAC,OAAA,CAAQG,MAAM,CAACD,CAAC,CAAC;EAC1B;AACF,CAAC"}
1
+ {"version":3,"names":["jwt","require","uuid","_require","Buffer","module","exports","createUser","_ref","displayName","expiresInSeconds","issuer","userId","payload","name","options","expiresIn","process","env","WEBEX_APPID_ORGID","subject","v4","secret","from","WEBEX_APPID_SECRET","jwtToken","sign","_promise","default","resolve","e","reject"],"sources":["create-user.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nconst jwt = require('jsonwebtoken');\nconst uuid = require('uuid');\nconst {Buffer} = require('safe-buffer');\n\n/**\n * Creates a jwt user token\n * @param {object} options\n * @param {String} options.displayName *required*\n * @param {Number} options.expiresInSeconds\n * @param {String} options.issuer Guest Issuer ID\n * @param {String} options.userId *no spaces*\n * @returns {Promise<object>}\n */\nmodule.exports = function createUser({displayName, expiresInSeconds, issuer, userId}) {\n const payload = {\n name: displayName,\n };\n const options = {\n expiresIn: expiresInSeconds || 90 * 60,\n issuer: issuer || process.env.WEBEX_APPID_ORGID,\n subject: userId || uuid.v4(),\n };\n const secret = Buffer.from(process.env.WEBEX_APPID_SECRET, 'base64');\n\n try {\n const jwtToken = jwt.sign(payload, secret, options);\n\n return Promise.resolve({\n jwt: jwtToken,\n secret: process.env.WEBEX_APPID_SECRET,\n });\n } cat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MAAM,CAACD,CAAC,CAAC;EAC1B;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["bodyParser","require","express","createUser","router","module","exports","Router","use","json","strict","post","req","res","next","body","displayName","status","error","end","then","token","jwt","catch"],"sources":["router.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nconst bodyParser = require('body-parser');\nconst express = require('express');\n\nconst createUser = require('./create-user');\n\n/* eslint new-cap: [0] */\nconst router = (module.exports = express.Router());\n\n// Enable JSON bodies\n// ------------------\n\nrouter.use(\n bodyParser.json({\n strict: false,\n })\n);\n\nrouter.post('/', (req, res, next) => {\n if (!req.body.displayName) {\n res\n .status(400)\n .json({\n error: '`displayName` is a required body parameter',\n })\n .end();\n\n return;\n }\n\n createUser(req.body)\n .then((token) => {\n res.status(201).json({jwt: token}).end();\n })\n .catch(next);\n});\n"],"mappings":";;AAAA;AACA;AACA;;AAEA,IAAMA,UAAU,GAAGC,OAAO,CAAC,aAAa,CAAC;AACzC,IAAMC,OAAO,GAAGD,OAAO,CAAC,SAAS,CAAC;AAElC,IAAME,UAAU,GAAGF,OAAO,CAAC,eAAe,CAAC;;AAE3C;AACA,IAAMG,MAAM,GAAIC,MAAM,CAACC,OAAO,GAAGJ,OAAO,CAACK,MAAM,EAAG;;AAElD;AACA;;AAEAH,MAAM,CAACI,GAAG,CACRR,UAAU,CAACS,IAAI,CAAC;EACdC,MAAM,EAAE;AACV,CAAC,CAAC,CACH;AAEDN,MAAM,CAACO,IAAI,CAAC,GAAG,EAAE,UAACC,GAAG,EAAEC,GAAG,EAAEC,IAAI,EAAK;EACnC,IAAI,CAACF,GAAG,CAACG,IAAI,CAACC,WAAW,EAAE;IACzBH,GAAG,CACAI,MAAM,CAAC,GAAG,CAAC,CACXR,IAAI,CAAC;MACJS,KAAK,EAAE;IACT,CAAC,CAAC,CACDC,GAAG,EAAE;IAER;EACF;EAEAhB,UAAU,CAACS,GAAG,CAACG,IAAI,CAAC,CACjBK,IAAI,CAAC,UAACC,KAAK,EAAK;IACfR,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACR,IAAI,CAAC;MAACa,GAAG,EAAED;IAAK,CAAC,CAAC,CAACF,GAAG,EAAE;EAC1C,CAAC,CAAC,CACDI,KAAK,CAACT,IAAI,CAAC;AAChB,CAAC,CAAC"}
1
+ {"version":3,"names":["bodyParser","require","express","createUser","router","module","exports","Router","use","json","strict","post","req","res","next","body","displayName","status","error","end","then","token","jwt","catch"],"sources":["router.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nconst bodyParser = require('body-parser');\nconst express = require('express');\n\nconst createUser = require('./create-user');\n\n/* eslint new-cap: [0] */\nconst router = (module.exports = express.Router());\n\n// Enable JSON bodies\n// ------------------\n\nrouter.use(\n bodyParser.json({\n strict: false,\n })\n);\n\nrouter.post('/', (req, res, next) => {\n if (!req.body.displayName) {\n res\n .status(400)\n .json({\n error: '`displayName` is a required body parameter',\n })\n .end();\n\n return;\n }\n\n createUser(req.body)\n .then((token) => {\n res.status(201).json({jwt: token}).end();\n })\n .catch(next);\n});\n"],"mappings":";;AAAA;AACA;AACA;;AAEA,IAAMA,UAAU,GAAGC,OAAO,CAAC,aAAa,CAAC;AACzC,IAAMC,OAAO,GAAGD,OAAO,CAAC,SAAS,CAAC;AAElC,IAAME,UAAU,GAAGF,OAAO,CAAC,eAAe,CAAC;;AAE3C;AACA,IAAMG,MAAM,GAAIC,MAAM,CAACC,OAAO,GAAGJ,OAAO,CAACK,MAAM,CAAC,CAAE;;AAElD;AACA;;AAEAH,MAAM,CAACI,GAAG,CACRR,UAAU,CAACS,IAAI,CAAC;EACdC,MAAM,EAAE;AACV,CAAC,CACH,CAAC;AAEDN,MAAM,CAACO,IAAI,CAAC,GAAG,EAAE,UAACC,GAAG,EAAEC,GAAG,EAAEC,IAAI,EAAK;EACnC,IAAI,CAACF,GAAG,CAACG,IAAI,CAACC,WAAW,EAAE;IACzBH,GAAG,CACAI,MAAM,CAAC,GAAG,CAAC,CACXR,IAAI,CAAC;MACJS,KAAK,EAAE;IACT,CAAC,CAAC,CACDC,GAAG,CAAC,CAAC;IAER;EACF;EAEAhB,UAAU,CAACS,GAAG,CAACG,IAAI,CAAC,CACjBK,IAAI,CAAC,UAACC,KAAK,EAAK;IACfR,GAAG,CAACI,MAAM,CAAC,GAAG,CAAC,CAACR,IAAI,CAAC;MAACa,GAAG,EAAED;IAAK,CAAC,CAAC,CAACF,GAAG,CAAC,CAAC;EAC1C,CAAC,CAAC,CACDI,KAAK,CAACT,IAAI,CAAC;AAChB,CAAC,CAAC"}
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "directory": "packages/@webex/test-helper-appid"
11
11
  },
12
12
  "engines": {
13
- "node": ">=14"
13
+ "node": ">=16"
14
14
  },
15
15
  "browser": {
16
16
  "./dist/create-user.js": "./dist/create-user.browser.js",
@@ -19,7 +19,7 @@
19
19
  "./src/router.js": false
20
20
  },
21
21
  "dependencies": {
22
- "@webex/test-helper-make-local-url": "^2.59.8-next.1",
22
+ "@webex/test-helper-make-local-url": "^2.60.0-next.1",
23
23
  "body-parser": "^1.19.0",
24
24
  "express": "^4.17.1",
25
25
  "jsonwebtoken": "^9.0.0",
@@ -43,12 +43,12 @@
43
43
  "@webex/eslint-config-legacy": "^0.0.0",
44
44
  "@webex/jest-config-legacy": "^0.0.0",
45
45
  "@webex/legacy-tools": "^0.0.0",
46
- "@webex/test-helper-chai": "^2.59.8-next.1",
47
- "@webex/test-helper-mocha": "^2.59.8-next.1",
48
- "@webex/test-helper-mock-webex": "^2.59.8-next.1",
49
- "@webex/test-helper-test-users": "^2.59.8-next.1",
46
+ "@webex/test-helper-chai": "^2.60.0-next.1",
47
+ "@webex/test-helper-mocha": "^2.60.0-next.1",
48
+ "@webex/test-helper-mock-webex": "^2.60.0-next.1",
49
+ "@webex/test-helper-test-users": "^2.60.0-next.1",
50
50
  "eslint": "^8.24.0",
51
51
  "prettier": "^2.7.1"
52
52
  },
53
- "version": "2.59.8-next.1"
53
+ "version": "2.60.0-next.1"
54
54
  }