@plasmicapp/data-sources 0.1.108 → 0.1.110

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.
@@ -6,6 +6,307 @@ import { useDataEnv } from '@plasmicapp/host';
6
6
  import fetch from '@plasmicapp/isomorphic-unfetch';
7
7
  import stringify from 'fast-stringify';
8
8
 
9
+ function _regeneratorRuntime() {
10
+ _regeneratorRuntime = function () {
11
+ return e;
12
+ };
13
+ var t,
14
+ e = {},
15
+ r = Object.prototype,
16
+ n = r.hasOwnProperty,
17
+ o = Object.defineProperty || function (t, e, r) {
18
+ t[e] = r.value;
19
+ },
20
+ i = "function" == typeof Symbol ? Symbol : {},
21
+ a = i.iterator || "@@iterator",
22
+ c = i.asyncIterator || "@@asyncIterator",
23
+ u = i.toStringTag || "@@toStringTag";
24
+ function define(t, e, r) {
25
+ return Object.defineProperty(t, e, {
26
+ value: r,
27
+ enumerable: !0,
28
+ configurable: !0,
29
+ writable: !0
30
+ }), t[e];
31
+ }
32
+ try {
33
+ define({}, "");
34
+ } catch (t) {
35
+ define = function (t, e, r) {
36
+ return t[e] = r;
37
+ };
38
+ }
39
+ function wrap(t, e, r, n) {
40
+ var i = e && e.prototype instanceof Generator ? e : Generator,
41
+ a = Object.create(i.prototype),
42
+ c = new Context(n || []);
43
+ return o(a, "_invoke", {
44
+ value: makeInvokeMethod(t, r, c)
45
+ }), a;
46
+ }
47
+ function tryCatch(t, e, r) {
48
+ try {
49
+ return {
50
+ type: "normal",
51
+ arg: t.call(e, r)
52
+ };
53
+ } catch (t) {
54
+ return {
55
+ type: "throw",
56
+ arg: t
57
+ };
58
+ }
59
+ }
60
+ e.wrap = wrap;
61
+ var h = "suspendedStart",
62
+ l = "suspendedYield",
63
+ f = "executing",
64
+ s = "completed",
65
+ y = {};
66
+ function Generator() {}
67
+ function GeneratorFunction() {}
68
+ function GeneratorFunctionPrototype() {}
69
+ var p = {};
70
+ define(p, a, function () {
71
+ return this;
72
+ });
73
+ var d = Object.getPrototypeOf,
74
+ v = d && d(d(values([])));
75
+ v && v !== r && n.call(v, a) && (p = v);
76
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
77
+ function defineIteratorMethods(t) {
78
+ ["next", "throw", "return"].forEach(function (e) {
79
+ define(t, e, function (t) {
80
+ return this._invoke(e, t);
81
+ });
82
+ });
83
+ }
84
+ function AsyncIterator(t, e) {
85
+ function invoke(r, o, i, a) {
86
+ var c = tryCatch(t[r], t, o);
87
+ if ("throw" !== c.type) {
88
+ var u = c.arg,
89
+ h = u.value;
90
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
91
+ invoke("next", t, i, a);
92
+ }, function (t) {
93
+ invoke("throw", t, i, a);
94
+ }) : e.resolve(h).then(function (t) {
95
+ u.value = t, i(u);
96
+ }, function (t) {
97
+ return invoke("throw", t, i, a);
98
+ });
99
+ }
100
+ a(c.arg);
101
+ }
102
+ var r;
103
+ o(this, "_invoke", {
104
+ value: function (t, n) {
105
+ function callInvokeWithMethodAndArg() {
106
+ return new e(function (e, r) {
107
+ invoke(t, n, e, r);
108
+ });
109
+ }
110
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
111
+ }
112
+ });
113
+ }
114
+ function makeInvokeMethod(e, r, n) {
115
+ var o = h;
116
+ return function (i, a) {
117
+ if (o === f) throw new Error("Generator is already running");
118
+ if (o === s) {
119
+ if ("throw" === i) throw a;
120
+ return {
121
+ value: t,
122
+ done: !0
123
+ };
124
+ }
125
+ for (n.method = i, n.arg = a;;) {
126
+ var c = n.delegate;
127
+ if (c) {
128
+ var u = maybeInvokeDelegate(c, n);
129
+ if (u) {
130
+ if (u === y) continue;
131
+ return u;
132
+ }
133
+ }
134
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
135
+ if (o === h) throw o = s, n.arg;
136
+ n.dispatchException(n.arg);
137
+ } else "return" === n.method && n.abrupt("return", n.arg);
138
+ o = f;
139
+ var p = tryCatch(e, r, n);
140
+ if ("normal" === p.type) {
141
+ if (o = n.done ? s : l, p.arg === y) continue;
142
+ return {
143
+ value: p.arg,
144
+ done: n.done
145
+ };
146
+ }
147
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
148
+ }
149
+ };
150
+ }
151
+ function maybeInvokeDelegate(e, r) {
152
+ var n = r.method,
153
+ o = e.iterator[n];
154
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
155
+ var i = tryCatch(o, e.iterator, r.arg);
156
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
157
+ var a = i.arg;
158
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
159
+ }
160
+ function pushTryEntry(t) {
161
+ var e = {
162
+ tryLoc: t[0]
163
+ };
164
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
165
+ }
166
+ function resetTryEntry(t) {
167
+ var e = t.completion || {};
168
+ e.type = "normal", delete e.arg, t.completion = e;
169
+ }
170
+ function Context(t) {
171
+ this.tryEntries = [{
172
+ tryLoc: "root"
173
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
174
+ }
175
+ function values(e) {
176
+ if (e || "" === e) {
177
+ var r = e[a];
178
+ if (r) return r.call(e);
179
+ if ("function" == typeof e.next) return e;
180
+ if (!isNaN(e.length)) {
181
+ var o = -1,
182
+ i = function next() {
183
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
184
+ return next.value = t, next.done = !0, next;
185
+ };
186
+ return i.next = i;
187
+ }
188
+ }
189
+ throw new TypeError(typeof e + " is not iterable");
190
+ }
191
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
192
+ value: GeneratorFunctionPrototype,
193
+ configurable: !0
194
+ }), o(GeneratorFunctionPrototype, "constructor", {
195
+ value: GeneratorFunction,
196
+ configurable: !0
197
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
198
+ var e = "function" == typeof t && t.constructor;
199
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
200
+ }, e.mark = function (t) {
201
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
202
+ }, e.awrap = function (t) {
203
+ return {
204
+ __await: t
205
+ };
206
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
207
+ return this;
208
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
209
+ void 0 === i && (i = Promise);
210
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
211
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
212
+ return t.done ? t.value : a.next();
213
+ });
214
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
215
+ return this;
216
+ }), define(g, "toString", function () {
217
+ return "[object Generator]";
218
+ }), e.keys = function (t) {
219
+ var e = Object(t),
220
+ r = [];
221
+ for (var n in e) r.push(n);
222
+ return r.reverse(), function next() {
223
+ for (; r.length;) {
224
+ var t = r.pop();
225
+ if (t in e) return next.value = t, next.done = !1, next;
226
+ }
227
+ return next.done = !0, next;
228
+ };
229
+ }, e.values = values, Context.prototype = {
230
+ constructor: Context,
231
+ reset: function (e) {
232
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
233
+ },
234
+ stop: function () {
235
+ this.done = !0;
236
+ var t = this.tryEntries[0].completion;
237
+ if ("throw" === t.type) throw t.arg;
238
+ return this.rval;
239
+ },
240
+ dispatchException: function (e) {
241
+ if (this.done) throw e;
242
+ var r = this;
243
+ function handle(n, o) {
244
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
245
+ }
246
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
247
+ var i = this.tryEntries[o],
248
+ a = i.completion;
249
+ if ("root" === i.tryLoc) return handle("end");
250
+ if (i.tryLoc <= this.prev) {
251
+ var c = n.call(i, "catchLoc"),
252
+ u = n.call(i, "finallyLoc");
253
+ if (c && u) {
254
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
255
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
256
+ } else if (c) {
257
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
258
+ } else {
259
+ if (!u) throw new Error("try statement without catch or finally");
260
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
261
+ }
262
+ }
263
+ }
264
+ },
265
+ abrupt: function (t, e) {
266
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
267
+ var o = this.tryEntries[r];
268
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
269
+ var i = o;
270
+ break;
271
+ }
272
+ }
273
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
274
+ var a = i ? i.completion : {};
275
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
276
+ },
277
+ complete: function (t, e) {
278
+ if ("throw" === t.type) throw t.arg;
279
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
280
+ },
281
+ finish: function (t) {
282
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
283
+ var r = this.tryEntries[e];
284
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
285
+ }
286
+ },
287
+ catch: function (t) {
288
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
289
+ var r = this.tryEntries[e];
290
+ if (r.tryLoc === t) {
291
+ var n = r.completion;
292
+ if ("throw" === n.type) {
293
+ var o = n.arg;
294
+ resetTryEntry(r);
295
+ }
296
+ return o;
297
+ }
298
+ }
299
+ throw new Error("illegal catch attempt");
300
+ },
301
+ delegateYield: function (e, r, n) {
302
+ return this.delegate = {
303
+ iterator: values(e),
304
+ resultName: r,
305
+ nextLoc: n
306
+ }, "next" === this.method && (this.arg = t), y;
307
+ }
308
+ }, e;
309
+ }
9
310
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
10
311
  try {
11
312
  var info = gen[key](arg);
@@ -51,753 +352,84 @@ function _extends() {
51
352
  return _extends.apply(this, arguments);
52
353
  }
53
354
 
54
- function createCommonjsModule(fn, module) {
55
- return module = { exports: {} }, fn(module, module.exports), module.exports;
56
- }
57
-
58
- var runtime_1 = /*#__PURE__*/createCommonjsModule(function (module) {
59
- /**
60
- * Copyright (c) 2014-present, Facebook, Inc.
61
- *
62
- * This source code is licensed under the MIT license found in the
63
- * LICENSE file in the root directory of this source tree.
64
- */
65
-
66
- var runtime = function (exports) {
67
-
68
- var Op = Object.prototype;
69
- var hasOwn = Op.hasOwnProperty;
70
- var undefined$1; // More compressible than void 0.
71
- var $Symbol = typeof Symbol === "function" ? Symbol : {};
72
- var iteratorSymbol = $Symbol.iterator || "@@iterator";
73
- var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
74
- var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
75
- function define(obj, key, value) {
76
- Object.defineProperty(obj, key, {
77
- value: value,
78
- enumerable: true,
79
- configurable: true,
80
- writable: true
81
- });
82
- return obj[key];
83
- }
84
- try {
85
- // IE 8 has a broken Object.defineProperty that only works on DOM objects.
86
- define({}, "");
87
- } catch (err) {
88
- define = function define(obj, key, value) {
89
- return obj[key] = value;
90
- };
91
- }
92
- function wrap(innerFn, outerFn, self, tryLocsList) {
93
- // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
94
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
95
- var generator = Object.create(protoGenerator.prototype);
96
- var context = new Context(tryLocsList || []);
97
-
98
- // The ._invoke method unifies the implementations of the .next,
99
- // .throw, and .return methods.
100
- generator._invoke = makeInvokeMethod(innerFn, self, context);
101
- return generator;
102
- }
103
- exports.wrap = wrap;
104
-
105
- // Try/catch helper to minimize deoptimizations. Returns a completion
106
- // record like context.tryEntries[i].completion. This interface could
107
- // have been (and was previously) designed to take a closure to be
108
- // invoked without arguments, but in all the cases we care about we
109
- // already have an existing method we want to call, so there's no need
110
- // to create a new function object. We can even get away with assuming
111
- // the method takes exactly one argument, since that happens to be true
112
- // in every case, so we don't have to touch the arguments object. The
113
- // only additional allocation required is the completion record, which
114
- // has a stable shape and so hopefully should be cheap to allocate.
115
- function tryCatch(fn, obj, arg) {
116
- try {
117
- return {
118
- type: "normal",
119
- arg: fn.call(obj, arg)
120
- };
121
- } catch (err) {
122
- return {
123
- type: "throw",
124
- arg: err
125
- };
126
- }
127
- }
128
- var GenStateSuspendedStart = "suspendedStart";
129
- var GenStateSuspendedYield = "suspendedYield";
130
- var GenStateExecuting = "executing";
131
- var GenStateCompleted = "completed";
132
-
133
- // Returning this object from the innerFn has the same effect as
134
- // breaking out of the dispatch switch statement.
135
- var ContinueSentinel = {};
136
-
137
- // Dummy constructor functions that we use as the .constructor and
138
- // .constructor.prototype properties for functions that return Generator
139
- // objects. For full spec compliance, you may wish to configure your
140
- // minifier not to mangle the names of these two functions.
141
- function Generator() {}
142
- function GeneratorFunction() {}
143
- function GeneratorFunctionPrototype() {}
144
-
145
- // This is a polyfill for %IteratorPrototype% for environments that
146
- // don't natively support it.
147
- var IteratorPrototype = {};
148
- define(IteratorPrototype, iteratorSymbol, function () {
149
- return this;
150
- });
151
- var getProto = Object.getPrototypeOf;
152
- var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
153
- if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
154
- // This environment has a native %IteratorPrototype%; use it instead
155
- // of the polyfill.
156
- IteratorPrototype = NativeIteratorPrototype;
157
- }
158
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
159
- GeneratorFunction.prototype = GeneratorFunctionPrototype;
160
- define(Gp, "constructor", GeneratorFunctionPrototype);
161
- define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
162
- GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
163
-
164
- // Helper for defining the .next, .throw, and .return methods of the
165
- // Iterator interface in terms of a single ._invoke method.
166
- function defineIteratorMethods(prototype) {
167
- ["next", "throw", "return"].forEach(function (method) {
168
- define(prototype, method, function (arg) {
169
- return this._invoke(method, arg);
170
- });
171
- });
172
- }
173
- exports.isGeneratorFunction = function (genFun) {
174
- var ctor = typeof genFun === "function" && genFun.constructor;
175
- return ctor ? ctor === GeneratorFunction ||
176
- // For the native GeneratorFunction constructor, the best we can
177
- // do is to check its .name property.
178
- (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
179
- };
180
- exports.mark = function (genFun) {
181
- if (Object.setPrototypeOf) {
182
- Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
183
- } else {
184
- genFun.__proto__ = GeneratorFunctionPrototype;
185
- define(genFun, toStringTagSymbol, "GeneratorFunction");
186
- }
187
- genFun.prototype = Object.create(Gp);
188
- return genFun;
189
- };
190
-
191
- // Within the body of any async function, `await x` is transformed to
192
- // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
193
- // `hasOwn.call(value, "__await")` to determine if the yielded value is
194
- // meant to be awaited.
195
- exports.awrap = function (arg) {
196
- return {
197
- __await: arg
198
- };
199
- };
200
- function AsyncIterator(generator, PromiseImpl) {
201
- function invoke(method, arg, resolve, reject) {
202
- var record = tryCatch(generator[method], generator, arg);
203
- if (record.type === "throw") {
204
- reject(record.arg);
205
- } else {
206
- var result = record.arg;
207
- var value = result.value;
208
- if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
209
- return PromiseImpl.resolve(value.__await).then(function (value) {
210
- invoke("next", value, resolve, reject);
211
- }, function (err) {
212
- invoke("throw", err, resolve, reject);
213
- });
214
- }
215
- return PromiseImpl.resolve(value).then(function (unwrapped) {
216
- // When a yielded Promise is resolved, its final value becomes
217
- // the .value of the Promise<{value,done}> result for the
218
- // current iteration.
219
- result.value = unwrapped;
220
- resolve(result);
221
- }, function (error) {
222
- // If a rejected Promise was yielded, throw the rejection back
223
- // into the async generator function so it can be handled there.
224
- return invoke("throw", error, resolve, reject);
225
- });
226
- }
227
- }
228
- var previousPromise;
229
- function enqueue(method, arg) {
230
- function callInvokeWithMethodAndArg() {
231
- return new PromiseImpl(function (resolve, reject) {
232
- invoke(method, arg, resolve, reject);
233
- });
234
- }
235
- return previousPromise =
236
- // If enqueue has been called before, then we want to wait until
237
- // all previous Promises have been resolved before calling invoke,
238
- // so that results are always delivered in the correct order. If
239
- // enqueue has not been called before, then it is important to
240
- // call invoke immediately, without waiting on a callback to fire,
241
- // so that the async generator function has the opportunity to do
242
- // any necessary setup in a predictable way. This predictability
243
- // is why the Promise constructor synchronously invokes its
244
- // executor callback, and why async functions synchronously
245
- // execute code before the first await. Since we implement simple
246
- // async functions in terms of async generators, it is especially
247
- // important to get this right, even though it requires care.
248
- previousPromise ? previousPromise.then(callInvokeWithMethodAndArg,
249
- // Avoid propagating failures to Promises returned by later
250
- // invocations of the iterator.
251
- callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
252
- }
253
-
254
- // Define the unified helper method that is used to implement .next,
255
- // .throw, and .return (see defineIteratorMethods).
256
- this._invoke = enqueue;
257
- }
258
- defineIteratorMethods(AsyncIterator.prototype);
259
- define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
260
- return this;
261
- });
262
- exports.AsyncIterator = AsyncIterator;
263
-
264
- // Note that simple async functions are implemented on top of
265
- // AsyncIterator objects; they just return a Promise for the value of
266
- // the final result produced by the iterator.
267
- exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
268
- if (PromiseImpl === void 0) PromiseImpl = Promise;
269
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
270
- return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
271
- : iter.next().then(function (result) {
272
- return result.done ? result.value : iter.next();
273
- });
274
- };
275
- function makeInvokeMethod(innerFn, self, context) {
276
- var state = GenStateSuspendedStart;
277
- return function invoke(method, arg) {
278
- if (state === GenStateExecuting) {
279
- throw new Error("Generator is already running");
280
- }
281
- if (state === GenStateCompleted) {
282
- if (method === "throw") {
283
- throw arg;
284
- }
285
-
286
- // Be forgiving, per 25.3.3.3.3 of the spec:
287
- // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
288
- return doneResult();
289
- }
290
- context.method = method;
291
- context.arg = arg;
292
- while (true) {
293
- var delegate = context.delegate;
294
- if (delegate) {
295
- var delegateResult = maybeInvokeDelegate(delegate, context);
296
- if (delegateResult) {
297
- if (delegateResult === ContinueSentinel) continue;
298
- return delegateResult;
299
- }
300
- }
301
- if (context.method === "next") {
302
- // Setting context._sent for legacy support of Babel's
303
- // function.sent implementation.
304
- context.sent = context._sent = context.arg;
305
- } else if (context.method === "throw") {
306
- if (state === GenStateSuspendedStart) {
307
- state = GenStateCompleted;
308
- throw context.arg;
309
- }
310
- context.dispatchException(context.arg);
311
- } else if (context.method === "return") {
312
- context.abrupt("return", context.arg);
313
- }
314
- state = GenStateExecuting;
315
- var record = tryCatch(innerFn, self, context);
316
- if (record.type === "normal") {
317
- // If an exception is thrown from innerFn, we leave state ===
318
- // GenStateExecuting and loop back for another invocation.
319
- state = context.done ? GenStateCompleted : GenStateSuspendedYield;
320
- if (record.arg === ContinueSentinel) {
321
- continue;
322
- }
323
- return {
324
- value: record.arg,
325
- done: context.done
326
- };
327
- } else if (record.type === "throw") {
328
- state = GenStateCompleted;
329
- // Dispatch the exception by looping back around to the
330
- // context.dispatchException(context.arg) call above.
331
- context.method = "throw";
332
- context.arg = record.arg;
333
- }
334
- }
335
- };
336
- }
337
-
338
- // Call delegate.iterator[context.method](context.arg) and handle the
339
- // result, either by returning a { value, done } result from the
340
- // delegate iterator, or by modifying context.method and context.arg,
341
- // setting context.delegate to null, and returning the ContinueSentinel.
342
- function maybeInvokeDelegate(delegate, context) {
343
- var method = delegate.iterator[context.method];
344
- if (method === undefined$1) {
345
- // A .throw or .return when the delegate iterator has no .throw
346
- // method always terminates the yield* loop.
347
- context.delegate = null;
348
- if (context.method === "throw") {
349
- // Note: ["return"] must be used for ES3 parsing compatibility.
350
- if (delegate.iterator["return"]) {
351
- // If the delegate iterator has a return method, give it a
352
- // chance to clean up.
353
- context.method = "return";
354
- context.arg = undefined$1;
355
- maybeInvokeDelegate(delegate, context);
356
- if (context.method === "throw") {
357
- // If maybeInvokeDelegate(context) changed context.method from
358
- // "return" to "throw", let that override the TypeError below.
359
- return ContinueSentinel;
360
- }
361
- }
362
- context.method = "throw";
363
- context.arg = new TypeError("The iterator does not provide a 'throw' method");
364
- }
365
- return ContinueSentinel;
366
- }
367
- var record = tryCatch(method, delegate.iterator, context.arg);
368
- if (record.type === "throw") {
369
- context.method = "throw";
370
- context.arg = record.arg;
371
- context.delegate = null;
372
- return ContinueSentinel;
373
- }
374
- var info = record.arg;
375
- if (!info) {
376
- context.method = "throw";
377
- context.arg = new TypeError("iterator result is not an object");
378
- context.delegate = null;
379
- return ContinueSentinel;
380
- }
381
- if (info.done) {
382
- // Assign the result of the finished delegate to the temporary
383
- // variable specified by delegate.resultName (see delegateYield).
384
- context[delegate.resultName] = info.value;
385
-
386
- // Resume execution at the desired location (see delegateYield).
387
- context.next = delegate.nextLoc;
388
-
389
- // If context.method was "throw" but the delegate handled the
390
- // exception, let the outer generator proceed normally. If
391
- // context.method was "next", forget context.arg since it has been
392
- // "consumed" by the delegate iterator. If context.method was
393
- // "return", allow the original .return call to continue in the
394
- // outer generator.
395
- if (context.method !== "return") {
396
- context.method = "next";
397
- context.arg = undefined$1;
398
- }
399
- } else {
400
- // Re-yield the result returned by the delegate method.
401
- return info;
402
- }
403
-
404
- // The delegate iterator is finished, so forget it and continue with
405
- // the outer generator.
406
- context.delegate = null;
407
- return ContinueSentinel;
408
- }
409
-
410
- // Define Generator.prototype.{next,throw,return} in terms of the
411
- // unified ._invoke helper method.
412
- defineIteratorMethods(Gp);
413
- define(Gp, toStringTagSymbol, "Generator");
414
-
415
- // A Generator should always return itself as the iterator object when the
416
- // @@iterator function is called on it. Some browsers' implementations of the
417
- // iterator prototype chain incorrectly implement this, causing the Generator
418
- // object to not be returned from this call. This ensures that doesn't happen.
419
- // See https://github.com/facebook/regenerator/issues/274 for more details.
420
- define(Gp, iteratorSymbol, function () {
421
- return this;
422
- });
423
- define(Gp, "toString", function () {
424
- return "[object Generator]";
425
- });
426
- function pushTryEntry(locs) {
427
- var entry = {
428
- tryLoc: locs[0]
429
- };
430
- if (1 in locs) {
431
- entry.catchLoc = locs[1];
432
- }
433
- if (2 in locs) {
434
- entry.finallyLoc = locs[2];
435
- entry.afterLoc = locs[3];
436
- }
437
- this.tryEntries.push(entry);
438
- }
439
- function resetTryEntry(entry) {
440
- var record = entry.completion || {};
441
- record.type = "normal";
442
- delete record.arg;
443
- entry.completion = record;
444
- }
445
- function Context(tryLocsList) {
446
- // The root entry object (effectively a try statement without a catch
447
- // or a finally block) gives us a place to store values thrown from
448
- // locations where there is no enclosing try statement.
449
- this.tryEntries = [{
450
- tryLoc: "root"
451
- }];
452
- tryLocsList.forEach(pushTryEntry, this);
453
- this.reset(true);
454
- }
455
- exports.keys = function (object) {
456
- var keys = [];
457
- for (var key in object) {
458
- keys.push(key);
459
- }
460
- keys.reverse();
461
-
462
- // Rather than returning an object with a next method, we keep
463
- // things simple and return the next function itself.
464
- return function next() {
465
- while (keys.length) {
466
- var key = keys.pop();
467
- if (key in object) {
468
- next.value = key;
469
- next.done = false;
470
- return next;
471
- }
472
- }
473
-
474
- // To avoid creating an additional object, we just hang the .value
475
- // and .done properties off the next function object itself. This
476
- // also ensures that the minifier will not anonymize the function.
477
- next.done = true;
478
- return next;
479
- };
480
- };
481
- function values(iterable) {
482
- if (iterable) {
483
- var iteratorMethod = iterable[iteratorSymbol];
484
- if (iteratorMethod) {
485
- return iteratorMethod.call(iterable);
486
- }
487
- if (typeof iterable.next === "function") {
488
- return iterable;
489
- }
490
- if (!isNaN(iterable.length)) {
491
- var i = -1,
492
- next = function next() {
493
- while (++i < iterable.length) {
494
- if (hasOwn.call(iterable, i)) {
495
- next.value = iterable[i];
496
- next.done = false;
497
- return next;
498
- }
499
- }
500
- next.value = undefined$1;
501
- next.done = true;
502
- return next;
503
- };
504
- return next.next = next;
505
- }
506
- }
507
-
508
- // Return an iterator with no values.
509
- return {
510
- next: doneResult
511
- };
512
- }
513
- exports.values = values;
514
- function doneResult() {
515
- return {
516
- value: undefined$1,
517
- done: true
518
- };
519
- }
520
- Context.prototype = {
521
- constructor: Context,
522
- reset: function reset(skipTempReset) {
523
- this.prev = 0;
524
- this.next = 0;
525
- // Resetting context._sent for legacy support of Babel's
526
- // function.sent implementation.
527
- this.sent = this._sent = undefined$1;
528
- this.done = false;
529
- this.delegate = null;
530
- this.method = "next";
531
- this.arg = undefined$1;
532
- this.tryEntries.forEach(resetTryEntry);
533
- if (!skipTempReset) {
534
- for (var name in this) {
535
- // Not sure about the optimal order of these conditions:
536
- if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
537
- this[name] = undefined$1;
538
- }
539
- }
540
- }
541
- },
542
- stop: function stop() {
543
- this.done = true;
544
- var rootEntry = this.tryEntries[0];
545
- var rootRecord = rootEntry.completion;
546
- if (rootRecord.type === "throw") {
547
- throw rootRecord.arg;
548
- }
549
- return this.rval;
550
- },
551
- dispatchException: function dispatchException(exception) {
552
- if (this.done) {
553
- throw exception;
554
- }
555
- var context = this;
556
- function handle(loc, caught) {
557
- record.type = "throw";
558
- record.arg = exception;
559
- context.next = loc;
560
- if (caught) {
561
- // If the dispatched exception was caught by a catch block,
562
- // then let that catch block handle the exception normally.
563
- context.method = "next";
564
- context.arg = undefined$1;
565
- }
566
- return !!caught;
567
- }
568
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
569
- var entry = this.tryEntries[i];
570
- var record = entry.completion;
571
- if (entry.tryLoc === "root") {
572
- // Exception thrown outside of any try block that could handle
573
- // it, so set the completion value of the entire function to
574
- // throw the exception.
575
- return handle("end");
576
- }
577
- if (entry.tryLoc <= this.prev) {
578
- var hasCatch = hasOwn.call(entry, "catchLoc");
579
- var hasFinally = hasOwn.call(entry, "finallyLoc");
580
- if (hasCatch && hasFinally) {
581
- if (this.prev < entry.catchLoc) {
582
- return handle(entry.catchLoc, true);
583
- } else if (this.prev < entry.finallyLoc) {
584
- return handle(entry.finallyLoc);
585
- }
586
- } else if (hasCatch) {
587
- if (this.prev < entry.catchLoc) {
588
- return handle(entry.catchLoc, true);
589
- }
590
- } else if (hasFinally) {
591
- if (this.prev < entry.finallyLoc) {
592
- return handle(entry.finallyLoc);
593
- }
594
- } else {
595
- throw new Error("try statement without catch or finally");
596
- }
597
- }
598
- }
599
- },
600
- abrupt: function abrupt(type, arg) {
601
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
602
- var entry = this.tryEntries[i];
603
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
604
- var finallyEntry = entry;
605
- break;
606
- }
607
- }
608
- if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
609
- // Ignore the finally entry if control is not jumping to a
610
- // location outside the try/catch block.
611
- finallyEntry = null;
612
- }
613
- var record = finallyEntry ? finallyEntry.completion : {};
614
- record.type = type;
615
- record.arg = arg;
616
- if (finallyEntry) {
617
- this.method = "next";
618
- this.next = finallyEntry.finallyLoc;
619
- return ContinueSentinel;
620
- }
621
- return this.complete(record);
622
- },
623
- complete: function complete(record, afterLoc) {
624
- if (record.type === "throw") {
625
- throw record.arg;
626
- }
627
- if (record.type === "break" || record.type === "continue") {
628
- this.next = record.arg;
629
- } else if (record.type === "return") {
630
- this.rval = this.arg = record.arg;
631
- this.method = "return";
632
- this.next = "end";
633
- } else if (record.type === "normal" && afterLoc) {
634
- this.next = afterLoc;
635
- }
636
- return ContinueSentinel;
637
- },
638
- finish: function finish(finallyLoc) {
639
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
640
- var entry = this.tryEntries[i];
641
- if (entry.finallyLoc === finallyLoc) {
642
- this.complete(entry.completion, entry.afterLoc);
643
- resetTryEntry(entry);
644
- return ContinueSentinel;
645
- }
646
- }
647
- },
648
- "catch": function _catch(tryLoc) {
649
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
650
- var entry = this.tryEntries[i];
651
- if (entry.tryLoc === tryLoc) {
652
- var record = entry.completion;
653
- if (record.type === "throw") {
654
- var thrown = record.arg;
655
- resetTryEntry(entry);
656
- }
657
- return thrown;
658
- }
659
- }
660
-
661
- // The context.catch method must only be called with a location
662
- // argument that corresponds to a known catch block.
663
- throw new Error("illegal catch attempt");
664
- },
665
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
666
- this.delegate = {
667
- iterator: values(iterable),
668
- resultName: resultName,
669
- nextLoc: nextLoc
670
- };
671
- if (this.method === "next") {
672
- // Deliberately forget the last sent value so that we don't
673
- // accidentally pass it on to the delegate.
674
- this.arg = undefined$1;
675
- }
676
- return ContinueSentinel;
677
- }
678
- };
679
-
680
- // Regardless of whether this script is executing as a CommonJS module
681
- // or not, return the runtime object so that we can declare the variable
682
- // regeneratorRuntime in the outer scope, which allows this module to be
683
- // injected easily by `bin/regenerator --include-runtime script.js`.
684
- return exports;
685
- }(
686
- // If this script is executing as a CommonJS module, use module.exports
687
- // as the regeneratorRuntime namespace. Otherwise create a new empty
688
- // object. Either way, the resulting object will be used to initialize
689
- // the regeneratorRuntime variable at the top of this file.
690
- module.exports );
691
- try {
692
- regeneratorRuntime = runtime;
693
- } catch (accidentalStrictMode) {
694
- // This module should not be running in strict mode, so the above
695
- // assignment should always work unless something is misconfigured. Just
696
- // in case runtime.js accidentally runs in strict mode, in modern engines
697
- // we can explicitly access globalThis. In older engines we can escape
698
- // strict mode using a global Function call. This could conceivably fail
699
- // if a Content Security Policy forbids using Function, but in that case
700
- // the proper solution is to fix the accidental strict mode problem. If
701
- // you've misconfigured your bundler to force strict mode and applied a
702
- // CSP to forbid Function, and you're not willing to fix either of those
703
- // problems, please detail your unique predicament in a GitHub issue.
704
- if (typeof globalThis === "object") {
705
- globalThis.regeneratorRuntime = runtime;
706
- } else {
707
- Function("r", "regeneratorRuntime = r")(runtime);
708
- }
709
- }
710
- });
711
-
355
+ var _executePlasmicDataOp2, _executePlasmicDataOp3;
712
356
  var DEFAULT_HOST = 'https://data.plasmic.app';
