parse 8.4.0 → 8.5.0

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.
@@ -191,7 +191,7 @@
191
191
  SERVER_URL: "https://api.parse.com/1",
192
192
  LIVEQUERY_SERVER_URL: null,
193
193
  ENCRYPTED_KEY: null,
194
- VERSION: "js8.4.0",
194
+ VERSION: "js8.5.0",
195
195
  APPLICATION_ID: null,
196
196
  JAVASCRIPT_KEY: null,
197
197
  MAINTENANCE_KEY: null,
@@ -9694,6 +9694,10 @@
9694
9694
  * }
9695
9695
  * });
9696
9696
  * </pre>
9697
+ * <li>maxUploadSize: Overrides the server's maxUploadSize for this upload.
9698
+ * Requires the master key. Only supported for Buffer and Stream source
9699
+ * types; files created from base64 strings, number arrays, Blobs, or URIs
9700
+ * do not support this option. Requires Parse Server >= 9.5.0.
9697
9701
  * </ul>
9698
9702
  * @returns {Promise | undefined} Promise that is resolved when the save finishes.
9699
9703
  */
@@ -9712,7 +9716,7 @@
9712
9716
  );
9713
9717
  }
9714
9718
  const hasFileData = this._metadata && Object.keys(this._metadata).length > 0 || this._tags && Object.keys(this._tags).length > 0 || !!this._directory;
9715
- if (controller.saveBinary && (this._source.format === "stream" || !hasFileData)) {
9719
+ if (controller.saveBinary && (this._source.format === "stream" || !hasFileData || options.maxUploadSize)) {
9716
9720
  this._previousSave = controller.saveBinary(this._name, this._source, options).then((res) => {
9717
9721
  this._name = res.name;
9718
9722
  this._url = res.url;
@@ -9970,6 +9974,9 @@
9970
9974
  if (options.tags && Object.keys(options.tags).length > 0) {
9971
9975
  headers["X-Parse-File-Tags"] = JSON.stringify(options.tags);
9972
9976
  }
9977
+ if (options.maxUploadSize) {
9978
+ headers["X-Parse-File-Max-Upload-Size"] = options.maxUploadSize.replace(/[\r\n]/g, "");
9979
+ }
9973
9980
  const jsKey = CoreManager.get("JAVASCRIPT_KEY");
9974
9981
  if (jsKey) {
9975
9982
  headers["X-Parse-JavaScript-Key"] = jsKey;