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