713
357
  var UNAUTHORIZED_MESSAGE = 'You do not have permission to perform this operation. Login to get access or contact the app owner to get access.';
714
358
  function executePlasmicDataOp(_x, _x2) {
715
- return _executePlasmicDataOp2.apply(this, arguments);
716
- }
717
- function _executePlasmicDataOp2() {
718
- _executePlasmicDataOp2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(op, opts) {
359
+ return (_executePlasmicDataOp2 = _executePlasmicDataOp2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(op, opts) {
719
360
  var func, res;
720
- return runtime_1.wrap(function _callee$(_context) {
721
- while (1) {
722
- switch (_context.prev = _context.next) {
723
- case 0:
724
- func = getConfig('__PLASMIC_EXECUTE_DATA_OP', _executePlasmicDataOp);
725
- _context.next = 3;
726
- return wrapLoadingFetcher(func)(op, opts);
727
- case 3:
728
- res = _context.sent;
729
- return _context.abrupt("return", res);
730
- case 5:
731
- case "end":
732
- return _context.stop();
733
- }
361
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
362
+ while (1) switch (_context.prev = _context.next) {
363
+ case 0:
364
+ func = getConfig('__PLASMIC_EXECUTE_DATA_OP', _executePlasmicDataOp);
365
+ _context.next = 3;
366
+ return wrapLoadingFetcher(func)(op, opts);
367
+ case 3:
368
+ res = _context.sent;
369
+ return _context.abrupt("return", res);
370
+ case 5:
371
+ case "end":
372
+ return _context.stop();
734
373
  }
735
374
  }, _callee);
736
- }));
737
- return _executePlasmicDataOp2.apply(this, arguments);
375
+ }))).apply(this, arguments);
738
376
  }
