@bytescale/sdk 3.0.0-alpha.2 → 3.0.0-alpha.21

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 (35) hide show
  1. package/README.md +391 -48
  2. package/dist/browser/cjs/main.js +723 -589
  3. package/dist/node/cjs/main.js +640 -263
  4. package/dist/node/esm/main.mjs +640 -263
  5. package/dist/types/index.d.ts +1 -1
  6. package/dist/types/private/AuthSessionState.d.ts +25 -8
  7. package/dist/types/private/EnvChecker.d.ts +1 -1
  8. package/dist/types/private/Mutex.d.ts +1 -1
  9. package/dist/types/private/StreamUtils.d.ts +1 -0
  10. package/dist/types/private/UploadManagerBase.d.ts +6 -1
  11. package/dist/types/private/UploadManagerBrowserWorkerBase.d.ts +19 -0
  12. package/dist/types/private/UploadManagerFetchUtils.d.ts +8 -0
  13. package/dist/types/private/model/AuthManagerInterface.d.ts +22 -5
  14. package/dist/types/private/model/AuthSession.d.ts +2 -2
  15. package/dist/types/private/model/OnPartProgress.d.ts +1 -1
  16. package/dist/types/private/model/UploadSourceProcessed.d.ts +6 -1
  17. package/dist/types/public/browser/AuthManagerBrowser.d.ts +11 -6
  18. package/dist/types/public/browser/UploadManagerBrowser.d.ts +3 -12
  19. package/dist/types/public/node/AuthManagerNode.d.ts +8 -3
  20. package/dist/types/public/shared/CommonTypes.d.ts +0 -1
  21. package/dist/types/public/shared/UrlBuilder.d.ts +10 -11
  22. package/dist/types/public/shared/UrlBuilderTypes.d.ts +65 -71
  23. package/dist/types/public/shared/generated/apis/FileApi.d.ts +104 -3
  24. package/dist/types/public/shared/generated/apis/FolderApi.d.ts +0 -3
  25. package/dist/types/public/shared/generated/apis/JobApi.d.ts +0 -3
  26. package/dist/types/public/shared/generated/apis/UploadApi.d.ts +6 -3
  27. package/dist/types/public/shared/generated/models/index.d.ts +5 -7
  28. package/dist/types/public/shared/generated/runtime.d.ts +7 -5
  29. package/dist/types/public/worker/UploadManagerWorker.d.ts +8 -0
  30. package/dist/types/public/worker/index.d.ts +2 -0
  31. package/dist/worker/cjs/main.js +2578 -0
  32. package/dist/worker/esm/main.mjs +2578 -0
  33. package/package.json +7 -8
  34. package/tests/UploadManager.test.ts +0 -7
  35. package/tests/UrlBuilder.test.ts +60 -59
@@ -47,9 +47,6 @@ export interface PutFolderOperationParams {
47
47
  accountId: string;
48
48
  putFolderRequest: PutFolderRequest;
49
49
  }
