@arbidocs/sdk 0.5.166 → 0.5.167

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.
@@ -1139,7 +1139,7 @@ declare const SUPPORTED_EXTENSIONS: Set<string>;
1139
1139
  */
1140
1140
  declare function sanitizeFolderPath(folderPath: string): string;
1141
1141
  interface UploadOptions {
1142
- /** Shared with the workspace's members (the server's default when absent: shared). */
1142
+ /** Share with workspace members. Omitted uploads are private. */
1143
1143
  shared?: boolean;
1144
1144
  folder?: string;
1145
1145
  configExtId?: string;
@@ -1139,7 +1139,7 @@ declare const SUPPORTED_EXTENSIONS: Set<string>;
1139
1139
  */
1140
1140
  declare function sanitizeFolderPath(folderPath: string): string;
1141
1141
  interface UploadOptions {
1142
- /** Shared with the workspace's members (the server's default when absent: shared). */
1142
+ /** Share with workspace members. Omitted uploads are private. */
1143
1143
  shared?: boolean;
1144
1144
  folder?: string;
1145
1145
  configExtId?: string;
package/dist/browser.cjs CHANGED
@@ -6179,8 +6179,7 @@ function requireUploadData(result, message) {
6179
6179
  return requireWorkspaceData(result, message, UPLOAD_WORKSPACE_CONFLICT_MESSAGES);
6180
6180
  }
6181
6181
  async function uploadDocuments(arbi, files, options = {}) {
6182
- const query2 = {};
6183
- if (options.shared !== void 0) query2.shared = options.shared;
6182
+ const query2 = { shared: options.shared ?? false };
6184
6183
  if (options.folder) query2.folder = sanitizeFolderPath(options.folder);
6185
6184
  if (options.configExtId) query2.config_ext_id = options.configExtId;
6186
6185
  if (options.wpType) query2.wp_type = options.wpType;
@@ -6242,7 +6241,7 @@ async function uploadFile(auth, fileData, fileName, options) {
6242
6241
  const formData = new FormData();
6243
6242
  formData.append("files", fileData, fileName);
6244
6243
  const params = new URLSearchParams();
6245
- if (options?.shared !== void 0) params.set("shared", String(options.shared));
6244
+ params.set("shared", String(options?.shared ?? false));
6246
6245
  if (options?.folder) params.set("folder", sanitizeFolderPath(options.folder));
6247
6246
  if (options?.configExtId) params.set("config_ext_id", options.configExtId);
6248
6247
  if (options?.wpType) params.set("wp_type", options.wpType);
@@ -6267,7 +6266,7 @@ async function uploadFile(auth, fileData, fileName, options) {
6267
6266
  async function uploadFiles(auth, files, options) {
6268
6267
  const formData = new FormData();
6269
6268
  for (const f2 of files) formData.append("files", f2.data, f2.name);
6270
- const params = new URLSearchParams();
6269
+ const params = new URLSearchParams({ shared: String(options?.shared ?? false) });
6271
6270
  if (options?.folder) params.set("folder", sanitizeFolderPath(options.folder));
6272
6271
  if (options?.configExtId) params.set("config_ext_id", options.configExtId);
6273
6272
  if (options?.wpType) params.set("wp_type", options.wpType);
@@ -6387,7 +6386,7 @@ async function uploadDocumentsDirect(arbi, workspaceKey, files, options) {
6387
6386
  }
6388
6387
  const initBody = {
6389
6388
  files: declared,
6390
- shared: options.shared !== false,
6389
+ shared: options.shared ?? false,
6391
6390
  config_ext_id: options.configExtId ?? null,
6392
6391
  // Only sent when set, so a plain upload is accepted by any server version.
6393
6392
  ...options.versionOf ? { version_of: options.versionOf } : {},