@plyaz/api 1.6.6 → 1.6.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.
Files changed (51) hide show
  1. package/dist/api/endpoints/files.d.ts +38 -0
  2. package/dist/api/endpoints/files.d.ts.map +1 -0
  3. package/dist/api/endpoints/index.d.ts +29 -0
  4. package/dist/api/endpoints/index.d.ts.map +1 -1
  5. package/dist/api/services/files/DELETE/deleteFile.d.ts +28 -0
  6. package/dist/api/services/files/DELETE/deleteFile.d.ts.map +1 -0
  7. package/dist/api/services/files/DELETE/index.d.ts +7 -0
  8. package/dist/api/services/files/DELETE/index.d.ts.map +1 -0
  9. package/dist/api/services/files/DELETE/useDeleteFile.d.ts +33 -0
  10. package/dist/api/services/files/DELETE/useDeleteFile.d.ts.map +1 -0
  11. package/dist/api/services/files/GET/downloadFile.d.ts +37 -0
  12. package/dist/api/services/files/GET/downloadFile.d.ts.map +1 -0
  13. package/dist/api/services/files/GET/getFile.d.ts +26 -0
  14. package/dist/api/services/files/GET/getFile.d.ts.map +1 -0
  15. package/dist/api/services/files/GET/getSignedUrl.d.ts +34 -0
  16. package/dist/api/services/files/GET/getSignedUrl.d.ts.map +1 -0
  17. package/dist/api/services/files/GET/index.d.ts +11 -0
  18. package/dist/api/services/files/GET/index.d.ts.map +1 -0
  19. package/dist/api/services/files/GET/useDownloadFile.d.ts +41 -0
  20. package/dist/api/services/files/GET/useDownloadFile.d.ts.map +1 -0
  21. package/dist/api/services/files/GET/useGetFile.d.ts +31 -0
  22. package/dist/api/services/files/GET/useGetFile.d.ts.map +1 -0
  23. package/dist/api/services/files/GET/useGetSignedUrl.d.ts +40 -0
  24. package/dist/api/services/files/GET/useGetSignedUrl.d.ts.map +1 -0
  25. package/dist/api/services/files/POST/generateDocument.d.ts +42 -0
  26. package/dist/api/services/files/POST/generateDocument.d.ts.map +1 -0
  27. package/dist/api/services/files/POST/index.d.ts +11 -0
  28. package/dist/api/services/files/POST/index.d.ts.map +1 -0
  29. package/dist/api/services/files/POST/uploadFile.d.ts +40 -0
  30. package/dist/api/services/files/POST/uploadFile.d.ts.map +1 -0
  31. package/dist/api/services/files/POST/uploadFiles.d.ts +49 -0
  32. package/dist/api/services/files/POST/uploadFiles.d.ts.map +1 -0
  33. package/dist/api/services/files/POST/useGenerateDocument.d.ts +39 -0
  34. package/dist/api/services/files/POST/useGenerateDocument.d.ts.map +1 -0
  35. package/dist/api/services/files/POST/useUploadFile.d.ts +34 -0
  36. package/dist/api/services/files/POST/useUploadFile.d.ts.map +1 -0
  37. package/dist/api/services/files/POST/useUploadFiles.d.ts +36 -0
  38. package/dist/api/services/files/POST/useUploadFiles.d.ts.map +1 -0
  39. package/dist/api/services/files/index.d.ts +16 -0
  40. package/dist/api/services/files/index.d.ts.map +1 -0
  41. package/dist/api/services/index.d.ts +1 -0
  42. package/dist/api/services/index.d.ts.map +1 -1
  43. package/dist/entry-frontend.cjs +300 -0
  44. package/dist/entry-frontend.cjs.map +1 -1
  45. package/dist/entry-frontend.mjs +286 -1
  46. package/dist/entry-frontend.mjs.map +1 -1
  47. package/dist/index.cjs +300 -0
  48. package/dist/index.cjs.map +1 -1
  49. package/dist/index.mjs +286 -1
  50. package/dist/index.mjs.map +1 -1
  51. package/package.json +3 -4
