@plasmicapp/data-sources 1.0.4 → 1.0.5
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/index.d.ts +2 -0
- package/dist/index.esm.js +60 -56
- package/dist/index.esm.js.map +4 -4
- package/dist/index.js +56 -52
- package/dist/index.js.map +4 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -76,6 +76,7 @@ __export(index_exports, {
|
|
|
76
76
|
makeCacheKey: () => makeCacheKey,
|
|
77
77
|
makeQueryCacheKey: () => makeQueryCacheKey,
|
|
78
78
|
normalizeData: () => normalizeData,
|
|
79
|
+
throwIfPlasmicUndefinedDataError: () => throwIfPlasmicUndefinedDataError,
|
|
79
80
|
unstable_executePlasmicQueries: () => executePlasmicQueries,
|
|
80
81
|
unstable_usePlasmicQueries: () => usePlasmicQueries,
|
|
81
82
|
unstable_wrapDollarQueriesForMetadata: () => wrapDollarQueriesForMetadata,
|
|
@@ -87,58 +88,6 @@ __export(index_exports, {
|
|
|
87
88
|
});
|
|
88
89
|
module.exports = __toCommonJS(index_exports);
|
|
89
90
|
|
|
90
|
-
// src/serverQueries/client.ts
|
|
91
|
-
var import_query2 = require("@plasmicapp/query");
|
|
92
|
-
var React3 = __toESM(require("react"));
|
|
93
|
-
|
|
94
|
-
// src/utils.ts
|
|
95
|
-
function noopFn() {
|
|
96
|
-
}
|
|
97
|
-
function pick(obj, ...keys) {
|
|
98
|
-
const res = {};
|
|
99
|
-
for (const key of keys) {
|
|
100
|
-
if (key in obj) {
|
|
101
|
-
res[key] = obj[key];
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return res;
|
|
105
|
-
}
|
|
106
|
-
var tuple = (...args) => args;
|
|
107
|
-
function mkIdMap(xs) {
|
|
108
|
-
return new Map(xs.map((x) => tuple(x.id, x)));
|
|
109
|
-
}
|
|
110
|
-
function notNil(x) {
|
|
111
|
-
return x !== null && x !== void 0;
|
|
112
|
-
}
|
|
113
|
-
function withoutNils(xs) {
|
|
114
|
-
return xs.filter(notNil);
|
|
115
|
-
}
|
|
116
|
-
function mapRecordEntries(callback, record1, record2, record3) {
|
|
117
|
-
return Object.entries(record1).map(([k, v1]) => {
|
|
118
|
-
const v2 = record2 == null ? void 0 : record2[k];
|
|
119
|
-
const v3 = record3 == null ? void 0 : record3[k];
|
|
120
|
-
return callback(
|
|
121
|
-
k,
|
|
122
|
-
v1,
|
|
123
|
-
v2,
|
|
124
|
-
v3
|
|
125
|
-
);
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
function mapRecords(callback, record1, record2, record3) {
|
|
129
|
-
return Object.fromEntries(
|
|
130
|
-
mapRecordEntries(
|
|
131
|
-
(k, v1, v2, v3) => [k, callback(k, v1, v2, v3)],
|
|
132
|
-
record1,
|
|
133
|
-
record2,
|
|
134
|
-
record3
|
|
135
|
-
)
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// src/serverQueries/common.ts
|
|
140
|
-
var import_react2 = __toESM(require("react"));
|
|
141
|
-
|
|
142
91
|
// src/common.ts
|
|
143
92
|
var import_query = require("@plasmicapp/query");
|
|
144
93
|
var ph = __toESM(require("@plasmicapp/host"));
|
|
@@ -146,6 +95,11 @@ var import_react = __toESM(require("react"));
|
|
|
146
95
|
function isPlasmicUndefinedDataErrorPromise(x) {
|
|
147
96
|
return !!x && typeof x === "object" && (x == null ? void 0 : x.plasmicType) === "PlasmicUndefinedDataError";
|
|
148
97
|
}
|
|
98
|
+
function throwIfPlasmicUndefinedDataError(err) {
|
|
99
|
+
if (isPlasmicUndefinedDataErrorPromise(err)) {
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
149
103
|
function tagPlasmicUndefinedDataErrorPromise(promise) {
|
|
150
104
|
promise.plasmicType = "PlasmicUndefinedDataError";
|
|
151
105
|
promise.message = "Query is not done";
|
|
@@ -315,7 +269,57 @@ function usePlasmicFetch(key, resolvedParams, fetcherFn, resultMapper, undefined
|
|
|
315
269
|
]);
|
|
316
270
|
}
|
|
317
271
|
|
|
272
|
+
// src/serverQueries/client.ts
|
|
273
|
+
var import_query2 = require("@plasmicapp/query");
|
|
274
|
+
var React3 = __toESM(require("react"));
|
|
275
|
+
|
|
276
|
+
// src/utils.ts
|
|
277
|
+
function noopFn() {
|
|
278
|
+
}
|
|
279
|
+
function pick(obj, ...keys) {
|
|
280
|
+
const res = {};
|
|
281
|
+
for (const key of keys) {
|
|
282
|
+
if (key in obj) {
|
|
283
|
+
res[key] = obj[key];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return res;
|
|
287
|
+
}
|
|
288
|
+
var tuple = (...args) => args;
|
|
289
|
+
function mkIdMap(xs) {
|
|
290
|
+
return new Map(xs.map((x) => tuple(x.id, x)));
|
|
291
|
+
}
|
|
292
|
+
function notNil(x) {
|
|
293
|
+
return x !== null && x !== void 0;
|
|
294
|
+
}
|
|
295
|
+
function withoutNils(xs) {
|
|
296
|
+
return xs.filter(notNil);
|
|
297
|
+
}
|
|
298
|
+
function mapRecordEntries(callback, record1, record2, record3) {
|
|
299
|
+
return Object.entries(record1).map(([k, v1]) => {
|
|
300
|
+
const v2 = record2 == null ? void 0 : record2[k];
|
|
301
|
+
const v3 = record3 == null ? void 0 : record3[k];
|
|
302
|
+
return callback(
|
|
303
|
+
k,
|
|
304
|
+
v1,
|
|
305
|
+
v2,
|
|
306
|
+
v3
|
|
307
|
+
);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
function mapRecords(callback, record1, record2, record3) {
|
|
311
|
+
return Object.fromEntries(
|
|
312
|
+
mapRecordEntries(
|
|
313
|
+
(k, v1, v2, v3) => [k, callback(k, v1, v2, v3)],
|
|
314
|
+
record1,
|
|
315
|
+
record2,
|
|
316
|
+
record3
|
|
317
|
+
)
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
|
|
318
321
|
// src/serverQueries/common.ts
|
|
322
|
+
var import_react2 = __toESM(require("react"));
|
|
319
323
|
function createDollarQueries(queryNames) {
|
|
320
324
|
return Object.fromEntries(
|
|
321
325
|
queryNames.map((queryName) => {
|