@plyaz/api 1.6.8 → 1.7.1

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.
@@ -9121,6 +9121,9 @@ var UnifiedDebugger = class _UnifiedDebugger {
9121
9121
  performanceMode = "minimal";
9122
9122
  trackAllProperties = true;
9123
9123
  // If false, uses TRACKED_PROPERTIES filter
9124
+ // Debug report control - disabled by default, enable via config:
9125
+ // createApiClient({ debugEvents: { comprehensiveReport: true } })
9126
+ comprehensiveReportEnabled = false;
9124
9127
  // Tracking configuration from API config
9125
9128
  trackingConfig = {};
9126
9129
  // Configurable limits
@@ -9549,8 +9552,14 @@ var UnifiedDebugger = class _UnifiedDebugger {
9549
9552
  }
9550
9553
  /**
9551
9554
  * Log comprehensive report to console
9555
+ *
9556
+ * Controlled via API config: debugEvents.comprehensiveReport = true
9557
+ * Or programmatically via setComprehensiveReportEnabled(true)
9552
9558
  */
9553
9559
  async logComprehensiveReport() {
9560
+ if (!this.comprehensiveReportEnabled) {
9561
+ return;
9562
+ }
9554
9563
  try {
9555
9564
  const presetReport = this.getPresetChangeReport();
9556
9565
  if (presetReport) {
@@ -9572,6 +9581,20 @@ var UnifiedDebugger = class _UnifiedDebugger {
9572
9581
  throw error;
9573
9582
  }
9574
9583
  }
9584
+ /**
9585
+ * Enable or disable comprehensive debug report logging
9586
+ *
9587
+ * Typically configured via API config: debugEvents.comprehensiveReport
9588
+ */
9589
+ setComprehensiveReportEnabled(enabled) {
9590
+ this.comprehensiveReportEnabled = enabled;
9591
+ }
9592
+ /**
9593
+ * Get current comprehensive report enabled state
9594
+ */
9595
+ getComprehensiveReportEnabled() {
9596
+ return this.comprehensiveReportEnabled;
9597
+ }
9575
9598
  /**
9576
9599
  * Get debug report (alias for generateDebugReport for API consistency)
9577
9600
  */
@@ -16147,6 +16170,11 @@ var ClientEventManager = class _ClientEventManager {
16147
16170
  this.config.configOverride.eventScopes ??= [...EVENT_SCOPES$1];
16148
16171
  }
16149
16172
  eventManager.setEventScopes(this.config.configOverride.eventScopes);
16173
+ if (this.config.debugEvents?.comprehensiveReport !== void 0) {
16174
+ getUnifiedDebugger().setComprehensiveReportEnabled(
16175
+ this.config.debugEvents.comprehensiveReport
16176
+ );
16177
+ }
16150
16178
  this.setupEventHandlers();
16151
16179
  }
16152
16180
  static {
@@ -16790,6 +16818,7 @@ var ClientEventManager = class _ClientEventManager {
16790
16818
  /**
16791
16819
  * Start monitoring
16792
16820
  */
16821
+ // eslint-disable-next-line complexity
16793
16822
  startMonitoring() {
16794
16823
  if (this.monitoringState.monitoring) return;
16795
16824
  this.monitoringState.monitoring = true;
@@ -16804,6 +16833,9 @@ var ClientEventManager = class _ClientEventManager {
16804
16833
  const id = setInterval(() => this.getDebugInfo(), interval);
16805
16834
  this.monitoringState.intervals.push(id);
16806
16835
  }
16836
+ if (debugConfig?.comprehensiveReport !== void 0) {
16837
+ getUnifiedDebugger().setComprehensiveReportEnabled(debugConfig.comprehensiveReport);
16838
+ }
16807
16839
  }
16808
16840
  /**
16809
16841
  * Stop monitoring
@@ -17193,6 +17225,24 @@ var unifiedStrategies = {
17193
17225
  // Wait for network/resources
17194
17226
  performance: "offline"
17195
17227
  // Offline-first, maximum caching
17228
+ },
17229
+ /**
17230
+ * Mutation: POST/PUT/DELETE operations (uploads, creates, updates, deletes)
17231
+ * - NO caching (mutations should never be cached)
17232
+ * - Standard retry for actual failures
17233
+ * - NO polling (critical! - polling causes duplicate mutations)
17234
+ * - Realtime performance (immediate response)
17235
+ *
17236
+ * Use this for any data-modifying operation to prevent duplicate requests.
17237
+ */
17238
+ mutation: {
17239
+ cache: "none",
17240
+ // Never cache mutations
17241
+ retry: "standard",
17242
+ // Standard retry for actual failures (not successes)
17243
+ // NO polling - this is critical! Polling would re-execute the mutation
17244
+ performance: "realtime"
17245
+ // Immediate response, no batching
17196
17246
  }
17197
17247
  };
17198
17248
  function applyUnifiedStrategy(strategyName) {
@@ -22416,7 +22466,7 @@ __name(useCampaignParticipants, "useCampaignParticipants");
22416
22466
  // src/api/services/campaigns/POST/createCampaign.ts
22417
22467
  async function createCampaign(data, options) {
22418
22468
  const client = options?.apiClient ?? getDefaultApiClient();
22419
- const serviceDefaults = { unifiedStrategy: "realtime" };
22469
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22420
22470
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22421
22471
  const updateOptions = {
22422
22472
  strategy: "temporary",
@@ -22440,7 +22490,7 @@ async function joinCampaign(campaignId, options) {
22440
22490
  API_ERROR_CODES.REQUIRED_FIELD_MISSING
22441
22491
  );
22442
22492
  }
22443
- const serviceDefaults = { unifiedStrategy: "realtime" };
22493
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22444
22494
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22445
22495
  const updateOptions = {
22446
22496
  strategy: "temporary",
@@ -22464,7 +22514,7 @@ async function leaveCampaign(campaignId, options) {
22464
22514
  API_ERROR_CODES.REQUIRED_FIELD_MISSING
22465
22515
  );
22466
22516
  }
22467
- const serviceDefaults = { unifiedStrategy: "realtime" };
22517
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22468
22518
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22469
22519
  const updateOptions = {
22470
22520
  strategy: "temporary",
@@ -22546,7 +22596,7 @@ async function updateCampaign(campaignId, data, options) {
22546
22596
  API_ERROR_CODES.REQUIRED_FIELD_MISSING
22547
22597
  );
22548
22598
  }
22549
- const serviceDefaults = { unifiedStrategy: "realtime" };
22599
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22550
22600
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22551
22601
  const updateOptions = {
22552
22602
  strategy: "temporary",
@@ -22591,7 +22641,7 @@ async function deleteCampaign(campaignId, options) {
22591
22641
  API_ERROR_CODES.REQUIRED_FIELD_MISSING
22592
22642
  );
22593
22643
  }
22594
- const serviceDefaults = { unifiedStrategy: "realtime" };
22644
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22595
22645
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22596
22646
  const updateOptions = {
22597
22647
  strategy: "temporary",
@@ -22677,7 +22727,7 @@ async function checkFeatureFlagEnabled(payload, options) {
22677
22727
  API_ERROR_CODES.REQUIRED_FIELD_MISSING
22678
22728
  );
22679
22729
  }
22680
- const serviceDefaults = { unifiedStrategy: "realtime" };
22730
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22681
22731
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22682
22732
  const updateOptions = {
22683
22733
  strategy: "temporary",
@@ -22702,7 +22752,7 @@ async function evaluateFeatureFlag(payload, options) {
22702
22752
  API_ERROR_CODES.REQUIRED_FIELD_MISSING
22703
22753
  );
22704
22754
  }
22705
- const serviceDefaults = { unifiedStrategy: "realtime" };
22755
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22706
22756
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22707
22757
  const updateOptions = {
22708
22758
  strategy: "temporary",
@@ -22739,7 +22789,7 @@ __name(evaluateAllFeatureFlags, "evaluateAllFeatureFlags");
22739
22789
  // src/api/services/featureFlags/POST/createFeatureFlag.ts
22740
22790
  async function createFeatureFlag(data, options) {
22741
22791
  const client = options?.apiClient ?? getDefaultApiClient();
22742
- const serviceDefaults = { unifiedStrategy: "realtime" };
22792
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22743
22793
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22744
22794
  const updateOptions = {
22745
22795
  strategy: "temporary",
@@ -22763,7 +22813,7 @@ async function setFeatureFlagOverride(payload, options) {
22763
22813
  API_ERROR_CODES.REQUIRED_FIELD_MISSING
22764
22814
  );
22765
22815
  }
22766
- const serviceDefaults = { unifiedStrategy: "realtime" };
22816
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22767
22817
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22768
22818
  const updateOptions = {
22769
22819
  strategy: "temporary",
@@ -22782,7 +22832,7 @@ __name(setFeatureFlagOverride, "setFeatureFlagOverride");
22782
22832
  // src/api/services/featureFlags/POST/refreshFeatureFlagCache.ts
22783
22833
  async function refreshFeatureFlagCache(options) {
22784
22834
  const client = options?.apiClient ?? getDefaultApiClient();
22785
- const serviceDefaults = { unifiedStrategy: "realtime" };
22835
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22786
22836
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22787
22837
  const updateOptions = {
22788
22838
  strategy: "temporary",
@@ -22826,7 +22876,7 @@ async function updateFeatureFlag(payload, options) {
22826
22876
  API_ERROR_CODES.REQUIRED_FIELD_MISSING
22827
22877
  );
22828
22878
  }
22829
- const serviceDefaults = { unifiedStrategy: "realtime" };
22879
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22830
22880
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22831
22881
  const updateOptions = {
22832
22882
  strategy: "temporary",
@@ -22862,7 +22912,7 @@ async function deleteFeatureFlag(key, options) {
22862
22912
  API_ERROR_CODES.REQUIRED_FIELD_MISSING
22863
22913
  );
22864
22914
  }
22865
- const serviceDefaults = { unifiedStrategy: "realtime" };
22915
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22866
22916
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22867
22917
  const updateOptions = {
22868
22918
  strategy: "temporary",
@@ -22886,7 +22936,7 @@ async function removeFeatureFlagOverride(key, options) {
22886
22936
  API_ERROR_CODES.REQUIRED_FIELD_MISSING
22887
22937
  );
22888
22938
  }
22889
- const serviceDefaults = { unifiedStrategy: "realtime" };
22939
+ const serviceDefaults = { unifiedStrategy: "mutation" };
22890
22940
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
22891
22941
  const updateOptions = {
22892
22942
  strategy: "temporary",
@@ -23710,7 +23760,7 @@ __name(useGetSignedUrl, "useGetSignedUrl");
23710
23760
  async function uploadFile(data, options) {
23711
23761
  const client = options?.apiClient ?? getDefaultApiClient();
23712
23762
  const serviceDefaults = {
23713
- unifiedStrategy: "realtime",
23763
+ unifiedStrategy: "mutation",
23714
23764
  timeout: 6e4
23715
23765
  // 60 seconds for uploads
23716
23766
  };
@@ -23732,7 +23782,7 @@ __name(uploadFile, "uploadFile");
23732
23782
  async function uploadFiles(data, options) {
23733
23783
  const client = options?.apiClient ?? getDefaultApiClient();
23734
23784
  const serviceDefaults = {
23735
- unifiedStrategy: "realtime",
23785
+ unifiedStrategy: "mutation",
23736
23786
  timeout: 12e4
23737
23787
  // 2 minutes for bulk uploads
23738
23788
  };
@@ -23754,7 +23804,7 @@ __name(uploadFiles, "uploadFiles");
23754
23804
  async function generateDocument(data, options) {
23755
23805
  const client = options?.apiClient ?? getDefaultApiClient();
23756
23806
  const serviceDefaults = {
23757
- unifiedStrategy: "realtime",
23807
+ unifiedStrategy: "mutation",
23758
23808
  timeout: 3e4
23759
23809
  // 30 seconds for document generation
23760
23810
  };
@@ -23814,7 +23864,7 @@ async function deleteFile(request, options) {
23814
23864
  API_ERROR_CODES.REQUIRED_FIELD_MISSING
23815
23865
  );
23816
23866
  }
23817
- const serviceDefaults = { unifiedStrategy: "realtime" };
23867
+ const serviceDefaults = { unifiedStrategy: "mutation" };
23818
23868
  const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
23819
23869
  const updateOptions = {
23820
23870
  strategy: "temporary",