django-content-studio 1.0.0b5__py3-none-any.whl → 1.0.0b8__py3-none-any.whl
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.
- content_studio/__init__.py +1 -1
- content_studio/form.py +13 -0
- content_studio/serializers.py +9 -0
- content_studio/static/content_studio/assets/index.css +1 -1
- content_studio/static/content_studio/assets/index.js +74 -74
- content_studio/static/content_studio/locales/en/translation.json +4 -1
- content_studio/static/content_studio/locales/nl/translation.json +4 -1
- content_studio/viewsets.py +52 -1
- {django_content_studio-1.0.0b5.dist-info → django_content_studio-1.0.0b8.dist-info}/METADATA +1 -1
- {django_content_studio-1.0.0b5.dist-info → django_content_studio-1.0.0b8.dist-info}/RECORD +12 -20
- content_studio/static/content_studio/assets/browser-ponyfill-Ct7s-5jI.js +0 -2
- content_studio/static/content_studio/assets/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- content_studio/static/content_studio/assets/inter-cyrillic-wght-normal.woff2 +0 -0
- content_studio/static/content_studio/assets/inter-greek-ext-wght-normal.woff2 +0 -0
- content_studio/static/content_studio/assets/inter-greek-wght-normal.woff2 +0 -0
- content_studio/static/content_studio/assets/inter-latin-ext-wght-normal.woff2 +0 -0
- content_studio/static/content_studio/assets/inter-latin-wght-normal.woff2 +0 -0
- content_studio/static/content_studio/assets/inter-vietnamese-wght-normal.woff2 +0 -0
- {django_content_studio-1.0.0b5.dist-info → django_content_studio-1.0.0b8.dist-info}/LICENSE +0 -0
- {django_content_studio-1.0.0b5.dist-info → django_content_studio-1.0.0b8.dist-info}/WHEEL +0 -0
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
"title_create": "Create {{modelName}}",
|
|
38
38
|
"title_edit": "Edit {{modelName}}",
|
|
39
39
|
"last_edited": "Last edited",
|
|
40
|
-
"
|
|
40
|
+
"field_validation_error_title": "Some fields are invalid",
|
|
41
|
+
"field_validation_error_description": "Please check the fields and try again.",
|
|
42
|
+
"unsaved_alert": "There are unsaved changes. Are you sure you want to leave?",
|
|
43
|
+
"empty_state": "No items yet"
|
|
41
44
|
},
|
|
42
45
|
"media-library": {
|
|
43
46
|
"title": "Media library",
|
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
"title_create": "Maak {{modelName}} aan",
|
|
38
38
|
"title_edit": "Bewerk {{modelName}}",
|
|
39
39
|
"last_edited": "Laatst bewerkt",
|
|
40
|
-
"
|
|
40
|
+
"field_validation_error_title": "Sommige velden zijn onjuist ingevuld",
|
|
41
|
+
"field_validation_error_description": "Controleer de velden en probeer het opnieuw.",
|
|
42
|
+
"unsaved_alert": "Je hebt niet-opgeslagen wijzigen. Weet je zeker dat je weg wilt gaan?",
|
|
43
|
+
"empty_state": "Nog geen items"
|
|
41
44
|
},
|
|
42
45
|
"media-library": {
|
|
43
46
|
"title": "Mediabibliotheek",
|
content_studio/viewsets.py
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
|
+
import operator
|
|
1
2
|
import uuid
|
|
3
|
+
from functools import reduce
|
|
2
4
|
|
|
3
5
|
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE, DELETION
|
|
4
6
|
from django.contrib.contenttypes.models import ContentType
|
|
7
|
+
from django.db import models
|
|
8
|
+
from django.db.models import Q
|
|
5
9
|
from rest_framework.decorators import action
|
|
6
|
-
from rest_framework.exceptions import NotFound
|
|
10
|
+
from rest_framework.exceptions import NotFound, ValidationError
|
|
7
11
|
from rest_framework.filters import SearchFilter, OrderingFilter
|
|
8
12
|
from rest_framework.parsers import JSONParser
|
|
9
13
|
from rest_framework.permissions import DjangoModelPermissions
|
|
10
14
|
from rest_framework.renderers import JSONRenderer
|
|
15
|
+
from rest_framework.response import Response
|
|
11
16
|
from rest_framework.viewsets import ModelViewSet
|
|
12
17
|
|
|
13
18
|
from .filters import LookupFilter
|
|
19
|
+
from .serializers import RelatedItemSerializer
|
|
14
20
|
from .settings import cs_settings
|
|
15
21
|
|
|
16
22
|
|
|
@@ -112,3 +118,48 @@ class BaseModelViewSet(ModelViewSet):
|
|
|
112
118
|
raise NotFound()
|
|
113
119
|
|
|
114
120
|
return component.handle_request(obj=self.get_object(), request=request)
|
|
121
|
+
|
|
122
|
+
@action(methods=["post"], detail=False, url_path="relations/(?P<field_name>[^/]+)")
|
|
123
|
+
def get_related_objects(self, request, field_name):
|
|
124
|
+
"""
|
|
125
|
+
Endpoint for retrieving related objects.
|
|
126
|
+
"""
|
|
127
|
+
search = request.data.get("search", "")
|
|
128
|
+
|
|
129
|
+
parent_model = self.queryset.model
|
|
130
|
+
|
|
131
|
+
try:
|
|
132
|
+
related_field = parent_model._meta.get_field(field_name)
|
|
133
|
+
except LookupError:
|
|
134
|
+
raise ValidationError("Related field not found.")
|
|
135
|
+
|
|
136
|
+
related_model = related_field.related_model
|
|
137
|
+
|
|
138
|
+
custom_filter_method = getattr(
|
|
139
|
+
self._admin_model, f"get_related_{field_name}", None
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
if custom_filter_method:
|
|
143
|
+
qs = custom_filter_method(
|
|
144
|
+
search=search,
|
|
145
|
+
form_data=request.data.get("form", {}),
|
|
146
|
+
related_model=related_model,
|
|
147
|
+
request=request,
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
else:
|
|
151
|
+
char_fields = [
|
|
152
|
+
f.name
|
|
153
|
+
for f in related_model._meta.get_fields()
|
|
154
|
+
if isinstance(f, models.CharField)
|
|
155
|
+
]
|
|
156
|
+
|
|
157
|
+
queries = [Q(**{f"{f}__icontains": search}) for f in char_fields]
|
|
158
|
+
|
|
159
|
+
combined_query = reduce(operator.or_, queries)
|
|
160
|
+
|
|
161
|
+
qs = related_model.objects.filter(combined_query)
|
|
162
|
+
|
|
163
|
+
serializer = RelatedItemSerializer(qs[:20], many=True)
|
|
164
|
+
|
|
165
|
+
return Response(data=serializer.data)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
content_studio/__init__.py,sha256=
|
|
1
|
+
content_studio/__init__.py,sha256=cOfJM7-GO8pGp5vMMbKTPdnR_6LtODxf4SV02Zg40xQ,161
|
|
2
2
|
content_studio/admin.py,sha256=BpPdw4g0uQMPPgNObxQzVGbTNzZWDc1L0L3gI_WA8WI,10260
|
|
3
3
|
content_studio/apps.py,sha256=cfZvEixECgLN0g2zbu_Y94u5k3QBMyr_bgsgj4qYuoA,3503
|
|
4
4
|
content_studio/dashboard/__init__.py,sha256=1GQcAuM5IlTlvqq6aPYA_QfuiEy_It0qx54VqDMQHCQ,1788
|
|
5
5
|
content_studio/dashboard/activity_log.py,sha256=Yr5F7wRFBnT7RlvWJb9gdwYZzEuEeQV4dhc6YXDCOPY,859
|
|
6
6
|
content_studio/filters.py,sha256=GyglR2E_wswomW7EnfShEXr14zxuRlLAuxrHVO3QQYg,4335
|
|
7
|
-
content_studio/form.py,sha256=
|
|
7
|
+
content_studio/form.py,sha256=XvUbBVR3QlvyM1l73QWV5TnreQTM8cWNJqgxkACj9dQ,5041
|
|
8
8
|
content_studio/formats.py,sha256=JzOWrDRCVSnjJI0oX5fyFQU8LC634_jeAe84Widy43U,786
|
|
9
9
|
content_studio/login_backends/__init__.py,sha256=hgPJh9hFobubImfhynaeZ_dku3sjqNQvN5B43TVg7Gw,643
|
|
10
10
|
content_studio/login_backends/username_password.py,sha256=JJbF3oWnhOwLs-WaqclCCH6nAnrhlKbyBUzAJKVtq7A,2561
|
|
@@ -13,27 +13,19 @@ content_studio/media_library/viewsets.py,sha256=XsQuCrcfZ52xvvsEbHZ2WTI99wf-cheO
|
|
|
13
13
|
content_studio/models.py,sha256=SLcgMIXu4FqwbQJBQ-jLw7_hlGjbSmwHmyKfzDsj-2M,2068
|
|
14
14
|
content_studio/paginators.py,sha256=XrA6ECP2pO75SSj0Mi0Jqj7n_YPuIin-V8_6EOaQj64,589
|
|
15
15
|
content_studio/router.py,sha256=7Up_sipGaUDoY6ElJNRf85ADaYfJCWV4To523L4LGuw,393
|
|
16
|
-
content_studio/serializers.py,sha256=
|
|
16
|
+
content_studio/serializers.py,sha256=tWgL7J2z-Qc5BQjMc3PXpvLZa_6J6MfVUqRDOK_X0Xs,3867
|
|
17
17
|
content_studio/settings.py,sha256=6U0o-DxwpFQo-1LLumr3U4FCVTHiBzySK7M77HWvpf4,4510
|
|
18
|
-
content_studio/static/content_studio/assets/browser-ponyfill-Ct7s-5jI.js,sha256=ka_XS-3zL9SFKN25BR2iVt7ZrWLHsY-13dDUJinsL10,10281
|
|
19
18
|
content_studio/static/content_studio/assets/browser-ponyfill-TyWUZ1Oq.js,sha256=sKLpD8vGwLfnJVLaSGMMi8krArcm2Qj3-igVwDvLMek,10287
|
|
20
|
-
content_studio/static/content_studio/assets/index.css,sha256=
|
|
21
|
-
content_studio/static/content_studio/assets/index.js,sha256=
|
|
22
|
-
content_studio/static/content_studio/assets/inter-cyrillic-ext-wght-normal.woff2,sha256=yhVwYzOaxK1BjyFPOr_tEZsHmKtNN3OGzlyeWnpDXr0,25960
|
|
23
|
-
content_studio/static/content_studio/assets/inter-cyrillic-wght-normal.woff2,sha256=cdXuk8wenx1SCjqLZkVt4Yx4edjfCdV_zS6v91_vAHU,18748
|
|
24
|
-
content_studio/static/content_studio/assets/inter-greek-ext-wght-normal.woff2,sha256=bp4CCiX5tW1BjywIWx08CXJaTaI_5pOltGMGRgZzIZA,11232
|
|
25
|
-
content_studio/static/content_studio/assets/inter-greek-wght-normal.woff2,sha256=G-NEjikvvwX_4Xb-HkPxNQE9ULHn0yStGlWPYj07tvY,18996
|
|
26
|
-
content_studio/static/content_studio/assets/inter-latin-ext-wght-normal.woff2,sha256=NLnFBMq3pz43t0Y0OkSRMuVs97VIGvLLgdx03P8lyVY,85068
|
|
27
|
-
content_studio/static/content_studio/assets/inter-latin-wght-normal.woff2,sha256=MQDndehhbNJhG-7PojpCY9cDdYZ4m0PwNSNqLm-9TGI,48256
|
|
28
|
-
content_studio/static/content_studio/assets/inter-vietnamese-wght-normal.woff2,sha256=XGb54H6QxtSsSSLMaNYN4mwXsYWOZ3-15gP845UrP_I,10252
|
|
19
|
+
content_studio/static/content_studio/assets/index.css,sha256=z4UGhtkbCGeVEL3ivv3f_OrQrWDxZwEGnHPbf4LLoow,84776
|
|
20
|
+
content_studio/static/content_studio/assets/index.js,sha256=7EsnDTWXXk8YSZvNVsmygAfj3zWod6o1OmyR4kltbLs,1411252
|
|
29
21
|
content_studio/static/content_studio/icons/pi/Phosphor-Bold.svg,sha256=4kdzmyaGcNVhK6qRIA8PdhaZ7raHU0xoU26ht52VG_c,2967217
|
|
30
22
|
content_studio/static/content_studio/icons/pi/Phosphor-Bold.ttf,sha256=EKChy0-BVqQg-fhM80xOmHHljtLd6h9qgHmtByQ6f7I,495308
|
|
31
23
|
content_studio/static/content_studio/icons/pi/Phosphor-Bold.woff,sha256=3k3MnRjPMzY8GdLJJMnZ1R4hCXi9Pm7FCK7HFnCz2wY,495388
|
|
32
24
|
content_studio/static/content_studio/icons/pi/Phosphor-Bold.woff2,sha256=IVO1LOqeBvwMyElgSL5IWzgaD4vxMK3qWpdW_I8QC4c,150052
|
|
33
25
|
content_studio/static/content_studio/icons/pi/style.css,sha256=yKMt9n-L1X9wxjceFewjLfJd3ro-uQYNeqpoEBps4kA,85821
|
|
34
26
|
content_studio/static/content_studio/img/media_placeholder.svg,sha256=ZLrfeqvaC5YwuHAg_7YJXLhYzLz2azVcKqCLEGOVTTs,3253
|
|
35
|
-
content_studio/static/content_studio/locales/en/translation.json,sha256=
|
|
36
|
-
content_studio/static/content_studio/locales/nl/translation.json,sha256=
|
|
27
|
+
content_studio/static/content_studio/locales/en/translation.json,sha256=aYJThaN5db_1Eo5YeeDpqxhf5gohtOL12yG4FF4CaRI,2524
|
|
28
|
+
content_studio/static/content_studio/locales/nl/translation.json,sha256=hB9oauYHeGvVDKBQn52sITNSMSGmcJL0TilfaH6Qv5c,2776
|
|
37
29
|
content_studio/static/content_studio/vite.svg,sha256=SnSK_UQ5GLsWWRyDTEAdrjPoeGGrXbrQgRw6O0qSFPs,1497
|
|
38
30
|
content_studio/templates/content_studio/index.html,sha256=zGS8iro3w1HLs5hLbDRTrchB50rAaFqXbTMu7hdVz6E,1193
|
|
39
31
|
content_studio/token_backends/__init__.py,sha256=dO3aWIHXX8He399ZEvlS4fNgyL84OY9TEtkva9b5N5Q,1183
|
|
@@ -41,9 +33,9 @@ content_studio/token_backends/jwt.py,sha256=niGCpRqaUVhhS9haXfH1uFlg2v8NLB5IpsJ4
|
|
|
41
33
|
content_studio/urls.py,sha256=EY7lbzC0Q5vLfvqE3rK_4hmDrXhTuxKzYC55cc5tEEo,701
|
|
42
34
|
content_studio/utils.py,sha256=xOolXd9Zmty6B6_2febvM8TmZhZ0JRc2nCLj3VooHkM,1488
|
|
43
35
|
content_studio/views.py,sha256=GbANmQY_VyzQPD4Hw3MEfWF3pOr2G6a61Ktvu2Bw6d8,5370
|
|
44
|
-
content_studio/viewsets.py,sha256=
|
|
36
|
+
content_studio/viewsets.py,sha256=ThTM9J7ecicS0FqVTZqn6UqegSxiQjP3NbPxhL58v7E,5433
|
|
45
37
|
content_studio/widgets.py,sha256=OlFKCAYNhkj2Ww9S_hvQTzUjcSnYXocmi04zusKrOTo,1071
|
|
46
|
-
django_content_studio-1.0.
|
|
47
|
-
django_content_studio-1.0.
|
|
48
|
-
django_content_studio-1.0.
|
|
49
|
-
django_content_studio-1.0.
|
|
38
|
+
django_content_studio-1.0.0b8.dist-info/LICENSE,sha256=Wnx2EJhtSNnXE5Qs80i1HTBNFZTi8acEtC5TYqtFlnQ,1075
|
|
39
|
+
django_content_studio-1.0.0b8.dist-info/METADATA,sha256=OFb5WlnFxalm-iLWP-vWeqeJ9qVECuaJqjQGErffYeg,2512
|
|
40
|
+
django_content_studio-1.0.0b8.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
41
|
+
django_content_studio-1.0.0b8.dist-info/RECORD,,
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as R,g as z}from"./index.js";function $(w,d){for(var b=0;b<d.length;b++){const y=d[b];if(typeof y!="string"&&!Array.isArray(y)){for(const h in y)if(h!=="default"&&!(h in w)){const p=Object.getOwnPropertyDescriptor(y,h);p&&Object.defineProperty(w,h,p.get?p:{enumerable:!0,get:()=>y[h]})}}}return Object.freeze(Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}))}var A={exports:{}},U;function X(){return U||(U=1,function(w,d){var b=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof R<"u"&&R,y=function(){function p(){this.fetch=!1,this.DOMException=b.DOMException}return p.prototype=b,new p}();(function(p){(function(u){var a=typeof p<"u"&&p||typeof self<"u"&&self||typeof a<"u"&&a,f={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function S(e){return e&&DataView.prototype.isPrototypeOf(e)}if(f.arrayBuffer)var F=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],I=ArrayBuffer.isView||function(e){return e&&F.indexOf(Object.prototype.toString.call(e))>-1};function v(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function E(e){return typeof e!="string"&&(e=String(e)),e}function T(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return f.iterable&&(t[Symbol.iterator]=function(){return t}),t}function s(e){this.map={},e instanceof s?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}s.prototype.append=function(e,t){e=v(e),t=E(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},s.prototype.delete=function(e){delete this.map[v(e)]},s.prototype.get=function(e){return e=v(e),this.has(e)?this.map[e]:null},s.prototype.has=function(e){return this.map.hasOwnProperty(v(e))},s.prototype.set=function(e,t){this.map[v(e)]=E(t)},s.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},s.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),T(e)},s.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),T(e)},s.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),T(e)},f.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);function B(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function P(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function M(e){var t=new FileReader,r=P(t);return t.readAsArrayBuffer(e),r}function q(e){var t=new FileReader,r=P(t);return t.readAsText(e),r}function H(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function D(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function x(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:f.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:f.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():f.arrayBuffer&&f.blob&&S(e)?(this._bodyArrayBuffer=D(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):f.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||I(e))?this._bodyArrayBuffer=D(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):f.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},f.blob&&(this.blob=function(){var e=B(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=B(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(M)}),this.text=function(){var e=B(this);if(e)return e;if(this._bodyBlob)return q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(H(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},f.formData&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}var L=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function C(e){var t=e.toUpperCase();return L.indexOf(t)>-1?t:e}function m(e,t){if(!(this instanceof m))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new s(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new s(t.headers)),this.method=C(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})};function k(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),i=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}}),t}function N(e){var t=new s,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
|
|
2
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),o=i.shift().trim();if(o){var _=i.join(":").trim();t.append(o,_)}}),t}x.call(m.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new s(t.headers),this.url=t.url||"",this._initBody(e)}x.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:0,statusText:""});return e.type="error",e};var G=[301,302,303,307,308];c.redirect=function(e,t){if(G.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},u.DOMException=a.DOMException;try{new u.DOMException}catch{u.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},u.DOMException.prototype=Object.create(Error.prototype),u.DOMException.prototype.constructor=u.DOMException}function O(e,t){return new Promise(function(r,n){var i=new m(e,t);if(i.signal&&i.signal.aborted)return n(new u.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function _(){o.abort()}o.onload=function(){var l={status:o.status,statusText:o.statusText,headers:N(o.getAllResponseHeaders()||"")};l.url="responseURL"in o?o.responseURL:l.headers.get("X-Request-URL");var g="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(g,l))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.onabort=function(){setTimeout(function(){n(new u.DOMException("Aborted","AbortError"))},0)};function V(l){try{return l===""&&a.location.href?a.location.href:l}catch{return l}}o.open(i.method,V(i.url),!0),i.credentials==="include"?o.withCredentials=!0:i.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(f.blob?o.responseType="blob":f.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof s)?Object.getOwnPropertyNames(t.headers).forEach(function(l){o.setRequestHeader(l,E(t.headers[l]))}):i.headers.forEach(function(l,g){o.setRequestHeader(g,l)}),i.signal&&(i.signal.addEventListener("abort",_),o.onreadystatechange=function(){o.readyState===4&&i.signal.removeEventListener("abort",_)}),o.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}return O.polyfill=!0,a.fetch||(a.fetch=O,a.Headers=s,a.Request=m,a.Response=c),u.Headers=s,u.Request=m,u.Response=c,u.fetch=O,u})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var h=b.fetch?b:y;d=h.fetch,d.default=h.fetch,d.fetch=h.fetch,d.Headers=h.Headers,d.Request=h.Request,d.Response=h.Response,w.exports=d}(A,A.exports)),A.exports}var j=X();const J=z(j),Q=$({__proto__:null,default:J},[j]);export{Q as b};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|