sanity-plugin-mux-input 2.18.0 → 2.19.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/dist/index.js +30 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/actions/assets.ts +7 -1
- package/src/actions/secrets.ts +6 -0
- package/src/actions/upload.ts +5 -1
- package/src/hooks/useMuxPolling.ts +2 -0
- package/src/util/pluginVersion.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -146,6 +146,7 @@ function useAssets() {
|
|
|
146
146
|
function useDialogState() {
|
|
147
147
|
return useState(!1);
|
|
148
148
|
}
|
|
149
|
+
const PLUGIN_VERSION_QUERY = { sanityVersion: "2.19.0" };
|
|
149
150
|
function saveSecrets(client, token, secretKey, enableSignedUrls, signingKeyId, signingKeyPrivate, drmConfigId) {
|
|
150
151
|
const doc = {
|
|
151
152
|
_id: "secrets.mux",
|
|
@@ -165,7 +166,8 @@ async function createSigningKeys(client) {
|
|
|
165
166
|
return await client.request({
|
|
166
167
|
url: `/addons/mux/signing-keys/${dataset}`,
|
|
167
168
|
withCredentials: !0,
|
|
168
|
-
method: "POST"
|
|
169
|
+
method: "POST",
|
|
170
|
+
query: PLUGIN_VERSION_QUERY
|
|
169
171
|
});
|
|
170
172
|
} catch (error) {
|
|
171
173
|
console.error("Error creating signing keys", error);
|
|
@@ -178,7 +180,8 @@ function testSecrets(client) {
|
|
|
178
180
|
return client.request({
|
|
179
181
|
url: `/addons/mux/secrets/${dataset}/test`,
|
|
180
182
|
withCredentials: !0,
|
|
181
|
-
method: "GET"
|
|
183
|
+
method: "GET",
|
|
184
|
+
query: PLUGIN_VERSION_QUERY
|
|
182
185
|
});
|
|
183
186
|
}
|
|
184
187
|
async function haveValidSigningKeys(client, signingKeyId, signingKeyPrivate) {
|
|
@@ -189,7 +192,8 @@ async function haveValidSigningKeys(client, signingKeyId, signingKeyPrivate) {
|
|
|
189
192
|
const res = await client.request({
|
|
190
193
|
url: `/addons/mux/signing-keys/${dataset}/${signingKeyId}`,
|
|
191
194
|
withCredentials: !0,
|
|
192
|
-
method: "GET"
|
|
195
|
+
method: "GET",
|
|
196
|
+
query: PLUGIN_VERSION_QUERY
|
|
193
197
|
});
|
|
194
198
|
return !!(res.data && res.data.id);
|
|
195
199
|
} catch {
|
|
@@ -202,7 +206,8 @@ function testSecretsObservable(client) {
|
|
|
202
206
|
() => client.observable.request({
|
|
203
207
|
url: `/addons/mux/secrets/${dataset}/test`,
|
|
204
208
|
withCredentials: !0,
|
|
205
|
-
method: "GET"
|
|
209
|
+
method: "GET",
|
|
210
|
+
query: PLUGIN_VERSION_QUERY
|
|
206
211
|
})
|
|
207
212
|
);
|
|
208
213
|
}
|
|
@@ -629,7 +634,8 @@ function deleteAssetOnMux(client, assetId) {
|
|
|
629
634
|
return client.request({
|
|
630
635
|
url: `/addons/mux/assets/${dataset}/${assetId}`,
|
|
631
636
|
withCredentials: !0,
|
|
632
|
-
method: "DELETE"
|
|
637
|
+
method: "DELETE",
|
|
638
|
+
query: PLUGIN_VERSION_QUERY
|
|
633
639
|
});
|
|
634
640
|
}
|
|
635
641
|
async function deleteAsset({
|
|
@@ -656,7 +662,8 @@ function getAsset(client, assetId) {
|
|
|
656
662
|
return client.request({
|
|
657
663
|
url: `/addons/mux/assets/${dataset}/data/${assetId}`,
|
|
658
664
|
withCredentials: !0,
|
|
659
|
-
method: "GET"
|
|
665
|
+
method: "GET",
|
|
666
|
+
query: PLUGIN_VERSION_QUERY
|
|
660
667
|
});
|
|
661
668
|
}
|
|
662
669
|
function listAssets(client, options) {
|
|
@@ -665,7 +672,7 @@ function listAssets(client, options) {
|
|
|
665
672
|
url: `/addons/mux/assets/${dataset}/data/list`,
|
|
666
673
|
withCredentials: !0,
|
|
667
674
|
method: "GET",
|
|
668
|
-
query
|
|
675
|
+
query: { ...query, ...PLUGIN_VERSION_QUERY }
|
|
669
676
|
});
|
|
670
677
|
}
|
|
671
678
|
function addTextTrackFromUrl(client, assetId, vttUrl, options) {
|
|
@@ -683,7 +690,8 @@ function addTextTrackFromUrl(client, assetId, vttUrl, options) {
|
|
|
683
690
|
},
|
|
684
691
|
headers: {
|
|
685
692
|
"Content-Type": "application/json"
|
|
686
|
-
}
|
|
693
|
+
},
|
|
694
|
+
query: PLUGIN_VERSION_QUERY
|
|
687
695
|
});
|
|
688
696
|
}
|
|
689
697
|
function generateSubtitles(client, assetId, audioTrackId, options) {
|
|
@@ -702,7 +710,8 @@ function generateSubtitles(client, assetId, audioTrackId, options) {
|
|
|
702
710
|
},
|
|
703
711
|
headers: {
|
|
704
712
|
"Content-Type": "application/json"
|
|
705
|
-
}
|
|
713
|
+
},
|
|
714
|
+
query: PLUGIN_VERSION_QUERY
|
|
706
715
|
});
|
|
707
716
|
}
|
|
708
717
|
function deleteTextTrack(client, assetId, trackId) {
|
|
@@ -710,7 +719,8 @@ function deleteTextTrack(client, assetId, trackId) {
|
|
|
710
719
|
return client.request({
|
|
711
720
|
url: `/addons/mux/assets/${dataset}/${assetId}/tracks/${trackId}`,
|
|
712
721
|
withCredentials: !0,
|
|
713
|
-
method: "DELETE"
|
|
722
|
+
method: "DELETE",
|
|
723
|
+
query: PLUGIN_VERSION_QUERY
|
|
714
724
|
});
|
|
715
725
|
}
|
|
716
726
|
const ASSETS_PER_PAGE = 100;
|
|
@@ -3162,7 +3172,7 @@ function VideoPlayer({
|
|
|
3162
3172
|
crossOrigin: "anonymous",
|
|
3163
3173
|
metadata: {
|
|
3164
3174
|
player_name: "Sanity Admin Dashboard",
|
|
3165
|
-
player_version: "2.
|
|
3175
|
+
player_version: "2.19.0",
|
|
3166
3176
|
page_type: "Preview Player"
|
|
3167
3177
|
},
|
|
3168
3178
|
audio: isAudio,
|
|
@@ -4173,7 +4183,8 @@ const useAccessControl = (config) => {
|
|
|
4173
4183
|
const { data } = await client.request({
|
|
4174
4184
|
url: `/addons/mux/assets/${dataset}/data/${asset.assetId}`,
|
|
4175
4185
|
withCredentials: !0,
|
|
4176
|
-
method: "GET"
|
|
4186
|
+
method: "GET",
|
|
4187
|
+
query: PLUGIN_VERSION_QUERY
|
|
4177
4188
|
});
|
|
4178
4189
|
client.patch(asset._id).set({ status: data.status, data }).commit({ returnDocuments: !1 });
|
|
4179
4190
|
},
|
|
@@ -4378,7 +4389,8 @@ function cancelUpload(client, uuid2) {
|
|
|
4378
4389
|
return client.observable.request({
|
|
4379
4390
|
url: `/addons/mux/uploads/${client.config().dataset}/${uuid2}`,
|
|
4380
4391
|
withCredentials: !0,
|
|
4381
|
-
method: "DELETE"
|
|
4392
|
+
method: "DELETE",
|
|
4393
|
+
query: PLUGIN_VERSION_QUERY
|
|
4382
4394
|
});
|
|
4383
4395
|
}
|
|
4384
4396
|
function uploadUrl({
|
|
@@ -4409,7 +4421,7 @@ function uploadUrl({
|
|
|
4409
4421
|
"MUX-Proxy-UUID": uuid$1,
|
|
4410
4422
|
"Content-Type": "application/json"
|
|
4411
4423
|
},
|
|
4412
|
-
query
|
|
4424
|
+
query: { ...query, ...PLUGIN_VERSION_QUERY }
|
|
4413
4425
|
})
|
|
4414
4426
|
).pipe(
|
|
4415
4427
|
mergeMap((result) => {
|
|
@@ -4447,7 +4459,8 @@ function uploadFile({
|
|
|
4447
4459
|
"MUX-Proxy-UUID": uuid$1,
|
|
4448
4460
|
"Content-Type": "application/json"
|
|
4449
4461
|
},
|
|
4450
|
-
body
|
|
4462
|
+
body,
|
|
4463
|
+
query: PLUGIN_VERSION_QUERY
|
|
4451
4464
|
})
|
|
4452
4465
|
).pipe(
|
|
4453
4466
|
mergeMap((result) => createUpChunkObservable(uuid$1, result.upload.url, file).pipe(
|
|
@@ -4473,7 +4486,8 @@ function getUpload(client, assetId) {
|
|
|
4473
4486
|
return client.request({
|
|
4474
4487
|
url: `/addons/mux/uploads/${dataset}/${assetId}`,
|
|
4475
4488
|
withCredentials: !0,
|
|
4476
|
-
method: "GET"
|
|
4489
|
+
method: "GET",
|
|
4490
|
+
query: PLUGIN_VERSION_QUERY
|
|
4477
4491
|
});
|
|
4478
4492
|
}
|
|
4479
4493
|
function pollUpload(client, uuid2) {
|