50
- /**
51
- *
52
- */
53
50
  export declare class FolderApi extends runtime.BaseAPI {
54
51
  /**
55
52
  * Copies a folder asynchronously. You can use ListFolder to preview the operation: set `dryRun=true` with ```recursive```, ```includeFiles```, ```includeOverriddenStorage``` and ```includeVirtualFolders``` set to match the values you\'re using here. Leave all other flags unset.
@@ -25,9 +25,6 @@ export interface ListRecentJobsParams {
25
25
  accountId: string;
26
26
  jobType: Array<AccountJobType>;
27
27
  }
28
- /**
29
- *
30
- */
31
28
  export declare class JobApi extends runtime.BaseAPI {
32
29
  /**
33
30
  * Cancels an in-progress background job. Requires a `secret_*` API key.
@@ -13,6 +13,9 @@ import * as runtime from "../runtime";
13
13
  import type { BasicUploadResponse, BeginMultipartUploadRequest, BeginMultipartUploadResponse, CompleteUploadPartRequest, UploadFromUrlRequest, UploadPart, UploadPartList } from "../models";
14
14
  export interface BeginMultipartUploadOperationParams {
15
15
  accountId: string;
16
+ /**
17
+ *
18
+ */
16
19
  beginMultipartUploadRequest: BeginMultipartUploadRequest;
17
20
  }
18
21
  export interface CompleteUploadPartOperationParams {
@@ -32,11 +35,11 @@ export interface ListUploadPartsParams {
32
35
  }
33
36
  export interface UploadFromUrlOperationParams {
34
37
  accountId: string;
38
+ /**
39
+ *
40
+ */
35
41
  uploadFromUrlRequest: UploadFromUrlRequest;
36
42
  }
37
- /**
38
- *
39
- */
40
43
  export declare class UploadApi extends runtime.BaseAPI {
41
44
  /**
42
45
  * Begins a new multipart file upload process.
@@ -1524,7 +1524,7 @@ export interface ProcessFileAndSaveRequest {
1524
1524
  */
1525
1525
  export declare type ProcessFileAndSaveResponse = ProcessFileAndSaveResponseAsync | ProcessFileAndSaveResponseSync;
1526
1526
  /**
1527
- * Response body for ProcessFileAndSave operations where the File Processing API operation is an asynchronous operation (e.g. a video transcoding job).
1527
+ * Response body for ProcessFileAndSave operations where the File Processing API operation is asynchronous (e.g. a video transcoding job).
1528
1528
  * @export
1529
1529
  * @interface ProcessFileAndSaveResponseAsync
1530
1530
  */
@@ -1617,7 +1617,7 @@ export declare type ProcessFileAndSaveResponseAsyncJobDocsEnum = "https://www.by
1617
1617
  */
1618
1618
  export declare type ProcessFileAndSaveResponseAsyncAsyncEnum = true;
1619
1619
  /**
1620
- * Response body for ProcessFileAndSave operations where the File Processing API operation is a synchronous operation (e.g. an image processing job).
1620
+ * Response body for ProcessFileAndSave operations where the File Processing API operation is synchronous (e.g. an image processing job).
1621
1621
  * @export
1622
1622
  * @interface ProcessFileAndSaveResponseSync
1623
1623
  */
@@ -1641,9 +1641,7 @@ export interface ProcessFileAndSaveResponseSync {
1641
1641
  */
1642
1642
  async: ProcessFileAndSaveResponseSyncAsyncEnum;
1643
1643
  /**
1644
- * The `filePath` of the transformed file.
1645
- *
1646
- * If the transformation outputs multiple artifacts, then each artifact's path will be a child of this path.
1644
+ * Absolute path to a file. Begins with a `/`.
1647
1645
  * @type {string}
1648
1646
  * @memberof ProcessFileAndSaveResponseSync
1649
1647
  */
@@ -1655,9 +1653,9 @@ export interface ProcessFileAndSaveResponseSync {
1655
1653
  */
1656
1654
  fileUrl: string;
1657
1655
  /**
1658
- * JSON response returned by certain transformation APIs.
1656
+ * JSON response returned by certain File Processing APIs.
1659
1657
  *
1660
- * Structure varies between transformation APIs (please consult the documentation of the individual transformation APIs).
1658
+ * Structure varies between File Processing APIs (please see the documentation of each individual File Processing API).
1661
1659
  * @type {{ [key: string]: any; }}
1662
1660
  * @memberof ProcessFileAndSaveResponseSync
1663
1661
  */
@@ -45,9 +45,9 @@ export declare class BytescaleApiClientConfigUtils {
45
45
  private static readonly specialApiKeyAccountId;
46
46
  private static readonly accountIdLength;
47
47
  static getApiUrl(config: BytescaleApiClientConfig): string;
48
- static getCdnUrl(config: BytescaleApiClientConfig): string;
49
- static getFetchApi(config: BytescaleApiClientConfig): FetchAPI;
50
- static getAccountId(config: BytescaleApiClientConfig): string;
48
+ static getCdnUrl(config: Pick<BytescaleApiClientConfig, "cdnUrl">): string;
49
+ static getFetchApi(config: Pick<BytescaleApiClientConfig, "fetchApi">): FetchAPI;
50
+ static getAccountId(config: Pick<BytescaleApiClientConfig, "apiKey">): string;
51
51
  static validate(config: BytescaleApiClientConfig): void;
52
52
  }
53
53
  /**
@@ -56,11 +56,13 @@ export declare class BytescaleApiClientConfigUtils {
56
56
  export declare class BaseAPI {
57
57
  protected readonly config: BytescaleApiClientConfig;
58
58
  constructor(config: BytescaleApiClientConfig);
59
- protected request(context: RequestOpts, initOverrides: RequestInit | InitOverrideFunction | undefined, baseUrlOverride: string | undefined): Promise<Response>;
60
59
  /**
61
60
  * Returns a successful response (2**) else throws an error.
62
61
  */
63
- protected doFetch(url: string, init: RequestInit, isBytescaleApi: boolean): Promise<Response>;
62
+ static fetch(url: string, init: RequestInit, config: Pick<BytescaleApiClientConfig, "fetchApi"> & {
63
+ isBytescaleApi: boolean;
64
+ }): Promise<Response>;
65
+ protected request(context: RequestOpts, initOverrides: RequestInit | InitOverrideFunction | undefined, baseUrlOverride: string | undefined): Promise<Response>;
64
66
  protected encodeParam(paramName: string, paramValue: string): string;
65
67
  private createFetchParams;
66
68
  }
@@ -0,0 +1,8 @@
1
+ import { UploadSourceProcessedWorker } from "../../private/model/UploadSourceProcessed";
2
+ import { UploadPart } from "../shared/generated";
3
+ import { PutUploadPartResult } from "../../private/model/PutUploadPartResult";
4
+ import { AddCancellationHandler } from "../../private/model/AddCancellationHandler";
5
+ import { UploadManagerBrowserWorkerBase } from "../../private/UploadManagerBrowserWorkerBase";
6
+ export declare class UploadManager extends UploadManagerBrowserWorkerBase {
7
+ protected doPutUploadPart(part: UploadPart, contentLength: number, source: UploadSourceProcessedWorker, _onProgress: (bytesSentDelta: number) => void, addCancellationHandler: AddCancellationHandler): Promise<PutUploadPartResult>;
8
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./UploadManagerWorker";
2
+ export * from "../node/AuthManagerNode";