739
377
  function _executePlasmicDataOp(_x3, _x4) {
740
- return _executePlasmicDataOp3.apply(this, arguments);
741
- }
742
- function _executePlasmicDataOp3() {
743
- _executePlasmicDataOp3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(op, opts) {
378
+ return (_executePlasmicDataOp3 = _executePlasmicDataOp3 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(op, opts) {
744
379
  var _op$userArgs;
745
380
  var host, url, resp, text;
746
- return runtime_1.wrap(function _callee2$(_context2) {
747
- while (1) {
748
- switch (_context2.prev = _context2.next) {
749
- case 0:
750
- if (!op.roleId) {
751
- _context2.next = 4;
752
- break;
753
- }
754
- if (!(!(opts != null && opts.user) || !opts.user.roleIds.includes(op.roleId))) {
755
- _context2.next = 4;
756
- break;
757
- }
758
- console.error(UNAUTHORIZED_MESSAGE);
759
- throw new Error(UNAUTHORIZED_MESSAGE);
760
- case 4:
761
- host = getConfig('__PLASMIC_DATA_HOST', DEFAULT_HOST);
762
- url = host + "/api/v1/server-data/sources/" + op.sourceId + "/execute";
763
- _context2.next = 8;
764
- return fetch(url, {
765
- method: 'POST',
766
- headers: _extends({
767
- 'Content-Type': 'application/json'
768
- }, (opts == null ? void 0 : opts.userAuthToken) && {
769
- 'x-plasmic-data-user-auth-token': opts.userAuthToken
770
- }),
771
- body: stringify({
772
- opId: op.opId,
773
- userArgs: (_op$userArgs = op.userArgs) != null ? _op$userArgs : {},
774
- paginate: opts == null ? void 0 : opts.paginate
775
- })
776
- });
777
- case 8:
778
- resp = _context2.sent;
779
- if (!(resp.status !== 200)) {
780
- _context2.next = 14;
781
- break;
782
- }
783
- _context2.next = 12;
784
- return resp.text();
785
- case 12:
786
- text = _context2.sent;
787
- throw new Error(text);
788
- case 14:
789
- _context2.next = 16;
790
- return resp.json();
791
- case 16:
792
- return _context2.abrupt("return", _context2.sent);
793
- case 17:
794
- case "end":
795
- return _context2.stop();
796
- }
381
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
382
+ while (1) switch (_context2.prev = _context2.next) {
383
+ case 0:
384
+ if (!op.roleId) {
385
+ _context2.next = 4;
386
+ break;
387
+ }
388
+ if (!(!(opts != null && opts.user) || !opts.user.roleIds.includes(op.roleId))) {
389
+ _context2.next = 4;
390
+ break;
391
+ }
392
+ console.error(UNAUTHORIZED_MESSAGE);
393
+ throw new Error(UNAUTHORIZED_MESSAGE);
394
+ case 4:
395
+ host = getConfig('__PLASMIC_DATA_HOST', DEFAULT_HOST);
396
+ url = host + "/api/v1/server-data/sources/" + op.sourceId + "/execute";
397
+ _context2.next = 8;
398
+ return fetch(url, {
399
+ method: 'POST',
400
+ headers: _extends({
401
+ 'Content-Type': 'application/json'
402
+ }, (opts == null ? void 0 : opts.userAuthToken) && {
403
+ 'x-plasmic-data-user-auth-token': opts.userAuthToken
404
+ }),
405
+ body: stringify({
406
+ opId: op.opId,
407
+ userArgs: (_op$userArgs = op.userArgs) != null ? _op$userArgs : {},
408
+ paginate: opts == null ? void 0 : opts.paginate
409
+ })
410
+ });
411
+ case 8:
412
+ resp = _context2.sent;
413
+ if (!(resp.status !== 200)) {
414
+ _context2.next = 14;
415
+ break;
416
+ }
417
+ _context2.next = 12;
418
+ return resp.text();
419
+ case 12:
420
+ text = _context2.sent;
421
+ throw new Error(text);
422
+ case 14:
423
+ _context2.next = 16;
424
+ return resp.json();
425
+ case 16:
426
+ return _context2.abrupt("return", _context2.sent);
427
+ case 17:
428
+ case "end":
429
+ return _context2.stop();
797
430
  }
798
431
  }, _callee2);
799
- }));
800
- return _executePlasmicDataOp3.apply(this, arguments);
432
+ }))).apply(this, arguments);
801
433
  }
