microcms-js-sdk 2.2.0 → 2.3.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/README.md +1 -0
- package/dist/cjs/createClient.d.ts +1 -1
- package/dist/cjs/lib/fetch.d.ts +7 -0
- package/dist/cjs/microcms-js-sdk.js +1 -1
- package/dist/cjs/types.d.ts +3 -2
- package/dist/esm/createClient.d.ts +1 -1
- package/dist/esm/lib/fetch.d.ts +7 -0
- package/dist/esm/microcms-js-sdk.js +2 -2
- package/dist/esm/types.d.ts +3 -2
- package/dist/umd/createClient.d.ts +1 -1
- package/dist/umd/lib/fetch.d.ts +7 -0
- package/dist/umd/microcms-js-sdk.js +2 -2
- package/dist/umd/types.d.ts +3 -2
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ const { createClient } = microcms;
|
|
|
47
47
|
const client = createClient({
|
|
48
48
|
serviceDomain: "YOUR_DOMAIN", // YOUR_DOMAIN is the XXXX part of XXXX.microcms.io
|
|
49
49
|
apiKey: "YOUR_API_KEY",
|
|
50
|
+
// customFetcher: fetch.bind(globalThis), // Provide a custom `fetch` implementation as an option
|
|
50
51
|
});
|
|
51
52
|
</script>
|
|
52
53
|
```
|
|
@@ -2,7 +2,7 @@ import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetOb
|
|
|
2
2
|
/**
|
|
3
3
|
* Initialize SDK Client
|
|
4
4
|
*/
|
|
5
|
-
export declare const createClient: ({ serviceDomain, apiKey }: MicroCMSClient) => {
|
|
5
|
+
export declare const createClient: ({ serviceDomain, apiKey, customFetch, }: MicroCMSClient) => {
|
|
6
6
|
get: <T = any>({ endpoint, contentId, queries, }: GetRequest) => Promise<T>;
|
|
7
7
|
getList: <T_1 = any>({ endpoint, queries, }: GetListRequest) => Promise<MicroCMSListResponse<T_1>>;
|
|
8
8
|
getListDetail: <T_2 = any>({ endpoint, contentId, queries, }: GetListDetailRequest) => Promise<T_2 & import("./types").MicroCMSContentId & import("./types").MicroCMSDate>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Fetch } from 'src/types';
|
|
2
|
+
export declare const resolveFetch: (customFetch?: Fetch) => Fetch;
|
|
3
|
+
export declare const resolveHeadersConstructor: () => {
|
|
4
|
+
new (init?: HeadersInit | undefined): Headers;
|
|
5
|
+
prototype: Headers;
|
|
6
|
+
};
|
|
7
|
+
export declare const generateFetchClient: (apiKey: string, customFetch?: Fetch) => Fetch;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("qs"),t=require("cross-fetch");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e),o=n(t),i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function c(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,u)}a((r=r.apply(e,t||[])).next())}))}function u(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var a=function(e){return"string"==typeof e},s=function(e){var t;return t=e||("undefined"==typeof fetch?o.default:fetch),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}},d=function(e,n){var r=s(n),o="undefined"==typeof Headers?t.Headers:Headers;return function(t,n){return c(void 0,void 0,void 0,(function(){var c;return u(this,(function(u){return(c=new o(null==n?void 0:n.headers)).has("X-MICROCMS-API-KEY")||c.set("X-MICROCMS-API-KEY",e),[2,r(t,i(i({},n),{headers:c}))]}))}))}};exports.createClient=function(e){var t=e.serviceDomain,n=e.apiKey,o=e.customFetch;if(!t||!n)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!a(t)||!a(n))throw new Error("parameter is not string");var i="https://".concat(t,".").concat("microcms.io","/api/").concat("v1"),s=function(e){var t=e.endpoint,a=e.contentId,s=e.queries,f=void 0===s?{}:s,l=e.method,v=e.customHeaders,p=e.customBody;return c(void 0,void 0,void 0,(function(){var e,c,s,h,w,y;return u(this,(function(u){switch(u.label){case 0:e=d(n,o),c=function(e){if(null===(t=e)||"object"!=typeof t)throw new Error("queries is not object");var t;return r.default.stringify(e,{arrayFormat:"comma"})}(f),s="".concat(i,"/").concat(t).concat(a?"/".concat(a):"").concat(c?"?".concat(c):""),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,e(s,{method:l||"GET",headers:v,body:p})];case 2:if(!(h=u.sent()).ok)throw new Error("fetch API response status: ".concat(h.status));return"DELETE"===l?[2]:[2,h.json()];case 3:if((w=u.sent()).data)throw w.data;if(null===(y=w.response)||void 0===y?void 0:y.data)throw w.response.data;return[2,Promise.reject(new Error("serviceDomain or endpoint may be wrong.\n Details: ".concat(w)))];case 4:return[2]}}))}))};return{get:function(e){var t=e.endpoint,n=e.contentId,r=e.queries,o=void 0===r?{}:r;return c(void 0,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return t?[4,s({endpoint:t,contentId:n,queries:o})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getList:function(e){var t=e.endpoint,n=e.queries,r=void 0===n?{}:n;return c(void 0,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return t?[4,s({endpoint:t,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getListDetail:function(e){var t=e.endpoint,n=e.contentId,r=e.queries,o=void 0===r?{}:r;return c(void 0,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return t?[4,s({endpoint:t,contentId:n,queries:o})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getObject:function(e){var t=e.endpoint,n=e.queries,r=void 0===n?{}:n;return c(void 0,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return t?[4,s({endpoint:t,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},create:function(e){var t=e.endpoint,n=e.contentId,r=e.content,o=e.isDraft,i=void 0!==o&&o;return c(void 0,void 0,void 0,(function(){var e,o,c,a;return u(this,(function(u){return t?(e=i?{status:"draft"}:{},o=n?"PUT":"POST",c={"Content-Type":"application/json"},a=JSON.stringify(r),[2,s({endpoint:t,contentId:n,queries:e,method:o,customHeaders:c,customBody:a})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},update:function(e){var t=e.endpoint,n=e.contentId,r=e.content;return c(void 0,void 0,void 0,(function(){var e,o;return u(this,(function(i){return t?("PATCH",e={"Content-Type":"application/json"},o=JSON.stringify(r),[2,s({endpoint:t,contentId:n,method:"PATCH",customHeaders:e,customBody:o})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},delete:function(e){var t=e.endpoint,n=e.contentId;return c(void 0,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return t?n?("DELETE",[4,s({endpoint:t,contentId:n,method:"DELETE"})]):[2,Promise.reject(new Error("contentId is required"))]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return e.sent(),[2]}}))}))}}};
|
|
2
2
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWljcm9jbXMtanMtc2RrLmpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
export declare type Fetch = typeof fetch;
|
|
2
2
|
/**
|
|
3
3
|
* microCMS createClient params
|
|
4
4
|
*/
|
|
5
5
|
export interface MicroCMSClient {
|
|
6
6
|
serviceDomain: string;
|
|
7
7
|
apiKey: string;
|
|
8
|
+
customFetch?: Fetch;
|
|
8
9
|
}
|
|
9
10
|
declare type depthNumber = 1 | 2 | 3;
|
|
10
11
|
/**
|
|
@@ -70,7 +71,7 @@ export interface MakeRequest {
|
|
|
70
71
|
queries?: MicroCMSQueries & Record<string, any>;
|
|
71
72
|
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
72
73
|
customHeaders?: HeadersInit;
|
|
73
|
-
customBody?:
|
|
74
|
+
customBody?: string;
|
|
74
75
|
}
|
|
75
76
|
export interface GetRequest {
|
|
76
77
|
endpoint: string;
|
|
@@ -2,7 +2,7 @@ import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetOb
|
|
|
2
2
|
/**
|
|
3
3
|
* Initialize SDK Client
|
|
4
4
|
*/
|
|
5
|
-
export declare const createClient: ({ serviceDomain, apiKey }: MicroCMSClient) => {
|
|
5
|
+
export declare const createClient: ({ serviceDomain, apiKey, customFetch, }: MicroCMSClient) => {
|
|
6
6
|
get: <T = any>({ endpoint, contentId, queries, }: GetRequest) => Promise<T>;
|
|
7
7
|
getList: <T_1 = any>({ endpoint, queries, }: GetListRequest) => Promise<MicroCMSListResponse<T_1>>;
|
|
8
8
|
getListDetail: <T_2 = any>({ endpoint, contentId, queries, }: GetListDetailRequest) => Promise<T_2 & import("./types").MicroCMSContentId & import("./types").MicroCMSDate>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Fetch } from 'src/types';
|
|
2
|
+
export declare const resolveFetch: (customFetch?: Fetch) => Fetch;
|
|
3
|
+
export declare const resolveHeadersConstructor: () => {
|
|
4
|
+
new (init?: HeadersInit | undefined): Headers;
|
|
5
|
+
prototype: Headers;
|
|
6
|
+
};
|
|
7
|
+
export declare const generateFetchClient: (apiKey: string, customFetch?: Fetch) => Fetch;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from"
|
|
1
|
+
import e from"qs";import n,{Headers as t}from"cross-fetch";
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -12,5 +12,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var
|
|
15
|
+
***************************************************************************** */var r=function(){return(r=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function o(e,n,t,r){return new(t||(t=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(c,u)}a((r=r.apply(e,n||[])).next())}))}function i(e,n){var t,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;c;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=c.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=n.call(e,c)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var c=function(e){return"string"==typeof e},u=function(e){var t;return t=e||("undefined"==typeof fetch?n:fetch),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.apply(void 0,e)}},a=function(e,n){var c=u(n),a="undefined"==typeof Headers?t:Headers;return function(n,t){return o(void 0,void 0,void 0,(function(){var o;return i(this,(function(i){return(o=new a(null==t?void 0:t.headers)).has("X-MICROCMS-API-KEY")||o.set("X-MICROCMS-API-KEY",e),[2,c(n,r(r({},t),{headers:o}))]}))}))}},s=function(n){var t=n.serviceDomain,r=n.apiKey,u=n.customFetch;if(!t||!r)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!c(t)||!c(r))throw new Error("parameter is not string");var s="https://".concat(t,".").concat("microcms.io","/api/").concat("v1"),d=function(n){var t=n.endpoint,c=n.contentId,d=n.queries,f=void 0===d?{}:d,p=n.method,v=n.customHeaders,l=n.customBody;return o(void 0,void 0,void 0,(function(){var n,o,d,h,m,w;return i(this,(function(i){switch(i.label){case 0:n=a(r,u),o=function(n){if(null===(t=n)||"object"!=typeof t)throw new Error("queries is not object");var t;return e.stringify(n,{arrayFormat:"comma"})}(f),d="".concat(s,"/").concat(t).concat(c?"/".concat(c):"").concat(o?"?".concat(o):""),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n(d,{method:p||"GET",headers:v,body:l})];case 2:if(!(h=i.sent()).ok)throw new Error("fetch API response status: ".concat(h.status));return"DELETE"===p?[2]:[2,h.json()];case 3:if((m=i.sent()).data)throw m.data;if(null===(w=m.response)||void 0===w?void 0:w.data)throw m.response.data;return[2,Promise.reject(new Error("serviceDomain or endpoint may be wrong.\n Details: ".concat(m)))];case 4:return[2]}}))}))};return{get:function(e){var n=e.endpoint,t=e.contentId,r=e.queries,c=void 0===r?{}:r;return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n?[4,d({endpoint:n,contentId:t,queries:c})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getList:function(e){var n=e.endpoint,t=e.queries,r=void 0===t?{}:t;return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n?[4,d({endpoint:n,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getListDetail:function(e){var n=e.endpoint,t=e.contentId,r=e.queries,c=void 0===r?{}:r;return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n?[4,d({endpoint:n,contentId:t,queries:c})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getObject:function(e){var n=e.endpoint,t=e.queries,r=void 0===t?{}:t;return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n?[4,d({endpoint:n,queries:r})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},create:function(e){var n=e.endpoint,t=e.contentId,r=e.content,c=e.isDraft,u=void 0!==c&&c;return o(void 0,void 0,void 0,(function(){var e,o,c,a;return i(this,(function(i){return n?(e=u?{status:"draft"}:{},o=t?"PUT":"POST",c={"Content-Type":"application/json"},a=JSON.stringify(r),[2,d({endpoint:n,contentId:t,queries:e,method:o,customHeaders:c,customBody:a})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},update:function(e){var n=e.endpoint,t=e.contentId,r=e.content;return o(void 0,void 0,void 0,(function(){var e,o;return i(this,(function(i){return n?("PATCH",e={"Content-Type":"application/json"},o=JSON.stringify(r),[2,d({endpoint:n,contentId:t,method:"PATCH",customHeaders:e,customBody:o})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},delete:function(e){var n=e.endpoint,t=e.contentId;return o(void 0,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return n?t?("DELETE",[4,d({endpoint:n,contentId:t,method:"DELETE"})]):[2,Promise.reject(new Error("contentId is required"))]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return e.sent(),[2]}}))}))}}};export{s as createClient};
|
|
16
16
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWljcm9jbXMtanMtc2RrLmpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7In0=
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
export declare type Fetch = typeof fetch;
|
|
2
2
|
/**
|
|
3
3
|
* microCMS createClient params
|
|
4
4
|
*/
|
|
5
5
|
export interface MicroCMSClient {
|
|
6
6
|
serviceDomain: string;
|
|
7
7
|
apiKey: string;
|
|
8
|
+
customFetch?: Fetch;
|
|
8
9
|
}
|
|
9
10
|
declare type depthNumber = 1 | 2 | 3;
|
|
10
11
|
/**
|
|
@@ -70,7 +71,7 @@ export interface MakeRequest {
|
|
|
70
71
|
queries?: MicroCMSQueries & Record<string, any>;
|
|
71
72
|
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
72
73
|
customHeaders?: HeadersInit;
|
|
73
|
-
customBody?:
|
|
74
|
+
customBody?: string;
|
|
74
75
|
}
|
|
75
76
|
export interface GetRequest {
|
|
76
77
|
endpoint: string;
|
|
@@ -2,7 +2,7 @@ import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetOb
|
|
|
2
2
|
/**
|
|
3
3
|
* Initialize SDK Client
|
|
4
4
|
*/
|
|
5
|
-
export declare const createClient: ({ serviceDomain, apiKey }: MicroCMSClient) => {
|
|
5
|
+
export declare const createClient: ({ serviceDomain, apiKey, customFetch, }: MicroCMSClient) => {
|
|
6
6
|
get: <T = any>({ endpoint, contentId, queries, }: GetRequest) => Promise<T>;
|
|
7
7
|
getList: <T_1 = any>({ endpoint, queries, }: GetListRequest) => Promise<MicroCMSListResponse<T_1>>;
|
|
8
8
|
getListDetail: <T_2 = any>({ endpoint, contentId, queries, }: GetListDetailRequest) => Promise<T_2 & import("./types").MicroCMSContentId & import("./types").MicroCMSDate>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Fetch } from 'src/types';
|
|
2
|
+
export declare const resolveFetch: (customFetch?: Fetch) => Fetch;
|
|
3
|
+
export declare const resolveHeadersConstructor: () => {
|
|
4
|
+
new (init?: HeadersInit | undefined): Headers;
|
|
5
|
+
prototype: Headers;
|
|
6
|
+
};
|
|
7
|
+
export declare const generateFetchClient: (apiKey: string, customFetch?: Fetch) => Fetch;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).microcms={})}(this,(function(t){"use strict";
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var t=function(){return(t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{p(n.next(e))}catch(e){i(e)}}function c(e){try{p(n.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,c)}p((n=n.apply(e,t||[])).next())}))}function n(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}function o(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}var i={exports:{}};!function(e,t){var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response}(i,i.exports);var a,c=i.exports,p="undefined"!=typeof Symbol&&Symbol,u=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0},f="Function.prototype.bind called on incompatible ",l=Array.prototype.slice,y=Object.prototype.toString,s="[object Function]",d=function(e){var t=this;if("function"!=typeof t||y.call(t)!==s)throw new TypeError(f+t);for(var r,n=l.call(arguments,1),o=function(){if(this instanceof r){var o=t.apply(this,n.concat(l.call(arguments)));return Object(o)===o?o:this}return t.apply(e,n.concat(l.call(arguments)))},i=Math.max(0,t.length-n.length),a=[],c=0;c<i;c++)a.push("$"+c);if(r=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var p=function(){};p.prototype=t.prototype,r.prototype=new p,p.prototype=null}return r},b=Function.prototype.bind||d,h=b.call(Function.call,Object.prototype.hasOwnProperty),m=SyntaxError,g=Function,v=TypeError,j=function(e){try{return g('"use strict"; return ('+e+").constructor;")()}catch(e){}},S=Object.getOwnPropertyDescriptor;if(S)try{S({},"")}catch(e){S=null}var w=function(){throw new v},O=S?function(){try{return w}catch(e){try{return S(arguments,"callee").get}catch(e){return w}}}():w,P="function"==typeof p&&"function"==typeof Symbol&&"symbol"==typeof p("foo")&&"symbol"==typeof Symbol("bar")&&u(),A=Object.getPrototypeOf||function(e){return e.__proto__},E={},x="undefined"==typeof Uint8Array?a:A(Uint8Array),I={"%AggregateError%":"undefined"==typeof AggregateError?a:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?a:ArrayBuffer,"%ArrayIteratorPrototype%":P?A([][Symbol.iterator]()):a,"%AsyncFromSyncIteratorPrototype%":a,"%AsyncFunction%":E,"%AsyncGenerator%":E,"%AsyncGeneratorFunction%":E,"%AsyncIteratorPrototype%":E,"%Atomics%":"undefined"==typeof Atomics?a:Atomics,"%BigInt%":"undefined"==typeof BigInt?a:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?a:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?a:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?a:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?a:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":E,"%Int8Array%":"undefined"==typeof Int8Array?a:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?a:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?a:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":P?A(A([][Symbol.iterator]())):a,"%JSON%":"object"==typeof JSON?JSON:a,"%Map%":"undefined"==typeof Map?a:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&P?A((new Map)[Symbol.iterator]()):a,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?a:Promise,"%Proxy%":"undefined"==typeof Proxy?a:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?a:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?a:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&P?A((new Set)[Symbol.iterator]()):a,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?a:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":P?A(""[Symbol.iterator]()):a,"%Symbol%":P?Symbol:a,"%SyntaxError%":m,"%ThrowTypeError%":O,"%TypedArray%":x,"%TypeError%":v,"%Uint8Array%":"undefined"==typeof Uint8Array?a:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?a:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?a:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?a:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?a:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?a:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?a:WeakSet},k=function e(t){var r;if("%AsyncFunction%"===t)r=j("async function () {}");else if("%GeneratorFunction%"===t)r=j("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=j("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(r=A(o.prototype))}return I[t]=r,r},F={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=b,N=h,D=R.call(Function.call,Array.prototype.concat),M=R.call(Function.apply,Array.prototype.splice),U=R.call(Function.call,String.prototype.replace),T=R.call(Function.call,String.prototype.slice),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,_=function(e){var t=T(e,0,1),r=T(e,-1);if("%"===t&&"%"!==r)throw new m("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new m("invalid intrinsic syntax, expected opening `%`");var n=[];return U(e,C,(function(e,t,r,o){n[n.length]=r?U(o,q,"$1"):t||e})),n},B=function(e,t){var r,n=e;if(N(F,n)&&(n="%"+(r=F[n])[0]+"%"),N(I,n)){var o=I[n];if(o===E&&(o=k(n)),void 0===o&&!t)throw new v("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new m("intrinsic "+e+" does not exist!")},W=function(e,t){if("string"!=typeof e||0===e.length)throw new v("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new v('"allowMissing" argument must be a boolean');var r=_(e),n=r.length>0?r[0]:"",o=B("%"+n+"%",t),i=o.name,a=o.value,c=!1,p=o.alias;p&&(n=p[0],M(r,D([0,1],p)));for(var u=1,f=!0;u<r.length;u+=1){var l=r[u],y=T(l,0,1),s=T(l,-1);if(('"'===y||"'"===y||"`"===y||'"'===s||"'"===s||"`"===s)&&y!==s)throw new m("property names with quotes must have matching quotes");if("constructor"!==l&&f||(c=!0),N(I,i="%"+(n+="."+l)+"%"))a=I[i];else if(null!=a){if(!(l in a)){if(!t)throw new v("base intrinsic for "+e+" exists, but the property is not available.");return}if(S&&u+1>=r.length){var d=S(a,l);a=(f=!!d)&&"get"in d&&!("originalValue"in d.get)?d.get:a[l]}else f=N(a,l),a=a[l];f&&!c&&(I[i]=a)}}return a},L={exports:{}};!function(e){var t=b,r=W,n=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),i=r("%Reflect.apply%",!0)||t.call(o,n),a=r("%Object.getOwnPropertyDescriptor%",!0),c=r("%Object.defineProperty%",!0),p=r("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var r=i(t,o,arguments);if(a&&c){var n=a(r,"length");n.configurable&&c(r,"length",{value:1+p(0,e.length-(arguments.length-1))})}return r};var u=function(){return i(t,n,arguments)};c?c(e.exports,"apply",{value:u}):e.exports.apply=u}(L);var H=W,G=L.exports,z=G(H("String.prototype.indexOf")),V=o(Object.freeze({__proto__:null,default:{}})),Q="function"==typeof Map&&Map.prototype,J=Object.getOwnPropertyDescriptor&&Q?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,$=Q&&J&&"function"==typeof J.get?J.get:null,K=Q&&Map.prototype.forEach,X="function"==typeof Set&&Set.prototype,Y=Object.getOwnPropertyDescriptor&&X?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Z=X&&Y&&"function"==typeof Y.get?Y.get:null,ee=X&&Set.prototype.forEach,te="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,re="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,ne="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,oe=Boolean.prototype.valueOf,ie=Object.prototype.toString,ae=Function.prototype.toString,ce=String.prototype.match,pe="function"==typeof BigInt?BigInt.prototype.valueOf:null,ue=Object.getOwnPropertySymbols,fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,le=Object.prototype.propertyIsEnumerable,ye=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),se=V.custom,de=se&&ve(se)?se:null,be="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag?Symbol.toStringTag:null;function he(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function me(e){return String(e).replace(/"/g,""")}function ge(e){return!("[object Array]"!==we(e)||be&&"object"==typeof e&&be in e)}function ve(e){if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!fe)return!1;try{return fe.call(e),!0}catch(e){}return!1}var je=Object.prototype.hasOwnProperty||function(e){return e in this};function Se(e,t){return je.call(e,t)}function we(e){return ie.call(e)}function Oe(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function Pe(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Pe(e.slice(0,t.maxStringLength),t)+n}return he(e.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,Ae),"single",t)}function Ae(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function Ee(e){return"Object("+e+")"}function xe(e){return e+" { ? }"}function Ie(e,t,r,n){return e+" ("+t+") {"+(n?ke(r,n):r.join(", "))+"}"}function ke(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+e.join(","+r)+"\n"+t.prev}function Fe(e,t){var r=ge(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=Se(e,o)?t(e[o],e):""}for(var i in e)Se(e,i)&&(r&&String(Number(i))===i&&i<e.length||(/[^\w$]/.test(i)?n.push(t(i,e)+": "+t(e[i],e)):n.push(i+": "+t(e[i],e))));if("function"==typeof ue)for(var a=ue(e),c=0;c<a.length;c++)le.call(e,a[c])&&n.push("["+t(a[c])+"]: "+t(e[a[c]],e));return n}var Re=W,Ne=function(e,t){var r=H(e,!!t);return"function"==typeof r&&z(e,".prototype.")>-1?G(r):r},De=function e(t,r,n,o){var i=r||{};if(Se(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Se(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&i.maxStringLength!==1/0:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=!Se(i,"customInspect")||i.customInspect;if("boolean"!=typeof a)throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(Se(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return Pe(t,i);if("number"==typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"==typeof t)return String(t)+"n";var c=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=c&&c>0&&"object"==typeof t)return ge(t)?"[Array]":"[Object]";var p=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=Array(e.indent+1).join(" ")}return{base:r,prev:Array(t+1).join(r)}}(i,n);if(void 0===o)o=[];else if(Oe(o,t)>=0)return"[Circular]";function u(t,r,a){if(r&&(o=o.slice()).push(r),a){var c={depth:i.depth};return Se(i,"quoteStyle")&&(c.quoteStyle=i.quoteStyle),e(t,c,n+1,o)}return e(t,i,n+1,o)}if("function"==typeof t){var f=function(e){if(e.name)return e.name;var t=ce.call(ae.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),l=Fe(t,u);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(l.length>0?" { "+l.join(", ")+" }":"")}if(ve(t)){var y=fe.call(t);return"object"==typeof t?Ee(y):y}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var s="<"+String(t.nodeName).toLowerCase(),d=t.attributes||[],b=0;b<d.length;b++)s+=" "+d[b].name+"="+he(me(d[b].value),"double",i);return s+=">",t.childNodes&&t.childNodes.length&&(s+="..."),s+="</"+String(t.nodeName).toLowerCase()+">"}if(ge(t)){if(0===t.length)return"[]";var h=Fe(t,u);return p&&!function(e){for(var t=0;t<e.length;t++)if(Oe(e[t],"\n")>=0)return!1;return!0}(h)?"["+ke(h,p)+"]":"[ "+h.join(", ")+" ]"}if(function(e){return!("[object Error]"!==we(e)||be&&"object"==typeof e&&be in e)}(t)){var m=Fe(t,u);return 0===m.length?"["+String(t)+"]":"{ ["+String(t)+"] "+m.join(", ")+" }"}if("object"==typeof t&&a){if(de&&"function"==typeof t[de])return t[de]();if("function"==typeof t.inspect)return t.inspect()}if(function(e){if(!$||!e||"object"!=typeof e)return!1;try{$.call(e);try{Z.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var g=[];return K.call(t,(function(e,r){g.push(u(r,t,!0)+" => "+u(e,t))})),Ie("Map",$.call(t),g,p)}if(function(e){if(!Z||!e||"object"!=typeof e)return!1;try{Z.call(e);try{$.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var v=[];return ee.call(t,(function(e){v.push(u(e,t))})),Ie("Set",Z.call(t),v,p)}if(function(e){if(!te||!e||"object"!=typeof e)return!1;try{te.call(e,te);try{re.call(e,re)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return xe("WeakMap");if(function(e){if(!re||!e||"object"!=typeof e)return!1;try{re.call(e,re);try{te.call(e,te)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return xe("WeakSet");if(function(e){if(!ne||!e||"object"!=typeof e)return!1;try{return ne.call(e),!0}catch(e){}return!1}(t))return xe("WeakRef");if(function(e){return!("[object Number]"!==we(e)||be&&"object"==typeof e&&be in e)}(t))return Ee(u(Number(t)));if(function(e){if(!e||"object"!=typeof e||!pe)return!1;try{return pe.call(e),!0}catch(e){}return!1}(t))return Ee(u(pe.call(t)));if(function(e){return!("[object Boolean]"!==we(e)||be&&"object"==typeof e&&be in e)}(t))return Ee(oe.call(t));if(function(e){return!("[object String]"!==we(e)||be&&"object"==typeof e&&be in e)}(t))return Ee(u(String(t)));if(!function(e){return!("[object Date]"!==we(e)||be&&"object"==typeof e&&be in e)}(t)&&!function(e){return!("[object RegExp]"!==we(e)||be&&"object"==typeof e&&be in e)}(t)){var j=Fe(t,u),S=ye?ye(t)===Object.prototype:t instanceof Object||t.constructor===Object,w=t instanceof Object?"":"null prototype",O=!S&&be&&Object(t)===t&&be in t?we(t).slice(8,-1):w?"Object":"",P=(S||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(O||w?"["+[].concat(O||[],w||[]).join(": ")+"] ":"");return 0===j.length?P+"{}":p?P+"{"+ke(j,p)+"}":P+"{ "+j.join(", ")+" }"}return String(t)},Me=Re("%TypeError%"),Ue=Re("%WeakMap%",!0),Te=Re("%Map%",!0),Ce=Ne("WeakMap.prototype.get",!0),qe=Ne("WeakMap.prototype.set",!0),_e=Ne("WeakMap.prototype.has",!0),Be=Ne("Map.prototype.get",!0),We=Ne("Map.prototype.set",!0),Le=Ne("Map.prototype.has",!0),He=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},Ge=String.prototype.replace,ze=/%20/g,Ve="RFC3986",Qe={default:Ve,formatters:{RFC1738:function(e){return Ge.call(e,ze,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:Ve},Je=Qe,$e=Object.prototype.hasOwnProperty,Ke=Array.isArray,Xe=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Ye=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},Ze={arrayToObject:Ye,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],i=o.obj[o.prop],a=Object.keys(i),c=0;c<a.length;++c){var p=a[c],u=i[p];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:i,prop:p}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(Ke(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,n,o){if(0===e.length)return e;var i=e;if("symbol"==typeof e?i=Symbol.prototype.toString.call(e):"string"!=typeof e&&(i=String(e)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var a="",c=0;c<i.length;++c){var p=i.charCodeAt(c);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||o===Je.RFC1738&&(40===p||41===p)?a+=i.charAt(c):p<128?a+=Xe[p]:p<2048?a+=Xe[192|p>>6]+Xe[128|63&p]:p<55296||p>=57344?a+=Xe[224|p>>12]+Xe[128|p>>6&63]+Xe[128|63&p]:(c+=1,p=65536+((1023&p)<<10|1023&i.charCodeAt(c)),a+=Xe[240|p>>18]+Xe[128|p>>12&63]+Xe[128|p>>6&63]+Xe[128|63&p])}return a},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(Ke(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(Ke(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!$e.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var o=t;return Ke(t)&&!Ke(r)&&(o=Ye(t,n)),Ke(t)&&Ke(r)?(r.forEach((function(r,o){if($e.call(t,o)){var i=t[o];i&&"object"==typeof i&&r&&"object"==typeof r?t[o]=e(i,r,n):t.push(r)}else t[o]=r})),t):Object.keys(r).reduce((function(t,o){var i=r[o];return $e.call(t,o)?t[o]=e(t[o],i,n):t[o]=i,t}),o)}},et=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new Me("Side channel does not contain "+De(e))},get:function(n){if(Ue&&n&&("object"==typeof n||"function"==typeof n)){if(e)return Ce(e,n)}else if(Te){if(t)return Be(t,n)}else if(r)return function(e,t){var r=He(e,t);return r&&r.value}(r,n)},has:function(n){if(Ue&&n&&("object"==typeof n||"function"==typeof n)){if(e)return _e(e,n)}else if(Te){if(t)return Le(t,n)}else if(r)return function(e,t){return!!He(e,t)}(r,n);return!1},set:function(n,o){Ue&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new Ue),qe(e,n,o)):Te?(t||(t=new Te),We(t,n,o)):(r||(r={key:{},next:null}),function(e,t,r){var n=He(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,o))}};return n},tt=Ze,rt=Qe,nt=Object.prototype.hasOwnProperty,ot={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},it=Array.isArray,at=Array.prototype.push,ct=function(e,t){at.apply(e,it(t)?t:[t])},pt=Date.prototype.toISOString,ut=rt.default,ft={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:tt.encode,encodeValuesOnly:!1,format:ut,formatter:rt.formatters[ut],indices:!1,serializeDate:function(e){return pt.call(e)},skipNulls:!1,strictNullHandling:!1},lt=function e(t,r,n,o,i,a,c,p,u,f,l,y,s,d,b){var h,m=t;if(b.has(t))throw new RangeError("Cyclic object value");if("function"==typeof c?m=c(r,m):m instanceof Date?m=f(m):"comma"===n&&it(m)&&(m=tt.maybeMap(m,(function(e){return e instanceof Date?f(e):e}))),null===m){if(o)return a&&!s?a(r,ft.encoder,d,"key",l):r;m=""}if("string"==typeof(h=m)||"number"==typeof h||"boolean"==typeof h||"symbol"==typeof h||"bigint"==typeof h||tt.isBuffer(m))return a?[y(s?r:a(r,ft.encoder,d,"key",l))+"="+y(a(m,ft.encoder,d,"value",l))]:[y(r)+"="+y(String(m))];var g,v=[];if(void 0===m)return v;if("comma"===n&&it(m))g=[{value:m.length>0?m.join(",")||null:void 0}];else if(it(c))g=c;else{var j=Object.keys(m);g=p?j.sort(p):j}for(var S=0;S<g.length;++S){var w=g[S],O="object"==typeof w&&void 0!==w.value?w.value:m[w];if(!i||null!==O){var P=it(m)?"function"==typeof n?n(r,w):r:r+(u?"."+w:"["+w+"]");b.set(t,!0);var A=et();ct(v,e(O,P,n,o,i,a,c,p,u,f,l,y,s,d,A))}}return v},yt=Ze,st=Object.prototype.hasOwnProperty,dt=Array.isArray,bt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:yt.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ht=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},mt=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},gt=function(e,t,r,n){if(e){var o=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(o),c=a?o.slice(0,a.index):o,p=[];if(c){if(!r.plainObjects&&st.call(Object.prototype,c)&&!r.allowPrototypes)return;p.push(c)}for(var u=0;r.depth>0&&null!==(a=i.exec(o))&&u<r.depth;){if(u+=1,!r.plainObjects&&st.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;p.push(a[1])}return a&&p.push("["+o.slice(a.index)+"]"),function(e,t,r,n){for(var o=n?t:mt(t,r),i=e.length-1;i>=0;--i){var a,c=e[i];if("[]"===c&&r.parseArrays)a=[].concat(o);else{a=r.plainObjects?Object.create(null):{};var p="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,u=parseInt(p,10);r.parseArrays||""!==p?!isNaN(u)&&c!==p&&String(u)===p&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[])[u]=o:a[p]=o:a={0:o}}o=a}return o}(p,t,r,n)}},vt={formats:Qe,parse:function(e,t){var r=function(e){if(!e)return bt;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?bt.charset:e.charset;return{allowDots:void 0===e.allowDots?bt.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:bt.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:bt.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:bt.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:bt.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:bt.comma,decoder:"function"==typeof e.decoder?e.decoder:bt.decoder,delimiter:"string"==typeof e.delimiter||yt.isRegExp(e.delimiter)?e.delimiter:bt.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:bt.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:bt.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:bt.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:bt.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:bt.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof e?function(e,t){var r,n={},o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,i=t.parameterLimit===1/0?void 0:t.parameterLimit,a=o.split(t.delimiter,i),c=-1,p=t.charset;if(t.charsetSentinel)for(r=0;r<a.length;++r)0===a[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[r]?p="utf-8":"utf8=%26%2310003%3B"===a[r]&&(p="iso-8859-1"),c=r,r=a.length);for(r=0;r<a.length;++r)if(r!==c){var u,f,l=a[r],y=l.indexOf("]="),s=-1===y?l.indexOf("="):y+1;-1===s?(u=t.decoder(l,bt.decoder,p,"key"),f=t.strictNullHandling?null:""):(u=t.decoder(l.slice(0,s),bt.decoder,p,"key"),f=yt.maybeMap(mt(l.slice(s+1),t),(function(e){return t.decoder(e,bt.decoder,p,"value")}))),f&&t.interpretNumericEntities&&"iso-8859-1"===p&&(f=ht(f)),l.indexOf("[]=")>-1&&(f=dt(f)?[f]:f),st.call(n,u)?n[u]=yt.combine(n[u],f):n[u]=f}return n}(e,r):e,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),a=0;a<i.length;++a){var c=i[a],p=gt(c,n[c],r,"string"==typeof e);o=yt.merge(o,p,r)}return!0===r.allowSparse?o:yt.compact(o)},stringify:function(e,t){var r,n=e,o=function(e){if(!e)return ft;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||ft.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=rt.default;if(void 0!==e.format){if(!nt.call(rt.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=rt.formatters[r],o=ft.filter;return("function"==typeof e.filter||it(e.filter))&&(o=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:ft.addQueryPrefix,allowDots:void 0===e.allowDots?ft.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:ft.charsetSentinel,delimiter:void 0===e.delimiter?ft.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:ft.encode,encoder:"function"==typeof e.encoder?e.encoder:ft.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:ft.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:ft.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:ft.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:ft.strictNullHandling}}(t);"function"==typeof o.filter?n=(0,o.filter)("",n):it(o.filter)&&(r=o.filter);var i,a=[];if("object"!=typeof n||null===n)return"";i=t&&t.arrayFormat in ot?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var c=ot[i];r||(r=Object.keys(n)),o.sort&&r.sort(o.sort);for(var p=et(),u=0;u<r.length;++u){var f=r[u];o.skipNulls&&null===n[f]||ct(a,lt(n[f],f,c,o.strictNullHandling,o.skipNulls,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,p))}var l=a.join(o.delimiter),y=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),l.length>0?y+l:""}},jt=function(e){return"string"==typeof e};e.createClient=function(e){var o=e.serviceDomain,i=e.apiKey;if(!o||!i)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!jt(o)||!jt(i))throw new Error("parameter is not string");var a="https://".concat(o,".").concat("microcms.io","/api/").concat("v1"),p=function(e){var o=e.endpoint,p=e.contentId,u=e.queries,f=void 0===u?{}:u,l=e.method,y=e.customHeaders,s=e.customBody;return r(void 0,void 0,void 0,(function(){var e,r,u,d,b,h;return n(this,(function(n){switch(n.label){case 0:e=function(e){if(null===(t=e)||"object"!=typeof t)throw new Error("queries is not object");var t;return vt.stringify(e,{arrayFormat:"comma"})}(f),r={headers:t(t({},y),{"X-MICROCMS-API-KEY":i}),body:s,method:l},u="".concat(a,"/").concat(o).concat(p?"/".concat(p):"").concat(e?"?".concat(e):""),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,c(u,r)];case 2:if(!(d=n.sent()).ok)throw new Error("fetch API response status: ".concat(d.status));return[2,d.json()];case 3:if((b=n.sent()).data)throw b.data;if(null===(h=b.response)||void 0===h?void 0:h.data)throw b.response.data;return[2,Promise.reject(new Error("serviceDomain or endpoint may be wrong.\n Details: ".concat(b)))];case 4:return[2]}}))}))};return{get:function(e){var t=e.endpoint,o=e.contentId,i=e.queries,a=void 0===i?{}:i;return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return t?[4,p({endpoint:t,contentId:o,queries:a})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getList:function(e){var t=e.endpoint,o=e.queries,i=void 0===o?{}:o;return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return t?[4,p({endpoint:t,queries:i})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getListDetail:function(e){var t=e.endpoint,o=e.contentId,i=e.queries,a=void 0===i?{}:i;return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return t?[4,p({endpoint:t,contentId:o,queries:a})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getObject:function(e){var t=e.endpoint,o=e.queries,i=void 0===o?{}:o;return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return t?[4,p({endpoint:t,queries:i})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},create:function(e){var t=e.endpoint,o=e.contentId,i=e.content,a=e.isDraft,c=void 0!==a&&a;return r(void 0,void 0,void 0,(function(){var e,r,a,u;return n(this,(function(n){return t?(e=c?{status:"draft"}:{},r=o?"PUT":"POST",a={"Content-Type":"application/json"},u=JSON.stringify(i),[2,p({endpoint:t,contentId:o,queries:e,method:r,customHeaders:a,customBody:u})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},update:function(e){var t=e.endpoint,o=e.contentId,i=e.content;return r(void 0,void 0,void 0,(function(){var e,r;return n(this,(function(n){return t?("PATCH",e={"Content-Type":"application/json"},r=JSON.stringify(i),[2,p({endpoint:t,contentId:o,method:"PATCH",customHeaders:e,customBody:r})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},delete:function(e){var t=e.endpoint,o=e.contentId;return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return t?o?("DELETE",[4,p({endpoint:t,contentId:o,method:"DELETE"})]):[2,Promise.reject(new Error("contentId is required"))]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return e.sent(),[2]}}))}))}}},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
15
|
+
***************************************************************************** */var e=function(){return(e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function r(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,c)}u((n=n.apply(t,e||[])).next())}))}function n(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function a(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})})),e}var c,u="undefined"!=typeof Symbol&&Symbol,p=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0},s="Function.prototype.bind called on incompatible ",f=Array.prototype.slice,l=Object.prototype.toString,y="[object Function]",d=function(t){var e=this;if("function"!=typeof e||l.call(e)!==y)throw new TypeError(s+e);for(var r,n=f.call(arguments,1),o=function(){if(this instanceof r){var o=e.apply(this,n.concat(f.call(arguments)));return Object(o)===o?o:this}return e.apply(t,n.concat(f.call(arguments)))},i=Math.max(0,e.length-n.length),a=[],c=0;c<i;c++)a.push("$"+c);if(r=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),e.prototype){var u=function(){};u.prototype=e.prototype,r.prototype=new u,u.prototype=null}return r},h=Function.prototype.bind||d,b=h.call(Function.call,Object.prototype.hasOwnProperty),m=SyntaxError,g=Function,v=TypeError,w=function(t){try{return g('"use strict"; return ('+t+").constructor;")()}catch(t){}},j=Object.getOwnPropertyDescriptor;if(j)try{j({},"")}catch(t){j=null}var O=function(){throw new v},S=j?function(){try{return O}catch(t){try{return j(arguments,"callee").get}catch(t){return O}}}():O,A="function"==typeof u&&"function"==typeof Symbol&&"symbol"==typeof u("foo")&&"symbol"==typeof Symbol("bar")&&p(),P=Object.getPrototypeOf||function(t){return t.__proto__},E={},x="undefined"==typeof Uint8Array?c:P(Uint8Array),I={"%AggregateError%":"undefined"==typeof AggregateError?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?c:ArrayBuffer,"%ArrayIteratorPrototype%":A?P([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":E,"%AsyncGenerator%":E,"%AsyncGeneratorFunction%":E,"%AsyncIteratorPrototype%":E,"%Atomics%":"undefined"==typeof Atomics?c:Atomics,"%BigInt%":"undefined"==typeof BigInt?c:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?c:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?c:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?c:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":E,"%Int8Array%":"undefined"==typeof Int8Array?c:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?c:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A?P(P([][Symbol.iterator]())):c,"%JSON%":"object"==typeof JSON?JSON:c,"%Map%":"undefined"==typeof Map?c:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A?P((new Map)[Symbol.iterator]()):c,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?c:Promise,"%Proxy%":"undefined"==typeof Proxy?c:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?c:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?c:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A?P((new Set)[Symbol.iterator]()):c,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A?P(""[Symbol.iterator]()):c,"%Symbol%":A?Symbol:c,"%SyntaxError%":m,"%ThrowTypeError%":S,"%TypedArray%":x,"%TypeError%":v,"%Uint8Array%":"undefined"==typeof Uint8Array?c:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?c:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?c:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?c:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?c:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?c:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?c:WeakSet},R=function t(e){var r;if("%AsyncFunction%"===e)r=w("async function () {}");else if("%GeneratorFunction%"===e)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=w("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&(r=P(o.prototype))}return I[e]=r,r},T={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},D=h,F=b,_=D.call(Function.call,Array.prototype.concat),k=D.call(Function.apply,Array.prototype.splice),B=D.call(Function.call,String.prototype.replace),M=D.call(Function.call,String.prototype.slice),U=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,C=function(t){var e=M(t,0,1),r=M(t,-1);if("%"===e&&"%"!==r)throw new m("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new m("invalid intrinsic syntax, expected opening `%`");var n=[];return B(t,U,(function(t,e,r,o){n[n.length]=r?B(o,N,"$1"):e||t})),n},L=function(t,e){var r,n=t;if(F(T,n)&&(n="%"+(r=T[n])[0]+"%"),F(I,n)){var o=I[n];if(o===E&&(o=R(n)),void 0===o&&!e)throw new v("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new m("intrinsic "+t+" does not exist!")},q=function(t,e){if("string"!=typeof t||0===t.length)throw new v("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new v('"allowMissing" argument must be a boolean');var r=C(t),n=r.length>0?r[0]:"",o=L("%"+n+"%",e),i=o.name,a=o.value,c=!1,u=o.alias;u&&(n=u[0],k(r,_([0,1],u)));for(var p=1,s=!0;p<r.length;p+=1){var f=r[p],l=M(f,0,1),y=M(f,-1);if(('"'===l||"'"===l||"`"===l||'"'===y||"'"===y||"`"===y)&&l!==y)throw new m("property names with quotes must have matching quotes");if("constructor"!==f&&s||(c=!0),F(I,i="%"+(n+="."+f)+"%"))a=I[i];else if(null!=a){if(!(f in a)){if(!e)throw new v("base intrinsic for "+t+" exists, but the property is not available.");return}if(j&&p+1>=r.length){var d=j(a,f);a=(s=!!d)&&"get"in d&&!("originalValue"in d.get)?d.get:a[f]}else s=F(a,f),a=a[f];s&&!c&&(I[i]=a)}}return a},H={exports:{}};!function(t){var e=h,r=q,n=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),i=r("%Reflect.apply%",!0)||e.call(o,n),a=r("%Object.getOwnPropertyDescriptor%",!0),c=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var r=i(e,o,arguments);if(a&&c){var n=a(r,"length");n.configurable&&c(r,"length",{value:1+u(0,t.length-(arguments.length-1))})}return r};var p=function(){return i(e,n,arguments)};c?c(t.exports,"apply",{value:p}):t.exports.apply=p}(H);var W=q,G=H.exports,V=G(W("String.prototype.indexOf")),z=a(Object.freeze({__proto__:null,default:{}})),J="function"==typeof Map&&Map.prototype,Q=Object.getOwnPropertyDescriptor&&J?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,$=J&&Q&&"function"==typeof Q.get?Q.get:null,K=J&&Map.prototype.forEach,X="function"==typeof Set&&Set.prototype,Y=Object.getOwnPropertyDescriptor&&X?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Z=X&&Y&&"function"==typeof Y.get?Y.get:null,tt=X&&Set.prototype.forEach,et="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,rt="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,nt="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,ot=Boolean.prototype.valueOf,it=Object.prototype.toString,at=Function.prototype.toString,ct=String.prototype.match,ut="function"==typeof BigInt?BigInt.prototype.valueOf:null,pt=Object.getOwnPropertySymbols,st="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,ft=Object.prototype.propertyIsEnumerable,lt=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),yt=z.custom,dt=yt&&vt(yt)?yt:null,ht="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag?Symbol.toStringTag:null;function bt(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function mt(t){return String(t).replace(/"/g,""")}function gt(t){return!("[object Array]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}function vt(t){if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!st)return!1;try{return st.call(t),!0}catch(t){}return!1}var wt=Object.prototype.hasOwnProperty||function(t){return t in this};function jt(t,e){return wt.call(t,e)}function Ot(t){return it.call(t)}function St(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function At(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return At(t.slice(0,e.maxStringLength),e)+n}return bt(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,Pt),"single",e)}function Pt(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+e.toString(16).toUpperCase()}function Et(t){return"Object("+t+")"}function xt(t){return t+" { ? }"}function It(t,e,r,n){return t+" ("+e+") {"+(n?Rt(r,n):r.join(", "))+"}"}function Rt(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+t.join(","+r)+"\n"+e.prev}function Tt(t,e){var r=gt(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=jt(t,o)?e(t[o],t):""}for(var i in t)jt(t,i)&&(r&&String(Number(i))===i&&i<t.length||(/[^\w$]/.test(i)?n.push(e(i,t)+": "+e(t[i],t)):n.push(i+": "+e(t[i],t))));if("function"==typeof pt)for(var a=pt(t),c=0;c<a.length;c++)ft.call(t,a[c])&&n.push("["+e(a[c])+"]: "+e(t[a[c]],t));return n}var Dt=q,Ft=function(t,e){var r=W(t,!!e);return"function"==typeof r&&V(t,".prototype.")>-1?G(r):r},_t=function t(e,r,n,o){var i=r||{};if(jt(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(jt(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&i.maxStringLength!==1/0:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=!jt(i,"customInspect")||i.customInspect;if("boolean"!=typeof a)throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(jt(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return At(e,i);if("number"==typeof e)return 0===e?1/0/e>0?"0":"-0":String(e);if("bigint"==typeof e)return String(e)+"n";var c=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=c&&c>0&&"object"==typeof e)return gt(e)?"[Array]":"[Object]";var u=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=Array(t.indent+1).join(" ")}return{base:r,prev:Array(e+1).join(r)}}(i,n);if(void 0===o)o=[];else if(St(o,e)>=0)return"[Circular]";function p(e,r,a){if(r&&(o=o.slice()).push(r),a){var c={depth:i.depth};return jt(i,"quoteStyle")&&(c.quoteStyle=i.quoteStyle),t(e,c,n+1,o)}return t(e,i,n+1,o)}if("function"==typeof e){var s=function(t){if(t.name)return t.name;var e=ct.call(at.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),f=Tt(e,p);return"[Function"+(s?": "+s:" (anonymous)")+"]"+(f.length>0?" { "+f.join(", ")+" }":"")}if(vt(e)){var l=st.call(e);return"object"==typeof e?Et(l):l}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var y="<"+String(e.nodeName).toLowerCase(),d=e.attributes||[],h=0;h<d.length;h++)y+=" "+d[h].name+"="+bt(mt(d[h].value),"double",i);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+String(e.nodeName).toLowerCase()+">"}if(gt(e)){if(0===e.length)return"[]";var b=Tt(e,p);return u&&!function(t){for(var e=0;e<t.length;e++)if(St(t[e],"\n")>=0)return!1;return!0}(b)?"["+Rt(b,u)+"]":"[ "+b.join(", ")+" ]"}if(function(t){return!("[object Error]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e)){var m=Tt(e,p);return 0===m.length?"["+String(e)+"]":"{ ["+String(e)+"] "+m.join(", ")+" }"}if("object"==typeof e&&a){if(dt&&"function"==typeof e[dt])return e[dt]();if("function"==typeof e.inspect)return e.inspect()}if(function(t){if(!$||!t||"object"!=typeof t)return!1;try{$.call(t);try{Z.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var g=[];return K.call(e,(function(t,r){g.push(p(r,e,!0)+" => "+p(t,e))})),It("Map",$.call(e),g,u)}if(function(t){if(!Z||!t||"object"!=typeof t)return!1;try{Z.call(t);try{$.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var v=[];return tt.call(e,(function(t){v.push(p(t,e))})),It("Set",Z.call(e),v,u)}if(function(t){if(!et||!t||"object"!=typeof t)return!1;try{et.call(t,et);try{rt.call(t,rt)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return xt("WeakMap");if(function(t){if(!rt||!t||"object"!=typeof t)return!1;try{rt.call(t,rt);try{et.call(t,et)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return xt("WeakSet");if(function(t){if(!nt||!t||"object"!=typeof t)return!1;try{return nt.call(t),!0}catch(t){}return!1}(e))return xt("WeakRef");if(function(t){return!("[object Number]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(p(Number(e)));if(function(t){if(!t||"object"!=typeof t||!ut)return!1;try{return ut.call(t),!0}catch(t){}return!1}(e))return Et(p(ut.call(e)));if(function(t){return!("[object Boolean]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(ot.call(e));if(function(t){return!("[object String]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(p(String(e)));if(!function(t){return!("[object Date]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e)&&!function(t){return!("[object RegExp]"!==Ot(t)||ht&&"object"==typeof t&&ht in t)}(e)){var w=Tt(e,p),j=lt?lt(e)===Object.prototype:e instanceof Object||e.constructor===Object,O=e instanceof Object?"":"null prototype",S=!j&&ht&&Object(e)===e&&ht in e?Ot(e).slice(8,-1):O?"Object":"",A=(j||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(S||O?"["+[].concat(S||[],O||[]).join(": ")+"] ":"");return 0===w.length?A+"{}":u?A+"{"+Rt(w,u)+"}":A+"{ "+w.join(", ")+" }"}return String(e)},kt=Dt("%TypeError%"),Bt=Dt("%WeakMap%",!0),Mt=Dt("%Map%",!0),Ut=Ft("WeakMap.prototype.get",!0),Nt=Ft("WeakMap.prototype.set",!0),Ct=Ft("WeakMap.prototype.has",!0),Lt=Ft("Map.prototype.get",!0),qt=Ft("Map.prototype.set",!0),Ht=Ft("Map.prototype.has",!0),Wt=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},Gt=String.prototype.replace,Vt=/%20/g,zt="RFC3986",Jt={default:zt,formatters:{RFC1738:function(t){return Gt.call(t,Vt,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:zt},Qt=Jt,$t=Object.prototype.hasOwnProperty,Kt=Array.isArray,Xt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Yt=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r},Zt={arrayToObject:Yt,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var o=e[n],i=o.obj[o.prop],a=Object.keys(i),c=0;c<a.length;++c){var u=a[c],p=i[u];"object"==typeof p&&null!==p&&-1===r.indexOf(p)&&(e.push({obj:i,prop:u}),r.push(p))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(Kt(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r,n,o){if(0===t.length)return t;var i=t;if("symbol"==typeof t?i=Symbol.prototype.toString.call(t):"string"!=typeof t&&(i=String(t)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var a="",c=0;c<i.length;++c){var u=i.charCodeAt(c);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===Qt.RFC1738&&(40===u||41===u)?a+=i.charAt(c):u<128?a+=Xt[u]:u<2048?a+=Xt[192|u>>6]+Xt[128|63&u]:u<55296||u>=57344?a+=Xt[224|u>>12]+Xt[128|u>>6&63]+Xt[128|63&u]:(c+=1,u=65536+((1023&u)<<10|1023&i.charCodeAt(c)),a+=Xt[240|u>>18]+Xt[128|u>>12&63]+Xt[128|u>>6&63]+Xt[128|63&u])}return a},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(Kt(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(Kt(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!$t.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var o=e;return Kt(e)&&!Kt(r)&&(o=Yt(e,n)),Kt(e)&&Kt(r)?(r.forEach((function(r,o){if($t.call(e,o)){var i=e[o];i&&"object"==typeof i&&r&&"object"==typeof r?e[o]=t(i,r,n):e.push(r)}else e[o]=r})),e):Object.keys(r).reduce((function(e,o){var i=r[o];return $t.call(e,o)?e[o]=t(e[o],i,n):e[o]=i,e}),o)}},te=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new kt("Side channel does not contain "+_t(t))},get:function(n){if(Bt&&n&&("object"==typeof n||"function"==typeof n)){if(t)return Ut(t,n)}else if(Mt){if(e)return Lt(e,n)}else if(r)return function(t,e){var r=Wt(t,e);return r&&r.value}(r,n)},has:function(n){if(Bt&&n&&("object"==typeof n||"function"==typeof n)){if(t)return Ct(t,n)}else if(Mt){if(e)return Ht(e,n)}else if(r)return function(t,e){return!!Wt(t,e)}(r,n);return!1},set:function(n,o){Bt&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new Bt),Nt(t,n,o)):Mt?(e||(e=new Mt),qt(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=Wt(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n},ee=Zt,re=Jt,ne=Object.prototype.hasOwnProperty,oe={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},ie=Array.isArray,ae=Array.prototype.push,ce=function(t,e){ae.apply(t,ie(e)?e:[e])},ue=Date.prototype.toISOString,pe=re.default,se={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:ee.encode,encodeValuesOnly:!1,format:pe,formatter:re.formatters[pe],indices:!1,serializeDate:function(t){return ue.call(t)},skipNulls:!1,strictNullHandling:!1},fe=function t(e,r,n,o,i,a,c,u,p,s,f,l,y,d,h){var b,m=e;if(h.has(e))throw new RangeError("Cyclic object value");if("function"==typeof c?m=c(r,m):m instanceof Date?m=s(m):"comma"===n&&ie(m)&&(m=ee.maybeMap(m,(function(t){return t instanceof Date?s(t):t}))),null===m){if(o)return a&&!y?a(r,se.encoder,d,"key",f):r;m=""}if("string"==typeof(b=m)||"number"==typeof b||"boolean"==typeof b||"symbol"==typeof b||"bigint"==typeof b||ee.isBuffer(m))return a?[l(y?r:a(r,se.encoder,d,"key",f))+"="+l(a(m,se.encoder,d,"value",f))]:[l(r)+"="+l(String(m))];var g,v=[];if(void 0===m)return v;if("comma"===n&&ie(m))g=[{value:m.length>0?m.join(",")||null:void 0}];else if(ie(c))g=c;else{var w=Object.keys(m);g=u?w.sort(u):w}for(var j=0;j<g.length;++j){var O=g[j],S="object"==typeof O&&void 0!==O.value?O.value:m[O];if(!i||null!==S){var A=ie(m)?"function"==typeof n?n(r,O):r:r+(p?"."+O:"["+O+"]");h.set(e,!0);var P=te();ce(v,t(S,A,n,o,i,a,c,u,p,s,f,l,y,d,P))}}return v},le=Zt,ye=Object.prototype.hasOwnProperty,de=Array.isArray,he={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:le.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},be=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},me=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},ge=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(o),c=a?o.slice(0,a.index):o,u=[];if(c){if(!r.plainObjects&&ye.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var p=0;r.depth>0&&null!==(a=i.exec(o))&&p<r.depth;){if(p+=1,!r.plainObjects&&ye.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(a[1])}return a&&u.push("["+o.slice(a.index)+"]"),function(t,e,r,n){for(var o=n?e:me(e,r),i=t.length-1;i>=0;--i){var a,c=t[i];if("[]"===c&&r.parseArrays)a=[].concat(o);else{a=r.plainObjects?Object.create(null):{};var u="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,p=parseInt(u,10);r.parseArrays||""!==u?!isNaN(p)&&c!==u&&String(p)===u&&p>=0&&r.parseArrays&&p<=r.arrayLimit?(a=[])[p]=o:a[u]=o:a={0:o}}o=a}return o}(u,e,r,n)}},ve={formats:Jt,parse:function(t,e){var r=function(t){if(!t)return he;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?he.charset:t.charset;return{allowDots:void 0===t.allowDots?he.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:he.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:he.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:he.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:he.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:he.comma,decoder:"function"==typeof t.decoder?t.decoder:he.decoder,delimiter:"string"==typeof t.delimiter||le.isRegExp(t.delimiter)?t.delimiter:he.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:he.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:he.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:he.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:he.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:he.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},o=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,i=e.parameterLimit===1/0?void 0:e.parameterLimit,a=o.split(e.delimiter,i),c=-1,u=e.charset;if(e.charsetSentinel)for(r=0;r<a.length;++r)0===a[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[r]?u="utf-8":"utf8=%26%2310003%3B"===a[r]&&(u="iso-8859-1"),c=r,r=a.length);for(r=0;r<a.length;++r)if(r!==c){var p,s,f=a[r],l=f.indexOf("]="),y=-1===l?f.indexOf("="):l+1;-1===y?(p=e.decoder(f,he.decoder,u,"key"),s=e.strictNullHandling?null:""):(p=e.decoder(f.slice(0,y),he.decoder,u,"key"),s=le.maybeMap(me(f.slice(y+1),e),(function(t){return e.decoder(t,he.decoder,u,"value")}))),s&&e.interpretNumericEntities&&"iso-8859-1"===u&&(s=be(s)),f.indexOf("[]=")>-1&&(s=de(s)?[s]:s),ye.call(n,p)?n[p]=le.combine(n[p],s):n[p]=s}return n}(t,r):t,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),a=0;a<i.length;++a){var c=i[a],u=ge(c,n[c],r,"string"==typeof t);o=le.merge(o,u,r)}return!0===r.allowSparse?o:le.compact(o)},stringify:function(t,e){var r,n=t,o=function(t){if(!t)return se;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||se.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=re.default;if(void 0!==t.format){if(!ne.call(re.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=re.formatters[r],o=se.filter;return("function"==typeof t.filter||ie(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:se.addQueryPrefix,allowDots:void 0===t.allowDots?se.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:se.charsetSentinel,delimiter:void 0===t.delimiter?se.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:se.encode,encoder:"function"==typeof t.encoder?t.encoder:se.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:se.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:se.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:se.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:se.strictNullHandling}}(e);"function"==typeof o.filter?n=(0,o.filter)("",n):ie(o.filter)&&(r=o.filter);var i,a=[];if("object"!=typeof n||null===n)return"";i=e&&e.arrayFormat in oe?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var c=oe[i];r||(r=Object.keys(n)),o.sort&&r.sort(o.sort);for(var u=te(),p=0;p<r.length;++p){var s=r[p];o.skipNulls&&null===n[s]||ce(a,fe(n[s],s,c,o.strictNullHandling,o.skipNulls,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,u))}var f=a.join(o.delimiter),l=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?l+="utf8=%26%2310003%3B&":l+="utf8=%E2%9C%93&"),f.length>0?l+f:""}},we=function(t){return"string"==typeof t},je={exports:{}};!function(t,e){var r="undefined"!=typeof self?self:o,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,o="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),i="FormData"in t,a="ArrayBuffer"in t;if(a)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&c.indexOf(Object.prototype.toString.call(t))>-1};function p(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function s(t){return"string"!=typeof t&&(t=String(t)),t}function f(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function y(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function h(t){var e=new FileReader,r=d(e);return e.readAsArrayBuffer(t),r}function b(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&o&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var t=y(this);if(t)return t;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(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var t,e,r,n=y(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=d(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=p(t),e=s(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},l.prototype.delete=function(t){delete this.map[p(t)]},l.prototype.get=function(t){return t=p(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(p(t))},l.prototype.set=function(t,e){this.map[p(t)]=s(e)},l.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),f(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),f(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),f(t)},n&&(l.prototype[Symbol.iterator]=l.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(t,e){var r,n,o=(e=e||{}).body;if(t instanceof v){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,o||null==t._bodyInit||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(r=e.method||this.method||"GET",n=r.toUpperCase(),g.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}})),e}function j(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},m.call(v.prototype),m.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},j.error=function(){var t=new j(null,{status:0,statusText:""});return t.type="error",t};var O=[301,302,303,307,308];j.redirect=function(t,e){if(-1===O.indexOf(e))throw new RangeError("Invalid status code");return new j(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function S(t,r){return new Promise((function(n,i){var a=new v(t,r);if(a.signal&&a.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function u(){c.abort()}c.onload=function(){var t,e,r={status:c.status,statusText:c.statusText,headers:(t=c.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();e.append(n,o)}})),e)};r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var o="response"in c?c.response:c.responseText;n(new j(o,r))},c.onerror=function(){i(new TypeError("Network request failed"))},c.ontimeout=function(){i(new TypeError("Network request failed"))},c.onabort=function(){i(new e.DOMException("Aborted","AbortError"))},c.open(a.method,a.url,!0),"include"===a.credentials?c.withCredentials=!0:"omit"===a.credentials&&(c.withCredentials=!1),"responseType"in c&&o&&(c.responseType="blob"),a.headers.forEach((function(t,e){c.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",u),c.onreadystatechange=function(){4===c.readyState&&a.signal.removeEventListener("abort",u)}),c.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=l,t.Request=v,t.Response=j),e.Headers=l,e.Request=v,e.Response=j,e.fetch=S,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e}(je,je.exports);var Oe=i(je.exports),Se=function(t){var e;return e=t||("undefined"==typeof fetch?Oe:fetch),function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.apply(void 0,t)}},Ae=function(t,o){var i=Se(o),a="undefined"==typeof Headers?je.exports.Headers:Headers;return function(o,c){return r(void 0,void 0,void 0,(function(){var r;return n(this,(function(n){return(r=new a(null==c?void 0:c.headers)).has("X-MICROCMS-API-KEY")||r.set("X-MICROCMS-API-KEY",t),[2,i(o,e(e({},c),{headers:r}))]}))}))}};t.createClient=function(t){var e=t.serviceDomain,o=t.apiKey,i=t.customFetch;if(!e||!o)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!we(e)||!we(o))throw new Error("parameter is not string");var a="https://".concat(e,".").concat("microcms.io","/api/").concat("v1"),c=function(t){var e=t.endpoint,c=t.contentId,u=t.queries,p=void 0===u?{}:u,s=t.method,f=t.customHeaders,l=t.customBody;return r(void 0,void 0,void 0,(function(){var t,r,u,y,d,h;return n(this,(function(n){switch(n.label){case 0:t=Ae(o,i),r=function(t){if(null===(e=t)||"object"!=typeof e)throw new Error("queries is not object");var e;return ve.stringify(t,{arrayFormat:"comma"})}(p),u="".concat(a,"/").concat(e).concat(c?"/".concat(c):"").concat(r?"?".concat(r):""),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t(u,{method:s||"GET",headers:f,body:l})];case 2:if(!(y=n.sent()).ok)throw new Error("fetch API response status: ".concat(y.status));return"DELETE"===s?[2]:[2,y.json()];case 3:if((d=n.sent()).data)throw d.data;if(null===(h=d.response)||void 0===h?void 0:h.data)throw d.response.data;return[2,Promise.reject(new Error("serviceDomain or endpoint may be wrong.\n Details: ".concat(d)))];case 4:return[2]}}))}))};return{get:function(t){var e=t.endpoint,o=t.contentId,i=t.queries,a=void 0===i?{}:i;return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,contentId:o,queries:a})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},getList:function(t){var e=t.endpoint,o=t.queries,i=void 0===o?{}:o;return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,queries:i})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},getListDetail:function(t){var e=t.endpoint,o=t.contentId,i=t.queries,a=void 0===i?{}:i;return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,contentId:o,queries:a})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},getObject:function(t){var e=t.endpoint,o=t.queries,i=void 0===o?{}:o;return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e?[4,c({endpoint:e,queries:i})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,t.sent()]}}))}))},create:function(t){var e=t.endpoint,o=t.contentId,i=t.content,a=t.isDraft,u=void 0!==a&&a;return r(void 0,void 0,void 0,(function(){var t,r,a,p;return n(this,(function(n){return e?(t=u?{status:"draft"}:{},r=o?"PUT":"POST",a={"Content-Type":"application/json"},p=JSON.stringify(i),[2,c({endpoint:e,contentId:o,queries:t,method:r,customHeaders:a,customBody:p})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},update:function(t){var e=t.endpoint,o=t.contentId,i=t.content;return r(void 0,void 0,void 0,(function(){var t,r;return n(this,(function(n){return e?("PATCH",t={"Content-Type":"application/json"},r=JSON.stringify(i),[2,c({endpoint:e,contentId:o,method:"PATCH",customHeaders:t,customBody:r})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},delete:function(t){var e=t.endpoint,o=t.contentId;return r(void 0,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e?o?("DELETE",[4,c({endpoint:e,contentId:o,method:"DELETE"})]):[2,Promise.reject(new Error("contentId is required"))]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return t.sent(),[2]}}))}))}}},Object.defineProperty(t,"__esModule",{value:!0})}));
|
package/dist/umd/types.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
export declare type Fetch = typeof fetch;
|
|
2
2
|
/**
|
|
3
3
|
* microCMS createClient params
|
|
4
4
|
*/
|
|
5
5
|
export interface MicroCMSClient {
|
|
6
6
|
serviceDomain: string;
|
|
7
7
|
apiKey: string;
|
|
8
|
+
customFetch?: Fetch;
|
|
8
9
|
}
|
|
9
10
|
declare type depthNumber = 1 | 2 | 3;
|
|
10
11
|
/**
|
|
@@ -70,7 +71,7 @@ export interface MakeRequest {
|
|
|
70
71
|
queries?: MicroCMSQueries & Record<string, any>;
|
|
71
72
|
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
72
73
|
customHeaders?: HeadersInit;
|
|
73
|
-
customBody?:
|
|
74
|
+
customBody?: string;
|
|
74
75
|
}
|
|
75
76
|
export interface GetRequest {
|
|
76
77
|
endpoint: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microcms-js-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "JavaScript SDK Client for microCMS.",
|
|
5
5
|
"main": "./dist/cjs/microcms-js-sdk.js",
|
|
6
6
|
"module": "./dist/esm/microcms-js-sdk.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"
|
|
32
|
+
"cross-fetch": "^3.1.5",
|
|
33
33
|
"qs": "^6.10.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
40
40
|
"@types/jest": "^28.1.6",
|
|
41
41
|
"@types/node": "^15.0.2",
|
|
42
|
-
"@types/node-fetch": "^2.5.10",
|
|
43
42
|
"@types/qs": "^6.9.6",
|
|
44
43
|
"@typescript-eslint/eslint-plugin": "^4.22.1",
|
|
45
44
|
"@typescript-eslint/parser": "^4.22.1",
|