@ductape/sdk 0.3.6 → 0.3.7

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/dist/index.d.ts CHANGED
@@ -993,7 +993,12 @@ export default class Ductape implements IDuctape {
993
993
  * @returns {Promise<void>} Resolves when the storage files are fetched. Throws on error.
994
994
  */
995
995
  /**
996
- * Deletes a storage by tag.
996
+ * Deletes an entire storage **component** from the product's configuration.
997
+ * This is an administrative operation, not a file operation — to delete a single file
998
+ * from cloud storage, use `ductape.storage.remove(options)` (matches `IDeleteOptions`)
999
+ * instead. Calling this with an `IDeleteOptions`-shaped object by mistake previously
1000
+ * stringified that object into the request URL and produced a confusing 404 rather than a
1001
+ * clear error (DT-087) — now rejected immediately with a descriptive TypeError.
997
1002
  * @param {string} product - The product tag.
998
1003
  * @param {string} tag - The storage tag.
999
1004
  * @returns {Promise<void>} Resolves when the storage is deleted. Throws on error.
@@ -1133,6 +1138,8 @@ export default class Ductape implements IDuctape {
1133
1138
  fileName: string;
1134
1139
  buffer: string | Buffer;
1135
1140
  mimeType?: string;
1141
+ /** Opaque Ductape session token used for authorization and activity attribution. */
1142
+ session?: string;
1136
1143
  }) => Promise<import("./storage").IStorageResult>;
1137
1144
  /**
1138
1145
  * Downloads a file from cloud storage.
@@ -1151,6 +1158,7 @@ export default class Ductape implements IDuctape {
1151
1158
  env: string;
1152
1159
  storage: string;
1153
1160
  fileName: string;
1161
+ session?: string;
1154
1162
  }) => Promise<import("./storage").IDownloadResult>;
1155
1163
  /**
1156
1164
  * Removes a file from cloud storage.
@@ -1169,6 +1177,7 @@ export default class Ductape implements IDuctape {
1169
1177
  env: string;
1170
1178
  storage: string;
1171
1179
  fileName: string;
1180
+ session?: string;
1172
1181
  }) => Promise<import("./storage").IDeleteResult>;
1173
1182
  /**
1174
1183
  * Lists files in cloud storage with pagination.
@@ -1212,6 +1221,7 @@ export default class Ductape implements IDuctape {
1212
1221
  fileName: string;
1213
1222
  expiresIn?: number;
1214
1223
  action?: "read" | "write";
1224
+ session?: string;
1215
1225
  }) => Promise<import("./storage").ISignedUrlResult>;
1216
1226
  };
1217
1227
  /**
package/dist/index.js CHANGED
@@ -1268,12 +1268,22 @@ class Ductape {
1268
1268
  return builder.fetchStorageFiles(data);
1269
1269
  },*/
1270
1270
  /**
1271
- * Deletes a storage by tag.
1271
+ * Deletes an entire storage **component** from the product's configuration.
1272
+ * This is an administrative operation, not a file operation — to delete a single file
1273
+ * from cloud storage, use `ductape.storage.remove(options)` (matches `IDeleteOptions`)
1274
+ * instead. Calling this with an `IDeleteOptions`-shaped object by mistake previously
1275
+ * stringified that object into the request URL and produced a confusing 404 rather than a
1276
+ * clear error (DT-087) — now rejected immediately with a descriptive TypeError.
1272
1277
  * @param {string} product - The product tag.
1273
1278
  * @param {string} tag - The storage tag.
1274
1279
  * @returns {Promise<void>} Resolves when the storage is deleted. Throws on error.
1275
1280
  */
1276
1281
  delete: async (product, tag) => {
1282
+ if (typeof product !== 'string' || typeof tag !== 'string') {
1283
+ throw new TypeError('storage.delete(product, tag) expects two string arguments (product tag, storage tag) — ' +
1284
+ 'it deletes an entire storage component from the product. To delete a single file, use ' +
1285
+ 'storage.remove({product, env, storage, fileName}) instead.');
1286
+ }
1277
1287
  const builder = await this.getProductBuilder(product);
1278
1288
  return builder.deleteStorage(tag);
1279
1289
  },