@scalemule/nextjs 0.1.11 → 0.1.13

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.mts CHANGED
@@ -436,9 +436,17 @@ interface ScaleMuleMediaProps {
436
436
  alt?: string;
437
437
  /**
438
438
  * Polling interval while waiting for the media pipeline to complete.
439
- * Defaults to 2000ms; set to `null` to disable polling. Polling stops
440
- * automatically once scan is clean. When `conversationId` is set the
441
- * component receives push updates and you can usually pass `null`.
439
+ *
440
+ * Default behaviour:
441
+ * - With `conversationId` set: polling **off** (the realtime
442
+ * conversation channel pushes `file_status_changed` events;
443
+ * a poll loop on top would just be wasted requests).
444
+ * - Without `conversationId`: 2000ms.
445
+ *
446
+ * Override either way by passing a number (belt-and-suspenders if you
447
+ * don't trust your websocket) or `null` (disable explicitly).
448
+ * Polling stops automatically once both scan and any expected
449
+ * pipeline (optimize / transcode) have settled.
442
450
  */
443
451
  pollIntervalMs?: number | null;
444
452
  /**
package/dist/index.d.ts CHANGED
@@ -436,9 +436,17 @@ interface ScaleMuleMediaProps {
436
436
  alt?: string;
437
437
  /**
438
438
  * Polling interval while waiting for the media pipeline to complete.
439
- * Defaults to 2000ms; set to `null` to disable polling. Polling stops
440
- * automatically once scan is clean. When `conversationId` is set the
441
- * component receives push updates and you can usually pass `null`.
439
+ *
440
+ * Default behaviour:
441
+ * - With `conversationId` set: polling **off** (the realtime
442
+ * conversation channel pushes `file_status_changed` events;
443
+ * a poll loop on top would just be wasted requests).
444
+ * - Without `conversationId`: 2000ms.
445
+ *
446
+ * Override either way by passing a number (belt-and-suspenders if you
447
+ * don't trust your websocket) or `null` (disable explicitly).
448
+ * Polling stops automatically once both scan and any expected
449
+ * pipeline (optimize / transcode) have settled.
442
450
  */
443
451
  pollIntervalMs?: number | null;
444
452
  /**
package/dist/index.js CHANGED
@@ -2242,14 +2242,25 @@ var StorageService = class extends ServiceModule {
2242
2242
  },
2243
2243
  requestOpts
2244
2244
  );
2245
- } else {
2246
- telemetry?.emit(sessionId, "upload.completed", {
2247
- file_id,
2248
- size_bytes: file.size,
2249
- duration_ms: Date.now() - directStart
2250
- });
2245
+ return { data: null, error: completeResult.error };
2251
2246
  }
2252
- return completeResult;
2247
+ telemetry?.emit(sessionId, "upload.completed", {
2248
+ file_id,
2249
+ size_bytes: file.size,
2250
+ duration_ms: Date.now() - directStart
2251
+ });
2252
+ const d = completeResult.data;
2253
+ return {
2254
+ data: {
2255
+ id: d.file_id,
2256
+ filename: d.filename,
2257
+ content_type: d.content_type,
2258
+ size_bytes: d.size_bytes,
2259
+ url: d.url,
2260
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
2261
+ },
2262
+ error: null
2263
+ };
2253
2264
  }
2254
2265
  // --------------------------------------------------------------------------
2255
2266
  // Multipart Upload
@@ -4458,15 +4469,19 @@ var BillingService = class extends ServiceModule {
4458
4469
  return this.retiredSurface(`/v1/money/billing/payments/${id}/sync`);
4459
4470
  }
4460
4471
  // --------------------------------------------------------------------------
4461
- // Legacy methods (backward compat)
4472
+ // Removed aliases (Phase 6 — billing-v2 retirement)
4473
+ //
4474
+ // These were soft-deprecated wrappers in earlier SDK versions. They now
4475
+ // throw at runtime so any caller still using them gets an immediate signal.
4476
+ // Replacements: createSubscription → subscribe(); getInvoices → listInvoices().
4462
4477
  // --------------------------------------------------------------------------
4463
- /** @deprecated Use subscribe() instead */
4478
+ /** @removed Use subscribe() instead. */
4464
4479
  async createSubscription(data) {
4465
- return this.subscribe(data);
4480
+ throw new Error("BillingService.createSubscription was removed in Phase 6. Use subscribe() instead.");
4466
4481
  }
4467
- /** @deprecated Use listInvoices() instead */
4482
+ /** @removed Use listInvoices() instead. */
4468
4483
  async getInvoices(params) {
4469
- return this.listInvoices(params);
4484
+ throw new Error("BillingService.getInvoices was removed in Phase 6. Use listInvoices() instead.");
4470
4485
  }
4471
4486
  };
