@builder.io/sdk-qwik 0.14.20 → 0.14.21
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/lib/browser/index.qwik.cjs +13 -2
- package/lib/browser/index.qwik.mjs +13 -2
- package/lib/edge/index.qwik.cjs +13 -2
- package/lib/edge/index.qwik.mjs +13 -2
- package/lib/node/index.qwik.cjs +13 -2
- package/lib/node/index.qwik.mjs +13 -2
- package/package.json +1 -1
- package/types/src/constants/sdk-version.d.ts +1 -1
- package/types/src/helpers/flatten.d.ts +10 -0
|
@@ -4353,6 +4353,17 @@ function flatten(object, path = null, separator = ".") {
|
|
|
4353
4353
|
};
|
|
4354
4354
|
}, {});
|
|
4355
4355
|
}
|
|
4356
|
+
function flattenMongoQuery(obj, _current, _res = {}) {
|
|
4357
|
+
for (const key in obj) {
|
|
4358
|
+
const value = obj[key];
|
|
4359
|
+
const newKey = _current ? _current + "." + key : key;
|
|
4360
|
+
if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$")))
|
|
4361
|
+
flattenMongoQuery(value, newKey, _res);
|
|
4362
|
+
else
|
|
4363
|
+
_res[newKey] = value;
|
|
4364
|
+
}
|
|
4365
|
+
return _res;
|
|
4366
|
+
}
|
|
4356
4367
|
const DEFAULT_API_VERSION = "v3";
|
|
4357
4368
|
const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
|
|
4358
4369
|
const BUILDER_OPTIONS_PREFIX = "options.";
|
|
@@ -4422,7 +4433,7 @@ const generateContentUrl = (options) => {
|
|
|
4422
4433
|
if (userAttributes)
|
|
4423
4434
|
url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
|
|
4424
4435
|
if (query) {
|
|
4425
|
-
const flattened2 =
|
|
4436
|
+
const flattened2 = flattenMongoQuery({
|
|
4426
4437
|
query
|
|
4427
4438
|
});
|
|
4428
4439
|
for (const key in flattened2)
|
|
@@ -4695,7 +4706,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4695
4706
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
4696
4707
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
4697
4708
|
}
|
|
4698
|
-
const SDK_VERSION = "0.14.
|
|
4709
|
+
const SDK_VERSION = "0.14.21";
|
|
4699
4710
|
const registry = {};
|
|
4700
4711
|
function register(type, info) {
|
|
4701
4712
|
let typeList = registry[type];
|
|
@@ -4351,6 +4351,17 @@ function flatten(object, path = null, separator = ".") {
|
|
|
4351
4351
|
};
|
|
4352
4352
|
}, {});
|
|
4353
4353
|
}
|
|
4354
|
+
function flattenMongoQuery(obj, _current, _res = {}) {
|
|
4355
|
+
for (const key in obj) {
|
|
4356
|
+
const value = obj[key];
|
|
4357
|
+
const newKey = _current ? _current + "." + key : key;
|
|
4358
|
+
if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$")))
|
|
4359
|
+
flattenMongoQuery(value, newKey, _res);
|
|
4360
|
+
else
|
|
4361
|
+
_res[newKey] = value;
|
|
4362
|
+
}
|
|
4363
|
+
return _res;
|
|
4364
|
+
}
|
|
4354
4365
|
const DEFAULT_API_VERSION = "v3";
|
|
4355
4366
|
const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
|
|
4356
4367
|
const BUILDER_OPTIONS_PREFIX = "options.";
|
|
@@ -4420,7 +4431,7 @@ const generateContentUrl = (options) => {
|
|
|
4420
4431
|
if (userAttributes)
|
|
4421
4432
|
url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
|
|
4422
4433
|
if (query) {
|
|
4423
|
-
const flattened2 =
|
|
4434
|
+
const flattened2 = flattenMongoQuery({
|
|
4424
4435
|
query
|
|
4425
4436
|
});
|
|
4426
4437
|
for (const key in flattened2)
|
|
@@ -4693,7 +4704,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4693
4704
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
4694
4705
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
4695
4706
|
}
|
|
4696
|
-
const SDK_VERSION = "0.14.
|
|
4707
|
+
const SDK_VERSION = "0.14.21";
|
|
4697
4708
|
const registry = {};
|
|
4698
4709
|
function register(type, info) {
|
|
4699
4710
|
let typeList = registry[type];
|
package/lib/edge/index.qwik.cjs
CHANGED
|
@@ -7584,6 +7584,17 @@ function flatten(object, path = null, separator = ".") {
|
|
|
7584
7584
|
};
|
|
7585
7585
|
}, {});
|
|
7586
7586
|
}
|
|
7587
|
+
function flattenMongoQuery(obj, _current, _res = {}) {
|
|
7588
|
+
for (const key in obj) {
|
|
7589
|
+
const value = obj[key];
|
|
7590
|
+
const newKey = _current ? _current + "." + key : key;
|
|
7591
|
+
if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$")))
|
|
7592
|
+
flattenMongoQuery(value, newKey, _res);
|
|
7593
|
+
else
|
|
7594
|
+
_res[newKey] = value;
|
|
7595
|
+
}
|
|
7596
|
+
return _res;
|
|
7597
|
+
}
|
|
7587
7598
|
const DEFAULT_API_VERSION = "v3";
|
|
7588
7599
|
const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
|
|
7589
7600
|
const BUILDER_OPTIONS_PREFIX = "options.";
|
|
@@ -7653,7 +7664,7 @@ const generateContentUrl = (options) => {
|
|
|
7653
7664
|
if (userAttributes)
|
|
7654
7665
|
url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
|
|
7655
7666
|
if (query) {
|
|
7656
|
-
const flattened2 =
|
|
7667
|
+
const flattened2 = flattenMongoQuery({
|
|
7657
7668
|
query
|
|
7658
7669
|
});
|
|
7659
7670
|
for (const key in flattened2)
|
|
@@ -7926,7 +7937,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7926
7937
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
7927
7938
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
7928
7939
|
}
|
|
7929
|
-
const SDK_VERSION = "0.14.
|
|
7940
|
+
const SDK_VERSION = "0.14.21";
|
|
7930
7941
|
const registry = {};
|
|
7931
7942
|
function register(type, info) {
|
|
7932
7943
|
let typeList = registry[type];
|
package/lib/edge/index.qwik.mjs
CHANGED
|
@@ -7582,6 +7582,17 @@ function flatten(object, path = null, separator = ".") {
|
|
|
7582
7582
|
};
|
|
7583
7583
|
}, {});
|
|
7584
7584
|
}
|
|
7585
|
+
function flattenMongoQuery(obj, _current, _res = {}) {
|
|
7586
|
+
for (const key in obj) {
|
|
7587
|
+
const value = obj[key];
|
|
7588
|
+
const newKey = _current ? _current + "." + key : key;
|
|
7589
|
+
if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$")))
|
|
7590
|
+
flattenMongoQuery(value, newKey, _res);
|
|
7591
|
+
else
|
|
7592
|
+
_res[newKey] = value;
|
|
7593
|
+
}
|
|
7594
|
+
return _res;
|
|
7595
|
+
}
|
|
7585
7596
|
const DEFAULT_API_VERSION = "v3";
|
|
7586
7597
|
const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
|
|
7587
7598
|
const BUILDER_OPTIONS_PREFIX = "options.";
|
|
@@ -7651,7 +7662,7 @@ const generateContentUrl = (options) => {
|
|
|
7651
7662
|
if (userAttributes)
|
|
7652
7663
|
url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
|
|
7653
7664
|
if (query) {
|
|
7654
|
-
const flattened2 =
|
|
7665
|
+
const flattened2 = flattenMongoQuery({
|
|
7655
7666
|
query
|
|
7656
7667
|
});
|
|
7657
7668
|
for (const key in flattened2)
|
|
@@ -7924,7 +7935,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7924
7935
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
7925
7936
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
7926
7937
|
}
|
|
7927
|
-
const SDK_VERSION = "0.14.
|
|
7938
|
+
const SDK_VERSION = "0.14.21";
|
|
7928
7939
|
const registry = {};
|
|
7929
7940
|
function register(type, info) {
|
|
7930
7941
|
let typeList = registry[type];
|
package/lib/node/index.qwik.cjs
CHANGED
|
@@ -4485,6 +4485,17 @@ function flatten(object, path = null, separator = ".") {
|
|
|
4485
4485
|
};
|
|
4486
4486
|
}, {});
|
|
4487
4487
|
}
|
|
4488
|
+
function flattenMongoQuery(obj, _current, _res = {}) {
|
|
4489
|
+
for (const key in obj) {
|
|
4490
|
+
const value = obj[key];
|
|
4491
|
+
const newKey = _current ? _current + "." + key : key;
|
|
4492
|
+
if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$")))
|
|
4493
|
+
flattenMongoQuery(value, newKey, _res);
|
|
4494
|
+
else
|
|
4495
|
+
_res[newKey] = value;
|
|
4496
|
+
}
|
|
4497
|
+
return _res;
|
|
4498
|
+
}
|
|
4488
4499
|
const DEFAULT_API_VERSION = "v3";
|
|
4489
4500
|
const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
|
|
4490
4501
|
const BUILDER_OPTIONS_PREFIX = "options.";
|
|
@@ -4554,7 +4565,7 @@ const generateContentUrl = (options) => {
|
|
|
4554
4565
|
if (userAttributes)
|
|
4555
4566
|
url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
|
|
4556
4567
|
if (query) {
|
|
4557
|
-
const flattened2 =
|
|
4568
|
+
const flattened2 = flattenMongoQuery({
|
|
4558
4569
|
query
|
|
4559
4570
|
});
|
|
4560
4571
|
for (const key in flattened2)
|
|
@@ -4827,7 +4838,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4827
4838
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
4828
4839
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
4829
4840
|
}
|
|
4830
|
-
const SDK_VERSION = "0.14.
|
|
4841
|
+
const SDK_VERSION = "0.14.21";
|
|
4831
4842
|
const registry = {};
|
|
4832
4843
|
function register(type, info) {
|
|
4833
4844
|
let typeList = registry[type];
|
package/lib/node/index.qwik.mjs
CHANGED
|
@@ -4483,6 +4483,17 @@ function flatten(object, path = null, separator = ".") {
|
|
|
4483
4483
|
};
|
|
4484
4484
|
}, {});
|
|
4485
4485
|
}
|
|
4486
|
+
function flattenMongoQuery(obj, _current, _res = {}) {
|
|
4487
|
+
for (const key in obj) {
|
|
4488
|
+
const value = obj[key];
|
|
4489
|
+
const newKey = _current ? _current + "." + key : key;
|
|
4490
|
+
if (value && typeof value === "object" && !Array.isArray(value) && !Object.keys(value).find((item) => item.startsWith("$")))
|
|
4491
|
+
flattenMongoQuery(value, newKey, _res);
|
|
4492
|
+
else
|
|
4493
|
+
_res[newKey] = value;
|
|
4494
|
+
}
|
|
4495
|
+
return _res;
|
|
4496
|
+
}
|
|
4486
4497
|
const DEFAULT_API_VERSION = "v3";
|
|
4487
4498
|
const BUILDER_SEARCHPARAMS_PREFIX = "builder.";
|
|
4488
4499
|
const BUILDER_OPTIONS_PREFIX = "options.";
|
|
@@ -4552,7 +4563,7 @@ const generateContentUrl = (options) => {
|
|
|
4552
4563
|
if (userAttributes)
|
|
4553
4564
|
url.searchParams.set("userAttributes", JSON.stringify(userAttributes));
|
|
4554
4565
|
if (query) {
|
|
4555
|
-
const flattened2 =
|
|
4566
|
+
const flattened2 = flattenMongoQuery({
|
|
4556
4567
|
query
|
|
4557
4568
|
});
|
|
4558
4569
|
for (const key in flattened2)
|
|
@@ -4825,7 +4836,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4825
4836
|
const url = new URL(e.origin), hostname = url.hostname;
|
|
4826
4837
|
return (trustedHosts || DEFAULT_TRUSTED_HOSTS).findIndex((trustedHost) => trustedHost.startsWith("*.") ? hostname.endsWith(trustedHost.slice(1)) : trustedHost === hostname) > -1;
|
|
4827
4838
|
}
|
|
4828
|
-
const SDK_VERSION = "0.14.
|
|
4839
|
+
const SDK_VERSION = "0.14.21";
|
|
4829
4840
|
const registry = {};
|
|
4830
4841
|
function register(type, info) {
|
|
4831
4842
|
let typeList = registry[type];
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.14.
|
|
1
|
+
export declare const SDK_VERSION = "0.14.21";
|
|
@@ -4,3 +4,13 @@
|
|
|
4
4
|
* { foo: { bar: 'baz' }} -> { 'foo.bar': 'baz' }
|
|
5
5
|
*/
|
|
6
6
|
export declare function flatten<T extends Record<string, any>>(object: T, path?: string | null, separator?: string): T;
|
|
7
|
+
/**
|
|
8
|
+
* Flatten a nested MongoDB query object into a flat object with dot-separated keys.
|
|
9
|
+
* $ keys are not flattened and are left as is.
|
|
10
|
+
*
|
|
11
|
+
* { foo: { bar: { $gt: 5 }}} -> { 'foo.bar': { '$gt': 5 }}
|
|
12
|
+
* { foo: {'bar.id': { $elemMatch: { 'baz.id': { $in: ['abc', 'bcd'] }}}}} -> { 'foo.bar.id': { '$elemMatch': { 'baz.id': { '$in': ['abc', 'bcd'] }}}}
|
|
13
|
+
*/
|
|
14
|
+
export declare function flattenMongoQuery(obj: any, _current?: any, _res?: any): {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|