microcms-js-sdk 1.3.0 → 2.2.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 +142 -12
- package/dist/cjs/createClient.d.ts +9 -6
- package/dist/cjs/microcms-js-sdk.js +2 -17
- package/dist/cjs/types.d.ts +25 -9
- package/dist/cjs/utils/constants.d.ts +2 -0
- package/dist/cjs/utils/isCheckValue.d.ts +6 -6
- package/dist/esm/createClient.d.ts +9 -6
- package/dist/esm/microcms-js-sdk.js +2 -2
- package/dist/esm/types.d.ts +25 -9
- package/dist/esm/utils/constants.d.ts +2 -0
- package/dist/esm/utils/isCheckValue.d.ts +6 -6
- package/dist/umd/createClient.d.ts +9 -6
- package/dist/umd/microcms-js-sdk.js +1 -1
- package/dist/umd/types.d.ts +25 -9
- package/dist/umd/utils/constants.d.ts +2 -0
- package/dist/umd/utils/isCheckValue.d.ts +6 -6
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -34,7 +34,6 @@ import { createClient } from 'microcms-js-sdk'; //ES6
|
|
|
34
34
|
const client = createClient({
|
|
35
35
|
serviceDomain: "YOUR_DOMAIN", // YOUR_DOMAIN is the XXXX part of XXXX.microcms.io
|
|
36
36
|
apiKey: "YOUR_API_KEY",
|
|
37
|
-
globalDraftKey: "YOUR_GLOBAL_DRAFT_KEY", // If need
|
|
38
37
|
});
|
|
39
38
|
```
|
|
40
39
|
|
|
@@ -48,7 +47,6 @@ const { createClient } = microcms;
|
|
|
48
47
|
const client = createClient({
|
|
49
48
|
serviceDomain: "YOUR_DOMAIN", // YOUR_DOMAIN is the XXXX part of XXXX.microcms.io
|
|
50
49
|
apiKey: "YOUR_API_KEY",
|
|
51
|
-
globalDraftKey: "YOUR_GLOBAL_DRAFT_KEY", // If need
|
|
52
50
|
});
|
|
53
51
|
</script>
|
|
54
52
|
```
|
|
@@ -60,10 +58,9 @@ client
|
|
|
60
58
|
.get({
|
|
61
59
|
endpoint: 'endpoint',
|
|
62
60
|
queries: { limit: 20, filters: 'createdAt[greater_than]2021' },
|
|
63
|
-
useGlobalDraftKey: false, // This is an option if your have set the globalDraftKey. Default value true.
|
|
64
61
|
})
|
|
65
62
|
.then((res) => console.log(res))
|
|
66
|
-
.catch((err) => console.
|
|
63
|
+
.catch((err) => console.error(err));
|
|
67
64
|
|
|
68
65
|
client
|
|
69
66
|
.get({
|
|
@@ -72,7 +69,7 @@ client
|
|
|
72
69
|
queries: { fields: 'title,publishedAt' },
|
|
73
70
|
})
|
|
74
71
|
.then((res) => console.log(res))
|
|
75
|
-
.catch((err) => console.
|
|
72
|
+
.catch((err) => console.error(err));
|
|
76
73
|
```
|
|
77
74
|
|
|
78
75
|
And, Api corresponding to each content are also available. example.
|
|
@@ -84,7 +81,7 @@ client
|
|
|
84
81
|
endpoint: 'endpoint',
|
|
85
82
|
})
|
|
86
83
|
.then((res) => console.log(res))
|
|
87
|
-
.catch((err) => console.
|
|
84
|
+
.catch((err) => console.error(err));
|
|
88
85
|
|
|
89
86
|
// Get list API detail data
|
|
90
87
|
client
|
|
@@ -93,7 +90,7 @@ client
|
|
|
93
90
|
contentId: 'contentId',
|
|
94
91
|
})
|
|
95
92
|
.then((res) => console.log(res))
|
|
96
|
-
.catch((err) => console.
|
|
93
|
+
.catch((err) => console.error(err));
|
|
97
94
|
|
|
98
95
|
// Get object API data
|
|
99
96
|
client
|
|
@@ -101,7 +98,99 @@ client
|
|
|
101
98
|
endpoint: 'endpoint',
|
|
102
99
|
})
|
|
103
100
|
.then((res) => console.log(res))
|
|
104
|
-
.catch((err) => console.
|
|
101
|
+
.catch((err) => console.error(err));
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
#### WRITE API
|
|
105
|
+
|
|
106
|
+
The following is how to use the write system when making a request to the write system API.
|
|
107
|
+
|
|
108
|
+
```javascript
|
|
109
|
+
// Create content
|
|
110
|
+
client
|
|
111
|
+
.create({
|
|
112
|
+
endpoint: 'endpoint',
|
|
113
|
+
content: {
|
|
114
|
+
title: 'title',
|
|
115
|
+
body: 'body',
|
|
116
|
+
},
|
|
117
|
+
})
|
|
118
|
+
.then((res) => console.log(res.id))
|
|
119
|
+
.catch((err) => console.error(err));
|
|
120
|
+
|
|
121
|
+
// Create content with specified ID
|
|
122
|
+
client
|
|
123
|
+
.create({
|
|
124
|
+
endpoint: 'endpoint',
|
|
125
|
+
contentId: 'contentId',
|
|
126
|
+
content: {
|
|
127
|
+
title: 'title',
|
|
128
|
+
body: 'body',
|
|
129
|
+
},
|
|
130
|
+
})
|
|
131
|
+
.then((res) => console.log(res.id))
|
|
132
|
+
.catch((err) => console.error(err));
|
|
133
|
+
// Create draft content
|
|
134
|
+
client
|
|
135
|
+
.create({
|
|
136
|
+
endpoint: 'endpoint',
|
|
137
|
+
content: {
|
|
138
|
+
title: 'title',
|
|
139
|
+
body: 'body',
|
|
140
|
+
},
|
|
141
|
+
// Available with microCMS paid plans
|
|
142
|
+
// https://microcms.io/pricing
|
|
143
|
+
isDraft: true,
|
|
144
|
+
})
|
|
145
|
+
.then((res) => console.log(res.id))
|
|
146
|
+
.catch((err) => console.error(err));
|
|
147
|
+
|
|
148
|
+
// Create draft content with specified ID
|
|
149
|
+
client
|
|
150
|
+
.create({
|
|
151
|
+
endpoint: 'endpoint',
|
|
152
|
+
contentId: 'contentId',
|
|
153
|
+
content: {
|
|
154
|
+
title: 'title',
|
|
155
|
+
body: 'body',
|
|
156
|
+
},
|
|
157
|
+
// Available with microCMS paid plans
|
|
158
|
+
// https://microcms.io/pricing
|
|
159
|
+
isDraft: true,
|
|
160
|
+
})
|
|
161
|
+
.then((res) => console.log(res.id))
|
|
162
|
+
.catch((err) => console.error(err));
|
|
163
|
+
|
|
164
|
+
// Update content
|
|
165
|
+
client
|
|
166
|
+
.update({
|
|
167
|
+
endpoint: 'endpoint',
|
|
168
|
+
contentId: 'contentId',
|
|
169
|
+
content: {
|
|
170
|
+
title: 'title',
|
|
171
|
+
},
|
|
172
|
+
})
|
|
173
|
+
.then((res) => console.log(res.id))
|
|
174
|
+
.catch((err) => console.error(err));
|
|
175
|
+
|
|
176
|
+
// Update object form content
|
|
177
|
+
client
|
|
178
|
+
.update({
|
|
179
|
+
endpoint: 'endpoint',
|
|
180
|
+
content: {
|
|
181
|
+
title: 'title',
|
|
182
|
+
},
|
|
183
|
+
})
|
|
184
|
+
.then((res) => console.log(res.id))
|
|
185
|
+
.catch((err) => console.error(err));
|
|
186
|
+
|
|
187
|
+
// Delete content
|
|
188
|
+
client
|
|
189
|
+
.delete({
|
|
190
|
+
endpoint: 'endpoint',
|
|
191
|
+
contentId: 'contentId',
|
|
192
|
+
})
|
|
193
|
+
.catch((err) => console.error(err));
|
|
105
194
|
```
|
|
106
195
|
|
|
107
196
|
### TypeScript
|
|
@@ -131,8 +220,8 @@ client.getList<Content>({ //other })
|
|
|
131
220
|
* id: string;
|
|
132
221
|
* createdAt: string;
|
|
133
222
|
* updatedAt: string;
|
|
134
|
-
* publishedAt
|
|
135
|
-
* revisedAt
|
|
223
|
+
* publishedAt?: string;
|
|
224
|
+
* revisedAt?: string;
|
|
136
225
|
* text: string; // This is Content type.
|
|
137
226
|
* }
|
|
138
227
|
*/
|
|
@@ -143,14 +232,55 @@ client.getListDetail<Content>({ //other })
|
|
|
143
232
|
* {
|
|
144
233
|
* createdAt: string;
|
|
145
234
|
* updatedAt: string;
|
|
146
|
-
* publishedAt
|
|
147
|
-
* revisedAt
|
|
235
|
+
* publishedAt?: string;
|
|
236
|
+
* revisedAt?: string;
|
|
148
237
|
* text: string; // This is Content type.
|
|
149
238
|
* }
|
|
150
239
|
*/
|
|
151
240
|
client.getObject<Content>({ //other })
|
|
152
241
|
```
|
|
153
242
|
|
|
243
|
+
Write functions can also be performed type-safely.
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
type Content = {
|
|
247
|
+
title: string
|
|
248
|
+
body?: string
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
client.create<Content>({
|
|
252
|
+
endpoint: 'endpoint',
|
|
253
|
+
// Since `content` will be of type `Content`, no required fields will be missed.
|
|
254
|
+
content: {
|
|
255
|
+
title: 'title',
|
|
256
|
+
body: 'body',
|
|
257
|
+
},
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
client.update<Content>({
|
|
261
|
+
endpoint: 'endpoint',
|
|
262
|
+
// The `content` will be of type `Partial<Content>`, so you can enter only the items needed for the update.
|
|
263
|
+
content: {
|
|
264
|
+
body: 'body',
|
|
265
|
+
},
|
|
266
|
+
})
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Tips
|
|
270
|
+
|
|
271
|
+
### Separate API keys for read and write
|
|
272
|
+
|
|
273
|
+
```javascript
|
|
274
|
+
const readClient = createClient({
|
|
275
|
+
serviceDomain: 'serviceDomain',
|
|
276
|
+
apiKey: 'readApiKey',
|
|
277
|
+
})
|
|
278
|
+
const writeClient = createClient({
|
|
279
|
+
serviceDomain: 'serviceDomain',
|
|
280
|
+
apiKey: 'writeApiKey',
|
|
281
|
+
})
|
|
282
|
+
```
|
|
283
|
+
|
|
154
284
|
# LICENSE
|
|
155
285
|
|
|
156
286
|
Apache-2.0
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetObjectRequest, MicroCMSListResponse, MicroCMSListContent, MicroCMSObjectContent } from './types';
|
|
1
|
+
import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetObjectRequest, WriteApiRequestResult, CreateRequest, MicroCMSListResponse, MicroCMSListContent, MicroCMSObjectContent, UpdateRequest, DeleteRequest } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Initialize SDK Client
|
|
4
4
|
*/
|
|
5
|
-
export declare const createClient: ({ serviceDomain, apiKey
|
|
6
|
-
get: <T = any>({ endpoint, contentId, queries,
|
|
7
|
-
getList: <T_1 = any>({ endpoint, queries,
|
|
8
|
-
getListDetail: <T_2 = any>({ endpoint, contentId, queries,
|
|
9
|
-
getObject: <T_3 = any>({ endpoint, queries,
|
|
5
|
+
export declare const createClient: ({ serviceDomain, apiKey }: MicroCMSClient) => {
|
|
6
|
+
get: <T = any>({ endpoint, contentId, queries, }: GetRequest) => Promise<T>;
|
|
7
|
+
getList: <T_1 = any>({ endpoint, queries, }: GetListRequest) => Promise<MicroCMSListResponse<T_1>>;
|
|
8
|
+
getListDetail: <T_2 = any>({ endpoint, contentId, queries, }: GetListDetailRequest) => Promise<T_2 & import("./types").MicroCMSContentId & import("./types").MicroCMSDate>;
|
|
9
|
+
getObject: <T_3 = any>({ endpoint, queries, }: GetObjectRequest) => Promise<T_3 & import("./types").MicroCMSDate>;
|
|
10
|
+
create: <T_4 extends Record<string | number, any>>({ endpoint, contentId, content, isDraft, }: CreateRequest<T_4>) => Promise<WriteApiRequestResult>;
|
|
11
|
+
update: <T_5 extends Record<string | number, any>>({ endpoint, contentId, content, }: UpdateRequest<T_5>) => Promise<WriteApiRequestResult>;
|
|
12
|
+
delete: ({ endpoint, contentId, }: DeleteRequest) => Promise<void>;
|
|
10
13
|
};
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("node-fetch"),
|
|
2
|
-
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */
|
|
16
|
-
function i(e,r,t,n){return new(t||(t=Promise))((function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function u(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(a,u)}s((n=n.apply(e,r||[])).next())}))}function a(e,r){var t,n,o,i,a={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(;a;)try{if(t=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=r.call(e,a)}catch(e){i=[6,e],n=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 u=function(e){return null!==e&&"string"==typeof e};exports.createClient=function(e){var r=e.serviceDomain,t=e.apiKey,s=e.globalDraftKey;if(!r||!t)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!u(r)||!u(t))throw new Error("parameter is not string");var c="https://"+r+".microcms.io/api/v1",l=function(e){var r=e.endpoint,u=e.contentId,l=e.queries,f=void 0===l?{}:l,d=e.useGlobalDraftKey,v=void 0===d||d;return i(void 0,void 0,void 0,(function(){var e,i,l,d,p,h;return a(this,(function(a){switch(a.label){case 0:e=function(e){if(null===(r=e)||"object"!=typeof r)throw new Error("queries is not object");var r;return o.default.stringify(e,{arrayFormat:"comma"})}(f),i={headers:{"X-API-KEY":t}},s&&v&&Object.assign(i.headers,{"X-GLOBAL-DRAFT-KEY":s}),l=c+"/"+r+(u?"/"+u:"")+(e?"?"+e:""),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,n.default(l,i)];case 2:if(!(d=a.sent()).ok)throw new Error("fetch API response status: "+d.status);return[2,d.json()];case 3:if((p=a.sent()).data)throw p.data;if(null===(h=p.response)||void 0===h?void 0:h.data)throw p.response.data;return[2,Promise.reject(new Error("serviceDomain or endpoint may be wrong.\n Details: "+p))];case 4:return[2]}}))}))};return{get:function(e){var r=e.endpoint,t=e.contentId,n=e.queries,o=void 0===n?{}:n,u=e.useGlobalDraftKey;return i(void 0,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return r?[4,l({endpoint:r,contentId:t,queries:o,useGlobalDraftKey:u})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getList:function(e){var r=e.endpoint,t=e.queries,n=void 0===t?{}:t,o=e.useGlobalDraftKey;return i(void 0,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return r?[4,l({endpoint:r,queries:n,useGlobalDraftKey:o})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getListDetail:function(e){var r=e.endpoint,t=e.contentId,n=e.queries,o=void 0===n?{}:n,u=e.useGlobalDraftKey;return i(void 0,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return r?[4,l({endpoint:r,contentId:t,queries:o,useGlobalDraftKey:u})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getObject:function(e){var r=e.endpoint,t=e.queries,n=void 0===t?{}:t,o=e.useGlobalDraftKey;return i(void 0,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return r?[4,l({endpoint:r,queries:n,useGlobalDraftKey:o})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))}}};
|
|
17
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWljcm9jbXMtanMtc2RrLmpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OyJ9
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("node-fetch"),t=require("qs");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};exports.createClient=function(e){var t=e.serviceDomain,n=e.apiKey;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 s="https://".concat(t,".").concat("microcms.io","/api/").concat("v1"),d=function(e){var t=e.endpoint,a=e.contentId,d=e.queries,f=void 0===d?{}:d,l=e.method,p=e.customHeaders,v=e.customBody;return c(void 0,void 0,void 0,(function(){var e,c,d,h,w,y;return u(this,(function(u){switch(u.label){case 0:e=function(e){if(null===(t=e)||"object"!=typeof t)throw new Error("queries is not object");var t;return o.default.stringify(e,{arrayFormat:"comma"})}(f),c={headers:i(i({},p),{"X-MICROCMS-API-KEY":n}),body:v,method:l},d="".concat(s,"/").concat(t).concat(a?"/".concat(a):"").concat(e?"?".concat(e):""),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,r.default(d,c)];case 2:if(!(h=u.sent()).ok)throw new Error("fetch API response status: ".concat(h.status));return[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,d({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,d({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,d({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,d({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,d({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,d({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,d({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
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWljcm9jbXMtanMtc2RrLmpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { BodyInit, HeadersInit } from 'node-fetch';
|
|
1
2
|
/**
|
|
2
3
|
* microCMS createClient params
|
|
3
4
|
*/
|
|
4
5
|
export interface MicroCMSClient {
|
|
5
6
|
serviceDomain: string;
|
|
6
7
|
apiKey: string;
|
|
7
|
-
globalDraftKey?: string;
|
|
8
8
|
}
|
|
9
9
|
declare type depthNumber = 1 | 2 | 3;
|
|
10
10
|
/**
|
|
@@ -36,8 +36,8 @@ export interface MicroCMSContentId {
|
|
|
36
36
|
export interface MicroCMSDate {
|
|
37
37
|
createdAt: string;
|
|
38
38
|
updatedAt: string;
|
|
39
|
-
publishedAt
|
|
40
|
-
revisedAt
|
|
39
|
+
publishedAt?: string;
|
|
40
|
+
revisedAt?: string;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* microCMS image
|
|
@@ -67,29 +67,45 @@ export declare type MicroCMSObjectContent = MicroCMSDate;
|
|
|
67
67
|
export interface MakeRequest {
|
|
68
68
|
endpoint: string;
|
|
69
69
|
contentId?: string;
|
|
70
|
-
queries?: MicroCMSQueries
|
|
71
|
-
|
|
70
|
+
queries?: MicroCMSQueries & Record<string, any>;
|
|
71
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
72
|
+
customHeaders?: HeadersInit;
|
|
73
|
+
customBody?: BodyInit;
|
|
72
74
|
}
|
|
73
75
|
export interface GetRequest {
|
|
74
76
|
endpoint: string;
|
|
75
77
|
contentId?: string;
|
|
76
78
|
queries?: MicroCMSQueries;
|
|
77
|
-
useGlobalDraftKey?: boolean;
|
|
78
79
|
}
|
|
79
80
|
export interface GetListDetailRequest {
|
|
80
81
|
endpoint: string;
|
|
81
82
|
contentId: string;
|
|
82
83
|
queries?: MicroCMSQueries;
|
|
83
|
-
useGlobalDraftKey?: boolean;
|
|
84
84
|
}
|
|
85
85
|
export interface GetListRequest {
|
|
86
86
|
endpoint: string;
|
|
87
87
|
queries?: MicroCMSQueries;
|
|
88
|
-
useGlobalDraftKey?: boolean;
|
|
89
88
|
}
|
|
90
89
|
export interface GetObjectRequest {
|
|
91
90
|
endpoint: string;
|
|
92
91
|
queries?: MicroCMSQueries;
|
|
93
|
-
|
|
92
|
+
}
|
|
93
|
+
export interface WriteApiRequestResult {
|
|
94
|
+
id: string;
|
|
95
|
+
}
|
|
96
|
+
export interface CreateRequest<T> {
|
|
97
|
+
endpoint: string;
|
|
98
|
+
contentId?: string;
|
|
99
|
+
content: T;
|
|
100
|
+
isDraft?: boolean;
|
|
101
|
+
}
|
|
102
|
+
export interface UpdateRequest<T> {
|
|
103
|
+
endpoint: string;
|
|
104
|
+
contentId?: string;
|
|
105
|
+
content: Partial<T>;
|
|
106
|
+
}
|
|
107
|
+
export interface DeleteRequest {
|
|
108
|
+
endpoint: string;
|
|
109
|
+
contentId: string;
|
|
94
110
|
}
|
|
95
111
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Check object
|
|
3
3
|
*
|
|
4
|
-
* @param {
|
|
5
|
-
* @
|
|
4
|
+
* @param {unknown} value
|
|
5
|
+
* @returns {boolean}
|
|
6
6
|
*/
|
|
7
|
-
export declare const isObject:
|
|
7
|
+
export declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
8
8
|
/**
|
|
9
9
|
* Check string
|
|
10
10
|
*
|
|
11
|
-
* @param {
|
|
12
|
-
* @
|
|
11
|
+
* @param {unknown} value
|
|
12
|
+
* @returns {boolean}
|
|
13
13
|
*/
|
|
14
|
-
export declare const isString: (value:
|
|
14
|
+
export declare const isString: (value: unknown) => value is string;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetObjectRequest, MicroCMSListResponse, MicroCMSListContent, MicroCMSObjectContent } from './types';
|
|
1
|
+
import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetObjectRequest, WriteApiRequestResult, CreateRequest, MicroCMSListResponse, MicroCMSListContent, MicroCMSObjectContent, UpdateRequest, DeleteRequest } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Initialize SDK Client
|
|
4
4
|
*/
|
|
5
|
-
export declare const createClient: ({ serviceDomain, apiKey
|
|
6
|
-
get: <T = any>({ endpoint, contentId, queries,
|
|
7
|
-
getList: <T_1 = any>({ endpoint, queries,
|
|
8
|
-
getListDetail: <T_2 = any>({ endpoint, contentId, queries,
|
|
9
|
-
getObject: <T_3 = any>({ endpoint, queries,
|
|
5
|
+
export declare const createClient: ({ serviceDomain, apiKey }: MicroCMSClient) => {
|
|
6
|
+
get: <T = any>({ endpoint, contentId, queries, }: GetRequest) => Promise<T>;
|
|
7
|
+
getList: <T_1 = any>({ endpoint, queries, }: GetListRequest) => Promise<MicroCMSListResponse<T_1>>;
|
|
8
|
+
getListDetail: <T_2 = any>({ endpoint, contentId, queries, }: GetListDetailRequest) => Promise<T_2 & import("./types").MicroCMSContentId & import("./types").MicroCMSDate>;
|
|
9
|
+
getObject: <T_3 = any>({ endpoint, queries, }: GetObjectRequest) => Promise<T_3 & import("./types").MicroCMSDate>;
|
|
10
|
+
create: <T_4 extends Record<string | number, any>>({ endpoint, contentId, content, isDraft, }: CreateRequest<T_4>) => Promise<WriteApiRequestResult>;
|
|
11
|
+
update: <T_5 extends Record<string | number, any>>({ endpoint, contentId, content, }: UpdateRequest<T_5>) => Promise<WriteApiRequestResult>;
|
|
12
|
+
delete: ({ endpoint, contentId, }: DeleteRequest) => Promise<void>;
|
|
10
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from"node-fetch";import
|
|
1
|
+
import e from"node-fetch";import n from"qs";
|
|
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
|
-
***************************************************************************** */function t(e,r,t,
|
|
15
|
+
***************************************************************************** */var t=function(){return(t=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 r(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 o(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 i=function(e){return"string"==typeof e},c=function(c){var u=c.serviceDomain,a=c.apiKey;if(!u||!a)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!i(u)||!i(a))throw new Error("parameter is not string");var s="https://".concat(u,".").concat("microcms.io","/api/").concat("v1"),d=function(i){var c=i.endpoint,u=i.contentId,d=i.queries,f=void 0===d?{}:d,p=i.method,l=i.customHeaders,v=i.customBody;return r(void 0,void 0,void 0,(function(){var r,i,d,h,m,w;return o(this,(function(o){switch(o.label){case 0:r=function(e){if(null===(t=e)||"object"!=typeof t)throw new Error("queries is not object");var t;return n.stringify(e,{arrayFormat:"comma"})}(f),i={headers:t(t({},l),{"X-MICROCMS-API-KEY":a}),body:v,method:p},d="".concat(s,"/").concat(c).concat(u?"/".concat(u):"").concat(r?"?".concat(r):""),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,e(d,i)];case 2:if(!(h=o.sent()).ok)throw new Error("fetch API response status: ".concat(h.status));return[2,h.json()];case 3:if((m=o.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,i=e.queries,c=void 0===i?{}:i;return r(void 0,void 0,void 0,(function(){return o(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,i=void 0===t?{}:t;return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return n?[4,d({endpoint:n,queries:i})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getListDetail:function(e){var n=e.endpoint,t=e.contentId,i=e.queries,c=void 0===i?{}:i;return r(void 0,void 0,void 0,(function(){return o(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,i=void 0===t?{}:t;return r(void 0,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return n?[4,d({endpoint:n,queries:i})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},create:function(e){var n=e.endpoint,t=e.contentId,i=e.content,c=e.isDraft,u=void 0!==c&&c;return r(void 0,void 0,void 0,(function(){var e,r,c,a;return o(this,(function(o){return n?(e=u?{status:"draft"}:{},r=t?"PUT":"POST",c={"Content-Type":"application/json"},a=JSON.stringify(i),[2,d({endpoint:n,contentId:t,queries:e,method:r,customHeaders:c,customBody:a})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},update:function(e){var n=e.endpoint,t=e.contentId,i=e.content;return r(void 0,void 0,void 0,(function(){var e,r;return o(this,(function(o){return n?("PATCH",e={"Content-Type":"application/json"},r=JSON.stringify(i),[2,d({endpoint:n,contentId:t,method:"PATCH",customHeaders:e,customBody:r})]):[2,Promise.reject(new Error("endpoint is required"))]}))}))},delete:function(e){var n=e.endpoint,t=e.contentId;return r(void 0,void 0,void 0,(function(){return o(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{c as createClient};
|
|
16
16
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWljcm9jbXMtanMtc2RrLmpzIiwic291cmNlcyI6W10sInNvdXJjZXNDb250ZW50IjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7In0=
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { BodyInit, HeadersInit } from 'node-fetch';
|
|
1
2
|
/**
|
|
2
3
|
* microCMS createClient params
|
|
3
4
|
*/
|
|
4
5
|
export interface MicroCMSClient {
|
|
5
6
|
serviceDomain: string;
|
|
6
7
|
apiKey: string;
|
|
7
|
-
globalDraftKey?: string;
|
|
8
8
|
}
|
|
9
9
|
declare type depthNumber = 1 | 2 | 3;
|
|
10
10
|
/**
|
|
@@ -36,8 +36,8 @@ export interface MicroCMSContentId {
|
|
|
36
36
|
export interface MicroCMSDate {
|
|
37
37
|
createdAt: string;
|
|
38
38
|
updatedAt: string;
|
|
39
|
-
publishedAt
|
|
40
|
-
revisedAt
|
|
39
|
+
publishedAt?: string;
|
|
40
|
+
revisedAt?: string;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* microCMS image
|
|
@@ -67,29 +67,45 @@ export declare type MicroCMSObjectContent = MicroCMSDate;
|
|
|
67
67
|
export interface MakeRequest {
|
|
68
68
|
endpoint: string;
|
|
69
69
|
contentId?: string;
|
|
70
|
-
queries?: MicroCMSQueries
|
|
71
|
-
|
|
70
|
+
queries?: MicroCMSQueries & Record<string, any>;
|
|
71
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
72
|
+
customHeaders?: HeadersInit;
|
|
73
|
+
customBody?: BodyInit;
|
|
72
74
|
}
|
|
73
75
|
export interface GetRequest {
|
|
74
76
|
endpoint: string;
|
|
75
77
|
contentId?: string;
|
|
76
78
|
queries?: MicroCMSQueries;
|
|
77
|
-
useGlobalDraftKey?: boolean;
|
|
78
79
|
}
|
|
79
80
|
export interface GetListDetailRequest {
|
|
80
81
|
endpoint: string;
|
|
81
82
|
contentId: string;
|
|
82
83
|
queries?: MicroCMSQueries;
|
|
83
|
-
useGlobalDraftKey?: boolean;
|
|
84
84
|
}
|
|
85
85
|
export interface GetListRequest {
|
|
86
86
|
endpoint: string;
|
|
87
87
|
queries?: MicroCMSQueries;
|
|
88
|
-
useGlobalDraftKey?: boolean;
|
|
89
88
|
}
|
|
90
89
|
export interface GetObjectRequest {
|
|
91
90
|
endpoint: string;
|
|
92
91
|
queries?: MicroCMSQueries;
|
|
93
|
-
|
|
92
|
+
}
|
|
93
|
+
export interface WriteApiRequestResult {
|
|
94
|
+
id: string;
|
|
95
|
+
}
|
|
96
|
+
export interface CreateRequest<T> {
|
|
97
|
+
endpoint: string;
|
|
98
|
+
contentId?: string;
|
|
99
|
+
content: T;
|
|
100
|
+
isDraft?: boolean;
|
|
101
|
+
}
|
|
102
|
+
export interface UpdateRequest<T> {
|
|
103
|
+
endpoint: string;
|
|
104
|
+
contentId?: string;
|
|
105
|
+
content: Partial<T>;
|
|
106
|
+
}
|
|
107
|
+
export interface DeleteRequest {
|
|
108
|
+
endpoint: string;
|
|
109
|
+
contentId: string;
|
|
94
110
|
}
|
|
95
111
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Check object
|
|
3
3
|
*
|
|
4
|
-
* @param {
|
|
5
|
-
* @
|
|
4
|
+
* @param {unknown} value
|
|
5
|
+
* @returns {boolean}
|
|
6
6
|
*/
|
|
7
|
-
export declare const isObject:
|
|
7
|
+
export declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
8
8
|
/**
|
|
9
9
|
* Check string
|
|
10
10
|
*
|
|
11
|
-
* @param {
|
|
12
|
-
* @
|
|
11
|
+
* @param {unknown} value
|
|
12
|
+
* @returns {boolean}
|
|
13
13
|
*/
|
|
14
|
-
export declare const isString: (value:
|
|
14
|
+
export declare const isString: (value: unknown) => value is string;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetObjectRequest, MicroCMSListResponse, MicroCMSListContent, MicroCMSObjectContent } from './types';
|
|
1
|
+
import { MicroCMSClient, GetRequest, GetListRequest, GetListDetailRequest, GetObjectRequest, WriteApiRequestResult, CreateRequest, MicroCMSListResponse, MicroCMSListContent, MicroCMSObjectContent, UpdateRequest, DeleteRequest } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Initialize SDK Client
|
|
4
4
|
*/
|
|
5
|
-
export declare const createClient: ({ serviceDomain, apiKey
|
|
6
|
-
get: <T = any>({ endpoint, contentId, queries,
|
|
7
|
-
getList: <T_1 = any>({ endpoint, queries,
|
|
8
|
-
getListDetail: <T_2 = any>({ endpoint, contentId, queries,
|
|
9
|
-
getObject: <T_3 = any>({ endpoint, queries,
|
|
5
|
+
export declare const createClient: ({ serviceDomain, apiKey }: MicroCMSClient) => {
|
|
6
|
+
get: <T = any>({ endpoint, contentId, queries, }: GetRequest) => Promise<T>;
|
|
7
|
+
getList: <T_1 = any>({ endpoint, queries, }: GetListRequest) => Promise<MicroCMSListResponse<T_1>>;
|
|
8
|
+
getListDetail: <T_2 = any>({ endpoint, contentId, queries, }: GetListDetailRequest) => Promise<T_2 & import("./types").MicroCMSContentId & import("./types").MicroCMSDate>;
|
|
9
|
+
getObject: <T_3 = any>({ endpoint, queries, }: GetObjectRequest) => Promise<T_3 & import("./types").MicroCMSDate>;
|
|
10
|
+
create: <T_4 extends Record<string | number, any>>({ endpoint, contentId, content, isDraft, }: CreateRequest<T_4>) => Promise<WriteApiRequestResult>;
|
|
11
|
+
update: <T_5 extends Record<string | number, any>>({ endpoint, contentId, content, }: UpdateRequest<T_5>) => Promise<WriteApiRequestResult>;
|
|
12
|
+
delete: ({ endpoint, contentId, }: DeleteRequest) => Promise<void>;
|
|
10
13
|
};
|
|
@@ -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
|
-
***************************************************************************** */function t(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{p(o.next(e))}catch(e){i(e)}}function c(e){try{p(o.throw(e))}catch(e){i(e)}}function p(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,c)}p((o=o.apply(e,t||[])).next())}))}function r(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[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,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=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 o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})})),t}var n={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}(n,n.exports);var i,a=n.exports,c="undefined"!=typeof Symbol&&Symbol,p=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 o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(e,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0},u="Function.prototype.bind called on incompatible ",l=Array.prototype.slice,f=Object.prototype.toString,y="[object Function]",s=function(e){var t=this;if("function"!=typeof t||f.call(t)!==y)throw new TypeError(u+t);for(var r,o=l.call(arguments,1),n=function(){if(this instanceof r){var n=t.apply(this,o.concat(l.call(arguments)));return Object(n)===n?n:this}return t.apply(e,o.concat(l.call(arguments)))},i=Math.max(0,t.length-o.length),a=[],c=0;c<i;c++)a.push("$"+c);if(r=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(n),t.prototype){var p=function(){};p.prototype=t.prototype,r.prototype=new p,p.prototype=null}return r},d=Function.prototype.bind||s,b=d.call(Function.call,Object.prototype.hasOwnProperty),h=SyntaxError,g=Function,m=TypeError,v=function(e){try{return g('"use strict"; return ('+e+").constructor;")()}catch(e){}},j=Object.getOwnPropertyDescriptor;if(j)try{j({},"")}catch(e){j=null}var S=function(){throw new m},w=j?function(){try{return S}catch(e){try{return j(arguments,"callee").get}catch(e){return S}}}():S,O="function"==typeof c&&"function"==typeof Symbol&&"symbol"==typeof c("foo")&&"symbol"==typeof Symbol("bar")&&p(),A=Object.getPrototypeOf||function(e){return e.__proto__},P={},E="undefined"==typeof Uint8Array?i:A(Uint8Array),x={"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":O?A([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":g,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":O?A(A([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&O?A((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&O?A((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":O?A(""[Symbol.iterator]()):i,"%Symbol%":O?Symbol:i,"%SyntaxError%":h,"%ThrowTypeError%":w,"%TypedArray%":E,"%TypeError%":m,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet},k=function e(t){var r;if("%AsyncFunction%"===t)r=v("async function () {}");else if("%GeneratorFunction%"===t)r=v("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=v("async function* () {}");else if("%AsyncGenerator%"===t){var o=e("%AsyncGeneratorFunction%");o&&(r=o.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&(r=A(n.prototype))}return x[t]=r,r},I={"%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"]},F=d,R=b,D=F.call(Function.call,Array.prototype.concat),N=F.call(Function.apply,Array.prototype.splice),M=F.call(Function.call,String.prototype.replace),U=F.call(Function.call,String.prototype.slice),_=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,C=/\\(\\)?/g,T=function(e){var t=U(e,0,1),r=U(e,-1);if("%"===t&&"%"!==r)throw new h("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new h("invalid intrinsic syntax, expected opening `%`");var o=[];return M(e,_,(function(e,t,r,n){o[o.length]=r?M(n,C,"$1"):t||e})),o},W=function(e,t){var r,o=e;if(R(I,o)&&(o="%"+(r=I[o])[0]+"%"),R(x,o)){var n=x[o];if(n===P&&(n=k(o)),void 0===n&&!t)throw new m("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:o,value:n}}throw new h("intrinsic "+e+" does not exist!")},L=function(e,t){if("string"!=typeof e||0===e.length)throw new m("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new m('"allowMissing" argument must be a boolean');var r=T(e),o=r.length>0?r[0]:"",n=W("%"+o+"%",t),i=n.name,a=n.value,c=!1,p=n.alias;p&&(o=p[0],N(r,D([0,1],p)));for(var u=1,l=!0;u<r.length;u+=1){var f=r[u],y=U(f,0,1),s=U(f,-1);if(('"'===y||"'"===y||"`"===y||'"'===s||"'"===s||"`"===s)&&y!==s)throw new h("property names with quotes must have matching quotes");if("constructor"!==f&&l||(c=!0),R(x,i="%"+(o+="."+f)+"%"))a=x[i];else if(null!=a){if(!(f in a)){if(!t)throw new m("base intrinsic for "+e+" exists, but the property is not available.");return}if(j&&u+1>=r.length){var d=j(a,f);a=(l=!!d)&&"get"in d&&!("originalValue"in d.get)?d.get:a[f]}else l=R(a,f),a=a[f];l&&!c&&(x[i]=a)}}return a},B={exports:{}};!function(e){var t=d,r=L,o=r("%Function.prototype.apply%"),n=r("%Function.prototype.call%"),i=r("%Reflect.apply%",!0)||t.call(n,o),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,n,arguments);if(a&&c){var o=a(r,"length");o.configurable&&c(r,"length",{value:1+p(0,e.length-(arguments.length-1))})}return r};var u=function(){return i(t,o,arguments)};c?c(e.exports,"apply",{value:u}):e.exports.apply=u}(B);var q=L,G=B.exports,H=G(q("String.prototype.indexOf")),K=o(Object.freeze({__proto__:null,default:{}})),z="function"==typeof Map&&Map.prototype,V=Object.getOwnPropertyDescriptor&&z?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Q=z&&V&&"function"==typeof V.get?V.get:null,J=z&&Map.prototype.forEach,$="function"==typeof Set&&Set.prototype,X=Object.getOwnPropertyDescriptor&&$?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Y=$&&X&&"function"==typeof X.get?X.get:null,Z=$&&Set.prototype.forEach,ee="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,te="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,re="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,oe=Boolean.prototype.valueOf,ne=Object.prototype.toString,ie=Function.prototype.toString,ae=String.prototype.match,ce="function"==typeof BigInt?BigInt.prototype.valueOf:null,pe=Object.getOwnPropertySymbols,ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,le=Object.prototype.propertyIsEnumerable,fe=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),ye=K.custom,se=ye&&me(ye)?ye:null,de="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag?Symbol.toStringTag:null;function be(e,t,r){var o="double"===(r.quoteStyle||t)?'"':"'";return o+e+o}function he(e){return String(e).replace(/"/g,""")}function ge(e){return!("[object Array]"!==Se(e)||de&&"object"==typeof e&&de in e)}function me(e){if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!ue)return!1;try{return ue.call(e),!0}catch(e){}return!1}var ve=Object.prototype.hasOwnProperty||function(e){return e in this};function je(e,t){return ve.call(e,t)}function Se(e){return ne.call(e)}function we(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,o=e.length;r<o;r++)if(e[r]===t)return r;return-1}function Oe(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return Oe(e.slice(0,t.maxStringLength),t)+o}return be(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 Pe(e){return"Object("+e+")"}function Ee(e){return e+" { ? }"}function xe(e,t,r,o){return e+" ("+t+") {"+(o?ke(r,o):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 Ie(e,t){var r=ge(e),o=[];if(r){o.length=e.length;for(var n=0;n<e.length;n++)o[n]=je(e,n)?t(e[n],e):""}for(var i in e)je(e,i)&&(r&&String(Number(i))===i&&i<e.length||(/[^\w$]/.test(i)?o.push(t(i,e)+": "+t(e[i],e)):o.push(i+": "+t(e[i],e))));if("function"==typeof pe)for(var a=pe(e),c=0;c<a.length;c++)le.call(e,a[c])&&o.push("["+t(a[c])+"]: "+t(e[a[c]],e));return o}var Fe=L,Re=function(e,t){var r=q(e,!!t);return"function"==typeof r&&H(e,".prototype.")>-1?G(r):r},De=function e(t,r,o,n){var i=r||{};if(je(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(je(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=!je(i,"customInspect")||i.customInspect;if("boolean"!=typeof a)throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(je(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 Oe(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===o&&(o=0),o>=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,o);if(void 0===n)n=[];else if(we(n,t)>=0)return"[Circular]";function u(t,r,a){if(r&&(n=n.slice()).push(r),a){var c={depth:i.depth};return je(i,"quoteStyle")&&(c.quoteStyle=i.quoteStyle),e(t,c,o+1,n)}return e(t,i,o+1,n)}if("function"==typeof t){var l=function(e){if(e.name)return e.name;var t=ae.call(ie.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),f=Ie(t,u);return"[Function"+(l?": "+l:" (anonymous)")+"]"+(f.length>0?" { "+f.join(", ")+" }":"")}if(me(t)){var y=ue.call(t);return"object"==typeof t?Pe(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+"="+be(he(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=Ie(t,u);return p&&!function(e){for(var t=0;t<e.length;t++)if(we(e[t],"\n")>=0)return!1;return!0}(h)?"["+ke(h,p)+"]":"[ "+h.join(", ")+" ]"}if(function(e){return!("[object Error]"!==Se(e)||de&&"object"==typeof e&&de in e)}(t)){var g=Ie(t,u);return 0===g.length?"["+String(t)+"]":"{ ["+String(t)+"] "+g.join(", ")+" }"}if("object"==typeof t&&a){if(se&&"function"==typeof t[se])return t[se]();if("function"==typeof t.inspect)return t.inspect()}if(function(e){if(!Q||!e||"object"!=typeof e)return!1;try{Q.call(e);try{Y.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var m=[];return J.call(t,(function(e,r){m.push(u(r,t,!0)+" => "+u(e,t))})),xe("Map",Q.call(t),m,p)}if(function(e){if(!Y||!e||"object"!=typeof e)return!1;try{Y.call(e);try{Q.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var v=[];return Z.call(t,(function(e){v.push(u(e,t))})),xe("Set",Y.call(t),v,p)}if(function(e){if(!ee||!e||"object"!=typeof e)return!1;try{ee.call(e,ee);try{te.call(e,te)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Ee("WeakMap");if(function(e){if(!te||!e||"object"!=typeof e)return!1;try{te.call(e,te);try{ee.call(e,ee)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Ee("WeakSet");if(function(e){if(!re||!e||"object"!=typeof e)return!1;try{return re.call(e),!0}catch(e){}return!1}(t))return Ee("WeakRef");if(function(e){return!("[object Number]"!==Se(e)||de&&"object"==typeof e&&de in e)}(t))return Pe(u(Number(t)));if(function(e){if(!e||"object"!=typeof e||!ce)return!1;try{return ce.call(e),!0}catch(e){}return!1}(t))return Pe(u(ce.call(t)));if(function(e){return!("[object Boolean]"!==Se(e)||de&&"object"==typeof e&&de in e)}(t))return Pe(oe.call(t));if(function(e){return!("[object String]"!==Se(e)||de&&"object"==typeof e&&de in e)}(t))return Pe(u(String(t)));if(!function(e){return!("[object Date]"!==Se(e)||de&&"object"==typeof e&&de in e)}(t)&&!function(e){return!("[object RegExp]"!==Se(e)||de&&"object"==typeof e&&de in e)}(t)){var j=Ie(t,u),S=fe?fe(t)===Object.prototype:t instanceof Object||t.constructor===Object,w=t instanceof Object?"":"null prototype",O=!S&&de&&Object(t)===t&&de in t?Se(t).slice(8,-1):w?"Object":"",A=(S||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(O||w?"["+[].concat(O||[],w||[]).join(": ")+"] ":"");return 0===j.length?A+"{}":p?A+"{"+ke(j,p)+"}":A+"{ "+j.join(", ")+" }"}return String(t)},Ne=Fe("%TypeError%"),Me=Fe("%WeakMap%",!0),Ue=Fe("%Map%",!0),_e=Re("WeakMap.prototype.get",!0),Ce=Re("WeakMap.prototype.set",!0),Te=Re("WeakMap.prototype.has",!0),We=Re("Map.prototype.get",!0),Le=Re("Map.prototype.set",!0),Be=Re("Map.prototype.has",!0),qe=function(e,t){for(var r,o=e;null!==(r=o.next);o=r)if(r.key===t)return o.next=r.next,r.next=e.next,e.next=r,r},Ge=String.prototype.replace,He=/%20/g,Ke="RFC3986",ze={default:Ke,formatters:{RFC1738:function(e){return Ge.call(e,He,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:Ke},Ve=ze,Qe=Object.prototype.hasOwnProperty,Je=Array.isArray,$e=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Xe=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},o=0;o<e.length;++o)void 0!==e[o]&&(r[o]=e[o]);return r},Ye={arrayToObject:Xe,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=[],o=0;o<t.length;++o)for(var n=t[o],i=n.obj[n.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(Je(r)){for(var o=[],n=0;n<r.length;++n)void 0!==r[n]&&o.push(r[n]);t.obj[t.prop]=o}}}(t),e},decode:function(e,t,r){var o=e.replace(/\+/g," ");if("iso-8859-1"===r)return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch(e){return o}},encode:function(e,t,r,o,n){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||n===Ve.RFC1738&&(40===p||41===p)?a+=i.charAt(c):p<128?a+=$e[p]:p<2048?a+=$e[192|p>>6]+$e[128|63&p]:p<55296||p>=57344?a+=$e[224|p>>12]+$e[128|p>>6&63]+$e[128|63&p]:(c+=1,p=65536+((1023&p)<<10|1023&i.charCodeAt(c)),a+=$e[240|p>>18]+$e[128|p>>12&63]+$e[128|p>>6&63]+$e[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(Je(e)){for(var r=[],o=0;o<e.length;o+=1)r.push(t(e[o]));return r}return t(e)},merge:function e(t,r,o){if(!r)return t;if("object"!=typeof r){if(Je(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(o&&(o.plainObjects||o.allowPrototypes)||!Qe.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var n=t;return Je(t)&&!Je(r)&&(n=Xe(t,o)),Je(t)&&Je(r)?(r.forEach((function(r,n){if(Qe.call(t,n)){var i=t[n];i&&"object"==typeof i&&r&&"object"==typeof r?t[n]=e(i,r,o):t.push(r)}else t[n]=r})),t):Object.keys(r).reduce((function(t,n){var i=r[n];return Qe.call(t,n)?t[n]=e(t[n],i,o):t[n]=i,t}),n)}},Ze=function(){var e,t,r,o={assert:function(e){if(!o.has(e))throw new Ne("Side channel does not contain "+De(e))},get:function(o){if(Me&&o&&("object"==typeof o||"function"==typeof o)){if(e)return _e(e,o)}else if(Ue){if(t)return We(t,o)}else if(r)return function(e,t){var r=qe(e,t);return r&&r.value}(r,o)},has:function(o){if(Me&&o&&("object"==typeof o||"function"==typeof o)){if(e)return Te(e,o)}else if(Ue){if(t)return Be(t,o)}else if(r)return function(e,t){return!!qe(e,t)}(r,o);return!1},set:function(o,n){Me&&o&&("object"==typeof o||"function"==typeof o)?(e||(e=new Me),Ce(e,o,n)):Ue?(t||(t=new Ue),Le(t,o,n)):(r||(r={key:{},next:null}),function(e,t,r){var o=qe(e,t);o?o.value=r:e.next={key:t,next:e.next,value:r}}(r,o,n))}};return o},et=Ye,tt=ze,rt=Object.prototype.hasOwnProperty,ot={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},nt=Array.isArray,it=Array.prototype.push,at=function(e,t){it.apply(e,nt(t)?t:[t])},ct=Date.prototype.toISOString,pt=tt.default,ut={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:et.encode,encodeValuesOnly:!1,format:pt,formatter:tt.formatters[pt],indices:!1,serializeDate:function(e){return ct.call(e)},skipNulls:!1,strictNullHandling:!1},lt=function e(t,r,o,n,i,a,c,p,u,l,f,y,s,d,b){var h,g=t;if(b.has(t))throw new RangeError("Cyclic object value");if("function"==typeof c?g=c(r,g):g instanceof Date?g=l(g):"comma"===o&&nt(g)&&(g=et.maybeMap(g,(function(e){return e instanceof Date?l(e):e}))),null===g){if(n)return a&&!s?a(r,ut.encoder,d,"key",f):r;g=""}if("string"==typeof(h=g)||"number"==typeof h||"boolean"==typeof h||"symbol"==typeof h||"bigint"==typeof h||et.isBuffer(g))return a?[y(s?r:a(r,ut.encoder,d,"key",f))+"="+y(a(g,ut.encoder,d,"value",f))]:[y(r)+"="+y(String(g))];var m,v=[];if(void 0===g)return v;if("comma"===o&&nt(g))m=[{value:g.length>0?g.join(",")||null:void 0}];else if(nt(c))m=c;else{var j=Object.keys(g);m=p?j.sort(p):j}for(var S=0;S<m.length;++S){var w=m[S],O="object"==typeof w&&void 0!==w.value?w.value:g[w];if(!i||null!==O){var A=nt(g)?"function"==typeof o?o(r,w):r:r+(u?"."+w:"["+w+"]");b.set(t,!0);var P=Ze();at(v,e(O,A,o,n,i,a,c,p,u,l,f,y,s,d,P))}}return v},ft=Ye,yt=Object.prototype.hasOwnProperty,st=Array.isArray,dt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ft.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},bt=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},ht=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},gt=function(e,t,r,o){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(n),c=a?n.slice(0,a.index):n,p=[];if(c){if(!r.plainObjects&&yt.call(Object.prototype,c)&&!r.allowPrototypes)return;p.push(c)}for(var u=0;r.depth>0&&null!==(a=i.exec(n))&&u<r.depth;){if(u+=1,!r.plainObjects&&yt.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;p.push(a[1])}return a&&p.push("["+n.slice(a.index)+"]"),function(e,t,r,o){for(var n=o?t:ht(t,r),i=e.length-1;i>=0;--i){var a,c=e[i];if("[]"===c&&r.parseArrays)a=[].concat(n);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]=n:a[p]=n:a={0:n}}n=a}return n}(p,t,r,o)}},mt={formats:ze,parse:function(e,t){var r=function(e){if(!e)return dt;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?dt.charset:e.charset;return{allowDots:void 0===e.allowDots?dt.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:dt.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:dt.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:dt.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:dt.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:dt.comma,decoder:"function"==typeof e.decoder?e.decoder:dt.decoder,delimiter:"string"==typeof e.delimiter||ft.isRegExp(e.delimiter)?e.delimiter:dt.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:dt.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:dt.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:dt.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:dt.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:dt.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var o="string"==typeof e?function(e,t){var r,o={},n=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,i=t.parameterLimit===1/0?void 0:t.parameterLimit,a=n.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,l,f=a[r],y=f.indexOf("]="),s=-1===y?f.indexOf("="):y+1;-1===s?(u=t.decoder(f,dt.decoder,p,"key"),l=t.strictNullHandling?null:""):(u=t.decoder(f.slice(0,s),dt.decoder,p,"key"),l=ft.maybeMap(ht(f.slice(s+1),t),(function(e){return t.decoder(e,dt.decoder,p,"value")}))),l&&t.interpretNumericEntities&&"iso-8859-1"===p&&(l=bt(l)),f.indexOf("[]=")>-1&&(l=st(l)?[l]:l),yt.call(o,u)?o[u]=ft.combine(o[u],l):o[u]=l}return o}(e,r):e,n=r.plainObjects?Object.create(null):{},i=Object.keys(o),a=0;a<i.length;++a){var c=i[a],p=gt(c,o[c],r,"string"==typeof e);n=ft.merge(n,p,r)}return!0===r.allowSparse?n:ft.compact(n)},stringify:function(e,t){var r,o=e,n=function(e){if(!e)return ut;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||ut.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=tt.default;if(void 0!==e.format){if(!rt.call(tt.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var o=tt.formatters[r],n=ut.filter;return("function"==typeof e.filter||nt(e.filter))&&(n=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:ut.addQueryPrefix,allowDots:void 0===e.allowDots?ut.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:ut.charsetSentinel,delimiter:void 0===e.delimiter?ut.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:ut.encode,encoder:"function"==typeof e.encoder?e.encoder:ut.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:ut.encodeValuesOnly,filter:n,format:r,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:ut.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:ut.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:ut.strictNullHandling}}(t);"function"==typeof n.filter?o=(0,n.filter)("",o):nt(n.filter)&&(r=n.filter);var i,a=[];if("object"!=typeof o||null===o)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(o)),n.sort&&r.sort(n.sort);for(var p=Ze(),u=0;u<r.length;++u){var l=r[u];n.skipNulls&&null===o[l]||at(a,lt(o[l],l,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,p))}var f=a.join(n.delimiter),y=!0===n.addQueryPrefix?"?":"";return n.charsetSentinel&&("iso-8859-1"===n.charset?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),f.length>0?y+f:""}},vt=function(e){return null!==e&&"string"==typeof e};e.createClient=function(e){var o=e.serviceDomain,n=e.apiKey,i=e.globalDraftKey;if(!o||!n)throw new Error("parameter is required (check serviceDomain and apiKey)");if(!vt(o)||!vt(n))throw new Error("parameter is not string");var c="https://"+o+".microcms.io/api/v1",p=function(e){var o=e.endpoint,p=e.contentId,u=e.queries,l=void 0===u?{}:u,f=e.useGlobalDraftKey,y=void 0===f||f;return t(void 0,void 0,void 0,(function(){var e,t,u,f,s,d;return r(this,(function(r){switch(r.label){case 0:e=function(e){if(null===(t=e)||"object"!=typeof t)throw new Error("queries is not object");var t;return mt.stringify(e,{arrayFormat:"comma"})}(l),t={headers:{"X-API-KEY":n}},i&&y&&Object.assign(t.headers,{"X-GLOBAL-DRAFT-KEY":i}),u=c+"/"+o+(p?"/"+p:"")+(e?"?"+e:""),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,a(u,t)];case 2:if(!(f=r.sent()).ok)throw new Error("fetch API response status: "+f.status);return[2,f.json()];case 3:if((s=r.sent()).data)throw s.data;if(null===(d=s.response)||void 0===d?void 0:d.data)throw s.response.data;return[2,Promise.reject(new Error("serviceDomain or endpoint may be wrong.\n Details: "+s))];case 4:return[2]}}))}))};return{get:function(e){var o=e.endpoint,n=e.contentId,i=e.queries,a=void 0===i?{}:i,c=e.useGlobalDraftKey;return t(void 0,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return o?[4,p({endpoint:o,contentId:n,queries:a,useGlobalDraftKey:c})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getList:function(e){var o=e.endpoint,n=e.queries,i=void 0===n?{}:n,a=e.useGlobalDraftKey;return t(void 0,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return o?[4,p({endpoint:o,queries:i,useGlobalDraftKey:a})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getListDetail:function(e){var o=e.endpoint,n=e.contentId,i=e.queries,a=void 0===i?{}:i,c=e.useGlobalDraftKey;return t(void 0,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return o?[4,p({endpoint:o,contentId:n,queries:a,useGlobalDraftKey:c})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))},getObject:function(e){var o=e.endpoint,n=e.queries,i=void 0===n?{}:n,a=e.useGlobalDraftKey;return t(void 0,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return o?[4,p({endpoint:o,queries:i,useGlobalDraftKey:a})]:[2,Promise.reject(new Error("endpoint is required"))];case 1:return[2,e.sent()]}}))}))}}},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
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})}));
|
package/dist/umd/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { BodyInit, HeadersInit } from 'node-fetch';
|
|
1
2
|
/**
|
|
2
3
|
* microCMS createClient params
|
|
3
4
|
*/
|
|
4
5
|
export interface MicroCMSClient {
|
|
5
6
|
serviceDomain: string;
|
|
6
7
|
apiKey: string;
|
|
7
|
-
globalDraftKey?: string;
|
|
8
8
|
}
|
|
9
9
|
declare type depthNumber = 1 | 2 | 3;
|
|
10
10
|
/**
|
|
@@ -36,8 +36,8 @@ export interface MicroCMSContentId {
|
|
|
36
36
|
export interface MicroCMSDate {
|
|
37
37
|
createdAt: string;
|
|
38
38
|
updatedAt: string;
|
|
39
|
-
publishedAt
|
|
40
|
-
revisedAt
|
|
39
|
+
publishedAt?: string;
|
|
40
|
+
revisedAt?: string;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* microCMS image
|
|
@@ -67,29 +67,45 @@ export declare type MicroCMSObjectContent = MicroCMSDate;
|
|
|
67
67
|
export interface MakeRequest {
|
|
68
68
|
endpoint: string;
|
|
69
69
|
contentId?: string;
|
|
70
|
-
queries?: MicroCMSQueries
|
|
71
|
-
|
|
70
|
+
queries?: MicroCMSQueries & Record<string, any>;
|
|
71
|
+
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
72
|
+
customHeaders?: HeadersInit;
|
|
73
|
+
customBody?: BodyInit;
|
|
72
74
|
}
|
|
73
75
|
export interface GetRequest {
|
|
74
76
|
endpoint: string;
|
|
75
77
|
contentId?: string;
|
|
76
78
|
queries?: MicroCMSQueries;
|
|
77
|
-
useGlobalDraftKey?: boolean;
|
|
78
79
|
}
|
|
79
80
|
export interface GetListDetailRequest {
|
|
80
81
|
endpoint: string;
|
|
81
82
|
contentId: string;
|
|
82
83
|
queries?: MicroCMSQueries;
|
|
83
|
-
useGlobalDraftKey?: boolean;
|
|
84
84
|
}
|
|
85
85
|
export interface GetListRequest {
|
|
86
86
|
endpoint: string;
|
|
87
87
|
queries?: MicroCMSQueries;
|
|
88
|
-
useGlobalDraftKey?: boolean;
|
|
89
88
|
}
|
|
90
89
|
export interface GetObjectRequest {
|
|
91
90
|
endpoint: string;
|
|
92
91
|
queries?: MicroCMSQueries;
|
|
93
|
-
|
|
92
|
+
}
|
|
93
|
+
export interface WriteApiRequestResult {
|
|
94
|
+
id: string;
|
|
95
|
+
}
|
|
96
|
+
export interface CreateRequest<T> {
|
|
97
|
+
endpoint: string;
|
|
98
|
+
contentId?: string;
|
|
99
|
+
content: T;
|
|
100
|
+
isDraft?: boolean;
|
|
101
|
+
}
|
|
102
|
+
export interface UpdateRequest<T> {
|
|
103
|
+
endpoint: string;
|
|
104
|
+
contentId?: string;
|
|
105
|
+
content: Partial<T>;
|
|
106
|
+
}
|
|
107
|
+
export interface DeleteRequest {
|
|
108
|
+
endpoint: string;
|
|
109
|
+
contentId: string;
|
|
94
110
|
}
|
|
95
111
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Check object
|
|
3
3
|
*
|
|
4
|
-
* @param {
|
|
5
|
-
* @
|
|
4
|
+
* @param {unknown} value
|
|
5
|
+
* @returns {boolean}
|
|
6
6
|
*/
|
|
7
|
-
export declare const isObject:
|
|
7
|
+
export declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
8
8
|
/**
|
|
9
9
|
* Check string
|
|
10
10
|
*
|
|
11
|
-
* @param {
|
|
12
|
-
* @
|
|
11
|
+
* @param {unknown} value
|
|
12
|
+
* @returns {boolean}
|
|
13
13
|
*/
|
|
14
|
-
export declare const isString: (value:
|
|
14
|
+
export declare const isString: (value: unknown) => value is string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microcms-js-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.2.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",
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "rollup -c",
|
|
23
23
|
"lint": "eslint ./src",
|
|
24
|
-
"lint:fix": "eslint --fix ./src"
|
|
24
|
+
"lint:fix": "eslint --fix ./src",
|
|
25
|
+
"test": "jest --coverage=false",
|
|
26
|
+
"test:coverage": "jest --coverage=true"
|
|
25
27
|
},
|
|
26
28
|
"files": [
|
|
27
29
|
"dist"
|
|
@@ -35,6 +37,7 @@
|
|
|
35
37
|
"@rollup/plugin-commonjs": "^19.0.0",
|
|
36
38
|
"@rollup/plugin-json": "^4.1.0",
|
|
37
39
|
"@rollup/plugin-node-resolve": "^13.0.0",
|
|
40
|
+
"@types/jest": "^28.1.6",
|
|
38
41
|
"@types/node": "^15.0.2",
|
|
39
42
|
"@types/node-fetch": "^2.5.10",
|
|
40
43
|
"@types/qs": "^6.9.6",
|
|
@@ -45,12 +48,16 @@
|
|
|
45
48
|
"eslint-config-prettier": "^8.3.0",
|
|
46
49
|
"eslint-config-standard": "^16.0.2",
|
|
47
50
|
"eslint-plugin-import": "^2.22.1",
|
|
51
|
+
"eslint-plugin-jest": "^26.6.0",
|
|
48
52
|
"eslint-plugin-node": "^11.1.0",
|
|
49
53
|
"eslint-plugin-standard": "^5.0.0",
|
|
54
|
+
"jest": "^28.1.3",
|
|
55
|
+
"msw": "^0.44.2",
|
|
50
56
|
"prettier": "^2.2.1",
|
|
51
57
|
"rollup": "^2.47.0",
|
|
52
58
|
"rollup-plugin-terser": "^7.0.2",
|
|
53
59
|
"rollup-plugin-typescript2": "^0.30.0",
|
|
54
|
-
"
|
|
60
|
+
"ts-jest": "^28.0.7",
|
|
61
|
+
"typescript": "^4.7.4"
|
|
55
62
|
}
|
|
56
|
-
}
|
|
63
|
+
}
|