bruce-models 1.8.2 → 1.8.4

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.
@@ -4725,7 +4725,7 @@
4725
4725
  ClientFile.Delete = Delete;
4726
4726
  function Upload(params) {
4727
4727
  return __awaiter(this, void 0, void 0, function* () {
4728
- const { api, file, purpose, req, onProgress } = params;
4728
+ let { api, file, purpose, req, onProgress } = params;
4729
4729
  if (!file) {
4730
4730
  throw ("File is required.");
4731
4731
  }
@@ -4733,6 +4733,7 @@
4733
4733
  if (!size) {
4734
4734
  throw ("You cannot upload a 0byte sized file.");
4735
4735
  }
4736
+ req = exports.Api.PrepReqParams(req);
4736
4737
  let clientFile;
4737
4738
  if (size > exports.Uploader.MIN_LARGE_FILE_SIZE) {
4738
4739
  clientFile = yield exports.Uploader.DoMultiPartUpload({
@@ -4744,8 +4745,7 @@
4744
4745
  });
4745
4746
  }
4746
4747
  else {
4747
- const reqParams = exports.Api.PrepReqParams(Object.assign({}, req));
4748
- reqParams.onProgress = (progress) => {
4748
+ req.onProgress = (progress) => {
4749
4749
  const percent = Math.round((progress.loaded / file.size) * 100);
4750
4750
  onProgress === null || onProgress === void 0 ? void 0 : onProgress({
4751
4751
  percent: percent,
@@ -4794,7 +4794,7 @@
4794
4794
  */
4795
4795
  function UploadTemp(params) {
4796
4796
  return __awaiter(this, void 0, void 0, function* () {
4797
- const { api, file, req, onProgress } = params;
4797
+ let { api, file, req, onProgress } = params;
4798
4798
  if (!file) {
4799
4799
  throw ("File is required.");
4800
4800
  }
@@ -4802,6 +4802,7 @@
4802
4802
  if (!size) {
4803
4803
  throw ("You cannot upload a 0byte sized file.");
4804
4804
  }
4805
+ req = exports.Api.PrepReqParams(req);
4805
4806
  let tempFile;
4806
4807
  if (size > exports.Uploader.MIN_LARGE_FILE_SIZE) {
4807
4808
  tempFile = yield exports.Uploader.DoMultiPartUpload({
@@ -5142,7 +5143,7 @@
5142
5143
  Tileset.Update = Update;
5143
5144
  function UploadFile(params) {
5144
5145
  return __awaiter(this, void 0, void 0, function* () {
5145
- const { api, file, req, tilesetId, onProgress } = params;
5146
+ let { api, file, req, tilesetId, onProgress } = params;
5146
5147
  if (!tilesetId || !file) {
5147
5148
  throw ("Tileset ID and file are required.");
5148
5149
  }
@@ -5150,6 +5151,7 @@
5150
5151
  if (!size) {
5151
5152
  throw ("You cannot upload a 0byte sized file.");
5152
5153
  }
5154
+ req = exports.Api.PrepReqParams(req);
5153
5155
  if (size > exports.Uploader.MIN_LARGE_FILE_SIZE) {
5154
5156
  yield exports.Uploader.DoMultiPartUpload({
5155
5157
  api,
@@ -5190,7 +5192,7 @@
5190
5192
  Tileset.DeleteFile = DeleteFile;
5191
5193
  function UploadSrcFile(params) {
5192
5194
  return __awaiter(this, void 0, void 0, function* () {
5193
- const { api, file, req, tilesetId, onProgress } = params;
5195
+ let { api, file, req, tilesetId, onProgress } = params;
5194
5196
  if (!tilesetId || !file) {
5195
5197
  throw ("Tileset ID and file are required.");
5196
5198
  }
@@ -5198,6 +5200,7 @@
5198
5200
  if (!size) {
5199
5201
  throw ("You cannot upload a 0byte sized file.");
5200
5202
  }
5203
+ req = exports.Api.PrepReqParams(req);
5201
5204
  if (size > exports.Uploader.MIN_LARGE_FILE_SIZE) {
5202
5205
  yield exports.Uploader.DoMultiPartUpload({
5203
5206
  api,