802
434
  function getConfig(key, defaultValue) {
803
435
  if (typeof globalThis === 'undefined') {
@@ -870,6 +502,18 @@ function mkUndefinedDataProxy(promiseRef, fetchAndUpdateCache) {
870
502
  });
871
503
  }
872
504
  var reactMajorVersion = + /*#__PURE__*/React.version.split('.')[0];
505
+ /**
506
+ * Fetches can be kicked off two ways -- normally, by useSWR(), or by some
507
+ * expression accessing the `$queries.*` proxy when not ready yet. We need
508
+ * a global cache for proxy-invoked caches, so that different components
509
+ * with the same key can share the same fetch.
510
+ *
511
+ * The life cycle for this cache is short -- only the duration of a
512
+ * proxy-invoked fetch, and once the fetch is done. That's because we really
513
+ * just want SWR to be managing the cache, not us! Once the data is in SWR,
514
+ * we will use SWR for getting data.
515
+ */
516
+ var PRE_FETCHES = /*#__PURE__*/new Map();
873
517
  function usePlasmicDataOp(dataOp, opts) {
874
518
  var _ph$useDataEnv;
875
519
  var ctx = usePlasmicDataSourceContext();
@@ -889,9 +533,19 @@ function usePlasmicDataOp(dataOp, opts) {
889
533
  }, [key]);
