@kwiz/node 1.0.55 → 1.0.56

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.
Files changed (43) hide show
  1. package/dist/SPO/common.js +13 -24
  2. package/dist/SPO/common.js.map +1 -1
  3. package/dist/auth/discovery.js +3 -12
  4. package/dist/auth/discovery.js.map +1 -1
  5. package/dist/auth/msal.js +40 -62
  6. package/dist/auth/msal.js.map +1 -1
  7. package/dist/get-with-cache.js +23 -34
  8. package/dist/get-with-cache.js.map +1 -1
  9. package/dist/graph/graph.js +11 -22
  10. package/dist/graph/graph.js.map +1 -1
  11. package/dist/next-js/api.js +21 -32
  12. package/dist/next-js/api.js.map +1 -1
  13. package/dist/next-js/api.responses.js +6 -2
  14. package/dist/next-js/api.responses.js.map +1 -1
  15. package/dist/ns/ns-rest.js +4 -15
  16. package/dist/ns/ns-rest.js.map +1 -1
  17. package/dist/ns/ns-restlet.js +5 -16
  18. package/dist/ns/ns-restlet.js.map +1 -1
  19. package/dist/ns/ns-soap.js +54 -63
  20. package/dist/ns/ns-soap.js.map +1 -1
  21. package/dist/ns/ns-suiteql.js +9 -17
  22. package/dist/ns/ns-suiteql.js.map +1 -1
  23. package/dist/ns/ns.js +52 -57
  24. package/dist/ns/ns.js.map +1 -1
  25. package/dist/ns/oauth1.js +4 -4
  26. package/dist/ns/oauth1.js.map +1 -1
  27. package/dist/sf/actions.js +183 -217
  28. package/dist/sf/actions.js.map +1 -1
  29. package/dist/sf/connections.js +49 -64
  30. package/dist/sf/connections.js.map +1 -1
  31. package/dist/sf/types.js +1 -1
  32. package/dist/sf/types.js.map +1 -1
  33. package/dist/storage/blob-storage.js +87 -115
  34. package/dist/storage/blob-storage.js.map +1 -1
  35. package/dist/storage/common.js +11 -22
  36. package/dist/storage/common.js.map +1 -1
  37. package/dist/storage/table-storage.js +191 -268
  38. package/dist/storage/table-storage.js.map +1 -1
  39. package/dist/utilities/email.js +28 -39
  40. package/dist/utilities/email.js.map +1 -1
  41. package/dist/utilities/xml.js +11 -2
  42. package/dist/utilities/xml.js.map +1 -1
  43. package/package.json +3 -3
@@ -1,46 +1,35 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.sendEmail = sendEmail;
13
4
  const common_1 = require("@kwiz/common");
14
5
  const nodemailer_1 = require("nodemailer");