4472
4487
  var AnalyticsService = class extends ServiceModule {
@@ -9257,17 +9272,18 @@ function ScaleMuleMedia(props) {
9257
9272
  className,
9258
9273
  style,
9259
9274
  alt,
9260
- pollIntervalMs = 2e3,
9275
+ pollIntervalMs,
9261
9276
  conversationId = null,
9262
9277
  conversationKind,
9263
9278
  renderPlaceholder,
9264
9279
  renderBlocked,
9265
9280
  renderOverride
9266
9281
  } = props;
9282
+ const effectivePollIntervalMs = pollIntervalMs !== void 0 ? pollIntervalMs : conversationId ? null : 2e3;
9267
9283
  const { gatewayUrl } = useScaleMule();
9268
9284
  const { status, isReady } = useFileStatus({
9269
9285
  fileId,
9270
- pollIntervalMs,
9286
+ pollIntervalMs: effectivePollIntervalMs,
9271
9287
  conversationId,
9272
9288
  conversationKind
9273
9289
  });
package/dist/index.mjs CHANGED
@@ -2222,14 +2222,25 @@ var StorageService = class extends ServiceModule {
2222
2222
  },
2223
2223
  requestOpts
2224
2224
  );
2225
- } else {
2226
- telemetry?.emit(sessionId, "upload.completed", {
2227
- file_id,
2228
- size_bytes: file.size,
2229
- duration_ms: Date.now() - directStart
2230
- });
2225
+ return { data: null, error: completeResult.error };
2231
2226
  }
2232
- return completeResult;
2227
+ telemetry?.emit(sessionId, "upload.completed", {
2228
+ file_id,
2229
+ size_bytes: file.size,
2230
+ duration_ms: Date.now() - directStart
2231
+ });
2232
+ const d = completeResult.data;
2233
+ return {
2234
+ data: {
2235
+ id: d.file_id,
2236
+ filename: d.filename,
2237
+ content_type: d.content_type,
2238
+ size_bytes: d.size_bytes,
2239
+ url: d.url,
2240
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
2241
+ },
2242
+ error: null
2243
+ };
2233
2244
  }
2234
2245
  // --------------------------------------------------------------------------
2235
2246
  // Multipart Upload
@@ -4438,15 +4449,19 @@ var BillingService = class extends ServiceModule {
4438
4449
  return this.retiredSurface(`/v1/money/billing/payments/${id}/sync`);
4439
4450
  }
4440
4451
  // --------------------------------------------------------------------------
4441
- // Legacy methods (backward compat)
4452
+ // Removed aliases (Phase 6 — billing-v2 retirement)
4453
+ //
4454
+ // These were soft-deprecated wrappers in earlier SDK versions. They now
4455
+ // throw at runtime so any caller still using them gets an immediate signal.
4456
+ // Replacements: createSubscription → subscribe(); getInvoices → listInvoices().
4442
4457
  // --------------------------------------------------------------------------
4443
- /** @deprecated Use subscribe() instead */
4458
+ /** @removed Use subscribe() instead. */
4444
4459
  async createSubscription(data) {
4445
- return this.subscribe(data);
4460
+ throw new Error("BillingService.createSubscription was removed in Phase 6. Use subscribe() instead.");
4446
4461
  }
4447
- /** @deprecated Use listInvoices() instead */
4462
+ /** @removed Use listInvoices() instead. */
4448
4463
  async getInvoices(params) {
4449
- return this.listInvoices(params);
4464
+ throw new Error("BillingService.getInvoices was removed in Phase 6. Use listInvoices() instead.");
4450
4465
  }
4451
4466
  };
4452
4467
  var AnalyticsService = class extends ServiceModule {
@@ -9237,17 +9252,18 @@ function ScaleMuleMedia(props) {
9237
9252
  className,
9238
9253
  style,
9239
9254
  alt,
9240
- pollIntervalMs = 2e3,
9255
+ pollIntervalMs,
9241
9256
  conversationId = null,
9242
9257
  conversationKind,
9243
9258
  renderPlaceholder,
9244
9259
  renderBlocked,
9245
9260
  renderOverride
9246
9261
  } = props;
9262
+ const effectivePollIntervalMs = pollIntervalMs !== void 0 ? pollIntervalMs : conversationId ? null : 2e3;
9247
9263
  const { gatewayUrl } = useScaleMule();
9248
9264
  const { status, isReady } = useFileStatus({
9249
9265
  fileId,
9250
- pollIntervalMs,
9266
+ pollIntervalMs: effectivePollIntervalMs,
9251
9267
  conversationId,
9252
9268
  conversationKind
9253
9269
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalemule/nextjs",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "ScaleMule SDK for Next.js applications - authentication, storage, and user management",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@scalemule/money": "^0.0.1",
57
- "@scalemule/sdk": ">=0.0.45 <0.1.0"
57
+ "@scalemule/sdk": "^0.0.47"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "next": ">=14.0.0",