@uniformdev/cli 11.0.1-alpha.14 → 11.0.1-alpha.65

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
- "use strict";var __awaiter=this&&this.__awaiter||function(e,a,i,u){return new(i=i||Promise)(function(r,t){function n(e){try{s(u.next(e))}catch(e){t(e)}}function o(e){try{s(u.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?r(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(n,o)}s((u=u.apply(e,a||[])).next())})},__generator=this&&this.__generator||function(r,n){var o,s,a,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return i.label++,{value:t[1],done:!1};case 5:i.label++,s=t[1],t=[0];continue;case 7:t=i.ops.pop(),i.trys.pop();continue;default:if(!(a=0<(a=i.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){i=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){i.label=t[1];break}if(6===t[0]&&i.label<a[1]){i.label=a[1],a=t;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(t);break}a[2]&&i.ops.pop(),i.trys.pop();continue}t=n.call(r,i)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var chalk_1=__importDefault(require("chalk")),fs_1=require("fs"),node_fetch_1=__importDefault(require("node-fetch")),process_1=require("process"),constants_1=require("../../../constants"),module={command:"download [output]",describe:"Download intent manifest",builder:function(e){return e.option("apiKey",{alias:"k",demandOption:!0,string:!0,default:process.env.UNIFORM_API_KEY,describe:"Uniform API key to use. Defaults to UNIFORM_API_KEY env if set."}).option("project",{describe:"Uniform project ID. Defaults to UOPT_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",default:null!==(e=process.env.UOPT_CLI_PROJECT_ID)&&void 0!==e?e:process.env.UNIFORM_PROJECT_ID,type:"string",alias:["p"]}).option("preview",{describe:"If set, fetches the unpublished preview manifest (assuming your API key has permission)",default:!1,type:"boolean",alias:["d"]}).option("output",{string:!0,alias:"o",default:process.env.UNIFORM_MANIFEST_PATH,describe:"Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set."})},handler:function(e){var c=e.apiKey,f=e.output,p=e.project,d=e.preview;return __awaiter(void 0,void 0,void 0,function(){var t,r,n,o,s,a,i,u,l;return __generator(this,function(e){switch(e.label){case 0:/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test(c)?console.error(chalk_1.default.yellow("WARNING: you appear to be using a deprecated type of API key. Keys like this will stop working soon; please create new keys on uniform.app.")):p||(console.error(chalk_1.default.red("You must specify the project ID")),process_1.exit(1)),r=resolveBaseUrl(),o=new URLSearchParams,p&&o.set("projectId",p),d&&o.set("preview","true"),t=r+"api/v1/manifest?"+o.toString(),r=void 0,e.label=1;case 1:return e.trys.push([1,5,,6]),[4,node_fetch_1.default(t,{headers:{"x-api-key":c}})];case 2:if((r=e.sent()).ok)return[3,4];if(403===r.status)throw"The API key "+c+" had no published data. This means it is either incorrectly entered, or intents have not been published since creating the API key.";return n=r.status+" "+r.statusText+", content ",[4,r.text()];case 3:throw n+e.sent();case 4:return[3,6];case 5:return o=e.sent(),console.error(chalk_1.default.red("⚠ Error fetching intent manifest "+t)),console.error(chalk_1.default.gray(" ❗ "+o)),process_1.exit(1),[3,6];case 6:return e.trys.push([6,8,,10]),[4,r.json()];case 7:return s=e.sent(),[3,10];case 8:return l=e.sent(),console.error(chalk_1.default.red(chalk_1.default.red("⚠ Error parsing intent manifest "+t))),console.error(chalk_1.default.gray(" ❗ "+l)),i=(a=console).error,u="Response: ",[4,r.text()];case 9:return i.apply(a,[u+e.sent()]),process_1.exit(1),[3,10];case 10:return l=JSON.stringify(s,null,2),f?fs_1.writeFile(f,l,function(e){e&&(console.error("Error writing file to "+f+"\n",e),process_1.exit(1)),console.log(chalk_1.default.green("✅ "+f+" has been updated from "+t))}):console.log(l),[2]}})})}},resolveBaseUrl=function(){var e=process.env.UNIFORM_CLI_BASE_URL||constants_1.UniformBaseUrl;return e.endsWith("/")||(e+="/"),e};exports.default=module;
1
+ "use strict";var __awaiter=this&&this.__awaiter||function(e,a,i,u){return new(i=i||Promise)(function(r,t){function n(e){try{s(u.next(e))}catch(e){t(e)}}function o(e){try{s(u.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?r(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(n,o)}s((u=u.apply(e,a||[])).next())})},__generator=this&&this.__generator||function(r,n){var o,s,a,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;i;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return i.label++,{value:t[1],done:!1};case 5:i.label++,s=t[1],t=[0];continue;case 7:t=i.ops.pop(),i.trys.pop();continue;default:if(!(a=0<(a=i.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){i=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){i.label=t[1];break}if(6===t[0]&&i.label<a[1]){i.label=a[1],a=t;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(t);break}a[2]&&i.ops.pop(),i.trys.pop();continue}t=n.call(r,i)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var chalk_1=__importDefault(require("chalk")),fs_1=require("fs"),node_fetch_1=__importDefault(require("node-fetch")),process_1=require("process"),constants_1=require("../../../constants"),module={command:"download [output]",describe:"Download intent manifest",builder:function(e){return e.option("apiKey",{alias:"k",demandOption:!0,string:!0,default:process.env.UNIFORM_API_KEY,describe:"Uniform API key to use. Defaults to UNIFORM_API_KEY env if set."}).option("project",{describe:"Uniform project ID. Defaults to UOPT_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",default:null!==(e=process.env.UOPT_CLI_PROJECT_ID)&&void 0!==e?e:process.env.UNIFORM_PROJECT_ID,type:"string",alias:["p"]}).option("preview",{describe:"If set, fetches the unpublished preview manifest (assuming your API key has permission)",default:!1,type:"boolean",alias:["d"]}).option("output",{string:!0,alias:"o",default:process.env.UNIFORM_MANIFEST_PATH,describe:"Path to write manifest to. Defaults to UNIFORM_MANIFEST_PATH env if set."})},handler:function(e){var c=e.apiKey,f=e.output,p=e.project,d=e.preview;return __awaiter(void 0,void 0,void 0,function(){var t,r,n,o,s,a,i,u,l;return __generator(this,function(e){switch(e.label){case 0:/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test(c)?console.error(chalk_1.default.yellow("WARNING: you appear to be using a deprecated type of API key. Keys like this will stop working soon; please create new keys on uniform.app.")):p||(console.error(chalk_1.default.red("You must specify the project ID")),(0,process_1.exit)(1)),r=resolveBaseUrl(),o=new URLSearchParams,p&&o.set("projectId",p),d&&o.set("preview","true"),t=r+"api/v1/manifest?"+o.toString(),r=void 0,e.label=1;case 1:return e.trys.push([1,5,,6]),[4,(0,node_fetch_1.default)(t,{headers:{"x-api-key":c}})];case 2:if((r=e.sent()).ok)return[3,4];if(403===r.status)throw"The API key "+c+" had no published data. This means it is either incorrectly entered, or intents have not been published since creating the API key.";return n=r.status+" "+r.statusText+", content ",[4,r.text()];case 3:throw n+e.sent();case 4:return[3,6];case 5:return o=e.sent(),console.error(chalk_1.default.red("⚠ Error fetching intent manifest "+t)),console.error(chalk_1.default.gray(" ❗ "+o)),(0,process_1.exit)(1),[3,6];case 6:return e.trys.push([6,8,,10]),[4,r.json()];case 7:return s=e.sent(),[3,10];case 8:return l=e.sent(),console.error(chalk_1.default.red(chalk_1.default.red("⚠ Error parsing intent manifest "+t))),console.error(chalk_1.default.gray(" ❗ "+l)),i=(a=console).error,u="Response: ",[4,r.text()];case 9:return i.apply(a,[u+e.sent()]),(0,process_1.exit)(1),[3,10];case 10:return l=JSON.stringify(s,null,2),f?(0,fs_1.writeFile)(f,l,function(e){e&&(console.error("Error writing file to "+f+"\n",e),(0,process_1.exit)(1)),console.log(chalk_1.default.green("✅ "+f+" has been updated from "+t))}):console.log(l),[2]}})})}},resolveBaseUrl=function(){var e=process.env.UNIFORM_CLI_BASE_URL||constants_1.UniformBaseUrl;return e.endsWith("/")||(e+="/"),e};exports.default=module;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "11.0.1-alpha.14+a21c398",
3
+ "version": "11.0.1-alpha.65+a1ddbff",
4
4
  "description": "Uniform command line interface tool",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./cli.js",
@@ -24,17 +24,17 @@
24
24
  "yargs": "^17.1.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@types/jest": "^27.0.1",
28
- "@types/node": "^16.7.1",
29
- "@types/node-fetch": "^2.5.12",
30
- "@types/yargs": "^17.0.2",
31
- "eslint": "^7.32.0",
32
- "eslint-plugin-react": "^7.24.0",
33
- "eslint-plugin-react-hooks": "^4.2.0",
34
- "jest": "^27.0.6",
35
- "npm-run-all": "^4.1.5",
36
- "rimraf": "^3.0.2",
37
- "ts-jest": "^27.0.5"
27
+ "@types/jest": "27.0.2",
28
+ "@types/node": "16.7.1",
29
+ "@types/node-fetch": "2.5.12",
30
+ "@types/yargs": "17.0.3",
31
+ "eslint": "7.32.0",
32
+ "eslint-plugin-react": "7.26.0",
33
+ "eslint-plugin-react-hooks": "4.2.0",
34
+ "jest": "27.2.1",
35
+ "npm-run-all": "4.1.5",
36
+ "rimraf": "3.0.2",
37
+ "ts-jest": "27.0.5"
38
38
  },
39
39
  "bin": {
40
40
  "uniform": "./cli.js"
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "a21c3980dabd89376b0d59ae057297efc46a7abe"
48
+ "gitHead": "a1ddbff0a3bedc3f44c39f6f8ca254a32f26267e"
49
49
  }