@sanity/client 3.3.3-esm.6 → 3.3.3-esm.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sanityClient.browser.mjs +248 -272
- package/dist/sanityClient.browser.mjs.map +4 -4
- package/lib/config.js +14 -8
- package/lib/data/encodeQueryString.js +9 -2
- package/lib/http/browserMiddleware.js +7 -1
- package/lib/http/errors.js +7 -3
- package/lib/http/nodeMiddleware.js +8 -1
- package/lib/http/queryString.js +10 -2
- package/lib/http/request.js +17 -13
- package/lib/http/requestOptions.js +10 -2
- package/lib/projects/projectsClient.js +8 -1
- package/lib/sanityClient.js +0 -4
- package/lib/users/usersClient.js +8 -1
- package/lib/util/defaults.js +10 -2
- package/lib/util/getSelection.js +9 -2
- package/lib/util/once.js +10 -2
- package/lib/util/pick.js +10 -2
- package/lib/validators.js +38 -15
- package/lib/warnings.js +16 -6
- package/package.json +3 -2
- package/umd/sanityClient.js +46 -49
- package/umd/sanityClient.min.js +1 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __esm = (fn, res) => function __init() {
|
|
8
6
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
@@ -22,82 +20,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
22
20
|
}
|
|
23
21
|
return to;
|
|
24
22
|
};
|
|
25
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
23
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
24
|
|
|
31
|
-
// node_modules/object-assign/index.js
|
|
32
|
-
var require_object_assign = __commonJS({
|
|
33
|
-
"node_modules/object-assign/index.js"(exports, module) {
|
|
34
|
-
"use strict";
|
|
35
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
36
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
37
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
38
|
-
function toObject(val) {
|
|
39
|
-
if (val === null || val === void 0) {
|
|
40
|
-
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
41
|
-
}
|
|
42
|
-
return Object(val);
|
|
43
|
-
}
|
|
44
|
-
function shouldUseNative() {
|
|
45
|
-
try {
|
|
46
|
-
if (!Object.assign) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
var test1 = new String("abc");
|
|
50
|
-
test1[5] = "de";
|
|
51
|
-
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
var test2 = {};
|
|
55
|
-
for (var i = 0; i < 10; i++) {
|
|
56
|
-
test2["_" + String.fromCharCode(i)] = i;
|
|
57
|
-
}
|
|
58
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
|
59
|
-
return test2[n];
|
|
60
|
-
});
|
|
61
|
-
if (order2.join("") !== "0123456789") {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
var test3 = {};
|
|
65
|
-
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
|
66
|
-
test3[letter] = letter;
|
|
67
|
-
});
|
|
68
|
-
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
return true;
|
|
72
|
-
} catch (err) {
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
module.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
|
77
|
-
var from;
|
|
78
|
-
var to = toObject(target);
|
|
79
|
-
var symbols;
|
|
80
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
81
|
-
from = Object(arguments[s]);
|
|
82
|
-
for (var key in from) {
|
|
83
|
-
if (hasOwnProperty.call(from, key)) {
|
|
84
|
-
to[key] = from[key];
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
if (getOwnPropertySymbols) {
|
|
88
|
-
symbols = getOwnPropertySymbols(from);
|
|
89
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
90
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
91
|
-
to[symbols[i]] = from[symbols[i]];
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return to;
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
|
|
101
25
|
// src/util/observable-modern.js
|
|
102
26
|
var observable_modern_exports = {};
|
|
103
27
|
__export(observable_modern_exports, {
|
|
@@ -114,66 +38,83 @@ var init_observable_modern = __esm({
|
|
|
114
38
|
});
|
|
115
39
|
|
|
116
40
|
// src/util/getSelection.js
|
|
117
|
-
var
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
41
|
+
var getSelection_exports = {};
|
|
42
|
+
__export(getSelection_exports, {
|
|
43
|
+
default: () => getSelection
|
|
44
|
+
});
|
|
45
|
+
function getSelection(sel) {
|
|
46
|
+
if (typeof sel === "string" || Array.isArray(sel)) {
|
|
47
|
+
return { id: sel };
|
|
48
|
+
}
|
|
49
|
+
if (sel && sel.query) {
|
|
50
|
+
return "params" in sel ? { query: sel.query, params: sel.params } : { query: sel.query };
|
|
51
|
+
}
|
|
52
|
+
const selectionOpts = [
|
|
53
|
+
"* Document ID (<docId>)",
|
|
54
|
+
"* Array of document IDs",
|
|
55
|
+
"* Object containing `query`"
|
|
56
|
+
].join("\n");
|
|
57
|
+
throw new Error(`Unknown selection - must be one of:
|
|
132
58
|
|
|
133
59
|
${selectionOpts}`);
|
|
134
|
-
|
|
60
|
+
}
|
|
61
|
+
var init_getSelection = __esm({
|
|
62
|
+
"src/util/getSelection.js"() {
|
|
135
63
|
}
|
|
136
64
|
});
|
|
137
65
|
|
|
138
66
|
// src/validators.js
|
|
139
|
-
var
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
67
|
+
var validators_exports = {};
|
|
68
|
+
__export(validators_exports, {
|
|
69
|
+
dataset: () => dataset,
|
|
70
|
+
hasDataset: () => hasDataset,
|
|
71
|
+
projectId: () => projectId,
|
|
72
|
+
requestTag: () => requestTag,
|
|
73
|
+
requireDocumentId: () => requireDocumentId,
|
|
74
|
+
validateAssetType: () => validateAssetType,
|
|
75
|
+
validateDocumentId: () => validateDocumentId,
|
|
76
|
+
validateInsert: () => validateInsert,
|
|
77
|
+
validateObject: () => validateObject
|
|
78
|
+
});
|
|
79
|
+
var VALID_ASSET_TYPES, VALID_INSERT_LOCATIONS, dataset, projectId, validateAssetType, validateObject, validateDocumentId, requireDocumentId, validateInsert, hasDataset, requestTag;
|
|
80
|
+
var init_validators = __esm({
|
|
81
|
+
"src/validators.js"() {
|
|
82
|
+
VALID_ASSET_TYPES = ["image", "file"];
|
|
83
|
+
VALID_INSERT_LOCATIONS = ["before", "after", "replace"];
|
|
84
|
+
dataset = (name) => {
|
|
144
85
|
if (!/^(~[a-z0-9]{1}[-\w]{0,63}|[a-z0-9]{1}[-\w]{0,63})$/.test(name)) {
|
|
145
86
|
throw new Error(
|
|
146
87
|
"Datasets can only contain lowercase characters, numbers, underscores and dashes, and start with tilde, and be maximum 64 characters"
|
|
147
88
|
);
|
|
148
89
|
}
|
|
149
90
|
};
|
|
150
|
-
|
|
91
|
+
projectId = (id) => {
|
|
151
92
|
if (!/^[-a-z0-9]+$/i.test(id)) {
|
|
152
93
|
throw new Error("`projectId` can only contain only a-z, 0-9 and dashes");
|
|
153
94
|
}
|
|
154
95
|
};
|
|
155
|
-
|
|
96
|
+
validateAssetType = (type) => {
|
|
156
97
|
if (VALID_ASSET_TYPES.indexOf(type) === -1) {
|
|
157
98
|
throw new Error(`Invalid asset type: ${type}. Must be one of ${VALID_ASSET_TYPES.join(", ")}`);
|
|
158
99
|
}
|
|
159
100
|
};
|
|
160
|
-
|
|
101
|
+
validateObject = (op, val) => {
|
|
161
102
|
if (val === null || typeof val !== "object" || Array.isArray(val)) {
|
|
162
103
|
throw new Error(`${op}() takes an object of properties`);
|
|
163
104
|
}
|
|
164
105
|
};
|
|
165
|
-
|
|
166
|
-
if (!doc._id) {
|
|
167
|
-
throw new Error(`${op}() requires that the document contains an ID ("_id" property)`);
|
|
168
|
-
}
|
|
169
|
-
exports.validateDocumentId(op, doc._id);
|
|
170
|
-
};
|
|
171
|
-
exports.validateDocumentId = (op, id) => {
|
|
106
|
+
validateDocumentId = (op, id) => {
|
|
172
107
|
if (typeof id !== "string" || !/^[a-z0-9_.-]+$/i.test(id)) {
|
|
173
108
|
throw new Error(`${op}(): "${id}" is not a valid document ID`);
|
|
174
109
|
}
|
|
175
110
|
};
|
|
176
|
-
|
|
111
|
+
requireDocumentId = (op, doc) => {
|
|
112
|
+
if (!doc._id) {
|
|
113
|
+
throw new Error(`${op}() requires that the document contains an ID ("_id" property)`);
|
|
114
|
+
}
|
|
115
|
+
validateDocumentId(op, doc._id);
|
|
116
|
+
};
|
|
117
|
+
validateInsert = (at, selector, items) => {
|
|
177
118
|
const signature = "insert(at, selector, items)";
|
|
178
119
|
if (VALID_INSERT_LOCATIONS.indexOf(at) === -1) {
|
|
179
120
|
const valid = VALID_INSERT_LOCATIONS.map((loc) => `"${loc}"`).join(", ");
|
|
@@ -186,13 +127,13 @@ var require_validators = __commonJS({
|
|
|
186
127
|
throw new Error(`${signature} takes an "items"-argument which must be an array`);
|
|
187
128
|
}
|
|
188
129
|
};
|
|
189
|
-
|
|
130
|
+
hasDataset = (config) => {
|
|
190
131
|
if (!config.dataset) {
|
|
191
132
|
throw new Error("`dataset` must be provided to perform queries");
|
|
192
133
|
}
|
|
193
134
|
return config.dataset || "";
|
|
194
135
|
};
|
|
195
|
-
|
|
136
|
+
requestTag = (tag) => {
|
|
196
137
|
if (typeof tag !== "string" || !/^[a-z0-9._-]{1,75}$/i.test(tag)) {
|
|
197
138
|
throw new Error(
|
|
198
139
|
`Tag can only contain alphanumeric characters, underscores, dashes and dots, and be between one and 75 characters long.`
|
|
@@ -206,10 +147,10 @@ var require_validators = __commonJS({
|
|
|
206
147
|
// src/data/patch.js
|
|
207
148
|
var require_patch = __commonJS({
|
|
208
149
|
"src/data/patch.js"(exports, module) {
|
|
209
|
-
var
|
|
210
|
-
var
|
|
211
|
-
var
|
|
212
|
-
var
|
|
150
|
+
var getSelection2 = (init_getSelection(), __toCommonJS(getSelection_exports));
|
|
151
|
+
var validate = (init_validators(), __toCommonJS(validators_exports));
|
|
152
|
+
var validateObject2 = validate.validateObject;
|
|
153
|
+
var validateInsert2 = validate.validateInsert;
|
|
213
154
|
function Patch(selection, operations = {}, client = null) {
|
|
214
155
|
this.selection = selection;
|
|
215
156
|
this.operations = Object.assign({}, operations);
|
|
@@ -223,7 +164,7 @@ var require_patch = __commonJS({
|
|
|
223
164
|
return this.assign("set", props);
|
|
224
165
|
},
|
|
225
166
|
diffMatchPatch(props) {
|
|
226
|
-
|
|
167
|
+
validateObject2("diffMatchPatch", props);
|
|
227
168
|
return this.assign("diffMatchPatch", props);
|
|
228
169
|
},
|
|
229
170
|
unset(attrs) {
|
|
@@ -237,7 +178,7 @@ var require_patch = __commonJS({
|
|
|
237
178
|
return this.assign("setIfMissing", props);
|
|
238
179
|
},
|
|
239
180
|
replace(props) {
|
|
240
|
-
|
|
181
|
+
validateObject2("replace", props);
|
|
241
182
|
return this._set("set", { $: props });
|
|
242
183
|
},
|
|
243
184
|
inc(props) {
|
|
@@ -247,7 +188,7 @@ var require_patch = __commonJS({
|
|
|
247
188
|
return this.assign("dec", props);
|
|
248
189
|
},
|
|
249
190
|
insert(at, selector, items) {
|
|
250
|
-
|
|
191
|
+
validateInsert2(at, selector, items);
|
|
251
192
|
return this.assign("insert", { [at]: selector, items });
|
|
252
193
|
},
|
|
253
194
|
append(selector, items) {
|
|
@@ -269,7 +210,7 @@ var require_patch = __commonJS({
|
|
|
269
210
|
return this;
|
|
270
211
|
},
|
|
271
212
|
serialize() {
|
|
272
|
-
return Object.assign(
|
|
213
|
+
return Object.assign(getSelection2(this.selection), this.operations);
|
|
273
214
|
},
|
|
274
215
|
toJSON() {
|
|
275
216
|
return this.serialize();
|
|
@@ -292,7 +233,7 @@ var require_patch = __commonJS({
|
|
|
292
233
|
return this.assign(op, props, false);
|
|
293
234
|
},
|
|
294
235
|
assign(op, props, merge = true) {
|
|
295
|
-
|
|
236
|
+
validateObject2(op, props);
|
|
296
237
|
this.operations = Object.assign({}, this.operations, {
|
|
297
238
|
[op]: Object.assign({}, merge && this.operations[op] || {}, props)
|
|
298
239
|
});
|
|
@@ -306,7 +247,7 @@ var require_patch = __commonJS({
|
|
|
306
247
|
// src/data/transaction.js
|
|
307
248
|
var require_transaction = __commonJS({
|
|
308
249
|
"src/data/transaction.js"(exports, module) {
|
|
309
|
-
var validators =
|
|
250
|
+
var validators = (init_validators(), __toCommonJS(validators_exports));
|
|
310
251
|
var Patch = require_patch();
|
|
311
252
|
var defaultMutateOptions = { returnDocuments: false };
|
|
312
253
|
function Transaction(operations = [], client, transactionId) {
|
|
@@ -391,10 +332,15 @@ var require_transaction = __commonJS({
|
|
|
391
332
|
});
|
|
392
333
|
|
|
393
334
|
// src/data/encodeQueryString.js
|
|
394
|
-
var
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
335
|
+
var encodeQueryString_exports = {};
|
|
336
|
+
__export(encodeQueryString_exports, {
|
|
337
|
+
default: () => encodeQueryString_default
|
|
338
|
+
});
|
|
339
|
+
var enc, encodeQueryString_default;
|
|
340
|
+
var init_encodeQueryString = __esm({
|
|
341
|
+
"src/data/encodeQueryString.js"() {
|
|
342
|
+
enc = encodeURIComponent;
|
|
343
|
+
encodeQueryString_default = ({ query, params = {}, options = {} }) => {
|
|
398
344
|
const { tag, ...opts } = options;
|
|
399
345
|
const q = `query=${enc(query)}`;
|
|
400
346
|
const base = tag ? `?tag=${enc(tag)}&${q}` : `?${q}`;
|
|
@@ -410,9 +356,14 @@ var require_encodeQueryString = __commonJS({
|
|
|
410
356
|
});
|
|
411
357
|
|
|
412
358
|
// src/util/pick.js
|
|
413
|
-
var
|
|
414
|
-
|
|
415
|
-
|
|
359
|
+
var pick_exports = {};
|
|
360
|
+
__export(pick_exports, {
|
|
361
|
+
default: () => pick_default
|
|
362
|
+
});
|
|
363
|
+
var pick_default;
|
|
364
|
+
var init_pick = __esm({
|
|
365
|
+
"src/util/pick.js"() {
|
|
366
|
+
pick_default = (obj, props) => props.reduce((selection, prop) => {
|
|
416
367
|
if (typeof obj[prop] === "undefined") {
|
|
417
368
|
return selection;
|
|
418
369
|
}
|
|
@@ -423,9 +374,14 @@ var require_pick = __commonJS({
|
|
|
423
374
|
});
|
|
424
375
|
|
|
425
376
|
// src/util/defaults.js
|
|
426
|
-
var
|
|
427
|
-
|
|
428
|
-
|
|
377
|
+
var defaults_exports = {};
|
|
378
|
+
__export(defaults_exports, {
|
|
379
|
+
default: () => defaults_default
|
|
380
|
+
});
|
|
381
|
+
var defaults_default;
|
|
382
|
+
var init_defaults = __esm({
|
|
383
|
+
"src/util/defaults.js"() {
|
|
384
|
+
defaults_default = (obj, defaults) => Object.keys(defaults).concat(Object.keys(obj)).reduce((target, prop) => {
|
|
429
385
|
target[prop] = typeof obj[prop] === "undefined" ? defaults[prop] : obj[prop];
|
|
430
386
|
return target;
|
|
431
387
|
}, {});
|
|
@@ -437,9 +393,9 @@ import polyfilledEventSource from "@sanity/eventsource";
|
|
|
437
393
|
var require_listen = __commonJS({
|
|
438
394
|
"src/data/listen.js"(exports, module) {
|
|
439
395
|
var { Observable: Observable2 } = (init_observable_modern(), __toCommonJS(observable_modern_exports));
|
|
440
|
-
var pick =
|
|
441
|
-
var defaults =
|
|
442
|
-
var encodeQueryString =
|
|
396
|
+
var pick = (init_pick(), __toCommonJS(pick_exports));
|
|
397
|
+
var defaults = (init_defaults(), __toCommonJS(defaults_exports));
|
|
398
|
+
var encodeQueryString = (init_encodeQueryString(), __toCommonJS(encodeQueryString_exports));
|
|
443
399
|
var MAX_URL_LENGTH = 16e3 - 1200;
|
|
444
400
|
var EventSource = polyfilledEventSource;
|
|
445
401
|
var possibleOptions = [
|
|
@@ -564,9 +520,9 @@ var require_listen = __commonJS({
|
|
|
564
520
|
var require_dataMethods = __commonJS({
|
|
565
521
|
"src/data/dataMethods.js"(exports, module) {
|
|
566
522
|
var { map: map2, filter: filter2 } = (init_observable_modern(), __toCommonJS(observable_modern_exports));
|
|
567
|
-
var validators =
|
|
568
|
-
var
|
|
569
|
-
var encodeQueryString =
|
|
523
|
+
var validators = (init_validators(), __toCommonJS(validators_exports));
|
|
524
|
+
var getSelection2 = (init_getSelection(), __toCommonJS(getSelection_exports));
|
|
525
|
+
var encodeQueryString = (init_encodeQueryString(), __toCommonJS(encodeQueryString_exports));
|
|
570
526
|
var Transaction = require_transaction();
|
|
571
527
|
var Patch = require_patch();
|
|
572
528
|
var listen = require_listen();
|
|
@@ -640,7 +596,7 @@ var require_dataMethods = __commonJS({
|
|
|
640
596
|
return new Patch(selector, operations, this);
|
|
641
597
|
},
|
|
642
598
|
delete(selection, options) {
|
|
643
|
-
return this.dataRequest("mutate", { mutations: [{ delete:
|
|
599
|
+
return this.dataRequest("mutate", { mutations: [{ delete: getSelection2(selection) }] }, options);
|
|
644
600
|
},
|
|
645
601
|
mutate(mutations, options) {
|
|
646
602
|
const mut = mutations instanceof Patch || mutations instanceof Transaction ? mutations.serialize() : mutations;
|
|
@@ -652,8 +608,8 @@ var require_dataMethods = __commonJS({
|
|
|
652
608
|
return new Transaction(operations, this);
|
|
653
609
|
},
|
|
654
610
|
dataRequest(endpoint, body, options = {}) {
|
|
655
|
-
const
|
|
656
|
-
return this.isPromiseAPI() ? toPromise(
|
|
611
|
+
const request2 = this._dataRequest(endpoint, body, options);
|
|
612
|
+
return this.isPromiseAPI() ? toPromise(request2) : request2;
|
|
657
613
|
},
|
|
658
614
|
_dataRequest(endpoint, body, options = {}) {
|
|
659
615
|
const isMutation = endpoint === "mutate";
|
|
@@ -709,7 +665,7 @@ var require_dataMethods = __commonJS({
|
|
|
709
665
|
// src/datasets/datasetsClient.js
|
|
710
666
|
var require_datasetsClient = __commonJS({
|
|
711
667
|
"src/datasets/datasetsClient.js"(exports, module) {
|
|
712
|
-
var
|
|
668
|
+
var validate = (init_validators(), __toCommonJS(validators_exports));
|
|
713
669
|
function DatasetsClient(client) {
|
|
714
670
|
this.request = client.request.bind(client);
|
|
715
671
|
}
|
|
@@ -727,7 +683,7 @@ var require_datasetsClient = __commonJS({
|
|
|
727
683
|
return this.request({ uri: "/datasets" });
|
|
728
684
|
},
|
|
729
685
|
_modify(method, name, body) {
|
|
730
|
-
|
|
686
|
+
validate.dataset(name);
|
|
731
687
|
return this.request({ method, uri: `/datasets/${name}`, body });
|
|
732
688
|
}
|
|
733
689
|
});
|
|
@@ -736,11 +692,16 @@ var require_datasetsClient = __commonJS({
|
|
|
736
692
|
});
|
|
737
693
|
|
|
738
694
|
// src/projects/projectsClient.js
|
|
739
|
-
var
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
695
|
+
var projectsClient_exports = {};
|
|
696
|
+
__export(projectsClient_exports, {
|
|
697
|
+
default: () => projectsClient_default
|
|
698
|
+
});
|
|
699
|
+
function ProjectsClient(client) {
|
|
700
|
+
this.client = client;
|
|
701
|
+
}
|
|
702
|
+
var projectsClient_default;
|
|
703
|
+
var init_projectsClient = __esm({
|
|
704
|
+
"src/projects/projectsClient.js"() {
|
|
744
705
|
Object.assign(ProjectsClient.prototype, {
|
|
745
706
|
list() {
|
|
746
707
|
return this.client.request({ uri: "/projects" });
|
|
@@ -749,14 +710,19 @@ var require_projectsClient = __commonJS({
|
|
|
749
710
|
return this.client.request({ uri: `/projects/${id}` });
|
|
750
711
|
}
|
|
751
712
|
});
|
|
752
|
-
|
|
713
|
+
projectsClient_default = ProjectsClient;
|
|
753
714
|
}
|
|
754
715
|
});
|
|
755
716
|
|
|
756
717
|
// src/http/queryString.js
|
|
757
|
-
var
|
|
758
|
-
|
|
759
|
-
|
|
718
|
+
var queryString_exports = {};
|
|
719
|
+
__export(queryString_exports, {
|
|
720
|
+
default: () => queryString_default
|
|
721
|
+
});
|
|
722
|
+
var queryString_default;
|
|
723
|
+
var init_queryString = __esm({
|
|
724
|
+
"src/http/queryString.js"() {
|
|
725
|
+
queryString_default = (params) => {
|
|
760
726
|
const qs = [];
|
|
761
727
|
for (const key in params) {
|
|
762
728
|
if (params.hasOwnProperty(key)) {
|
|
@@ -772,8 +738,8 @@ var require_queryString = __commonJS({
|
|
|
772
738
|
var require_assetsClient = __commonJS({
|
|
773
739
|
"src/assets/assetsClient.js"(exports, module) {
|
|
774
740
|
var { map: map2, filter: filter2 } = (init_observable_modern(), __toCommonJS(observable_modern_exports));
|
|
775
|
-
var queryString =
|
|
776
|
-
var validators =
|
|
741
|
+
var queryString = (init_queryString(), __toCommonJS(queryString_exports));
|
|
742
|
+
var validators = (init_validators(), __toCommonJS(validators_exports));
|
|
777
743
|
function AssetsClient(client) {
|
|
778
744
|
this.client = client;
|
|
779
745
|
}
|
|
@@ -796,7 +762,7 @@ var require_assetsClient = __commonJS({
|
|
|
796
762
|
if (meta && !meta.length) {
|
|
797
763
|
meta = ["none"];
|
|
798
764
|
}
|
|
799
|
-
const
|
|
765
|
+
const dataset2 = validators.hasDataset(this.client.clientConfig);
|
|
800
766
|
const assetEndpoint = assetType === "image" ? "images" : "files";
|
|
801
767
|
const options = optionsFromFile(opts, body);
|
|
802
768
|
const { tag, label, title, description, creditLine, filename, source } = options;
|
|
@@ -817,7 +783,7 @@ var require_assetsClient = __commonJS({
|
|
|
817
783
|
tag,
|
|
818
784
|
method: "POST",
|
|
819
785
|
timeout: options.timeout || 0,
|
|
820
|
-
uri: `/assets/${assetEndpoint}/${
|
|
786
|
+
uri: `/assets/${assetEndpoint}/${dataset2}`,
|
|
821
787
|
headers: options.contentType ? { "Content-Type": options.contentType } : {},
|
|
822
788
|
query,
|
|
823
789
|
body
|
|
@@ -852,9 +818,9 @@ var require_assetsClient = __commonJS({
|
|
|
852
818
|
}
|
|
853
819
|
const [, assetId, size, format] = id.split("-");
|
|
854
820
|
validators.hasDataset(this.client.clientConfig);
|
|
855
|
-
const { projectId, dataset } = this.client.clientConfig;
|
|
821
|
+
const { projectId: projectId2, dataset: dataset2 } = this.client.clientConfig;
|
|
856
822
|
const qs = query ? queryString(query) : "";
|
|
857
|
-
return `https://cdn.sanity.io/images/${
|
|
823
|
+
return `https://cdn.sanity.io/images/${projectId2}/${dataset2}/${assetId}-${size}.${format}${qs}`;
|
|
858
824
|
}
|
|
859
825
|
});
|
|
860
826
|
module.exports = AssetsClient;
|
|
@@ -862,17 +828,22 @@ var require_assetsClient = __commonJS({
|
|
|
862
828
|
});
|
|
863
829
|
|
|
864
830
|
// src/users/usersClient.js
|
|
865
|
-
var
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
831
|
+
var usersClient_exports = {};
|
|
832
|
+
__export(usersClient_exports, {
|
|
833
|
+
default: () => usersClient_default
|
|
834
|
+
});
|
|
835
|
+
function UsersClient(client) {
|
|
836
|
+
this.client = client;
|
|
837
|
+
}
|
|
838
|
+
var usersClient_default;
|
|
839
|
+
var init_usersClient = __esm({
|
|
840
|
+
"src/users/usersClient.js"() {
|
|
870
841
|
Object.assign(UsersClient.prototype, {
|
|
871
842
|
getById(id) {
|
|
872
843
|
return this.client.request({ uri: `/users/${id}` });
|
|
873
844
|
}
|
|
874
845
|
});
|
|
875
|
-
|
|
846
|
+
usersClient_default = UsersClient;
|
|
876
847
|
}
|
|
877
848
|
});
|
|
878
849
|
|
|
@@ -896,68 +867,79 @@ var require_authClient = __commonJS({
|
|
|
896
867
|
|
|
897
868
|
// src/http/errors.js
|
|
898
869
|
import makeError from "make-error";
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
870
|
+
function ClientError(res) {
|
|
871
|
+
const props = extractErrorProps(res);
|
|
872
|
+
ClientError.super.call(this, props.message);
|
|
873
|
+
Object.assign(this, props);
|
|
874
|
+
}
|
|
875
|
+
function ServerError(res) {
|
|
876
|
+
const props = extractErrorProps(res);
|
|
877
|
+
ServerError.super.call(this, props.message);
|
|
878
|
+
Object.assign(this, props);
|
|
879
|
+
}
|
|
880
|
+
function extractErrorProps(res) {
|
|
881
|
+
const body = res.body;
|
|
882
|
+
const props = {
|
|
883
|
+
response: res,
|
|
884
|
+
statusCode: res.statusCode,
|
|
885
|
+
responseBody: stringifyBody(body, res)
|
|
886
|
+
};
|
|
887
|
+
if (body.error && body.message) {
|
|
888
|
+
props.message = `${body.error} - ${body.message}`;
|
|
889
|
+
return props;
|
|
890
|
+
}
|
|
891
|
+
if (body.error && body.error.description) {
|
|
892
|
+
props.message = body.error.description;
|
|
893
|
+
props.details = body.error;
|
|
894
|
+
return props;
|
|
895
|
+
}
|
|
896
|
+
props.message = body.error || body.message || httpErrorMessage(res);
|
|
897
|
+
return props;
|
|
898
|
+
}
|
|
899
|
+
function httpErrorMessage(res) {
|
|
900
|
+
const statusMessage = res.statusMessage ? ` ${res.statusMessage}` : "";
|
|
901
|
+
return `${res.method}-request to ${res.url} resulted in HTTP ${res.statusCode}${statusMessage}`;
|
|
902
|
+
}
|
|
903
|
+
function stringifyBody(body, res) {
|
|
904
|
+
const contentType = (res.headers["content-type"] || "").toLowerCase();
|
|
905
|
+
const isJson = contentType.indexOf("application/json") !== -1;
|
|
906
|
+
return isJson ? JSON.stringify(body, null, 2) : body;
|
|
907
|
+
}
|
|
908
|
+
var init_errors = __esm({
|
|
909
|
+
"src/http/errors.js"() {
|
|
939
910
|
makeError(ClientError);
|
|
940
911
|
makeError(ServerError);
|
|
941
|
-
exports.ClientError = ClientError;
|
|
942
|
-
exports.ServerError = ServerError;
|
|
943
912
|
}
|
|
944
913
|
});
|
|
945
914
|
|
|
946
915
|
// src/http/browserMiddleware.js
|
|
947
|
-
var
|
|
948
|
-
|
|
949
|
-
|
|
916
|
+
var browserMiddleware_exports = {};
|
|
917
|
+
__export(browserMiddleware_exports, {
|
|
918
|
+
default: () => browserMiddleware_default
|
|
919
|
+
});
|
|
920
|
+
var browserMiddleware_default;
|
|
921
|
+
var init_browserMiddleware = __esm({
|
|
922
|
+
"src/http/browserMiddleware.js"() {
|
|
923
|
+
browserMiddleware_default = [];
|
|
950
924
|
}
|
|
951
925
|
});
|
|
952
926
|
|
|
953
927
|
// src/http/request.js
|
|
928
|
+
var request_exports = {};
|
|
929
|
+
__export(request_exports, {
|
|
930
|
+
default: () => request_default
|
|
931
|
+
});
|
|
954
932
|
import getIt from "get-it";
|
|
955
933
|
import { observable, jsonRequest, jsonResponse, progress } from "get-it/middleware";
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
934
|
+
function httpRequest(options, requester = request) {
|
|
935
|
+
return requester(Object.assign({ maxRedirects: 0 }, options));
|
|
936
|
+
}
|
|
937
|
+
var httpError, printWarnings, envSpecific, middleware, request, request_default;
|
|
938
|
+
var init_request = __esm({
|
|
939
|
+
"src/http/request.js"() {
|
|
940
|
+
init_observable_modern();
|
|
941
|
+
init_errors();
|
|
942
|
+
httpError = {
|
|
961
943
|
onResponse: (res) => {
|
|
962
944
|
if (res.statusCode >= 500) {
|
|
963
945
|
throw new ServerError(res);
|
|
@@ -967,39 +949,41 @@ var require_request = __commonJS({
|
|
|
967
949
|
return res;
|
|
968
950
|
}
|
|
969
951
|
};
|
|
970
|
-
|
|
952
|
+
printWarnings = {
|
|
971
953
|
onResponse: (res) => {
|
|
972
954
|
const warn = res.headers["x-sanity-warning"];
|
|
973
|
-
const
|
|
974
|
-
|
|
955
|
+
const warnings = Array.isArray(warn) ? warn : [warn];
|
|
956
|
+
warnings.filter(Boolean).forEach((msg) => console.warn(msg));
|
|
975
957
|
return res;
|
|
976
958
|
}
|
|
977
959
|
};
|
|
978
|
-
|
|
979
|
-
|
|
960
|
+
envSpecific = typeof EdgeRuntime === "string" ? (init_browserMiddleware(), __toCommonJS(browserMiddleware_exports)) : (init_browserMiddleware(), __toCommonJS(browserMiddleware_exports));
|
|
961
|
+
middleware = envSpecific.concat([
|
|
980
962
|
printWarnings,
|
|
981
963
|
jsonRequest(),
|
|
982
964
|
jsonResponse(),
|
|
983
965
|
progress(),
|
|
984
966
|
httpError,
|
|
985
|
-
observable({ implementation:
|
|
967
|
+
observable({ implementation: Observable })
|
|
986
968
|
]);
|
|
987
|
-
|
|
988
|
-
function httpRequest(options, requester = request) {
|
|
989
|
-
return requester(Object.assign({ maxRedirects: 0 }, options));
|
|
990
|
-
}
|
|
969
|
+
request = getIt(middleware);
|
|
991
970
|
httpRequest.defaultRequester = request;
|
|
992
971
|
httpRequest.ClientError = ClientError;
|
|
993
972
|
httpRequest.ServerError = ServerError;
|
|
994
|
-
|
|
973
|
+
request_default = httpRequest;
|
|
995
974
|
}
|
|
996
975
|
});
|
|
997
976
|
|
|
998
977
|
// src/http/requestOptions.js
|
|
999
|
-
var
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
978
|
+
var requestOptions_exports = {};
|
|
979
|
+
__export(requestOptions_exports, {
|
|
980
|
+
default: () => requestOptions_default
|
|
981
|
+
});
|
|
982
|
+
var projectHeader, requestOptions_default;
|
|
983
|
+
var init_requestOptions = __esm({
|
|
984
|
+
"src/http/requestOptions.js"() {
|
|
985
|
+
projectHeader = "X-Sanity-Project-ID";
|
|
986
|
+
requestOptions_default = (config, overrides = {}) => {
|
|
1003
987
|
const headers = {};
|
|
1004
988
|
const token = overrides.token || config.token;
|
|
1005
989
|
if (token) {
|
|
@@ -1024,10 +1008,6 @@ var require_requestOptions = __commonJS({
|
|
|
1024
1008
|
});
|
|
1025
1009
|
|
|
1026
1010
|
// src/generateHelpUrl.js
|
|
1027
|
-
var generateHelpUrl_exports = {};
|
|
1028
|
-
__export(generateHelpUrl_exports, {
|
|
1029
|
-
default: () => generateHelpUrl
|
|
1030
|
-
});
|
|
1031
1011
|
function generateHelpUrl(slug) {
|
|
1032
1012
|
return BASE_URL + slug;
|
|
1033
1013
|
}
|
|
@@ -1039,9 +1019,10 @@ var init_generateHelpUrl = __esm({
|
|
|
1039
1019
|
});
|
|
1040
1020
|
|
|
1041
1021
|
// src/util/once.js
|
|
1042
|
-
var
|
|
1043
|
-
|
|
1044
|
-
|
|
1022
|
+
var once_default;
|
|
1023
|
+
var init_once = __esm({
|
|
1024
|
+
"src/util/once.js"() {
|
|
1025
|
+
once_default = (fn) => {
|
|
1045
1026
|
let didCall = false;
|
|
1046
1027
|
let returnValue;
|
|
1047
1028
|
return (...args) => {
|
|
@@ -1057,26 +1038,27 @@ var require_once = __commonJS({
|
|
|
1057
1038
|
});
|
|
1058
1039
|
|
|
1059
1040
|
// src/warnings.js
|
|
1060
|
-
var
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1041
|
+
var createWarningPrinter, printCdnWarning, printBrowserTokenWarning, printNoApiVersionSpecifiedWarning;
|
|
1042
|
+
var init_warnings = __esm({
|
|
1043
|
+
"src/warnings.js"() {
|
|
1044
|
+
init_generateHelpUrl();
|
|
1045
|
+
init_once();
|
|
1046
|
+
createWarningPrinter = (message) => once_default((...args) => console.warn(message.join(" "), ...args));
|
|
1047
|
+
printCdnWarning = createWarningPrinter([
|
|
1066
1048
|
"You are not using the Sanity CDN. That means your data is always fresh, but the CDN is faster and",
|
|
1067
|
-
`cheaper. Think about it! For more info, see ${
|
|
1049
|
+
`cheaper. Think about it! For more info, see ${generateHelpUrl("js-client-cdn-configuration")}.`,
|
|
1068
1050
|
"To hide this warning, please set the `useCdn` option to either `true` or `false` when creating",
|
|
1069
1051
|
"the client."
|
|
1070
1052
|
]);
|
|
1071
|
-
|
|
1053
|
+
printBrowserTokenWarning = createWarningPrinter([
|
|
1072
1054
|
"You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",
|
|
1073
|
-
`See ${
|
|
1055
|
+
`See ${generateHelpUrl(
|
|
1074
1056
|
"js-client-browser-token"
|
|
1075
1057
|
)} for more information and how to hide this warning.`
|
|
1076
1058
|
]);
|
|
1077
|
-
|
|
1059
|
+
printNoApiVersionSpecifiedWarning = createWarningPrinter([
|
|
1078
1060
|
"Using the Sanity client without specifying an API version is deprecated.",
|
|
1079
|
-
`See ${
|
|
1061
|
+
`See ${generateHelpUrl("js-client-api-version")}`
|
|
1080
1062
|
]);
|
|
1081
1063
|
}
|
|
1082
1064
|
});
|
|
@@ -1088,12 +1070,12 @@ __export(config_exports, {
|
|
|
1088
1070
|
initConfig: () => initConfig,
|
|
1089
1071
|
validateApiVersion: () => validateApiVersion
|
|
1090
1072
|
});
|
|
1091
|
-
var
|
|
1073
|
+
var defaultCdnHost, defaultConfig, LOCALHOSTS, isLocal, validateApiVersion, initConfig;
|
|
1092
1074
|
var init_config = __esm({
|
|
1093
1075
|
"src/config.js"() {
|
|
1094
1076
|
init_generateHelpUrl();
|
|
1095
|
-
|
|
1096
|
-
|
|
1077
|
+
init_validators();
|
|
1078
|
+
init_warnings();
|
|
1097
1079
|
defaultCdnHost = "apicdn.sanity.io";
|
|
1098
1080
|
defaultConfig = {
|
|
1099
1081
|
apiHost: "https://api.sanity.io",
|
|
@@ -1116,7 +1098,7 @@ var init_config = __esm({
|
|
|
1116
1098
|
initConfig = (config, prevConfig) => {
|
|
1117
1099
|
const specifiedConfig = Object.assign({}, prevConfig, config);
|
|
1118
1100
|
if (!specifiedConfig.apiVersion) {
|
|
1119
|
-
|
|
1101
|
+
printNoApiVersionSpecifiedWarning();
|
|
1120
1102
|
}
|
|
1121
1103
|
const newConfig = Object.assign({}, defaultConfig, specifiedConfig);
|
|
1122
1104
|
const projectBased = newConfig.useProjectHostname;
|
|
@@ -1130,18 +1112,18 @@ var init_config = __esm({
|
|
|
1130
1112
|
const isBrowser = typeof window !== "undefined" && window.location && window.location.hostname;
|
|
1131
1113
|
const isLocalhost = isBrowser && isLocal(window.location.hostname);
|
|
1132
1114
|
if (isBrowser && isLocalhost && newConfig.token && newConfig.ignoreBrowserTokenWarning !== true) {
|
|
1133
|
-
|
|
1115
|
+
printBrowserTokenWarning();
|
|
1134
1116
|
} else if (typeof newConfig.useCdn === "undefined") {
|
|
1135
|
-
|
|
1117
|
+
printCdnWarning();
|
|
1136
1118
|
}
|
|
1137
1119
|
if (projectBased) {
|
|
1138
|
-
|
|
1120
|
+
projectId(newConfig.projectId);
|
|
1139
1121
|
}
|
|
1140
1122
|
if (newConfig.dataset) {
|
|
1141
|
-
|
|
1123
|
+
dataset(newConfig.dataset);
|
|
1142
1124
|
}
|
|
1143
1125
|
if ("requestTagPrefix" in newConfig) {
|
|
1144
|
-
newConfig.requestTagPrefix = newConfig.requestTagPrefix ?
|
|
1126
|
+
newConfig.requestTagPrefix = newConfig.requestTagPrefix ? requestTag(newConfig.requestTagPrefix).replace(/\.+$/, "") : void 0;
|
|
1145
1127
|
}
|
|
1146
1128
|
newConfig.apiVersion = `${newConfig.apiVersion}`.replace(/^v/, "");
|
|
1147
1129
|
newConfig.isDefaultApi = newConfig.apiHost === defaultConfig.apiHost;
|
|
@@ -1166,20 +1148,19 @@ var init_config = __esm({
|
|
|
1166
1148
|
// src/sanityClient.js
|
|
1167
1149
|
var require_sanityClient = __commonJS({
|
|
1168
1150
|
"src/sanityClient.js"(exports, module) {
|
|
1169
|
-
var import_object_assign = __toESM(require_object_assign());
|
|
1170
1151
|
var { Observable: Observable2, map: map2, filter: filter2 } = (init_observable_modern(), __toCommonJS(observable_modern_exports));
|
|
1171
1152
|
var Patch = require_patch();
|
|
1172
1153
|
var Transaction = require_transaction();
|
|
1173
1154
|
var dataMethods = require_dataMethods();
|
|
1174
1155
|
var DatasetsClient = require_datasetsClient();
|
|
1175
|
-
var
|
|
1156
|
+
var ProjectsClient2 = (init_projectsClient(), __toCommonJS(projectsClient_exports));
|
|
1176
1157
|
var AssetsClient = require_assetsClient();
|
|
1177
|
-
var
|
|
1158
|
+
var UsersClient2 = (init_usersClient(), __toCommonJS(usersClient_exports));
|
|
1178
1159
|
var AuthClient = require_authClient();
|
|
1179
|
-
var
|
|
1180
|
-
var getRequestOptions =
|
|
1160
|
+
var httpRequest2 = (init_request(), __toCommonJS(request_exports));
|
|
1161
|
+
var getRequestOptions = (init_requestOptions(), __toCommonJS(requestOptions_exports));
|
|
1181
1162
|
var { defaultConfig: defaultConfig2, initConfig: initConfig2 } = (init_config(), __toCommonJS(config_exports));
|
|
1182
|
-
var
|
|
1163
|
+
var validate = (init_validators(), __toCommonJS(validators_exports));
|
|
1183
1164
|
var toPromise = (observable2) => observable2.toPromise();
|
|
1184
1165
|
function SanityClient(config = defaultConfig2) {
|
|
1185
1166
|
if (!(this instanceof SanityClient)) {
|
|
@@ -1188,8 +1169,8 @@ var require_sanityClient = __commonJS({
|
|
|
1188
1169
|
this.config(config);
|
|
1189
1170
|
this.assets = new AssetsClient(this);
|
|
1190
1171
|
this.datasets = new DatasetsClient(this);
|
|
1191
|
-
this.projects = new
|
|
1192
|
-
this.users = new
|
|
1172
|
+
this.projects = new ProjectsClient2(this);
|
|
1173
|
+
this.users = new UsersClient2(this);
|
|
1193
1174
|
this.auth = new AuthClient(this);
|
|
1194
1175
|
if (this.clientConfig.isPromiseAPI) {
|
|
1195
1176
|
const observableConfig = Object.assign({}, this.clientConfig, { isPromiseAPI: false });
|
|
@@ -1228,7 +1209,7 @@ var require_sanityClient = __commonJS({
|
|
|
1228
1209
|
const useCdn = this.clientConfig.useCdn && canUseCdn;
|
|
1229
1210
|
const tag = options.tag && this.clientConfig.requestTagPrefix ? [this.clientConfig.requestTagPrefix, options.tag].join(".") : options.tag || this.clientConfig.requestTagPrefix;
|
|
1230
1211
|
if (tag) {
|
|
1231
|
-
options.query = { tag:
|
|
1212
|
+
options.query = { tag: validate.requestTag(tag), ...options.query };
|
|
1232
1213
|
}
|
|
1233
1214
|
const reqOptions = getRequestOptions(
|
|
1234
1215
|
this.clientConfig,
|
|
@@ -1237,7 +1218,7 @@ var require_sanityClient = __commonJS({
|
|
|
1237
1218
|
})
|
|
1238
1219
|
);
|
|
1239
1220
|
return new Observable2(
|
|
1240
|
-
(subscriber) =>
|
|
1221
|
+
(subscriber) => httpRequest2(reqOptions, this.clientConfig.requester).subscribe(subscriber)
|
|
1241
1222
|
);
|
|
1242
1223
|
},
|
|
1243
1224
|
request(options) {
|
|
@@ -1250,16 +1231,11 @@ var require_sanityClient = __commonJS({
|
|
|
1250
1231
|
});
|
|
1251
1232
|
SanityClient.Patch = Patch;
|
|
1252
1233
|
SanityClient.Transaction = Transaction;
|
|
1253
|
-
SanityClient.ClientError =
|
|
1254
|
-
SanityClient.ServerError =
|
|
1255
|
-
SanityClient.requester =
|
|
1234
|
+
SanityClient.ClientError = httpRequest2.ClientError;
|
|
1235
|
+
SanityClient.ServerError = httpRequest2.ServerError;
|
|
1236
|
+
SanityClient.requester = httpRequest2.defaultRequester;
|
|
1256
1237
|
module.exports = SanityClient;
|
|
1257
1238
|
}
|
|
1258
1239
|
});
|
|
1259
1240
|
export default require_sanityClient();
|
|
1260
|
-
/*
|
|
1261
|
-
object-assign
|
|
1262
|
-
(c) Sindre Sorhus
|
|
1263
|
-
@license MIT
|
|
1264
|
-
*/
|
|
1265
1241
|
//# sourceMappingURL=sanityClient.browser.mjs.map
|