15
- function sendEmail(cfg, info) {
16
- return __awaiter(this, void 0, void 0, function* () {
17
- const logger = common_1.ConsoleLogger.get("send-email");
18
- try {
19
- const email_user = cfg.login;
20
- const email_password = cfg.password;
21
- const mailTransport = (0, nodemailer_1.createTransport)({
22
- host: 'smtp.office365.com',
23
- port: 587,
24
- secure: false,
25
- auth: { user: email_user, pass: email_password },
26
- tls: { ciphers: 'SSLv3' }
27
- });
28
- const result = yield mailTransport.sendMail({
29
- from: { address: email_user, name: info.fromName },
30
- to: info.to,
31
- cc: info.cc,
32
- bcc: info.bcc,
33
- replyTo: email_user,
34
- subject: info.subject,
35
- html: info.bodyHtml,
36
- text: info.bodyText
37
- });
38
- return result.response;
39
- }
40
- catch (err) {
41
- logger.error(err);
42
- return (0, common_1.GetError)(err, "send365Email: An error occurred");
43
- }
44
- });
6
+ async function sendEmail(cfg, info) {
7
+ const logger = common_1.ConsoleLogger.get("send-email");
8
+ try {
9
+ const email_user = cfg.login;
10
+ const email_password = cfg.password;
11
+ const mailTransport = (0, nodemailer_1.createTransport)({
12
+ host: 'smtp.office365.com',
13
+ port: 587,
14
+ secure: false,
15
+ auth: { user: email_user, pass: email_password },
16
+ tls: { ciphers: 'SSLv3' }
17
+ });
18
+ const result = await mailTransport.sendMail({
19
+ from: { address: email_user, name: info.fromName },
20
+ to: info.to,
21
+ cc: info.cc,
22
+ bcc: info.bcc,
23
+ replyTo: email_user,
24
+ subject: info.subject,
25
+ html: info.bodyHtml,
26
+ text: info.bodyText
27
+ });
28
+ return result.response;
29
+ }
30
+ catch (err) {
31
+ logger.error(err);
32
+ return (0, common_1.GetError)(err, "send365Email: An error occurred");
33
+ }
45
34
  }
46
35
  //# sourceMappingURL=email.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/utilities/email.ts"],"names":[],"mappings":";;;;;;;;;;;AAQA,8BAqCC;AA7CD,yCAAuD;AACvD,2CAA6C;AAO7C,SAAsB,SAAS,CAAC,GAAyC,EAAE,IAS1E;;QACG,MAAM,MAAM,GAAG,sBAAa,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC/C,IAAI,CAAC;YACD,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC;YAC7B,MAAM,cAAc,GAAG,GAAG,CAAC,QAAQ,CAAC;YACpC,MAAM,aAAa,GAAG,IAAA,4BAAe,EAAC;gBAClC,IAAI,EAAE,oBAAoB;gBAC1B,IAAI,EAAE,GAAG;gBACT,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,cAAc,EAAE;gBAChD,GAAG,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;aAC5B,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC;gBACxC,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE;gBAClD,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,EAAE,EAAE,IAAI,CAAC,EAA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E;YACX,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,OAAO,EAAE,UAAU;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,QAAQ;YACnB,IAAI,EAAE,IAAI,CAAC,QAAQ;SACtB,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,QAAQ,CAAC;IAC3B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,OAAO,IAAA,iBAAQ,EAAC,GAAG,EAAE,iCAAiC,CAAC,CAAC;IAC5D,CAAC;AACL,CAAC"}
@@ -5,12 +5,21 @@ const xml2js_1 = require("xml2js");
5
5
  const processors_1 = require("xml2js/lib/processors");
6
6
  function parseXml(xml, options) {
7
7
  xml = xml.replace(/\r/g, ''); //\r\n will be replaced with " " instead of \n
8
- return (0, xml2js_1.parseStringPromise)(xml, Object.assign({ normalize: true, trim: true, explicitRoot: false, explicitArray: false, xmlns: false, tagNameProcessors: [processors_1.stripPrefix],
8
+ return (0, xml2js_1.parseStringPromise)(xml, {
9
+ normalize: true,
10
+ trim: true,
11
+ explicitRoot: false,
12
+ explicitArray: false,
13
+ xmlns: false,
14
+ tagNameProcessors: [processors_1.stripPrefix],
9
15
  //breaking values in text that have :
10
16
  //valueProcessors: [stripPrefix],
11
17
  attrNameProcessors: [name => {
12
18
  let names = name.split(":");
13
19
  return names[names.length - 1];
14
- }], attrValueProcessors: [processors_1.stripPrefix] }, (options || {})));
20
+ }],
21
+ attrValueProcessors: [processors_1.stripPrefix],
22
+ ...(options || {})
23
+ });
15
24
  }
16
25
  //# sourceMappingURL=xml.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"xml.js","sourceRoot":"","sources":["../../src/utilities/xml.ts"],"names":[],"mappings":";;AA8BA,4BAkBC;AAhDD,mCAA4C;AAC5C,sDAAoD;AA6BpD,SAAgB,QAAQ,CAAI,GAAW,EAAE,OAAkB;IACvD,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KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACnC,CAAC,CAAC;QACF,mBAAmB,EAAE,CAAC,wBAAW,CAAC;QAClC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;KACrB,CAAM,CAAC;AACZ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwiz/node",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
4
4
  "description": "KWIZ utilities and helpers for node applications",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "packageManager": "npm@9.5.1",
64
64
  "devDependencies": {
65
- "@types/node": "^18.19.21",
65
+ "@types/node": "^22.19.15",
66
66
  "@types/nodemailer": "^7.0.9",
67
67
  "@types/xml2js": "^0.4.14",
68
68
  "check-node-version": "^4.2.1",
@@ -78,7 +78,7 @@
78
78
  "@azure/msal-node": "^2.6.4",
79
79
  "@azure/storage-blob": "^12.31.0",
80
80
  "@jsforce/jsforce-node": "^3.10.14",
81
- "@kwiz/common": "^1.0.218",
81
+ "@kwiz/common": "^1.0.226",
82
82
  "axios": "^1.6.7",
83
83
  "esbuild": "^0.19.12",
84
84
  "get-tsconfig": "^4.7.2",