@scaleflex/widget-companion-client 4.0.6 → 4.1.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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 scaleflex
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2019 scaleflex
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,33 +1,33 @@
1
- # @scaleflex/widget-companion-client
2
-
3
- [![Plugins][plugins-image]](#plugins)
4
- [![Website][filerobot-image]][sfx-url]
5
- [![Version][filerobot-version]][version-url]
6
- [![Scaleflex team][made-by-image]][sfx-url]
7
- [![License][license-image]][license-url]
8
- [![CodeSandbox][codeSandbox-image]][codeSandbox-url]
9
-
10
-
11
- <div align='center'>
12
- <img title="Scaleflex Widget logo" alt="Scaleflex Widget logo" src="https://assets.scaleflex.com/Corporate+Branding/%5B2025%5D+ALL+LOGOS+%2B+ICONS/SCALEFLEX/VXP+logo/Horizontal+White/VXP+logo+WHITE.png?vh=663932" width="140"/>
13
- </div>
14
-
15
- The package used internally in [Scaleflex Media Asset Widget](https://www.npmjs.com/package/@scaleflex/widget-core) while communicating with companion of backend for handling 3rd parties uploading.
16
-
17
-
18
- <!-- Variables -->
19
-
20
- [npm-url]: https://www.npmjs.com/package/@scaleflex/widget-companion-client
21
- [license-url]: https://opensource.org/licenses/MIT
22
- [sfx-url]: https://www.scaleflex.com/
23
- [version-url]: https://www.npmjs.com/package/@scaleflex/widget-companion-client
24
- [codeSandbox-url]: https://codesandbox.io/p/sandbox/scalelfex-widget-v4-sandbox-dtp6l3?file=%2Fsrc%2Findex.js
25
-
26
-
27
- [npm-image]: https://img.shields.io/npm/v/@telus/remark-config.svg?style=for-the-badge&logo=npm
28
- [license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge
29
- [made-by-image]: https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-the%20Scaleflex%20team-6986fa.svg?style=for-the-badge
30
- [plugins-image]: https://img.shields.io/static/v1?label=Scaleflex&message=Plugins&color=yellow&style=for-the-badge
31
- [filerobot-image]: https://img.shields.io/static/v1?label=Scaleflex&message=website&color=orange&style=for-the-badge
32
- [filerobot-version]: https://img.shields.io/npm/v/@scaleflex/widget-companion-client?label=Version&style=for-the-badge&logo=npm
33
- [codeSandbox-image]: https://img.shields.io/badge/CodeSandbox-black?style=for-the-badge&logo=CodeSandbox
1
+ # @scaleflex/widget-companion-client
2
+
3
+ [![Plugins][plugins-image]](#plugins)
4
+ [![Website][filerobot-image]][sfx-url]
5
+ [![Version][filerobot-version]][version-url]
6
+ [![Scaleflex team][made-by-image]][sfx-url]
7
+ [![License][license-image]][license-url]
8
+ [![CodeSandbox][codeSandbox-image]][codeSandbox-url]
9
+
10
+
11
+ <div align='center'>
12
+ <img title="Scaleflex Widget logo" alt="Scaleflex Widget logo" src="https://assets.scaleflex.com/Corporate+Branding/%5B2025%5D+ALL+LOGOS+%2B+ICONS/SCALEFLEX/VXP+logo/Horizontal+White/VXP+logo+WHITE.png?vh=663932" width="140"/>
13
+ </div>
14
+
15
+ The package used internally in [Scaleflex Media Asset Widget](https://www.npmjs.com/package/@scaleflex/widget-core) while communicating with companion of backend for handling 3rd parties uploading.
16
+
17
+
18
+ <!-- Variables -->
19
+
20
+ [npm-url]: https://www.npmjs.com/package/@scaleflex/widget-companion-client
21
+ [license-url]: https://opensource.org/licenses/MIT
22
+ [sfx-url]: https://www.scaleflex.com/
23
+ [version-url]: https://www.npmjs.com/package/@scaleflex/widget-companion-client
24
+ [codeSandbox-url]: https://codesandbox.io/p/sandbox/scalelfex-widget-v4-sandbox-dtp6l3?file=%2Fsrc%2Findex.js
25
+
26
+
27
+ [npm-image]: https://img.shields.io/npm/v/@telus/remark-config.svg?style=for-the-badge&logo=npm
28
+ [license-image]: https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge
29
+ [made-by-image]: https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-the%20Scaleflex%20team-6986fa.svg?style=for-the-badge
30
+ [plugins-image]: https://img.shields.io/static/v1?label=Scaleflex&message=Plugins&color=yellow&style=for-the-badge
31
+ [filerobot-image]: https://img.shields.io/static/v1?label=Scaleflex&message=website&color=orange&style=for-the-badge
32
+ [filerobot-version]: https://img.shields.io/npm/v/@scaleflex/widget-companion-client?label=Version&style=for-the-badge&logo=npm
33
+ [codeSandbox-image]: https://img.shields.io/badge/CodeSandbox-black?style=for-the-badge&logo=CodeSandbox
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- /**
4
- * Manages communications with Companion
3
+ /**
4
+ * Manages communications with Companion
5
5
  */
6
6
  import RequestClient from './RequestClient';
7
7
  import Provider from './Provider';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- /**
4
- * This module serves as an Async wrapper for LocalStorage
3
+ /**
4
+ * This module serves as an Async wrapper for LocalStorage
5
5
  */
6
6
  var setItem = function setItem(key, value) {
7
7
  return new Promise(function (resolve) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scaleflex/widget-companion-client",
3
3
  "description": "Client library for communication with Companion. Intended for use in Scaleflex plugins.",
4
- "version": "4.0.6",
4
+ "version": "4.1.0",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
7
7
  "types": "types/index.d.ts",
@@ -14,8 +14,8 @@
14
14
  "access": "public"
15
15
  },
16
16
  "dependencies": {
17
- "@scaleflex/widget-utils": "^4.0.6",
17
+ "@scaleflex/widget-utils": "^4.1.0",
18
18
  "namespace-emitter": "^2.0.1"
19
19
  },
20
- "gitHead": "17ad9b9abc2add9c8b52ab56e3a72108bee20a7a"
20
+ "gitHead": "471120d67066617a0d8824eae11b07d1f2259473"
21
21
  }
package/types/index.d.ts CHANGED
@@ -1,65 +1,65 @@
1
- /**
2
- * Async storage interface, similar to `localStorage`. This can be used to
3
- * implement custom storages for authentication tokens.
4
- */
5
- export interface TokenStorage {
6
- setItem: (key: string, value: string) => Promise<void>
7
- getItem: (key: string) => Promise<string>
8
- removeItem: (key: string) => Promise<void>
9
- }
10
-
11
- export interface RequestClientOptions {
12
- companionUrl: string
13
- companionHeaders?: object
14
- }
15
-
16
- export class RequestClient {
17
- constructor (filerobot: any, opts: RequestClientOptions)
18
- get (path: string): Promise<any>
19
- post (path: string, data: object): Promise<any>
20
- delete (path: string, data: object): Promise<any>
21
- }
22
-
23
- /**
24
- * Options for Providers that can be passed in by Filerobot users through
25
- * Plugin constructors.
26
- */
27
- export interface PublicProviderOptions extends RequestClientOptions {
28
- companionAllowedHosts?: string | RegExp | Array<string | RegExp>
29
- }
30
-
31
- /**
32
- * Options for Providers, including internal options that Plugins can set.
33
- */
34
- export interface ProviderOptions extends PublicProviderOptions {
35
- provider: string
36
- name?: string
37
- pluginId: string
38
- }
39
-
40
- export class Provider extends RequestClient {
41
- constructor (filerobot: any, opts: ProviderOptions)
42
- checkAuth (): Promise<boolean>
43
- authUrl (): string
44
- fileUrl (id: string): string
45
- list (directory: string): Promise<any>
46
- logout (redirect?: string): Promise<any>
47
- static initPlugin (plugin: any, opts: object, defaultOpts?: object): void
48
- }
49
-
50
- export interface SocketOptions {
51
- target: string
52
- autoOpen?: boolean
53
- }
54
-
55
- export class Socket {
56
- isOpen: boolean
57
-
58
- constructor (opts: SocketOptions)
59
- open (): void
60
- close (): void
61
- send (action: string, payload: any): void
62
- on (action: string, handler: (param: any) => void): void
63
- once (action: string, handler: (param: any) => void): void
64
- emit (action: string, payload: (param: any) => void): void
65
- }
1
+ /**
2
+ * Async storage interface, similar to `localStorage`. This can be used to
3
+ * implement custom storages for authentication tokens.
4
+ */
5
+ export interface TokenStorage {
6
+ setItem: (key: string, value: string) => Promise<void>
7
+ getItem: (key: string) => Promise<string>
8
+ removeItem: (key: string) => Promise<void>
9
+ }
10
+
11
+ export interface RequestClientOptions {
12
+ companionUrl: string
13
+ companionHeaders?: object
14
+ }
15
+
16
+ export class RequestClient {
17
+ constructor (filerobot: any, opts: RequestClientOptions)
18
+ get (path: string): Promise<any>
19
+ post (path: string, data: object): Promise<any>
20
+ delete (path: string, data: object): Promise<any>
21
+ }
22
+
23
+ /**
24
+ * Options for Providers that can be passed in by Filerobot users through
25
+ * Plugin constructors.
26
+ */
27
+ export interface PublicProviderOptions extends RequestClientOptions {
28
+ companionAllowedHosts?: string | RegExp | Array<string | RegExp>
29
+ }
30
+
31
+ /**
32
+ * Options for Providers, including internal options that Plugins can set.
33
+ */
34
+ export interface ProviderOptions extends PublicProviderOptions {
35
+ provider: string
36
+ name?: string
37
+ pluginId: string
38
+ }
39
+
40
+ export class Provider extends RequestClient {
41
+ constructor (filerobot: any, opts: ProviderOptions)
42
+ checkAuth (): Promise<boolean>
43
+ authUrl (): string
44
+ fileUrl (id: string): string
45
+ list (directory: string): Promise<any>
46
+ logout (redirect?: string): Promise<any>
47
+ static initPlugin (plugin: any, opts: object, defaultOpts?: object): void
48
+ }
49
+
50
+ export interface SocketOptions {
51
+ target: string
52
+ autoOpen?: boolean
53
+ }
54
+
55
+ export class Socket {
56
+ isOpen: boolean
57
+
58
+ constructor (opts: SocketOptions)
59
+ open (): void
60
+ close (): void
61
+ send (action: string, payload: any): void
62
+ on (action: string, handler: (param: any) => void): void
63
+ once (action: string, handler: (param: any) => void): void
64
+ emit (action: string, payload: (param: any) => void): void
65
+ }