@rubixstudios/payload-media 1.0.0 → 1.0.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.
package/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 rilrom / Riley Langbein
4
- Copyright (c) 2025-2026 Rubix Studios Pty. Ltd. <https://rubixstudios.com.au>
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rilrom / Riley Langbein
4
+ Copyright (c) 2025-2026 Rubix Studios Pty. Ltd. <https://rubixstudios.com.au>
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md CHANGED
@@ -1,73 +1,73 @@
1
- # PayloadCMS Media Search Plugin
2
-
3
- PayloadCMS plugin for stock image and video search across Unsplash, Pexels, and Pixabay, with filterable results and instant import.
4
-
5
- <img width="1899" height="907" alt="image" src="https://github.com/user-attachments/assets/1c19f977-d075-4dfc-9f52-8d9426bc1500" />
6
-
7
- This project is an independent implementation derived [PayloadBites' Image Search](https://github.com/rilrom/payload-bites/tree/main/packages/image-search) extended with provider-specific image filtering and improved Windows OS compatibility.
8
-
9
- ## Installation
10
-
11
- ```sh
12
- pnpm add @rubixstudios/payload-media
13
- ```
14
-
15
- ```typescript
16
- // payload.config.ts
17
- import { buildConfig } from 'payload/config'
18
- import { mediaPlugin } from '@rubixstudios/payload-media'
19
-
20
- export default buildConfig({
21
- plugins: [
22
- mediaPlugin({
23
- disabled: false, // Optional, defaults to false
24
- access: ({ req: { user } }) => Boolean(user), // Media search access control
25
- pexels: process.env.API_KEY_PEXELS!,
26
- pixabay: process.env.API_KEY_PIXABAY!,
27
- unsplash: process.env.API_KEY_UNSPLASH!,
28
- }),
29
- ],
30
- })
31
- ```
32
-
33
- ## Notes
34
-
35
- API key can be obtained from the respective provider's website.
36
-
37
- - [Unsplash](https://unsplash.com/developers)
38
- - [Pexels](https://www.pexels.com/api/)
39
- - [Pixabay](https://pixabay.com/api/docs/)
40
-
41
- When using Unplash, utilise your Access Key for the API Token.
42
-
43
- ## Features
44
-
45
- - Stock image and video search inside Payload Admin
46
- - Providers: Unsplash, Pexels, Pixabay
47
- - Provider-specific filters (color, orientation, size, type)
48
- - Featured and keyword search modes
49
- - One-click image import
50
- - Permission-based access control
51
-
52
- ## Liability
53
-
54
- Rubix Studios, its developers, and contributors bear no responsibility for how images are used.
55
- Before using any provider, ensure you have reviewed and agreed to their terms and usage policies.
56
-
57
- ## Support
58
-
59
- For support or inquiries:
60
-
61
- - LinkedIn: [rubixvi](https://www.linkedin.com/in/rubixvi/)
62
- - Website: [Rubix Studios](https://rubixstudios.com.au)
63
-
64
- ## Author
65
-
66
- Rubix Studios Pty. Ltd.
67
- [https://rubixstudios.com.au](https://rubixstudios.com.au)
68
-
69
- ## Acknowledgments
70
-
71
- This project is based on the Image Search by Riley Langbein:
72
-
73
- - [Riley Langbein](https://github.com/rilrom)
1
+ # PayloadCMS Media Search Plugin
2
+
3
+ PayloadCMS plugin for stock image and video search across Unsplash, Pexels, and Pixabay, with filterable results and instant import.
4
+
5
+ <img width="1899" height="907" alt="image" src="https://github.com/user-attachments/assets/1c19f977-d075-4dfc-9f52-8d9426bc1500" />
6
+
7
+ This project is an independent implementation derived [PayloadBites' Image Search](https://github.com/rilrom/payload-bites/tree/main/packages/image-search) extended with provider-specific image filtering and improved Windows OS compatibility.
8
+
9
+ ## Installation
10
+
11
+ ```sh
12
+ pnpm add @rubixstudios/payload-media
13
+ ```
14
+
15
+ ```typescript
16
+ // payload.config.ts
17
+ import { buildConfig } from 'payload/config'
18
+ import { mediaPlugin } from '@rubixstudios/payload-media'
19
+
20
+ export default buildConfig({
21
+ plugins: [
22
+ mediaPlugin({
23
+ disabled: false, // Optional, defaults to false
24
+ access: ({ req: { user } }) => Boolean(user), // Media search access control
25
+ pexels: process.env.API_KEY_PEXELS!,
26
+ pixabay: process.env.API_KEY_PIXABAY!,
27
+ unsplash: process.env.API_KEY_UNSPLASH!,
28
+ }),
29
+ ],
30
+ })
31
+ ```
32
+
33
+ ## Notes
34
+
35
+ API key can be obtained from the respective provider's website.
36
+
37
+ - [Unsplash](https://unsplash.com/developers)
38
+ - [Pexels](https://www.pexels.com/api/)
39
+ - [Pixabay](https://pixabay.com/api/docs/)
40
+
41
+ When using Unplash, utilise your Access Key for the API Token.
42
+
43
+ ## Features
44
+
45
+ - Stock image and video search inside Payload Admin
46
+ - Providers: Unsplash, Pexels, Pixabay
47
+ - Provider-specific filters (color, orientation, size, type)
48
+ - Featured and keyword search modes
49
+ - One-click image import
50
+ - Permission-based access control
51
+
52
+ ## Liability
53
+
54
+ Rubix Studios, its developers, and contributors bear no responsibility for how images are used.
55
+ Before using any provider, ensure you have reviewed and agreed to their terms and usage policies.
56
+
57
+ ## Support
58
+
59
+ For support or inquiries:
60
+
61
+ - LinkedIn: [rubixvi](https://www.linkedin.com/in/rubixvi/)
62
+ - Website: [Rubix Studios](https://rubixstudios.com.au)
63
+
64
+ ## Author
65
+
66
+ Rubix Studios Pty. Ltd.
67
+ [https://rubixstudios.com.au](https://rubixstudios.com.au)
68
+
69
+ ## Acknowledgments
70
+
71
+ This project is based on the Image Search by Riley Langbein:
72
+
73
+ - [Riley Langbein](https://github.com/rilrom)
@@ -1,5 +1,5 @@
1
1
  import { type PexelsFilters, type PexelsResult, type PexelsVideo, type ProviderResult } from '../../types.js';
2
- import { Provider, type Resolver } from './provider.js';
2
+ import { Provider, type Resolver } from './Provider.js';
3
3
  export declare class Pexels extends Provider {
4
4
  constructor(apiKey: Resolver);
5
5
  getFetchBaseUrl(): string;
@@ -9,4 +9,4 @@ export declare class Pexels extends Provider {
9
9
  formatVideoResults(data: PexelsVideo[]): ProviderResult[];
10
10
  formatResults(data: PexelsResult[]): ProviderResult[];
11
11
  }
12
- //# sourceMappingURL=pexels.d.ts.map
12
+ //# sourceMappingURL=Pexels.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pexels.d.ts","sourceRoot":"","sources":["../../../src/endpoints/handler/pexels.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEvD,qBAAa,MAAO,SAAQ,QAAQ;gBACtB,MAAM,EAAE,QAAQ;IAInB,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAInC,WAAW,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IAwBtD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IA2ChG,kBAAkB,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,cAAc,EAAE;IAyBhD,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE;CAkB/D"}
1
+ {"version":3,"file":"Pexels.d.ts","sourceRoot":"","sources":["../../../src/endpoints/handler/Pexels.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAEhB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEvD,qBAAa,MAAO,SAAQ,QAAQ;gBACtB,MAAM,EAAE,QAAQ;IAInB,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAInC,WAAW,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IAwBtD,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC;IA2ChG,kBAAkB,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,cAAc,EAAE;IAyBhD,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE;CAkB/D"}
@@ -1,4 +1,4 @@
1
- import { Provider } from './provider.js';
1
+ import { Provider } from './Provider.js';
2
2
  export class Pexels extends Provider {
3
3
  constructor(apiKey){
4
4
  super('pexels', 'Pexels', 'https://www.pexels.com/', apiKey);
@@ -1,5 +1,5 @@
1
1
  import { type PixabayFilters, type PixabayResult, type PixabayVideo, type ProviderResult } from '../../types.js';
2
- import { Provider, type Resolver } from './provider.js';
2
+ import { Provider, type Resolver } from './Provider.js';
3
3
  export declare class Pixabay extends Provider {
4
4
  constructor(apiKey: Resolver);
5
5
  getFetchBaseUrl(): string;
@@ -9,4 +9,4 @@ export declare class Pixabay extends Provider {
9
9
  formatVideoResults(data: PixabayVideo[]): ProviderResult[];
10
10
  formatResults(data: PixabayResult[]): ProviderResult[];
11
11
  }
12
- //# sourceMappingURL=pixabay.d.ts.map
12
+ //# sourceMappingURL=Pixabay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pixabay.d.ts","sourceRoot":"","sources":["../../../src/endpoints/handler/pixabay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEvD,qBAAa,OAAQ,SAAQ,QAAQ;gBACvB,MAAM,EAAE,QAAQ;IAInB,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAInC,WAAW,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAoCvD,SAAS,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,OAAO,CAAC;IA+CnB,kBAAkB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE;IA0BjD,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,cAAc,EAAE;CAoBhE"}
1
+ {"version":3,"file":"Pixabay.d.ts","sourceRoot":"","sources":["../../../src/endpoints/handler/Pixabay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEvD,qBAAa,OAAQ,SAAQ,QAAQ;gBACvB,MAAM,EAAE,QAAQ;IAInB,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAInC,WAAW,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAoCvD,SAAS,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,OAAO,CAAC;IA+CnB,kBAAkB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE;IA0BjD,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,cAAc,EAAE;CAoBhE"}
@@ -1,4 +1,4 @@
1
- import { Provider } from './provider.js';
1
+ import { Provider } from './Provider.js';
2
2
  export class Pixabay extends Provider {
3
3
  constructor(apiKey){
4
4
  super('pixabay', 'Pixabay', 'https://pixabay.com', apiKey);
@@ -17,4 +17,4 @@ export declare class Provider {
17
17
  trackDownload(_url: string): null;
18
18
  formatResults(_data: object): ProviderResult[];
19
19
  }
20
- //# sourceMappingURL=provider.d.ts.map
20
+ //# sourceMappingURL=Provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/endpoints/handler/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,MAAM,QAAQ,GAAG,MAAM,MAAM,GAAG,SAAS,CAAA;AAE/C,qBAAa,QAAQ;IACnB,SAAS,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAA;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;gBAEC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ;IAO/D,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAU7E,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,SAAS,CAAC,SAAS,IAAI,MAAM;IAU7B,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIzC,aAAa,IAAI,MAAM;IAIvB,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1D,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIjC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE;CAG/C"}
1
+ {"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../src/endpoints/handler/Provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,MAAM,QAAQ,GAAG,MAAM,MAAM,GAAG,SAAS,CAAA;AAE/C,qBAAa,QAAQ;IACnB,SAAS,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAA;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;gBAEC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ;IAO/D,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAU7E,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,SAAS,CAAC,SAAS,IAAI,MAAM;IAU7B,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIzC,aAAa,IAAI,MAAM;IAIvB,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI1D,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIjC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE;CAG/C"}
@@ -1,5 +1,5 @@
1
1
  import { type ProviderResult, type UnsplashFilters, type UnsplashResult } from '../../types.js';
2
- import { Provider, type Resolver } from './provider.js';
2
+ import { Provider, type Resolver } from './Provider.js';
3
3
  export declare class Unsplash extends Provider {
4
4
  constructor(apiKey: Resolver);
5
5
  getFetchBaseUrl(): string;
@@ -9,4 +9,4 @@ export declare class Unsplash extends Provider {
9
9
  trackDownload(url: string): null;
10
10
  formatResults(data: UnsplashResult[]): ProviderResult[];
11
11
  }
12
- //# sourceMappingURL=unsplash.d.ts.map
12
+ //# sourceMappingURL=Unsplash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unsplash.d.ts","sourceRoot":"","sources":["../../../src/endpoints/handler/unsplash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/F,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAIvD,qBAAa,QAAS,SAAQ,QAAQ;gBACxB,MAAM,EAAE,QAAQ;IAInB,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAInC,WAAW,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAoCxD,SAAS,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,OAAO,CAAC;IAmBV,aAAa,CAAC,GAAG,EAAE,MAAM;IAMzB,aAAa,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;CAqBjE"}
1
+ {"version":3,"file":"Unsplash.d.ts","sourceRoot":"","sources":["../../../src/endpoints/handler/Unsplash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/F,OAAO,EAAE,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAA;AAIvD,qBAAa,QAAS,SAAQ,QAAQ;gBACxB,MAAM,EAAE,QAAQ;IAInB,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAInC,WAAW,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAoCxD,SAAS,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,OAAO,CAAC;IAmBV,aAAa,CAAC,GAAG,EAAE,MAAM;IAMzB,aAAa,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE;CAqBjE"}
@@ -1,4 +1,4 @@
1
- import { Provider } from './provider.js';
1
+ import { Provider } from './Provider.js';
2
2
  const UTMParams = 'utm_source=rubixstudios-payload-images&utm_medium=referral';
3
3
  export class Unsplash extends Provider {
4
4
  constructor(apiKey){
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { type Config } from 'payload';
2
2
  import { type ProviderConfig } from './types.js';
3
- export declare const imagePlugin: (pluginConfig?: ProviderConfig) => (incomingConfig: Config) => Config;
3
+ export declare const mediaPlugin: (pluginConfig?: ProviderConfig) => (incomingConfig: Config) => Config;
4
4
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defaultPluginOptions } from './defaults.js';
2
2
  import { providers } from './endpoints/index.js';
3
- export const imagePlugin = (pluginConfig = {})=>(incomingConfig)=>{
3
+ export const mediaPlugin = (pluginConfig = {})=>(incomingConfig)=>{
4
4
  if (pluginConfig.disabled) return incomingConfig;
5
5
  const mergedOptions = {
6
6
  ...defaultPluginOptions,
@@ -32,7 +32,7 @@ export const imagePlugin = (pluginConfig = {})=>(incomingConfig)=>{
32
32
  ...uploadObj?.admin?.components || {},
33
33
  controls: [
34
34
  ...uploadObj?.admin?.components?.controls || [],
35
- '@rubixstudios/payload-images/client#MediaSearch'
35
+ '@rubixstudios/payload-media/client#MediaSearch'
36
36
  ]
37
37
  }
38
38
  }
@@ -1,6 +1,6 @@
1
- import { Pexels } from '../endpoints/handler/pexels.js';
2
- import { Pixabay } from '../endpoints/handler/pixabay.js';
3
- import { Unsplash } from '../endpoints/handler/unsplash.js';
1
+ import { Pexels } from '../endpoints/handler/Pexels.js';
2
+ import { Pixabay } from '../endpoints/handler/Pixabay.js';
3
+ import { Unsplash } from '../endpoints/handler/Unsplash.js';
4
4
  import { type ProviderKeys } from '../types.js';
5
5
  export declare const getProvider: (providerKey: string | undefined, providerKeys?: ProviderKeys) => Pexels | Pixabay | Unsplash | null;
6
6
  //# sourceMappingURL=getProvider.d.ts.map
@@ -1,6 +1,6 @@
1
- import { Pexels } from '../endpoints/handler/pexels.js';
2
- import { Pixabay } from '../endpoints/handler/pixabay.js';
3
- import { Unsplash } from '../endpoints/handler/unsplash.js';
1
+ import { Pexels } from '../endpoints/handler/Pexels.js';
2
+ import { Pixabay } from '../endpoints/handler/Pixabay.js';
3
+ import { Unsplash } from '../endpoints/handler/Unsplash.js';
4
4
  export const getProvider = (providerKey, providerKeys)=>{
5
5
  if (!providerKey) return null;
6
6
  switch(providerKey.toLowerCase()){
@@ -1,6 +1,6 @@
1
- import { Pexels } from '../endpoints/handler/pexels.js';
2
- import { Pixabay } from '../endpoints/handler/pixabay.js';
3
- import { Unsplash } from '../endpoints/handler/unsplash.js';
1
+ import { Pexels } from '../endpoints/handler/Pexels.js';
2
+ import { Pixabay } from '../endpoints/handler/Pixabay.js';
3
+ import { Unsplash } from '../endpoints/handler/Unsplash.js';
4
4
  import { type ProviderKeys } from '../types.js';
5
5
  export declare function getProviders(providerKey?: ProviderKeys): Array<Pexels | Unsplash | Pixabay>;
6
6
  //# sourceMappingURL=getProviders.d.ts.map
@@ -1,6 +1,6 @@
1
- import { Pexels } from '../endpoints/handler/pexels.js';
2
- import { Pixabay } from '../endpoints/handler/pixabay.js';
3
- import { Unsplash } from '../endpoints/handler/unsplash.js';
1
+ import { Pexels } from '../endpoints/handler/Pexels.js';
2
+ import { Pixabay } from '../endpoints/handler/Pixabay.js';
3
+ import { Unsplash } from '../endpoints/handler/Unsplash.js';
4
4
  export function getProviders(providerKey) {
5
5
  return [
6
6
  new Unsplash(()=>providerKey?.unsplash),
@@ -1,6 +1,6 @@
1
1
  import { type PayloadRequest } from 'payload';
2
- import { type Pexels } from '../endpoints/handler/pexels.js';
3
- import { type Pixabay } from '../endpoints/handler/pixabay.js';
4
- import { type Unsplash } from '../endpoints/handler/unsplash.js';
2
+ import { type Pexels } from '../endpoints/handler/Pexels.js';
3
+ import { type Pixabay } from '../endpoints/handler/Pixabay.js';
4
+ import { type Unsplash } from '../endpoints/handler/Unsplash.js';
5
5
  export declare const resolveProvider: (req: PayloadRequest) => Unsplash | Pexels | Pixabay | null;
6
6
  //# sourceMappingURL=resolveProvider.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubixstudios/payload-media",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A Payload CMS plugin that integrates with stock image and video providers including Unsplash, Pexels and Pixabay.",
5
5
  "license": "MIT",
6
6
  "author": "Rubix Studios <hello@rubixstudios.com.au> (https://rubixstudios.com.au)",
@@ -47,7 +47,9 @@
47
47
  },
48
48
  "main": "./dist/index.js",
49
49
  "types": "./dist/index.d.ts",
50
- "files": ["dist"],
50
+ "files": [
51
+ "dist"
52
+ ],
51
53
  "scripts": {
52
54
  "build": "pnpm build:types && pnpm build:swc && pnpm build:assets",
53
55
  "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",