@youversion/platform-react-ui 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +19 -10
- package/dist/index.js +19 -10
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -12648,9 +12648,15 @@ var ApiClient = class {
|
|
|
12648
12648
|
*/
|
|
12649
12649
|
buildQueryString(params) {
|
|
12650
12650
|
if (!params) return "";
|
|
12651
|
-
const
|
|
12652
|
-
|
|
12653
|
-
|
|
12651
|
+
const searchParams = new URLSearchParams();
|
|
12652
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
12653
|
+
if (Array.isArray(value)) {
|
|
12654
|
+
value.forEach((item) => searchParams.append(key, String(item)));
|
|
12655
|
+
} else {
|
|
12656
|
+
searchParams.append(key, String(value));
|
|
12657
|
+
}
|
|
12658
|
+
});
|
|
12659
|
+
const queryString = searchParams.toString();
|
|
12654
12660
|
return queryString ? `?${queryString}` : "";
|
|
12655
12661
|
}
|
|
12656
12662
|
/**
|
|
@@ -12781,14 +12787,15 @@ var BibleClient = class {
|
|
|
12781
12787
|
/**
|
|
12782
12788
|
* Fetches a collection of Bible versions filtered by language ranges.
|
|
12783
12789
|
*
|
|
12784
|
-
* @param language_ranges -
|
|
12790
|
+
* @param language_ranges - One or more language codes or ranges to filter the versions (required).
|
|
12785
12791
|
* @param license_id - Optional license ID to filter versions by license.
|
|
12786
12792
|
* @returns A promise that resolves to a collection of BibleVersion objects.
|
|
12787
12793
|
*/
|
|
12788
12794
|
async getVersions(language_ranges, license_id) {
|
|
12789
|
-
|
|
12795
|
+
const languageRangeArray = Array.isArray(language_ranges) ? language_ranges : [language_ranges];
|
|
12796
|
+
const parsedLanguageRanges = external_exports.array(this.languageRangesSchema).nonempty("At least one language range is required").parse(languageRangeArray);
|
|
12790
12797
|
const params = {
|
|
12791
|
-
"language_ranges[]":
|
|
12798
|
+
"language_ranges[]": parsedLanguageRanges
|
|
12792
12799
|
};
|
|
12793
12800
|
if (license_id !== void 0) {
|
|
12794
12801
|
params.license_id = license_id;
|
|
@@ -12982,13 +12989,15 @@ var LanguagesClient = class {
|
|
|
12982
12989
|
}
|
|
12983
12990
|
/**
|
|
12984
12991
|
* Fetches a collection of languages supported in the Platform.
|
|
12985
|
-
* @param options Query parameters for pagination and filtering
|
|
12992
|
+
* @param options Query parameters for pagination and filtering.
|
|
12986
12993
|
* @returns A collection of Language objects.
|
|
12987
12994
|
*/
|
|
12988
|
-
async getLanguages(options) {
|
|
12995
|
+
async getLanguages(options = {}) {
|
|
12989
12996
|
const params = {};
|
|
12990
|
-
|
|
12991
|
-
|
|
12997
|
+
if (options.country !== void 0) {
|
|
12998
|
+
const country = this.countrySchema.parse(options.country);
|
|
12999
|
+
params.country = country;
|
|
13000
|
+
}
|
|
12992
13001
|
if (options.page_size !== void 0) {
|
|
12993
13002
|
const pageSizeSchema = external_exports.number().int().positive();
|
|
12994
13003
|
pageSizeSchema.parse(options.page_size);
|
package/dist/index.js
CHANGED
|
@@ -12603,9 +12603,15 @@ var ApiClient = class {
|
|
|
12603
12603
|
*/
|
|
12604
12604
|
buildQueryString(params) {
|
|
12605
12605
|
if (!params) return "";
|
|
12606
|
-
const
|
|
12607
|
-
|
|
12608
|
-
|
|
12606
|
+
const searchParams = new URLSearchParams();
|
|
12607
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
12608
|
+
if (Array.isArray(value)) {
|
|
12609
|
+
value.forEach((item) => searchParams.append(key, String(item)));
|
|
12610
|
+
} else {
|
|
12611
|
+
searchParams.append(key, String(value));
|
|
12612
|
+
}
|
|
12613
|
+
});
|
|
12614
|
+
const queryString = searchParams.toString();
|
|
12609
12615
|
return queryString ? `?${queryString}` : "";
|
|
12610
12616
|
}
|
|
12611
12617
|
/**
|
|
@@ -12736,14 +12742,15 @@ var BibleClient = class {
|
|
|
12736
12742
|
/**
|
|
12737
12743
|
* Fetches a collection of Bible versions filtered by language ranges.
|
|
12738
12744
|
*
|
|
12739
|
-
* @param language_ranges -
|
|
12745
|
+
* @param language_ranges - One or more language codes or ranges to filter the versions (required).
|
|
12740
12746
|
* @param license_id - Optional license ID to filter versions by license.
|
|
12741
12747
|
* @returns A promise that resolves to a collection of BibleVersion objects.
|
|
12742
12748
|
*/
|
|
12743
12749
|
async getVersions(language_ranges, license_id) {
|
|
12744
|
-
|
|
12750
|
+
const languageRangeArray = Array.isArray(language_ranges) ? language_ranges : [language_ranges];
|
|
12751
|
+
const parsedLanguageRanges = external_exports.array(this.languageRangesSchema).nonempty("At least one language range is required").parse(languageRangeArray);
|
|
12745
12752
|
const params = {
|
|
12746
|
-
"language_ranges[]":
|
|
12753
|
+
"language_ranges[]": parsedLanguageRanges
|
|
12747
12754
|
};
|
|
12748
12755
|
if (license_id !== void 0) {
|
|
12749
12756
|
params.license_id = license_id;
|
|
@@ -12937,13 +12944,15 @@ var LanguagesClient = class {
|
|
|
12937
12944
|
}
|
|
12938
12945
|
/**
|
|
12939
12946
|
* Fetches a collection of languages supported in the Platform.
|
|
12940
|
-
* @param options Query parameters for pagination and filtering
|
|
12947
|
+
* @param options Query parameters for pagination and filtering.
|
|
12941
12948
|
* @returns A collection of Language objects.
|
|
12942
12949
|
*/
|
|
12943
|
-
async getLanguages(options) {
|
|
12950
|
+
async getLanguages(options = {}) {
|
|
12944
12951
|
const params = {};
|
|
12945
|
-
|
|
12946
|
-
|
|
12952
|
+
if (options.country !== void 0) {
|
|
12953
|
+
const country = this.countrySchema.parse(options.country);
|
|
12954
|
+
params.country = country;
|
|
12955
|
+
}
|
|
12947
12956
|
if (options.page_size !== void 0) {
|
|
12948
12957
|
const pageSizeSchema = external_exports.number().int().positive();
|
|
12949
12958
|
pageSizeSchema.parse(options.page_size);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youversion/platform-react-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "React SDK for YouVersion Platform",
|
|
5
5
|
"license": "TBD",
|
|
6
6
|
"type": "module",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"lucide-react": "0.546.0",
|
|
40
40
|
"tailwind-merge": "3.3.1",
|
|
41
41
|
"tw-animate-css": "1.4.0",
|
|
42
|
-
"@youversion/platform-core": "1.
|
|
43
|
-
"@youversion/platform-react-hooks": "1.
|
|
42
|
+
"@youversion/platform-core": "1.3.0",
|
|
43
|
+
"@youversion/platform-react-hooks": "1.3.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=19.1.0 <20.0.0",
|