890
534
  var fetcher = React.useMemo(function () {
891
535
  return function () {
536
+ // If we are in this function, that means SWR cache missed.
892
537
  if (fetchingData.fetchingPromise) {
538
+ // Fetch is already underway from this hook
893
539
  return fetchingData.fetchingPromise;
894
540
  }
541
+ if (key && PRE_FETCHES.has(key)) {
542
+ // Some other usePlasmicDataOp() hook elsewhere has already
543
+ // started this fetch as well; re-use it here.
544
+ var existing = PRE_FETCHES.get(key);
545
+ fetchingData.fetchingPromise = existing;
546
+ return existing;
547
+ }
548
+ // Else we really need to kick off this fetch now...
895
549
  var fetcherFn = function fetcherFn() {
896
550
  return (
897
551
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -904,15 +558,38 @@ function usePlasmicDataOp(dataOp, opts) {
904
558
  };
905
559
  var fetcherPromise = fetcherFn();
906
560
  fetchingData.fetchingPromise = fetcherPromise;
561
+ if (key) {
562
+ PRE_FETCHES.set(key, fetcherPromise);
563
+ fetcherPromise.then(function () {
564
+ // Once we have a result, we rely on swr to perform the caching,
565
+ // so remove from our cache as quickly as possible.
566
+ PRE_FETCHES["delete"](key);
567
+ });
568
+ }
907
569
  return fetcherPromise;
908
570
  };
909
571
  }, [key, fetchingData]);
910
572
  var fetchAndUpdateCache = React.useMemo(function () {
911
573
  return function () {
574
+ // This function is called when the undefined data proxy is invoked.
575
+ // USUALLY, this means the data is not available in SWR yet, and
576
+ // we need to kick off a fetch.
912
577
  if (fetchingData.fetchingPromise) {
913
578
  // No need to update cache as the exist promise call site will do it
914
579
  return fetchingData.fetchingPromise;
915
580
  }
581
+ // SOMETIMES, SWR actually _does_ have the cache, but we still end up
582
+ // here. That's because of how we update $queries, which takes two
583
+ // cycles; each time we render, we build a `new$Queries`, and
584
+ // `set$Queries(new$Queries)`. So once the data is ready, at the
585
+ // first render, we will have data in `new$Queries` but not `$queries`,
586
+ // but we will still finish rendering that pass, which means any `$queries`
587
+ // access will still end up here. So we look into the SWR cache and
588
+ // return any data that's here.
589
+ var cached = cache.get(key);
590
+ if (cached) {
591
+ return Promise.resolve(cached);
592
+ }
916
593
  var fetcherPromise = fetcher();
917
594
  fetcherPromise.then(function (data) {
918
595
  return mutate(key, data);
@@ -924,7 +601,7 @@ function usePlasmicDataOp(dataOp, opts) {
924
601
  error: err
925
602
  }));
926
603
  });
927
- return fetcherPromise;
604
+ return fetchingData.fetchingPromise;
928
605
  };
929
606
  }, [fetcher, fetchingData, cache, key]);
