jitsu-cli 1.9.10 → 1.9.12

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,4 +1,4 @@
1
- jitsu-cli:build: cache hit, replaying output 239dfa4ad2d56ea3
1
+ jitsu-cli:build: cache hit, replaying output bfbddb46fe0fca38
2
2
  jitsu-cli:build: 
3
3
  jitsu-cli:build: > jitsu-cli@0.0.0 build /Users/ildarnurislamov/Projects/newjitsu/cli/jitsu-cli
4
4
  jitsu-cli:build: > pnpm compile && webpack
@@ -25,4 +25,4 @@ jitsu-cli:build: cache hit, replaying output 239dfa4ad2d56ea3
25
25
  jitsu-cli:build:  external "worker_threads" 42 bytes [optional] [built] [code generated]
26
26
  jitsu-cli:build:  external "node:stream/web" 42 bytes [optional] [built] [code generated]
27
27
  jitsu-cli:build: + 26 modules
28
- jitsu-cli:build: webpack 5.95.0 compiled successfully in 4532 ms
28
+ jitsu-cli:build: webpack 5.95.0 compiled successfully in 4626 ms
@@ -1,4 +1,4 @@
1
- jitsu-cli:clean: cache hit, replaying output 257faca600459f53
1
+ jitsu-cli:clean: cache hit, replaying output e8f3d6c4dafa8085
2
2
  jitsu-cli:clean: 
3
3
  jitsu-cli:clean: > jitsu-cli@0.0.0 clean /Users/ildarnurislamov/Projects/newjitsu/cli/jitsu-cli
4
4
  jitsu-cli:clean: > rm -rf ./dist
@@ -44,7 +44,7 @@ export const config = {
44
44
  description: ""
45
45
  };
46
46
 
47
- const helloWorldFunction: JitsuFunction<AnalyticsServerEvent, any> = async (event, { log, fetch, props, store, geo, ...meta }) => {
47
+ const helloWorldFunction: JitsuFunction<AnalyticsServerEvent, any> = async (event, { log, fetch, store, geo, ...meta }) => {
48
48
  //output "Hello World!" to logs and return unchanged event
49
49
  log.info("Hello World!");
50
50
  return event
package/dist/main.js CHANGED
@@ -913,7 +913,7 @@ function extractString(obj) {
913
913
  }
914
914
  var rpc = /*#__PURE__*/function () {
915
915
  var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(url) {
916
- var _result$headers$get;
916
+ var _result$headers$get, _result$headers$get2;
917
917
  var _ref6,
918
918
  body,
919
919
  rest,
@@ -928,6 +928,7 @@ var rpc = /*#__PURE__*/function () {
928
928
  errorJson,
929
929
  defaultErrorMessage,
930
930
  errorMessage,
931
+ text,
931
932
  _args2 = arguments;
932
933
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
933
934
  while (1) switch (_context2.prev = _context2.next) {
@@ -1006,11 +1007,30 @@ var rpc = /*#__PURE__*/function () {
1006
1007
  case 27:
1007
1008
  return _context2.abrupt("return", _context2.sent);
1008
1009
  case 30:
1009
- _context2.next = 32;
1010
+ if (!((_result$headers$get2 = result.headers.get("Content-Type")) !== null && _result$headers$get2 !== void 0 ? _result$headers$get2 : "").startsWith("application/x-ndjson")) {
1011
+ _context2.next = 37;
1012
+ break;
1013
+ }
1014
+ _context2.next = 33;
1010
1015
  return result.text();
1011
- case 32:
1012
- return _context2.abrupt("return", _context2.sent);
1013
1016
  case 33:
1017
+ text = _context2.sent;
1018
+ return _context2.abrupt("return", text.split("\n").filter(function (line) {
1019
+ return line.length > 0;
1020
+ }).map(function (line) {
1021
+ try {
1022
+ return JSON.parse(line);
1023
+ } catch (e) {
1024
+ console.error("Error parsing JSON line from ".concat(method, " ").concat(url, ": ").concat(error_getErrorMessage(e)));
1025
+ return undefined;
1026
+ }
1027
+ }));
1028
+ case 37:
1029
+ _context2.next = 39;
1030
+ return result.text();
1031
+ case 39:
1032
+ return _context2.abrupt("return", _context2.sent);
1033
+ case 40:
1014
1034
  case "end":
1015
1035
  return _context2.stop();
1016
1036
  }
@@ -82202,7 +82222,7 @@ var functionTest = function functionTest(_ref2) {
82202
82222
  };
82203
82223
  var functionCode = function functionCode(_ref3) {
82204
82224
  _objectDestructuringEmpty(_ref3);
82205
- return "\nimport { JitsuFunction } from \"@jitsu/protocols/functions\";\nimport { RetryError } from \"@jitsu/functions-lib\";\nimport { AnalyticsServerEvent } from \"@jitsu/protocols/analytics\";\n\nexport const config = {\n slug: \"hello.ts\", //id (uniq per workspace) used to identify function in Jitsu\n name: \"Hello World Function\", //human readable name of function\n description: \"\"\n};\n\nconst helloWorldFunction: JitsuFunction<AnalyticsServerEvent, any> = async (event, { log, fetch, props, store, geo, ...meta }) => {\n //output \"Hello World!\" to logs and return unchanged event\n log.info(\"Hello World!\");\n return event\n};\n\nexport default helloWorldFunction;\n";
82225
+ return "\nimport { JitsuFunction } from \"@jitsu/protocols/functions\";\nimport { RetryError } from \"@jitsu/functions-lib\";\nimport { AnalyticsServerEvent } from \"@jitsu/protocols/analytics\";\n\nexport const config = {\n slug: \"hello.ts\", //id (uniq per workspace) used to identify function in Jitsu\n name: \"Hello World Function\", //human readable name of function\n description: \"\"\n};\n\nconst helloWorldFunction: JitsuFunction<AnalyticsServerEvent, any> = async (event, { log, fetch, store, geo, ...meta }) => {\n //output \"Hello World!\" to logs and return unchanged event\n log.info(\"Hello World!\");\n return event\n};\n\nexport default helloWorldFunction;\n";
82206
82226
  };
82207
82227
  var profileTest = function profileTest(_ref4) {
82208
82228
  var packageName = _ref4.packageName;