@gammarers/aws-sns-slack-message-lambda-subscription 1.0.2 → 1.0.3

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.
package/.jsii CHANGED
@@ -3971,7 +3971,7 @@
3971
3971
  "stability": "stable"
3972
3972
  },
3973
3973
  "homepage": "https://github.com/gammarers/aws-sns-slack-message-lambda-subscription.git",
3974
- "jsiiVersion": "5.8.11 (build 55d251b)",
3974
+ "jsiiVersion": "5.8.12 (build 5c353f5)",
3975
3975
  "keywords": [
3976
3976
  "aws",
3977
3977
  "aws-cdk",
@@ -4192,6 +4192,6 @@
4192
4192
  "symbolId": "src/index:SNSSlackMessageLambdaSubscriptionProps"
4193
4193
  }
4194
4194
  },
4195
- "version": "1.0.2",
4196
- "fingerprint": "Dbvfjh0ClPyaUPkh4VjnEN/riyjpVvwTM9H7iIKq7kM="
4195
+ "version": "1.0.3",
4196
+ "fingerprint": "7z1ySrTCUecSLeVjn6853mfeXsL33ysE6MbOhDo9OGs="
4197
4197
  }
@@ -10008,9 +10008,8 @@ var require_form_data = __commonJS({
10008
10008
  var mime = require_mime_types();
10009
10009
  var asynckit = require_asynckit();
10010
10010
  var setToStringTag = require_es_set_tostringtag();
10011
+ var hasOwn = require_hasown();
10011
10012
  var populate = require_populate();
10012
- module2.exports = FormData3;
10013
- util3.inherits(FormData3, CombinedStream);
10014
10013
  function FormData3(options) {
10015
10014
  if (!(this instanceof FormData3)) {
10016
10015
  return new FormData3(options);
@@ -10024,16 +10023,17 @@ var require_form_data = __commonJS({
10024
10023
  this[option] = options[option];
10025
10024
  }
10026
10025
  }
10026
+ util3.inherits(FormData3, CombinedStream);
10027
10027
  FormData3.LINE_BREAK = "\r\n";
10028
10028
  FormData3.DEFAULT_CONTENT_TYPE = "application/octet-stream";
10029
10029
  FormData3.prototype.append = function(field, value, options) {
10030
10030
  options = options || {};
10031
- if (typeof options == "string") {
10031
+ if (typeof options === "string") {
10032
10032
  options = { filename: options };
10033
10033
  }
10034
10034
  var append2 = CombinedStream.prototype.append.bind(this);
10035
- if (typeof value == "number") {
10036
- value = "" + value;
10035
+ if (typeof value === "number" || value == null) {
10036
+ value = String(value);
10037
10037
  }
10038
10038
  if (Array.isArray(value)) {
10039
10039
  this._error(new Error("Arrays are not supported."));
@@ -10049,7 +10049,7 @@ var require_form_data = __commonJS({
10049
10049
  FormData3.prototype._trackLength = function(header, value, options) {
10050
10050
  var valueLength = 0;
10051
10051
  if (options.knownLength != null) {
10052
- valueLength += +options.knownLength;
10052
+ valueLength += Number(options.knownLength);
10053
10053
  } else if (Buffer.isBuffer(value)) {
10054
10054
  valueLength = value.length;
10055
10055
  } else if (typeof value === "string") {
@@ -10057,7 +10057,7 @@ var require_form_data = __commonJS({
10057
10057
  }
10058
10058
  this._valueLength += valueLength;
10059
10059
  this._overheadLength += Buffer.byteLength(header) + FormData3.LINE_BREAK.length;
10060
- if (!value || !value.path && !(value.readable && Object.prototype.hasOwnProperty.call(value, "httpVersion")) && !(value instanceof Stream)) {
10060
+ if (!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) {
10061
10061
  return;
10062
10062
  }
10063
10063
  if (!options.knownLength) {
@@ -10065,26 +10065,25 @@ var require_form_data = __commonJS({
10065
10065
  }
10066
10066
  };
10067
10067
  FormData3.prototype._lengthRetriever = function(value, callback) {
10068
- if (Object.prototype.hasOwnProperty.call(value, "fd")) {
10068
+ if (hasOwn(value, "fd")) {
10069
10069
  if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
10070
10070
  callback(null, value.end + 1 - (value.start ? value.start : 0));
10071
10071
  } else {
10072
10072
  fs.stat(value.path, function(err, stat) {
10073
- var fileSize;
10074
10073
  if (err) {
10075
10074
  callback(err);
10076
10075
  return;
10077
10076
  }
10078
- fileSize = stat.size - (value.start ? value.start : 0);
10077
+ var fileSize = stat.size - (value.start ? value.start : 0);
10079
10078
  callback(null, fileSize);
10080
10079
  });
10081
10080
  }
10082
- } else if (Object.prototype.hasOwnProperty.call(value, "httpVersion")) {
10083
- callback(null, +value.headers["content-length"]);
10084
- } else if (Object.prototype.hasOwnProperty.call(value, "httpModule")) {
10081
+ } else if (hasOwn(value, "httpVersion")) {
10082
+ callback(null, Number(value.headers["content-length"]));
10083
+ } else if (hasOwn(value, "httpModule")) {
10085
10084
  value.on("response", function(response) {
10086
10085
  value.pause();
10087
- callback(null, +response.headers["content-length"]);
10086
+ callback(null, Number(response.headers["content-length"]));
10088
10087
  });
10089
10088
  value.resume();
10090
10089
  } else {
@@ -10092,7 +10091,7 @@ var require_form_data = __commonJS({
10092
10091
  }
10093
10092
  };
10094
10093
  FormData3.prototype._multiPartHeader = function(field, value, options) {
10095
- if (typeof options.header == "string") {
10094
+ if (typeof options.header === "string") {
10096
10095
  return options.header;
10097
10096
  }
10098
10097
  var contentDisposition = this._getContentDisposition(value, options);
@@ -10104,12 +10103,12 @@ var require_form_data = __commonJS({
10104
10103
  // if no content type. allow it to be empty array
10105
10104
  "Content-Type": [].concat(contentType || [])
10106
10105
  };
10107
- if (typeof options.header == "object") {
10106
+ if (typeof options.header === "object") {
10108
10107
  populate(headers, options.header);
10109
10108
  }
10110
10109
  var header;
10111
10110
  for (var prop in headers) {
10112
- if (Object.prototype.hasOwnProperty.call(headers, prop)) {
10111
+ if (hasOwn(headers, prop)) {
10113
10112
  header = headers[prop];
10114
10113
  if (header == null) {
10115
10114
  continue;
@@ -10125,34 +10124,33 @@ var require_form_data = __commonJS({
10125
10124
  return "--" + this.getBoundary() + FormData3.LINE_BREAK + contents + FormData3.LINE_BREAK;
10126
10125
  };
10127
10126
  FormData3.prototype._getContentDisposition = function(value, options) {
10128
- var filename, contentDisposition;
10127
+ var filename;
10129
10128
  if (typeof options.filepath === "string") {
10130
10129
  filename = path.normalize(options.filepath).replace(/\\/g, "/");
10131
- } else if (options.filename || value.name || value.path) {
10132
- filename = path.basename(options.filename || value.name || value.path);
10133
- } else if (value.readable && Object.prototype.hasOwnProperty.call(value, "httpVersion")) {
10130
+ } else if (options.filename || value && (value.name || value.path)) {
10131
+ filename = path.basename(options.filename || value && (value.name || value.path));
10132
+ } else if (value && value.readable && hasOwn(value, "httpVersion")) {
10134
10133
  filename = path.basename(value.client._httpMessage.path || "");
10135
10134
  }
10136
10135
  if (filename) {
10137
- contentDisposition = 'filename="' + filename + '"';
10136
+ return 'filename="' + filename + '"';
10138
10137
  }
10139
- return contentDisposition;
10140
10138
  };
10141
10139
  FormData3.prototype._getContentType = function(value, options) {
10142
10140
  var contentType = options.contentType;
10143
- if (!contentType && value.name) {
10141
+ if (!contentType && value && value.name) {
10144
10142
  contentType = mime.lookup(value.name);
10145
10143
  }
10146
- if (!contentType && value.path) {
10144
+ if (!contentType && value && value.path) {
10147
10145
  contentType = mime.lookup(value.path);
10148
10146
  }
10149
- if (!contentType && value.readable && Object.prototype.hasOwnProperty.call(value, "httpVersion")) {
10147
+ if (!contentType && value && value.readable && hasOwn(value, "httpVersion")) {
10150
10148
  contentType = value.headers["content-type"];
10151
10149
  }
10152
10150
  if (!contentType && (options.filepath || options.filename)) {
10153
10151
  contentType = mime.lookup(options.filepath || options.filename);
10154
10152
  }
10155
- if (!contentType && typeof value == "object") {
10153
+ if (!contentType && value && typeof value === "object") {
10156
10154
  contentType = FormData3.DEFAULT_CONTENT_TYPE;
10157
10155
  }
10158
10156
  return contentType;
@@ -10176,13 +10174,16 @@ var require_form_data = __commonJS({
10176
10174
  "content-type": "multipart/form-data; boundary=" + this.getBoundary()
10177
10175
  };
10178
10176
  for (header in userHeaders) {
10179
- if (Object.prototype.hasOwnProperty.call(userHeaders, header)) {
10177
+ if (hasOwn(userHeaders, header)) {
10180
10178
  formHeaders[header.toLowerCase()] = userHeaders[header];
10181
10179
  }
10182
10180
  }
10183
10181
  return formHeaders;
10184
10182
  };
10185
10183
  FormData3.prototype.setBoundary = function(boundary) {
10184
+ if (typeof boundary !== "string") {
10185
+ throw new TypeError("FormData boundary must be a string");
10186
+ }
10186
10187
  this._boundary = boundary;
10187
10188
  };
10188
10189
  FormData3.prototype.getBoundary = function() {
@@ -10253,8 +10254,10 @@ var require_form_data = __commonJS({
10253
10254
  });
10254
10255
  };
10255
10256
  FormData3.prototype.submit = function(params, cb) {
10256
- var request, options, defaults2 = { method: "post" };
10257
- if (typeof params == "string") {
10257
+ var request;
10258
+ var options;
10259
+ var defaults2 = { method: "post" };
10260
+ if (typeof params === "string") {
10258
10261
  params = parseUrl(params);
10259
10262
  options = populate({
10260
10263
  port: params.port,
@@ -10265,11 +10268,11 @@ var require_form_data = __commonJS({
10265
10268
  } else {
10266
10269
  options = populate(params, defaults2);
10267
10270
  if (!options.port) {
10268
- options.port = options.protocol == "https:" ? 443 : 80;
10271
+ options.port = options.protocol === "https:" ? 443 : 80;
10269
10272
  }
10270
10273
  }
10271
10274
  options.headers = this.getHeaders(params.headers);
10272
- if (options.protocol == "https:") {
10275
+ if (options.protocol === "https:") {
10273
10276
  request = https2.request(options);
10274
10277
  } else {
10275
10278
  request = http2.request(options);
@@ -10308,6 +10311,7 @@ var require_form_data = __commonJS({
10308
10311
  return "[object FormData]";
10309
10312
  };
10310
10313
  setToStringTag(FormData3, "FormData");
10314
+ module2.exports = FormData3;
10311
10315
  }
10312
10316
  });
10313
10317