@youversion/platform-core 0.5.0 → 0.5.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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +32 -0
- package/README.md +11 -70
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/package.json +5 -4
- package/src/__tests__/MockBibles.ts +1628 -0
- package/src/__tests__/MockChapters.ts +1958 -0
- package/src/__tests__/MockPassages.ts +52 -0
- package/src/__tests__/MockVOTDs.ts +1466 -0
- package/src/__tests__/MockVerses.ts +178 -0
- package/src/__tests__/MockVersions.ts +1238 -0
- package/src/__tests__/URLBuilder.test.ts +9 -12
- package/src/__tests__/authentication.test.ts +23 -11
- package/src/__tests__/handlers.ts +98 -0
- package/src/schemas/version.ts +4 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @youversion/platform-core@0.5.
|
|
2
|
+
> @youversion/platform-core@0.5.5 build /home/runner/work/platform-sdk-react/platform-sdk-react/packages/core
|
|
3
3
|
> tsup src/index.ts --format cjs,esm --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2022
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.js [22m[32m37.59 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in 37ms
|
|
13
11
|
[32mCJS[39m [1mdist/index.cjs [22m[32m39.59 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 34ms
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m37.59 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 34ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m34.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m34.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 1765ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m34.21 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m34.21 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @youversion/platform-core
|
|
2
2
|
|
|
3
|
+
## 0.5.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 752e0d5: fix(ci): remove registry-url for NPM Trusted Publishing
|
|
8
|
+
- 752e0d5: Use npm during the release process to support OIDC.
|
|
9
|
+
|
|
10
|
+
## 0.5.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 1acb93a: fix(ci): remove registry-url for NPM Trusted Publishing
|
|
15
|
+
- 1acb93a: Use npm during the release process to support OIDC.
|
|
16
|
+
|
|
17
|
+
## 0.5.3
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 7fd89a0: fix(ci): remove registry-url for NPM Trusted Publishing
|
|
22
|
+
|
|
23
|
+
## 0.5.2
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- 2d11ab6: Publishing workflow now uses NPM Trusted Publishing instead of token publishing.
|
|
28
|
+
|
|
29
|
+
## 0.5.1
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- caaf811: fix(ui): add export for BibleWidgetView
|
|
34
|
+
|
|
3
35
|
## 0.5.0
|
|
4
36
|
|
|
5
37
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,29 +1,10 @@
|
|
|
1
|
-

|
|
3
|
-

|
|
1
|
+

|
|
4
2
|
|
|
5
3
|
# @youversion/platform-core
|
|
6
4
|
|
|
7
5
|
A type-safe TypeScript SDK for accessing the YouVersion Platform APIs. Get Bible content and build Bible-based applications.
|
|
8
6
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
`@youversion/platform-core` provides comprehensive API clients for the YouVersion Bible Platform. Access Bible versions, books, chapters, verses, language information, and Verse of the Day. Built with TypeScript for type safety and works in Node.js and browser environments.
|
|
12
|
-
|
|
13
|
-
> **📚 Full Documentation:** [developers.youversion.com/sdks/react](https://developers.youversion.com/sdks/react)
|
|
14
|
-
|
|
15
|
-
## Installation
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
pnpm add @youversion/platform-core
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### Prerequisites
|
|
22
|
-
|
|
23
|
-
- Node.js >= 20.0.0
|
|
24
|
-
- YouVersion Platform App Key ([Get from platform.youversion.com](https://platform.youversion.com/))
|
|
25
|
-
|
|
26
|
-
## When to Use This Package
|
|
7
|
+
## When to use this package
|
|
27
8
|
|
|
28
9
|
Use `@youversion/platform-core` when you need:
|
|
29
10
|
- ✅ Direct access to YouVersion Platform APIs
|
|
@@ -35,12 +16,15 @@ Use `@youversion/platform-core` when you need:
|
|
|
35
16
|
- ❌ Building React components → Use [@youversion/platform-react-hooks](../hooks/README.md) for hooks with state management
|
|
36
17
|
- ❌ Need ready-made UI → Use [@youversion/platform-react-ui](../ui/README.md) for production-ready components
|
|
37
18
|
|
|
38
|
-
##
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add @youversion/platform-core
|
|
23
|
+
```
|
|
39
24
|
|
|
40
|
-
|
|
41
|
-
- **[@youversion/platform-react-ui](../ui/README.md)** - Pre-built React components
|
|
25
|
+
Get your App Key at [platform.youversion.com](https://platform.youversion.com/)
|
|
42
26
|
|
|
43
|
-
##
|
|
27
|
+
## Usage
|
|
44
28
|
|
|
45
29
|
```ts
|
|
46
30
|
import { ApiClient, BibleClient } from '@youversion/platform-core'
|
|
@@ -61,49 +45,6 @@ const passage = await bibleClient.getPassage(111, 'JHN.3.16')
|
|
|
61
45
|
console.log(passage.content) // "For God so loved the world..."
|
|
62
46
|
```
|
|
63
47
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- Retrieve Bible versions, books, chapters, verses, and passages
|
|
67
|
-
- Get formatted passages with optional headings and notes
|
|
68
|
-
- Access the complete Bible index structure
|
|
69
|
-
- Query available languages by country
|
|
70
|
-
- Get Verse of the Day
|
|
71
|
-
|
|
72
|
-
## Configuration
|
|
73
|
-
|
|
74
|
-
```ts
|
|
75
|
-
const apiClient = new ApiClient({
|
|
76
|
-
appKey: import.meta.env.YVP_APP_KEY, // Required
|
|
77
|
-
timeout: 10000, // Optional (default: 10000ms)
|
|
78
|
-
})
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Troubleshooting
|
|
82
|
-
|
|
83
|
-
### "Invalid appKey" Error
|
|
84
|
-
|
|
85
|
-
**Solution:** Verify your App Key from [platform.youversion.com](https://platform.youversion.com/). Check for typos or extra whitespace.
|
|
86
|
-
|
|
87
|
-
### "Version not found" Error (404)
|
|
88
|
-
|
|
89
|
-
**Solution:** Verify the version ID exists:
|
|
90
|
-
|
|
91
|
-
```ts
|
|
92
|
-
const versions = await bibleClient.getVersions('en*')
|
|
93
|
-
const validIds = versions.data.map(v => v.id)
|
|
94
|
-
console.log('Valid version IDs:', validIds)
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## Development
|
|
98
|
-
|
|
99
|
-
See [CONTRIBUTING.md](../../CONTRIBUTING.md) for development instructions.
|
|
100
|
-
|
|
101
|
-
## License
|
|
102
|
-
|
|
103
|
-
See [LICENSE](../../LICENSE)
|
|
104
|
-
|
|
105
|
-
## Support
|
|
48
|
+
---
|
|
106
49
|
|
|
107
|
-
|
|
108
|
-
- Platform Docs: [platform.youversion.com](https://platform.youversion.com/)
|
|
109
|
-
- Monorepo: [YouVersion Platform SDK](../../README.md)
|
|
50
|
+
**API Reference:** [developers.youversion.com/sdks/typescript](https://developers.youversion.com/sdks/typescript)
|
package/dist/index.d.cts
CHANGED
|
@@ -3,13 +3,14 @@ import { z } from 'zod';
|
|
|
3
3
|
declare const BibleVersionSchema: z.ZodObject<{
|
|
4
4
|
id: z.ZodNumber;
|
|
5
5
|
abbreviation: z.ZodString;
|
|
6
|
-
copyright_long: z.ZodString
|
|
7
|
-
copyright_short: z.ZodString
|
|
6
|
+
copyright_long: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
copyright_short: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
8
|
info: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
9
|
publisher_url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
10
10
|
language_tag: z.ZodString;
|
|
11
11
|
local_abbreviation: z.ZodString;
|
|
12
12
|
local_title: z.ZodString;
|
|
13
|
+
organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
14
|
title: z.ZodString;
|
|
14
15
|
books: z.ZodArray<z.ZodUnion<readonly [...z.ZodLiteral<"GEN" | "EXO" | "LEV" | "NUM" | "DEU" | "JOS" | "JDG" | "RUT" | "1SA" | "2SA" | "1KI" | "2KI" | "1CH" | "2CH" | "EZR" | "NEH" | "EST" | "JOB" | "PSA" | "PRO" | "ECC" | "SNG" | "ISA" | "JER" | "LAM" | "EZK" | "DAN" | "HOS" | "JOL" | "AMO" | "OBA" | "JON" | "MIC" | "NAM" | "HAB" | "ZEP" | "HAG" | "ZEC" | "MAL" | "MAT" | "MRK" | "LUK" | "JHN" | "ACT" | "ROM" | "1CO" | "2CO" | "GAL" | "EPH" | "PHP" | "COL" | "1TH" | "2TH" | "1TI" | "2TI" | "TIT" | "PHM" | "HEB" | "JAS" | "1PE" | "2PE" | "1JN" | "2JN" | "3JN" | "JUD" | "REV" | "TOB" | "JDT" | "ESG" | "WIS" | "SIR" | "BAR" | "LJE" | "S3Y" | "SUS" | "BEL" | "1MA" | "2MA" | "3MA" | "4MA" | "1ES" | "2ES" | "MAN" | "PS2" | "ODA" | "PSS" | "3ES" | "EZA" | "5EZ" | "6EZ" | "DAG" | "PS3" | "2BA" | "LBA" | "JUB" | "ENO" | "1MQ" | "2MQ" | "3MQ" | "REP" | "4BA" | "LAO" | "LKA">[], z.ZodType<string & {}, unknown, z.core.$ZodTypeInternals<string & {}, unknown>>]>>;
|
|
15
16
|
youversion_deep_link: z.ZodURL;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,13 +3,14 @@ import { z } from 'zod';
|
|
|
3
3
|
declare const BibleVersionSchema: z.ZodObject<{
|
|
4
4
|
id: z.ZodNumber;
|
|
5
5
|
abbreviation: z.ZodString;
|
|
6
|
-
copyright_long: z.ZodString
|
|
7
|
-
copyright_short: z.ZodString
|
|
6
|
+
copyright_long: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
copyright_short: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
8
|
info: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
9
|
publisher_url: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
10
10
|
language_tag: z.ZodString;
|
|
11
11
|
local_abbreviation: z.ZodString;
|
|
12
12
|
local_title: z.ZodString;
|
|
13
|
+
organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
13
14
|
title: z.ZodString;
|
|
14
15
|
books: z.ZodArray<z.ZodUnion<readonly [...z.ZodLiteral<"GEN" | "EXO" | "LEV" | "NUM" | "DEU" | "JOS" | "JDG" | "RUT" | "1SA" | "2SA" | "1KI" | "2KI" | "1CH" | "2CH" | "EZR" | "NEH" | "EST" | "JOB" | "PSA" | "PRO" | "ECC" | "SNG" | "ISA" | "JER" | "LAM" | "EZK" | "DAN" | "HOS" | "JOL" | "AMO" | "OBA" | "JON" | "MIC" | "NAM" | "HAB" | "ZEP" | "HAG" | "ZEC" | "MAL" | "MAT" | "MRK" | "LUK" | "JHN" | "ACT" | "ROM" | "1CO" | "2CO" | "GAL" | "EPH" | "PHP" | "COL" | "1TH" | "2TH" | "1TI" | "2TI" | "TIT" | "PHM" | "HEB" | "JAS" | "1PE" | "2PE" | "1JN" | "2JN" | "3JN" | "JUD" | "REV" | "TOB" | "JDT" | "ESG" | "WIS" | "SIR" | "BAR" | "LJE" | "S3Y" | "SUS" | "BEL" | "1MA" | "2MA" | "3MA" | "4MA" | "1ES" | "2ES" | "MAN" | "PS2" | "ODA" | "PSS" | "3ES" | "EZA" | "5EZ" | "6EZ" | "DAG" | "PS3" | "2BA" | "LBA" | "JUB" | "ENO" | "1MQ" | "2MQ" | "3MQ" | "REP" | "4BA" | "LAO" | "LKA">[], z.ZodType<string & {}, unknown, z.core.$ZodTypeInternals<string & {}, unknown>>]>>;
|
|
15
16
|
youversion_deep_link: z.ZodURL;
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youversion/platform-core",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
|
-
"access": "public"
|
|
6
|
+
"access": "public",
|
|
7
|
+
"provenance": true
|
|
7
8
|
},
|
|
8
9
|
"repository": {
|
|
9
10
|
"type": "git",
|
|
@@ -21,10 +22,10 @@
|
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
|
-
"@vitest/coverage-v8": "
|
|
25
|
+
"@vitest/coverage-v8": "4.0.4",
|
|
25
26
|
"dotenv-cli": "7.4.2",
|
|
26
27
|
"eslint": "9.38.0",
|
|
27
|
-
"jsdom": "
|
|
28
|
+
"jsdom": "24.0.0",
|
|
28
29
|
"msw": "2.11.6",
|
|
29
30
|
"typescript": "5.9.3",
|
|
30
31
|
"vitest": "4.0.4",
|