@imgly/plugin-soundstripe-web 1.69.0-nightly.20260203 → 1.69.0-nightly.20260204

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 (2) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var A="@imgly/plugin-soundstripe-web";var b={assets:[],currentPage:1,nextPage:void 0,total:0};function P(r,c){let{apiKey:o,baseUrl:a}=c,l=async(e,t,i)=>{let d=a||"https://api.soundstripe.com",s=new URL(`${d}/v1/songs`);e&&s.searchParams.set("filter[q]",e),t&&s.searchParams.set("page[number]",t.toString()),i&&s.searchParams.set("page[size]",i.toString());let g={Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"};o&&(console.warn("Using direct Soundstripe API access, this is not recommended for production use. Instead, consider using a proxy server."),g.Authorization=`Bearer ${o}`);let p=await fetch(s.toString(),{headers:g});if(!p.ok)throw new Error(`Soundstripe API error: ${p.status} ${p.statusText}`);return p.json()},n=(e,t)=>{let i=t.find(s=>s.type==="audio_files"&&s.id===e.relationships.audio_files.data[0]?.id);if(!i?.attributes.versions?.mp3)return;let d=t.find(s=>s.type==="artists"&&s.id===e.relationships.artists.data[0]?.id);return{id:e.id,label:e.attributes.title,meta:{mimeType:"audio/mp3",uri:i.attributes.versions.mp3,thumbUri:d?.attributes?.image,previewUri:i.attributes.versions.mp3,filename:e.attributes.title,blockType:"//ly.img.ubq/audio",duration:i.attributes.duration.toString()},credits:d?.attributes?.name?{name:d.attributes.name}:void 0}},f=(e,t,i)=>e<Math.ceil(i/t)?e+1:void 0;return{id:"ly.img.audio.soundstripe",credits:{name:"Soundstripe",url:"https://soundstripe.com/"},license:{name:"Soundstripe",url:"https://www.soundstripe.com/music-licensing"},applyAsset:async e=>{let t=await r.asset.defaultApplyAsset(e);if(t)return r.block.setMetadata(t,"ly.img.audio.soundstripe.songId",e.id),t},applyAssetToBlock:async(e,t)=>{await r.asset.defaultApplyAssetToBlock(e,t),r.block.setMetadata(t,"ly.img.audio.soundstripe.songId",e.id)},async findAssets(e){try{let t=await l(e.query,e.page,e.perPage);return{assets:t.data.map(s=>n(s,t.included)).filter(s=>s!==void 0),currentPage:e.page,nextPage:f(e.page,e.perPage,t.links.meta.total_count),total:t.links.meta.total_count}}catch{return b}}}}var y=P;async function m(r,c={}){let{apiKey:o,baseUrl:a}=c,l=async n=>{let f=a||"https://api.soundstripe.com",u=new URL(`${f}/v1/songs/${n}`),e={Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"};o&&(console.warn("Using direct Soundstripe API access for refresh, this is not recommended for production use. Instead, consider using a proxy server."),e.Authorization=`Bearer ${o}`);let t=await fetch(u.toString(),{headers:e});if(!t.ok)throw new Error(`Soundstripe API error: ${t.status} ${t.statusText}`);return t.json()};try{if(r.scene.get()===null)return;let f=r.block.findByType("audio");await Promise.allSettled(f.map(async u=>{let e=r.block.getString(u,"audio/fileURI");if(e&&e.includes("soundstripe.com"))try{let i=r.block.getMetadata(u,"ly.img.audio.soundstripe.songId");if(!i){console.warn(`No metadata found for Soundstripe audio block ${u}`);return}let s=await l(i),p=s.included.find(S=>S.type==="audio_files"&&S.id===s.data.relationships.audio_files.data[0]?.id)?.attributes.versions?.mp3;p&&p!==e&&r.block.setString(u,"audio/fileURI",p)}catch(i){console.warn(`Failed to refresh URI for Soundstripe audio block ${u}:`,i)}}))}catch(n){console.warn("Failed to refresh Soundstripe audio URIs:",n)}}var h=r=>{let{apiKey:c,baseUrl:o}=r;if(!c&&!o)throw new Error("Soundstripe Plugin: Either apiKey or baseUrl must be provided");return{async initialize({engine:a,cesdk:l}){let n=y(a,{apiKey:c,baseUrl:o});a.asset.addSource(n),a.scene.onActiveChanged(()=>{m(a,{apiKey:c,baseUrl:o})}),l&&l.setTranslations({en:{[`libraries.${n.id}.label`]:"Soundstripe"}})}}};var U=r=>({name:A,version:"1.69.0-nightly.20260203",...h(r)}),$=U;export{$ as default,m as refreshSoundstripeAudioURIs};
1
+ var A="@imgly/plugin-soundstripe-web";var b={assets:[],currentPage:1,nextPage:void 0,total:0};function P(r,c){let{apiKey:o,baseUrl:a}=c,l=async(e,t,i)=>{let d=a||"https://api.soundstripe.com",s=new URL(`${d}/v1/songs`);e&&s.searchParams.set("filter[q]",e),t&&s.searchParams.set("page[number]",t.toString()),i&&s.searchParams.set("page[size]",i.toString());let g={Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"};o&&(console.warn("Using direct Soundstripe API access, this is not recommended for production use. Instead, consider using a proxy server."),g.Authorization=`Bearer ${o}`);let p=await fetch(s.toString(),{headers:g});if(!p.ok)throw new Error(`Soundstripe API error: ${p.status} ${p.statusText}`);return p.json()},n=(e,t)=>{let i=t.find(s=>s.type==="audio_files"&&s.id===e.relationships.audio_files.data[0]?.id);if(!i?.attributes.versions?.mp3)return;let d=t.find(s=>s.type==="artists"&&s.id===e.relationships.artists.data[0]?.id);return{id:e.id,label:e.attributes.title,meta:{mimeType:"audio/mp3",uri:i.attributes.versions.mp3,thumbUri:d?.attributes?.image,previewUri:i.attributes.versions.mp3,filename:e.attributes.title,blockType:"//ly.img.ubq/audio",duration:i.attributes.duration.toString()},credits:d?.attributes?.name?{name:d.attributes.name}:void 0}},f=(e,t,i)=>e<Math.ceil(i/t)?e+1:void 0;return{id:"ly.img.audio.soundstripe",credits:{name:"Soundstripe",url:"https://soundstripe.com/"},license:{name:"Soundstripe",url:"https://www.soundstripe.com/music-licensing"},applyAsset:async e=>{let t=await r.asset.defaultApplyAsset(e);if(t)return r.block.setMetadata(t,"ly.img.audio.soundstripe.songId",e.id),t},applyAssetToBlock:async(e,t)=>{await r.asset.defaultApplyAssetToBlock(e,t),r.block.setMetadata(t,"ly.img.audio.soundstripe.songId",e.id)},async findAssets(e){try{let t=await l(e.query,e.page,e.perPage);return{assets:t.data.map(s=>n(s,t.included)).filter(s=>s!==void 0),currentPage:e.page,nextPage:f(e.page,e.perPage,t.links.meta.total_count),total:t.links.meta.total_count}}catch{return b}}}}var y=P;async function m(r,c={}){let{apiKey:o,baseUrl:a}=c,l=async n=>{let f=a||"https://api.soundstripe.com",u=new URL(`${f}/v1/songs/${n}`),e={Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json"};o&&(console.warn("Using direct Soundstripe API access for refresh, this is not recommended for production use. Instead, consider using a proxy server."),e.Authorization=`Bearer ${o}`);let t=await fetch(u.toString(),{headers:e});if(!t.ok)throw new Error(`Soundstripe API error: ${t.status} ${t.statusText}`);return t.json()};try{if(r.scene.get()===null)return;let f=r.block.findByType("audio");await Promise.allSettled(f.map(async u=>{let e=r.block.getString(u,"audio/fileURI");if(e&&e.includes("soundstripe.com"))try{let i=r.block.getMetadata(u,"ly.img.audio.soundstripe.songId");if(!i){console.warn(`No metadata found for Soundstripe audio block ${u}`);return}let s=await l(i),p=s.included.find(S=>S.type==="audio_files"&&S.id===s.data.relationships.audio_files.data[0]?.id)?.attributes.versions?.mp3;p&&p!==e&&r.block.setString(u,"audio/fileURI",p)}catch(i){console.warn(`Failed to refresh URI for Soundstripe audio block ${u}:`,i)}}))}catch(n){console.warn("Failed to refresh Soundstripe audio URIs:",n)}}var h=r=>{let{apiKey:c,baseUrl:o}=r;if(!c&&!o)throw new Error("Soundstripe Plugin: Either apiKey or baseUrl must be provided");return{async initialize({engine:a,cesdk:l}){let n=y(a,{apiKey:c,baseUrl:o});a.asset.addSource(n),a.scene.onActiveChanged(()=>{m(a,{apiKey:c,baseUrl:o})}),l&&l.setTranslations({en:{[`libraries.${n.id}.label`]:"Soundstripe"}})}}};var U=r=>({name:A,version:"1.69.0-nightly.20260204",...h(r)}),$=U;export{$ as default,m as refreshSoundstripeAudioURIs};
2
2
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imgly/plugin-soundstripe-web",
3
- "version": "1.69.0-nightly.20260203",
3
+ "version": "1.69.0-nightly.20260204",
4
4
  "description": "Soundstripe asset source plugin for the CE.SDK editor",
5
5
  "keywords": [
6
6
  "CE.SDK",
@@ -45,7 +45,7 @@
45
45
  "typescript": "^5.7.3"
46
46
  },
47
47
  "peerDependencies": {
48
- "@cesdk/cesdk-js": "1.69.0-nightly.20260203"
48
+ "@cesdk/cesdk-js": "1.69.0-nightly.20260204"
49
49
  },
50
50
  "dependencies": {},
51
51
  "scripts": {