package/dist/index.cjs CHANGED
@@ -13924,6 +13924,41 @@ var featureFlagEndpoints = {
13924
13924
  }
13925
13925
  };
13926
13926
 
13927
+ // src/api/endpoints/files.ts
13928
+ var filesEndpoints = {
13929
+ // POST endpoints
13930
+ uploadFile: {
13931
+ url: "/upload",
13932
+ method: "POST"
13933
+ },
13934
+ uploadFiles: {
13935
+ url: "/upload/bulk",
13936
+ method: "POST"
13937
+ },
13938
+ generateDocument: {
13939
+ url: "/generate-document",
13940
+ method: "POST"
13941
+ },
13942
+ // GET endpoints
13943
+ downloadFile: {
13944
+ url: "/files/:id/download",
13945
+ method: "GET"
13946
+ },
13947
+ getSignedUrl: {
13948
+ url: "/files/:id/signed-url",
13949
+ method: "GET"
13950
+ },
13951
+ getFile: {
13952
+ url: "/files/:id",
13953
+ method: "GET"
13954
+ },
13955
+ // DELETE endpoints
13956
+ deleteFile: {
13957
+ url: "/files/:id",
13958
+ method: "DELETE"
13959
+ }
13960
+ };
13961
+
13927
13962
  // src/api/endpoints/polling.ts
13928
13963
  var pollingEndpoints = {
13929
13964
  // Job monitoring - use with 'jobStatus' polling strategy
@@ -14366,6 +14401,8 @@ var endpoints = {
14366
14401
  ...campaignEndpoints,
14367
14402
  // Feature flag endpoints (evaluation, management)
14368
14403
  ...featureFlagEndpoints,
14404
+ // File operation endpoints (upload, download, generate document)
14405
+ ...filesEndpoints,
14369
14406
  // These are only examples for the polling, none of these endpoints doesnt exist yet
14370
14407
  ...pollingEndpoints,
14371
14408
  // Infobip third-party provider endpoints (Email, SMS, WhatsApp)
@@ -26238,6 +26275,254 @@ async function fastlyPurgeUrl(payload, options) {
26238
26275
  });
26239
26276
  }
26240
26277
  __name(fastlyPurgeUrl, "fastlyPurgeUrl");
