@ckeditor/ckeditor5-cloud-services 41.3.0-alpha.3 → 41.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-cloud-services",
3
- "version": "41.3.0-alpha.3",
3
+ "version": "41.3.0",
4
4
  "description": "CKEditor 5's Cloud Services integration layer.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,7 +12,7 @@
12
12
  "type": "module",
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "ckeditor5": "41.3.0-alpha.3"
15
+ "ckeditor5": "41.3.0"
16
16
  },
17
17
  "author": "CKSource (http://cksource.com/)",
18
18
  "license": "GPL-2.0-or-later",
@@ -24,7 +24,6 @@
24
24
  "directory": "packages/ckeditor5-cloud-services"
25
25
  },
26
26
  "files": [
27
- "dist",
28
27
  "lang",
29
28
  "src/**/*.js",
30
29
  "src/**/*.d.ts",
package/src/index.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  */
8
8
  export { default as CloudServices } from './cloudservices.js';
9
9
  export { default as CloudServicesCore } from './cloudservicescore.js';
10
- export type { TokenUrl, CloudServicesConfig } from './cloudservicesconfig.js';
10
+ export { TokenUrl, type CloudServicesConfig } from './cloudservicesconfig.js';
11
11
  export type { default as Token, InitializedToken } from './token/token.js';
12
12
  export type { default as UploadGateway } from './uploadgateway/uploadgateway.js';
13
13
  export type { default as FileUploader } from './uploadgateway/fileuploader.js';
@@ -1,4 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
@@ -1,4 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
package/dist/index.css DELETED
@@ -1,4 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
@@ -1,23 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- import type { CloudServices, CloudServicesConfig, CloudServicesCore } from './index.js';
10
- declare module '@ckeditor/ckeditor5-core' {
11
- interface EditorConfig {
12
- /**
13
- * The configuration of CKEditor Cloud Services. Introduced by the {@link module:cloud-services/cloudservices~CloudServices} plugin.
14
- *
15
- * Read more in {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig}.
16
- */
17
- cloudServices?: CloudServicesConfig;
18
- }
19
- interface PluginsMap {
20
- [CloudServices.pluginName]: CloudServices;
21
- [CloudServicesCore.pluginName]: CloudServicesCore;
22
- }
23
- }
@@ -1,88 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module cloud-services/cloudservices
11
- */
12
- import { ContextPlugin } from 'ckeditor5/src/core.js';
13
- import CloudServicesCore from './cloudservicescore.js';
14
- import type { CloudServicesConfig, TokenUrl } from './cloudservicesconfig.js';
15
- import type { InitializedToken } from './token/token.js';
16
- /**
17
- * Plugin introducing the integration between CKEditor 5 and CKEditor Cloud Services .
18
- *
19
- * It initializes the token provider based on
20
- * the {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig `config.cloudService`}.
21
- */
22
- export default class CloudServices extends ContextPlugin implements CloudServicesConfig {
23
- /**
24
- * The authentication token URL for CKEditor Cloud Services or a callback to the token value promise. See the
25
- * {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl} for more details.
26
- */
27
- readonly tokenUrl?: TokenUrl;
28
- /**
29
- * The URL to which the files should be uploaded.
30
- */
31
- readonly uploadUrl?: string;
32
- /**
33
- * The URL for web socket communication, used by the `RealTimeCollaborativeEditing` plugin. Every customer (organization in the CKEditor
34
- * Ecosystem dashboard) has their own, unique URLs to communicate with CKEditor Cloud Services. The URL can be found in the
35
- * CKEditor Ecosystem customer dashboard.
36
- *
37
- * Note: Unlike most plugins, `RealTimeCollaborativeEditing` is not included in any CKEditor 5 build and needs to be installed manually.
38
- * Check [Collaboration overview](https://ckeditor.com/docs/ckeditor5/latest/features/collaboration/overview.html) for more details.
39
- */
40
- readonly webSocketUrl?: string;
41
- /**
42
- * An optional parameter used for integration with CKEditor Cloud Services when uploading the editor build to cloud services.
43
- *
44
- * Whenever the editor build or the configuration changes, this parameter should be set to a new, unique value to differentiate
45
- * the new bundle (build + configuration) from the old ones.
46
- */
47
- readonly bundleVersion?: string;
48
- /**
49
- * Other plugins use this token for the authorization process. It handles token requesting and refreshing.
50
- * Its value is `null` when {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl} is not provided.
51
- *
52
- * @readonly
53
- */
54
- token: InitializedToken | null;
55
- /**
56
- * A map of token object instances keyed by the token URLs.
57
- */
58
- private readonly _tokens;
59
- /**
60
- * @inheritDoc
61
- */
62
- static get pluginName(): "CloudServices";
63
- /**
64
- * @inheritDoc
65
- */
66
- static get requires(): readonly [typeof CloudServicesCore];
67
- /**
68
- * @inheritDoc
69
- */
70
- init(): Promise<void>;
71
- /**
72
- * Registers an additional authentication token URL for CKEditor Cloud Services or a callback to the token value promise. See the
73
- * {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl} for more details.
74
- *
75
- * @param tokenUrl The authentication token URL for CKEditor Cloud Services or a callback to the token value promise.
76
- */
77
- registerTokenUrl(tokenUrl: TokenUrl): Promise<InitializedToken>;
78
- /**
79
- * Returns an authentication token provider previously registered by {@link #registerTokenUrl}.
80
- *
81
- * @param tokenUrl The authentication token URL for CKEditor Cloud Services or a callback to the token value promise.
82
- */
83
- getTokenFor(tokenUrl: TokenUrl): InitializedToken;
84
- /**
85
- * @inheritDoc
86
- */
87
- destroy(): void;
88
- }
@@ -1,125 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module cloud-services/cloudservicesconfig
11
- */
12
- /**
13
- * Endpoint address to download the token or a callback that provides the token.
14
- */
15
- export type TokenUrl = string | (() => Promise<string>);
16
- /**
17
- * The configuration for all plugins using CKEditor Cloud Services.
18
- *
19
- * ```ts
20
- * ClassicEditor
21
- * .create( document.querySelector( '#editor' ), {
22
- * cloudServices: {
23
- * tokenUrl: 'https://example.com/cs-token-endpoint',
24
- * uploadUrl: 'https://your-organization-id.cke-cs.com/easyimage/upload/'
25
- * }
26
- * } )
27
- * .then( ... )
28
- * .catch( ... );
29
- * ```
30
- *
31
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
32
- */
33
- export interface CloudServicesConfig {
34
- /**
35
- * A token URL or a token request function.
36
- *
37
- * As a string, it should be a URL to the security token endpoint in your application.
38
- * The role of this endpoint is to securely authorize
39
- * the end users of your application to use [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services) only
40
- * if they should have access e.g. to upload files with {@glink features/file-management/ckbox CKBox} or to use the
41
- * {@glink @cs guides/collaboration/quick-start Collaboration} service.
42
- *
43
- * ```ts
44
- * ClassicEditor
45
- * .create( document.querySelector( '#editor' ), {
46
- * cloudServices: {
47
- * tokenUrl: 'https://example.com/cs-token-endpoint',
48
- * ...
49
- * }
50
- * } )
51
- * .then( ... )
52
- * .catch( ... );
53
- * ```
54
- *
55
- * As a function, it should provide a promise to the token value,
56
- * so you can highly customize the token and provide your token URL endpoint.
57
- * By using this approach you can set your own headers for the request.
58
- *
59
- * ```ts
60
- * ClassicEditor
61
- * .create( document.querySelector( '#editor' ), {
62
- * cloudServices: {
63
- * tokenUrl: () => new Promise( ( resolve, reject ) => {
64
- * const xhr = new XMLHttpRequest();
65
- *
66
- * xhr.open( 'GET', 'https://example.com/cs-token-endpoint' );
67
- *
68
- * xhr.addEventListener( 'load', () => {
69
- * const statusCode = xhr.status;
70
- * const xhrResponse = xhr.response;
71
- *
72
- * if ( statusCode < 200 || statusCode > 299 ) {
73
- * return reject( new Error( 'Cannot download new token!' ) );
74
- * }
75
- *
76
- * return resolve( xhrResponse );
77
- * } );
78
- *
79
- * xhr.addEventListener( 'error', () => reject( new Error( 'Network Error' ) ) );
80
- * xhr.addEventListener( 'abort', () => reject( new Error( 'Abort' ) ) );
81
- *
82
- * xhr.setRequestHeader( customHeader, customValue );
83
- *
84
- * xhr.send();
85
- * } ),
86
- * ...
87
- * }
88
- * } )
89
- * ```
90
- *
91
- * You can find more information about token endpoints in the
92
- * {@glink @cs guides/easy-image/quick-start#create-token-endpoint Cloud Services - Quick start}
93
- * and {@glink @cs developer-resources/security/token-endpoint Cloud Services - Token endpoint} documentation.
94
- *
95
- * Without a properly working token endpoint (token URL) CKEditor plugins will not be able to connect to CKEditor Cloud Services.
96
- */
97
- tokenUrl?: TokenUrl;
98
- /**
99
- * The endpoint URL for [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services) uploads.
100
- * This option must be set for Easy Image to work correctly.
101
- *
102
- * The upload URL is unique for each customer and can be found in the
103
- * [CKEditor Ecosystem customer dashboard](https://dashboard.ckeditor.com) after subscribing to the Easy Image service.
104
- * To learn how to start using Easy Image, check the {@glink @cs guides/easy-image/quick-start Easy Image - Quick start} documentation.
105
- *
106
- * Note: Make sure to also set the {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl} configuration option.
107
- */
108
- uploadUrl?: string;
109
- /**
110
- * The URL for web socket communication, used by the `RealTimeCollaborativeEditing` plugin. Every customer (organization in the CKEditor
111
- * Ecosystem dashboard) has their own, unique URLs to communicate with CKEditor Cloud Services. The URL can be found in the
112
- * CKEditor Ecosystem customer dashboard.
113
- *
114
- * Note: Unlike most plugins, `RealTimeCollaborativeEditing` is not included in any CKEditor 5 build and needs to be installed manually.
115
- * Check [Collaboration overview](https://ckeditor.com/docs/ckeditor5/latest/features/collaboration/overview.html) for more details.
116
- */
117
- webSocketUrl?: string;
118
- /**
119
- * An optional parameter used for integration with CKEditor Cloud Services when uploading the editor build to cloud services.
120
- *
121
- * Whenever the editor build or the configuration changes, this parameter should be set to a new, unique value to differentiate
122
- * the new bundle (build + configuration) from the old ones.
123
- */
124
- bundleVersion?: string;
125
- }
@@ -1,40 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module cloud-services/cloudservicescore
11
- */
12
- import { ContextPlugin } from 'ckeditor5/src/core.js';
13
- import type { TokenUrl } from './cloudservicesconfig.js';
14
- import Token, { type InitializedToken, type TokenOptions } from './token/token.js';
15
- import UploadGateway from './uploadgateway/uploadgateway.js';
16
- /**
17
- * The `CloudServicesCore` plugin exposes the base API for communication with CKEditor Cloud Services.
18
- */
19
- export default class CloudServicesCore extends ContextPlugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get pluginName(): "CloudServicesCore";
24
- /**
25
- * Creates the {@link module:cloud-services/token/token~Token} instance.
26
- *
27
- * @param tokenUrlOrRefreshToken Endpoint address to download the token or a callback that provides the token. If the
28
- * value is a function it has to match the {@link module:cloud-services/token/token~Token#refreshToken} interface.
29
- * @param options.initValue Initial value of the token.
30
- * @param options.autoRefresh Specifies whether to start the refresh automatically.
31
- */
32
- createToken(tokenUrlOrRefreshToken: TokenUrl, options?: TokenOptions): Token;
33
- /**
34
- * Creates the {@link module:cloud-services/uploadgateway/uploadgateway~UploadGateway} instance.
35
- *
36
- * @param token Token used for authentication.
37
- * @param apiAddress API address.
38
- */
39
- createUploadGateway(token: InitializedToken, apiAddress: string): UploadGateway;
40
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module cloud-services
11
- */
12
- export { default as CloudServices } from './cloudservices.js';
13
- export { default as CloudServicesCore } from './cloudservicescore.js';
14
- export type { TokenUrl, CloudServicesConfig } from './cloudservicesconfig.js';
15
- export type { default as Token, InitializedToken } from './token/token.js';
16
- export type { default as UploadGateway } from './uploadgateway/uploadgateway.js';
17
- export type { default as FileUploader } from './uploadgateway/fileuploader.js';
18
- import './augmentation.js';
@@ -1,100 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- import type { TokenUrl } from '../cloudservicesconfig.js';
10
- declare const Token_base: {
11
- new (): import("ckeditor5/src/utils.js").Observable;
12
- prototype: import("ckeditor5/src/utils.js").Observable;
13
- };
14
- /**
15
- * Class representing the token used for communication with CKEditor Cloud Services.
16
- * Value of the token is retrieving from the specified URL and is refreshed every 1 hour by default.
17
- */
18
- export default class Token extends Token_base {
19
- /**
20
- * Value of the token.
21
- * The value of the token is undefined if `initValue` is not provided or `init` method was not called.
22
- * `create` method creates token with initialized value from url.
23
- *
24
- * @see module:cloud-services/token/token~InitializedToken
25
- * @observable
26
- * @readonly
27
- */
28
- value: string | undefined;
29
- /**
30
- * Base refreshing function.
31
- */
32
- private _refresh;
33
- private _options;
34
- private _tokenRefreshTimeout?;
35
- /**
36
- * Creates `Token` instance.
37
- * Method `init` should be called after using the constructor or use `create` method instead.
38
- *
39
- * @param tokenUrlOrRefreshToken Endpoint address to download the token or a callback that provides the token. If the
40
- * value is a function it has to match the {@link module:cloud-services/token/token~Token#refreshToken} interface.
41
- */
42
- constructor(tokenUrlOrRefreshToken: TokenUrl, options?: TokenOptions);
43
- /**
44
- * Initializes the token.
45
- */
46
- init(): Promise<InitializedToken>;
47
- /**
48
- * Refresh token method. Useful in a method form as it can be override in tests.
49
- */
50
- refreshToken(): Promise<InitializedToken>;
51
- /**
52
- * Destroys token instance. Stops refreshing.
53
- */
54
- destroy(): void;
55
- /**
56
- * Checks whether the provided token follows the JSON Web Tokens (JWT) format.
57
- *
58
- * @param tokenValue The token to validate.
59
- */
60
- private _validateTokenValue;
61
- /**
62
- * Registers a refresh token timeout for the time taken from token.
63
- */
64
- private _registerRefreshTokenTimeout;
65
- /**
66
- * Returns token refresh timeout time calculated from expire time in the token payload.
67
- *
68
- * If the token parse fails or the token payload doesn't contain, the default DEFAULT_TOKEN_REFRESH_TIMEOUT_TIME is returned.
69
- */
70
- private _getTokenRefreshTimeoutTime;
71
- /**
72
- * Creates a initialized {@link module:cloud-services/token/token~Token} instance.
73
- *
74
- * @param tokenUrlOrRefreshToken Endpoint address to download the token or a callback that provides the token. If the
75
- * value is a function it has to match the {@link module:cloud-services/token/token~Token#refreshToken} interface.
76
- */
77
- static create(tokenUrlOrRefreshToken: TokenUrl, options?: TokenOptions): Promise<InitializedToken>;
78
- }
79
- /**
80
- * A {@link ~Token} instance that has been initialized.
81
- */
82
- export type InitializedToken = Token & {
83
- value: string;
84
- };
85
- /**
86
- * Options for creating tokens.
87
- */
88
- export interface TokenOptions {
89
- /**
90
- * Initial value of the token.
91
- */
92
- initValue?: string;
93
- /**
94
- * Specifies whether to start the refresh automatically.
95
- *
96
- * @default true
97
- */
98
- autoRefresh?: boolean;
99
- }
100
- export {};
@@ -1,98 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module cloud-services/uploadgateway/fileuploader
11
- */
12
- import type { UploadResponse } from 'ckeditor5/src/upload.js';
13
- import type { InitializedToken } from '../token/token.js';
14
- declare const FileUploader_base: {
15
- new (): import("ckeditor5/src/utils.js").Emitter;
16
- prototype: import("ckeditor5/src/utils.js").Emitter;
17
- };
18
- /**
19
- * FileUploader class used to upload single file.
20
- */
21
- export default class FileUploader extends FileUploader_base {
22
- /**
23
- * A file that is being uploaded.
24
- */
25
- readonly file: Blob;
26
- xhr?: XMLHttpRequest;
27
- /**
28
- * CKEditor Cloud Services access token.
29
- */
30
- private readonly _token;
31
- /**
32
- * CKEditor Cloud Services API address.
33
- */
34
- private readonly _apiAddress;
35
- /**
36
- * Creates `FileUploader` instance.
37
- *
38
- * @param fileOrData A blob object or a data string encoded with Base64.
39
- * @param token Token used for authentication.
40
- * @param apiAddress API address.
41
- */
42
- constructor(fileOrData: string | Blob, token: InitializedToken, apiAddress: string);
43
- /**
44
- * Registers callback on `progress` event.
45
- */
46
- onProgress(callback: (status: {
47
- total: number;
48
- uploaded: number;
49
- }) => void): this;
50
- /**
51
- * Registers callback on `error` event. Event is called once when error occurs.
52
- */
53
- onError(callback: (error: string) => void): this;
54
- /**
55
- * Aborts upload process.
56
- */
57
- abort(): void;
58
- /**
59
- * Sends XHR request to API.
60
- */
61
- send(): Promise<UploadResponse>;
62
- /**
63
- * Prepares XHR request.
64
- */
65
- private _prepareRequest;
66
- /**
67
- * Attaches listeners to the XHR.
68
- */
69
- private _attachXHRListeners;
70
- /**
71
- * Sends XHR request.
72
- */
73
- private _sendRequest;
74
- }
75
- /**
76
- * Fired when error occurs.
77
- *
78
- * @eventName ~FileUploader#error
79
- * @param error Error message
80
- */
81
- export type FileUploaderErrorEvent = {
82
- name: 'error';
83
- args: [error: string];
84
- };
85
- /**
86
- * Fired on upload progress.
87
- *
88
- * @eventName ~FileUploader#progress
89
- * @param status Total and uploaded status
90
- */
91
- export type FileUploaderProgressErrorEvent = {
92
- name: 'progress';
93
- args: [status: {
94
- total: number;
95
- uploaded: number;
96
- }];
97
- };
98
- export {};
@@ -1,51 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module cloud-services/uploadgateway/uploadgateway
11
- */
12
- import FileUploader from './fileuploader.js';
13
- import type { InitializedToken } from '../token/token.js';
14
- /**
15
- * UploadGateway abstracts file uploads to CKEditor Cloud Services.
16
- */
17
- export default class UploadGateway {
18
- /**
19
- * CKEditor Cloud Services access token.
20
- */
21
- private readonly _token;
22
- /**
23
- * CKEditor Cloud Services API address.
24
- */
25
- private readonly _apiAddress;
26
- /**
27
- * Creates `UploadGateway` instance.
28
- *
29
- * @param token Token used for authentication.
30
- * @param apiAddress API address.
31
- */
32
- constructor(token: InitializedToken, apiAddress: string);
33
- /**
34
- * Creates a {@link module:cloud-services/uploadgateway/fileuploader~FileUploader} instance that wraps
35
- * file upload process. The file is being sent at a time when the
36
- * {@link module:cloud-services/uploadgateway/fileuploader~FileUploader#send} method is called.
37
- *
38
- * ```ts
39
- * const token = await Token.create( 'https://token-endpoint' );
40
- * new UploadGateway( token, 'https://example.org' )
41
- * .upload( 'FILE' )
42
- * .onProgress( ( data ) => console.log( data ) )
43
- * .send()
44
- * .then( ( response ) => console.log( response ) );
45
- * ```
46
- *
47
- * @param {Blob|String} fileOrData A blob object or a data string encoded with Base64.
48
- * @returns {module:cloud-services/uploadgateway/fileuploader~FileUploader} Returns `FileUploader` instance.
49
- */
50
- upload(fileOrData: string | Blob): FileUploader;
51
- }