930
607
  var res = useMutablePlasmicQueryData(key, fetcher, {
@@ -954,29 +631,27 @@ function usePlasmicDataMutationOp(dataOp) {
954
631
  userArgs = _ref.userArgs;
955
632
  var ctx = usePlasmicDataSourceContext();
956
633
  var userToken = ctx == null ? void 0 : ctx.userAuthToken;
957
- return React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
958
- return runtime_1.wrap(function _callee$(_context) {
959
- while (1) {
960
- switch (_context.prev = _context.next) {
961
- case 0:
962
- if (!(!sourceId || !opId)) {
963
- _context.next = 2;
964
- break;
965
- }
966
- return _context.abrupt("return", undefined);
967
- case 2:
968
- return _context.abrupt("return", executePlasmicDataOp({
969
- sourceId: sourceId,
970
- opId: opId,
971
- userArgs: userArgs
972
- }, {
973
- userAuthToken: userToken || undefined,
974
- user: ctx == null ? void 0 : ctx.user
975
- }));
976
- case 3:
977
- case "end":
978
- return _context.stop();
979
- }
634
+ return React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
635
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
636
+ while (1) switch (_context.prev = _context.next) {
637
+ case 0:
638
+ if (!(!sourceId || !opId)) {
639
+ _context.next = 2;
640
+ break;
641
+ }
642
+ return _context.abrupt("return", undefined);
643
+ case 2:
644
+ return _context.abrupt("return", executePlasmicDataOp({
645
+ sourceId: sourceId,
646
+ opId: opId,
647
+ userArgs: userArgs
648
+ }, {
649
+ userAuthToken: userToken || undefined,
650
+ user: ctx == null ? void 0 : ctx.user
651
+ }));
652
+ case 3:
653
+ case "end":
654
+ return _context.stop();
980
655
  }
981
656
  }, _callee);
982
657
  })), [sourceId, opId, userArgs, userToken]);