26278
+ async function getFile(request, options) {
26279
+ const client = options?.apiClient ?? getDefaultApiClient();
26280
+ const pathParams = { id: request.id };
26281
+ if (!validatePathParams("getFile", pathParams)) {
26282
+ throw new ApiPackageError(
26283
+ "Missing required path parameter: id",
26284
+ void 0,
26285
+ api.API_ERROR_CODES.REQUIRED_FIELD_MISSING
26286
+ );
26287
+ }
26288
+ const serviceDefaults = { unifiedStrategy: "interactive" };
26289
+ const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
26290
+ const updateOptions = {
26291
+ strategy: "temporary",
26292
+ ...options?.updateConfigOptions
26293
+ };
26294
+ if (shouldApplyConfig(mergedConfig, updateOptions)) {
26295
+ client.updateConfig(mergedConfig, updateOptions);
26296
+ }
26297
+ return client.getFile({
26298
+ urlPathParams: pathParams
26299
+ });
26300
+ }
26301
+ __name(getFile, "getFile");
26302
+ async function downloadFile(request, options) {
26303
+ const client = options?.apiClient ?? getDefaultApiClient();
26304
+ const pathParams = { id: request.id };
26305
+ if (!validatePathParams("downloadFile", pathParams)) {
26306
+ throw new ApiPackageError(
26307
+ "Missing required path parameter: id",
26308
+ void 0,
26309
+ api.API_ERROR_CODES.REQUIRED_FIELD_MISSING
26310
+ );
26311
+ }
26312
+ const serviceDefaults = {
26313
+ unifiedStrategy: "background",
26314
+ timeout: 6e4
26315
+ // 60 seconds for downloads
26316
+ };
26317
+ const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
26318
+ const updateOptions = {
26319
+ strategy: "temporary",
26320
+ ...options?.updateConfigOptions
26321
+ };
26322
+ if (shouldApplyConfig(mergedConfig, updateOptions)) {
26323
+ client.updateConfig(mergedConfig, updateOptions);
26324
+ }
26325
+ return client.downloadFile({
26326
+ urlPathParams: pathParams
26327
+ });
26328
+ }
26329
+ __name(downloadFile, "downloadFile");
26330
+ async function getSignedUrl(request, options) {
26331
+ const client = options?.apiClient ?? getDefaultApiClient();
26332
+ const pathParams = { id: request.id };
26333
+ if (!validatePathParams("getSignedUrl", pathParams)) {
26334
+ throw new ApiPackageError(
26335
+ "Missing required path parameter: id",
26336
+ void 0,
26337
+ api.API_ERROR_CODES.REQUIRED_FIELD_MISSING
26338
+ );
26339
+ }
26340
+ const serviceDefaults = { unifiedStrategy: "interactive" };
26341
+ const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
26342
+ const updateOptions = {
26343
+ strategy: "temporary",
26344
+ ...options?.updateConfigOptions
26345
+ };
26346
+ if (shouldApplyConfig(mergedConfig, updateOptions)) {
26347
+ client.updateConfig(mergedConfig, updateOptions);
26348
+ }
26349
+ return client.getSignedUrl({
26350
+ urlPathParams: pathParams,
26351
+ ...request.query ? { params: request.query } : {}
26352
+ });
26353
+ }
26354
+ __name(getSignedUrl, "getSignedUrl");
26355
+
26356
+ // src/api/services/files/GET/useGetFile.ts
26357
+ function useGetFile(queryKey, request, serviceOptions, queryOptions) {
26358
+ return createApiQuery(getFile, {
26359
+ apiConfig: {
26360
+ unifiedStrategy: "interactive"
26361
+ }
26362
+ })(queryKey, request, serviceOptions, queryOptions);
26363
+ }
26364
+ __name(useGetFile, "useGetFile");
26365
+
26366
+ // src/api/services/files/GET/useDownloadFile.ts
26367
+ function useDownloadFile(queryKey, request, serviceOptions, queryOptions) {
26368
+ return createApiQuery(downloadFile, {
26369
+ apiConfig: {
26370
+ unifiedStrategy: "background"
26371
+ }
26372
+ })(queryKey, request, serviceOptions, queryOptions);
26373
+ }
26374
+ __name(useDownloadFile, "useDownloadFile");
26375
+
26376
+ // src/api/services/files/GET/useGetSignedUrl.ts
26377
+ function useGetSignedUrl(queryKey, request, serviceOptions, queryOptions) {
26378
+ return createApiQuery(getSignedUrl, {
26379
+ apiConfig: {
26380
+ unifiedStrategy: "interactive"
26381
+ }
26382
+ })(queryKey, request, serviceOptions, queryOptions);
26383
+ }
26384
+ __name(useGetSignedUrl, "useGetSignedUrl");
26385
+
26386
+ // src/api/services/files/POST/uploadFile.ts
26387
+ async function uploadFile(data, options) {
26388
+ const client = options?.apiClient ?? getDefaultApiClient();
26389
+ const serviceDefaults = {
26390
+ unifiedStrategy: "realtime",
26391
+ timeout: 6e4
26392
+ // 60 seconds for uploads
26393
+ };
26394
+ const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
26395
+ const updateOptions = {
26396
+ strategy: "temporary",
26397
+ ...options?.updateConfigOptions
26398
+ };
26399
+ if (shouldApplyConfig(mergedConfig, updateOptions)) {
26400
+ client.updateConfig(mergedConfig, updateOptions);
26401
+ }
26402
+ return client.uploadFile({
26403
+ body: data
26404
+ });
26405
+ }
26406
+ __name(uploadFile, "uploadFile");
26407
+
26408
+ // src/api/services/files/POST/uploadFiles.ts
26409
+ async function uploadFiles(data, options) {
26410
+ const client = options?.apiClient ?? getDefaultApiClient();
26411
+ const serviceDefaults = {
26412
+ unifiedStrategy: "realtime",
26413
+ timeout: 12e4
26414
+ // 2 minutes for bulk uploads
26415
+ };
26416
+ const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
26417
+ const updateOptions = {
26418
+ strategy: "temporary",
26419
+ ...options?.updateConfigOptions
26420
+ };
26421
+ if (shouldApplyConfig(mergedConfig, updateOptions)) {
26422
+ client.updateConfig(mergedConfig, updateOptions);
26423
+ }
26424
+ return client.uploadFiles({
26425
+ body: data
26426
+ });
26427
+ }
26428
+ __name(uploadFiles, "uploadFiles");
26429
+
26430
+ // src/api/services/files/POST/generateDocument.ts
26431
+ async function generateDocument(data, options) {
26432
+ const client = options?.apiClient ?? getDefaultApiClient();
26433
+ const serviceDefaults = {
26434
+ unifiedStrategy: "realtime",
26435
+ timeout: 3e4
26436
+ // 30 seconds for document generation
26437
+ };
26438
+ const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
26439
+ const updateOptions = {
26440
+ strategy: "temporary",
26441
+ ...options?.updateConfigOptions
26442
+ };
26443
+ if (shouldApplyConfig(mergedConfig, updateOptions)) {
26444
+ client.updateConfig(mergedConfig, updateOptions);
26445
+ }
26446
+ return client.generateDocument({
26447
+ body: data
26448
+ });
26449
+ }
26450
+ __name(generateDocument, "generateDocument");
26451
+ function useUploadFile(serviceOptions, mutationOptions) {
26452
+ const queryClient = reactQuery.useQueryClient();
26453
+ return createApiMutation(uploadFile, {
26454
+ onSuccess: /* @__PURE__ */ __name(() => {
26455
+ void queryClient.invalidateQueries({
26456
+ queryKey: ["files"]
26457
+ });
26458
+ }, "onSuccess"),
26459
+ ...mutationOptions
26460
+ })(serviceOptions, mutationOptions);
26461
+ }
26462
+ __name(useUploadFile, "useUploadFile");
26463
+ function useUploadFiles(serviceOptions, mutationOptions) {
26464
+ const queryClient = reactQuery.useQueryClient();
26465
+ return createApiMutation(uploadFiles, {
26466
+ onSuccess: /* @__PURE__ */ __name(() => {
26467
+ void queryClient.invalidateQueries({
26468
+ queryKey: ["files"]
26469
+ });
26470
+ }, "onSuccess"),
26471
+ ...mutationOptions
26472
+ })(serviceOptions, mutationOptions);
26473
+ }
26474
+ __name(useUploadFiles, "useUploadFiles");
26475
+
26476
+ // src/api/services/files/POST/useGenerateDocument.ts
26477
+ function useGenerateDocument(serviceOptions, mutationOptions) {
26478
+ return createApiMutation(generateDocument, {
26479
+ // No cache invalidation needed for document generation
26480
+ ...mutationOptions
26481
+ })(serviceOptions, mutationOptions);
26482
+ }
26483
+ __name(useGenerateDocument, "useGenerateDocument");
26484
+ async function deleteFile(request, options) {
26485
+ const client = options?.apiClient ?? getDefaultApiClient();
26486
+ const pathParams = { id: request.id };
26487
+ if (!validatePathParams("deleteFile", pathParams)) {
26488
+ throw new ApiPackageError(
26489
+ "Missing required path parameter: id",
26490
+ void 0,
26491
+ api.API_ERROR_CODES.REQUIRED_FIELD_MISSING
26492
+ );
26493
+ }
26494
+ const serviceDefaults = { unifiedStrategy: "realtime" };
26495
+ const mergedConfig = mergeConfigs(serviceDefaults, options?.apiConfig ?? {});
26496
+ const updateOptions = {
26497
+ strategy: "temporary",
26498
+ ...options?.updateConfigOptions
26499
+ };
26500
+ if (shouldApplyConfig(mergedConfig, updateOptions)) {
26501
+ client.updateConfig(mergedConfig, updateOptions);
26502
+ }
26503
+ return client.deleteFile({
26504
+ urlPathParams: pathParams
26505
+ });
26506
+ }
26507
+ __name(deleteFile, "deleteFile");
26508
+ function useDeleteFile(serviceOptions, mutationOptions) {
26509
+ const queryClient = reactQuery.useQueryClient();
26510
+ return createApiMutation(deleteFile, {
26511
+ onSuccess: /* @__PURE__ */ __name((_data, request) => {
26512
+ void queryClient.invalidateQueries({
26513
+ queryKey: ["files"]
26514
+ });
26515
+ queryClient.removeQueries({
26516
+ queryKey: ["file", request.id]
26517
+ });
26518
+ queryClient.removeQueries({
26519
+ queryKey: ["signedUrl", request.id]
26520
+ });
26521
+ }, "onSuccess"),
26522
+ ...mutationOptions
26523
+ })(serviceOptions, mutationOptions);
26524
+ }
26525
+ __name(useDeleteFile, "useDeleteFile");
26241
26526
  function getSSRSafeConfig(config) {
26242
26527
  if (!isBrowser()) {
26243
26528
  return {
@@ -26806,11 +27091,13 @@ exports.deepMerge = deepMerge;
26806
27091
  exports.deleteCache = deleteCache;
26807
27092
  exports.deleteCampaign = deleteCampaign;
26808
27093
  exports.deleteFeatureFlag = deleteFeatureFlag;
27094
+ exports.deleteFile = deleteFile;
26809
27095
  exports.detectConfigConflicts = detectConfigConflicts;
26810
27096
  exports.detectConflicts = detectConflicts;
26811
27097
  exports.detectPlatform = detectPlatform;
26812
27098
  exports.determinePrecedenceReason = determinePrecedenceReason;
26813
27099
  exports.disableNetworkConfigDebug = disableNetworkConfigDebug;
27100
+ exports.downloadFile = downloadFile;
26814
27101
  exports.enableNetworkConfigDebug = enableNetworkConfigDebug;
26815
27102
  exports.encrypt = encrypt;
26816
27103
  exports.endOfDay = endOfDay;
@@ -26839,6 +27126,7 @@ exports.fetchInfobipEmailReports = fetchInfobipEmailReports;
26839
27126
  exports.fetchInfobipScheduledEmailStatuses = fetchInfobipScheduledEmailStatuses;
26840
27127
  exports.fetchInfobipScheduledEmails = fetchInfobipScheduledEmails;
26841
27128
  exports.fetchInfobipValidations = fetchInfobipValidations;
27129
+ exports.filesEndpoints = filesEndpoints;
26842
27130
  exports.filterHistory = filterHistory;
26843
27131
  exports.filterObject = filterObject;
26844
27132
  exports.findEndpointsByPattern = findEndpointsByPattern;
@@ -26851,6 +27139,7 @@ exports.fromFetchffConfig = fromFetchffConfig;
26851
27139
  exports.fromISOString = fromISOString;
26852
27140
  exports.fromUnixTimestamp = fromUnixTimestamp;
26853
27141
  exports.generateComprehensiveReport = generateComprehensiveReport;
27142
+ exports.generateDocument = generateDocument;
26854
27143
  exports.generateIV = generateIV;
26855
27144
  exports.generateIssueBreakdown = generateIssueBreakdown;
26856
27145
  exports.generateRandomKey = generateRandomKey;
@@ -26899,6 +27188,7 @@ exports.getErrorHandlers = getErrorHandlers;
26899
27188
  exports.getEventManager = getEventManager;
26900
27189
  exports.getExtendedEnvironmentInfo = getExtendedEnvironmentInfo;
26901
27190
  exports.getFieldValue = getFieldValue;
27191
+ exports.getFile = getFile;
26902
27192
  exports.getFileExtension = getFileExtension;
26903
27193
  exports.getFrameworkAdaptiveBatchSize = getFrameworkAdaptiveBatchSize;
26904
27194
  exports.getFrameworkAdaptiveTimeout = getFrameworkAdaptiveTimeout;
@@ -26948,6 +27238,7 @@ exports.getRuntimeEnvironment = getRuntimeEnvironment;
26948
27238
  exports.getSSRSafeConfig = getSSRSafeConfig;
26949
27239
  exports.getSSRSafePollingConfig = getSSRSafePollingConfig;
26950
27240
  exports.getSessionStorage = getSessionStorage;
27241
+ exports.getSignedUrl = getSignedUrl;
26951
27242
  exports.getTimeComponents = getTimeComponents;
26952
27243
  exports.getUnifiedDebugger = getUnifiedDebugger;
26953
27244
  exports.getUnifiedStrategy = getUnifiedStrategy;
@@ -27196,7 +27487,9 @@ exports.updateCampaign = updateCampaign;
27196
27487
  exports.updateFeatureFlag = updateFeatureFlag;
27197
27488
  exports.updateGlobalConfig = updateGlobalConfig;
27198
27489
  exports.updateInfobipScheduledEmailStatuses = updateInfobipScheduledEmailStatuses;
27490
+ exports.uploadFile = uploadFile;
27199
27491
  exports.uploadFileForScanning = uploadFileForScanning;
27492
+ exports.uploadFiles = uploadFiles;
27200
27493
  exports.useAbortableRequest = useAbortableRequest;
27201
27494
  exports.useApiConfigConflicts = useApiConfigConflicts;
27202
27495
  exports.useApiDebugInfo = useApiDebugInfo;
@@ -27213,7 +27506,12 @@ exports.useCreateFeatureFlag = useCreateFeatureFlag;
27213
27506
  exports.useDebouncedSubscription = useDebouncedSubscription;
27214
27507
  exports.useDeleteCampaign = useDeleteCampaign;
27215
27508
  exports.useDeleteFeatureFlag = useDeleteFeatureFlag;
27509
+ exports.useDeleteFile = useDeleteFile;
27510
+ exports.useDownloadFile = useDownloadFile;
27216
27511
  exports.useEvaluateAllFeatureFlags = useEvaluateAllFeatureFlags;
27512
+ exports.useGenerateDocument = useGenerateDocument;
27513
+ exports.useGetFile = useGetFile;
27514
+ exports.useGetSignedUrl = useGetSignedUrl;
27217
27515
  exports.useJoinCampaign = useJoinCampaign;
27218
27516
  exports.useLeaveCampaign = useLeaveCampaign;
27219
27517
  exports.useMultipleSubscriptions = useMultipleSubscriptions;
@@ -27227,6 +27525,8 @@ exports.useSubscription = useSubscription;
27227
27525
  exports.useSubscriptionState = useSubscriptionState;
27228
27526
  exports.useUpdateCampaign = useUpdateCampaign;
27229
27527
  exports.useUpdateFeatureFlag = useUpdateFeatureFlag;
27528
+ exports.useUploadFile = useUploadFile;
27529
+ exports.useUploadFiles = useUploadFiles;
27230
27530
  exports.validateConfigUpdate = validateConfigUpdate;
27231
27531
  exports.validateEncryptionConfig = validateEncryptionConfig;
27232
27532
  exports.validateHeaders = validateHeaders;