@youversion/platform-core 0.8.2 → 0.9.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @youversion/platform-core@0.8.2 build /home/runner/work/platform-sdk-react/platform-sdk-react/packages/core
2
+ > @youversion/platform-core@0.9.0 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
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@
8
8
  CLI Target: es2022
9
9
  CJS Build start
10
10
  ESM Build start
11
- ESM dist/index.js 41.62 KB
12
- ESM ⚡️ Build success in 36ms
13
- CJS dist/index.cjs 43.46 KB
14
- CJS ⚡️ Build success in 36ms
11
+ ESM dist/index.js 40.66 KB
12
+ ESM ⚡️ Build success in 31ms
13
+ CJS dist/index.cjs 42.47 KB
14
+ CJS ⚡️ Build success in 32ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 1808ms
17
- DTS dist/index.d.cts 31.98 KB
18
- DTS dist/index.d.ts 31.98 KB
16
+ DTS ⚡️ Build success in 1699ms
17
+ DTS dist/index.d.cts 31.83 KB
18
+ DTS dist/index.d.ts 31.83 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @youversion/platform-core
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e4f93b6: Update authentication system with enhanced OAuth scopes and API schema alignment
8
+
9
+ Key Changes:
10
+ - Added profile and email scopes to OAuth authentication
11
+ - Updated book resource schema to match new API endpoints
12
+ - Removed deprecated URLBuilder functionality
13
+
14
+ Breaking Changes:
15
+ - Book Schema: Must use the new updated book schema in any APIs returning bible book data Please enter a summary for your changes.
16
+
3
17
  ## 0.8.2
4
18
 
5
19
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -30,7 +30,6 @@ __export(index_exports, {
30
30
  SessionStorageStrategy: () => SessionStorageStrategy,
31
31
  SignInWithYouVersionPermission: () => SignInWithYouVersionPermission,
32
32
  SignInWithYouVersionResult: () => SignInWithYouVersionResult,
33
- URLBuilder: () => URLBuilder,
34
33
  YouVersionAPI: () => YouVersionAPI,
35
34
  YouVersionAPIUsers: () => YouVersionAPIUsers,
36
35
  YouVersionPlatformConfiguration: () => YouVersionPlatformConfiguration,
@@ -232,7 +231,7 @@ var BibleClient = class {
232
231
  /**
233
232
  * Fetches all books for a given Bible version.
234
233
  * @param versionId The version ID.
235
- * @param canon Optional canon filter ('ot', 'nt', 'deuterocanon').
234
+ * @param canon Optional canon filter ("old_testament", 'new_testament', 'deuterocanon').
236
235
  * @returns An array of BibleBook objects.
237
236
  */
238
237
  async getBooks(versionId, canon) {
@@ -732,7 +731,7 @@ var YouVersionUserInfo = class {
732
731
 
733
732
  // src/SignInWithYouVersionPKCE.ts
734
733
  var SignInWithYouVersionPKCEAuthorizationRequestBuilder = class {
735
- static async make(appKey, permissions, redirectURL) {
734
+ static async make(appKey, redirectURL, scopes) {
736
735
  const codeVerifier = this.randomURLSafeString(32);
737
736
  const codeChallenge = await this.codeChallenge(codeVerifier);
738
737
  const state = this.randomURLSafeString(24);
@@ -743,10 +742,10 @@ var SignInWithYouVersionPKCEAuthorizationRequestBuilder = class {
743
742
  state,
744
743
  nonce
745
744
  };
746
- const url = this.authorizeURL(appKey, permissions, redirectURL, parameters);
745
+ const url = this.authorizeURL(appKey, redirectURL, parameters, scopes);
747
746
  return { url, parameters };
748
747
  }
749
- static authorizeURL(appKey, permissions, redirectURL, parameters) {
748
+ static authorizeURL(appKey, redirectURL, parameters, scopes) {
750
749
  const components = new URL(`https://${YouVersionPlatformConfiguration.apiHost}/auth/authorize`);
751
750
  const redirectUrlString = redirectURL.toString().endsWith("/") ? redirectURL.toString().slice(0, -1) : redirectURL.toString();
752
751
  const queryParams = new URLSearchParams({
@@ -762,7 +761,7 @@ var SignInWithYouVersionPKCEAuthorizationRequestBuilder = class {
762
761
  if (installId) {
763
762
  queryParams.set("x-yvp-installation-id", installId);
764
763
  }
765
- const scopeValue = this.scopeValue(permissions);
764
+ const scopeValue = this.scopeValue(scopes || []);
766
765
  if (scopeValue) {
767
766
  queryParams.set("scope", scopeValue);
768
767
  }
@@ -802,8 +801,8 @@ var SignInWithYouVersionPKCEAuthorizationRequestBuilder = class {
802
801
  const base64 = btoa(String.fromCharCode.apply(null, Array.from(data)));
803
802
  return base64.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
804
803
  }
805
- static scopeValue(permissions) {
806
- const scopeArray = Array.from(permissions).sort();
804
+ static scopeValue(scopes) {
805
+ const scopeArray = Array.from(scopes).sort();
807
806
  let scopeWithOpenID = scopeArray.join(" ");
808
807
  if (!scopeWithOpenID.split(" ").includes("openid")) {
809
808
  scopeWithOpenID += (scopeWithOpenID === "" ? "" : " ") + "openid";
@@ -825,7 +824,6 @@ var SignInWithYouVersionResult = class {
825
824
  expiryDate;
826
825
  refreshToken;
827
826
  idToken;
828
- permissions;
829
827
  yvpUserId;
830
828
  name;
831
829
  profilePicture;
@@ -835,7 +833,6 @@ var SignInWithYouVersionResult = class {
835
833
  expiresIn,
836
834
  refreshToken,
837
835
  idToken,
838
- permissions,
839
836
  yvpUserId,
840
837
  name,
841
838
  profilePicture,
@@ -845,7 +842,6 @@ var SignInWithYouVersionResult = class {
845
842
  this.expiryDate = expiresIn ? new Date(Date.now() + expiresIn * 1e3) : /* @__PURE__ */ new Date();
846
843
  this.refreshToken = refreshToken;
847
844
  this.idToken = idToken;
848
- this.permissions = permissions;
849
845
  this.yvpUserId = yvpUserId;
850
846
  this.name = name;
851
847
  this.profilePicture = profilePicture;
@@ -858,22 +854,22 @@ var YouVersionAPIUsers = class {
858
854
  /**
859
855
  * Presents the YouVersion login flow to the user and returns the login result upon completion.
860
856
  *
861
- * This function authenticates the user with YouVersion, requesting the specified required and optional permissions.
857
+ * This function authenticates the user with YouVersion.
862
858
  * The function redirects to the YouVersion authorization URL and expects the callback to be handled separately.
863
859
  *
864
- * @param permissions - The set of permissions that must be granted by the user for successful login.
860
+ * @param scopes - The scopes given to the authentication call.
865
861
  * @param redirectURL - The URL to redirect back to after authentication.
866
862
  * @throws An error if authentication fails or configuration is invalid.
867
863
  */
868
- static async signIn(permissions, redirectURL) {
864
+ static async signIn(redirectURL, scopes) {
869
865
  const appKey = YouVersionPlatformConfiguration.appKey;
870
866
  if (!appKey) {
871
867
  throw new Error("YouVersionPlatformConfiguration.appKey must be set before calling signIn");
872
868
  }
873
869
  const authorizationRequest = await SignInWithYouVersionPKCEAuthorizationRequestBuilder.make(
874
870
  appKey,
875
- permissions,
876
- new URL(redirectURL)
871
+ new URL(redirectURL),
872
+ scopes
877
873
  );
878
874
  localStorage.setItem(
879
875
  "youversion-auth-code-verifier",
@@ -973,17 +969,11 @@ var YouVersionAPIUsers = class {
973
969
  */
974
970
  static extractSignInResult(tokens) {
975
971
  const idClaims = this.decodeJWT(tokens.id_token);
976
- const permissions = tokens.scope.split(" ").map((p) => p.trim()).filter((p) => p.length > 0).filter(
977
- (p) => Object.values(SignInWithYouVersionPermission).includes(
978
- p
979
- )
980
- );
981
972
  const resultData = {
982
973
  accessToken: tokens.access_token,
983
974
  expiresIn: tokens.expires_in,
984
975
  refreshToken: tokens.refresh_token,
985
976
  idToken: tokens.id_token,
986
- permissions,
987
977
  yvpUserId: idClaims.sub,
988
978
  name: idClaims.name,
989
979
  profilePicture: idClaims.profile_picture,
@@ -1102,12 +1092,7 @@ var YouVersionAPIUsers = class {
1102
1092
  accessToken: tokens.access_token,
1103
1093
  expiresIn: tokens.expires_in,
1104
1094
  refreshToken: tokens.refresh_token,
1105
- idToken: existingIdToken,
1106
- permissions: tokens.scope.split(" ").map((p) => p.trim()).filter((p) => p.length > 0).filter(
1107
- (p) => Object.values(SignInWithYouVersionPermission).includes(
1108
- p
1109
- )
1110
- )
1095
+ idToken: existingIdToken
1111
1096
  });
1112
1097
  YouVersionPlatformConfiguration.saveAuthData(
1113
1098
  result.accessToken || null,
@@ -1177,43 +1162,6 @@ var YouVersionAPI = class {
1177
1162
  }
1178
1163
  };
1179
1164
 
1180
- // src/URLBuilder.ts
1181
- var URLBuilder = class {
1182
- static get baseURL() {
1183
- return new URL(`https://${YouVersionPlatformConfiguration.apiHost}`);
1184
- }
1185
- static authURL(appKey, requiredPermissions = /* @__PURE__ */ new Set(), optionalPermissions = /* @__PURE__ */ new Set()) {
1186
- if (typeof appKey !== "string" || appKey.trim().length === 0) {
1187
- throw new Error("appKey must be a non-empty string");
1188
- }
1189
- try {
1190
- const url = new URL(this.baseURL);
1191
- url.pathname = "/auth/login";
1192
- const searchParams = new URLSearchParams();
1193
- searchParams.append("APP_KEY", appKey);
1194
- searchParams.append("language", "en");
1195
- if (requiredPermissions.size > 0) {
1196
- const requiredList = Array.from(requiredPermissions).map((p) => p.toString());
1197
- searchParams.append("required_perms", requiredList.join(","));
1198
- }
1199
- if (optionalPermissions.size > 0) {
1200
- const optionalList = Array.from(optionalPermissions).map((p) => p.toString());
1201
- searchParams.append("opt_perms", optionalList.join(","));
1202
- }
1203
- const installationId = YouVersionPlatformConfiguration.installationId;
1204
- if (installationId) {
1205
- searchParams.append("x-yvp-installation-id", installationId);
1206
- }
1207
- url.search = searchParams.toString();
1208
- return url;
1209
- } catch (error) {
1210
- throw new Error(
1211
- `Failed to construct auth URL: ${error instanceof Error ? error.message : "Unknown error"}`
1212
- );
1213
- }
1214
- }
1215
- };
1216
-
1217
1165
  // src/utils/constants.ts
1218
1166
  var BOOK_IDS = [
1219
1167
  "GEN",
@@ -1323,109 +1271,109 @@ var BOOK_IDS = [
1323
1271
  "LKA"
1324
1272
  ];
1325
1273
  var BOOK_CANON = {
1326
- GEN: "ot",
1327
- EXO: "ot",
1328
- LEV: "ot",
1329
- NUM: "ot",
1330
- DEU: "ot",
1331
- JOS: "ot",
1332
- JDG: "ot",
1333
- RUT: "ot",
1334
- "1SA": "ot",
1335
- "2SA": "ot",
1336
- "1KI": "ot",
1337
- "2KI": "ot",
1338
- "1CH": "ot",
1339
- "2CH": "ot",
1340
- EZR: "ot",
1341
- NEH: "ot",
1342
- EST: "ot",
1343
- JOB: "ot",
1344
- PSA: "ot",
1345
- PRO: "ot",
1346
- ECC: "ot",
1347
- SNG: "ot",
1348
- ISA: "ot",
1349
- JER: "ot",
1350
- LAM: "ot",
1351
- EZK: "ot",
1352
- DAN: "ot",
1353
- HOS: "ot",
1354
- JOL: "ot",
1355
- AMO: "ot",
1356
- OBA: "ot",
1357
- JON: "ot",
1358
- MIC: "ot",
1359
- NAM: "ot",
1360
- HAB: "ot",
1361
- ZEP: "ot",
1362
- HAG: "ot",
1363
- ZEC: "ot",
1364
- MAL: "ot",
1365
- MAT: "nt",
1366
- MRK: "nt",
1367
- LUK: "nt",
1368
- JHN: "nt",
1369
- ACT: "nt",
1370
- ROM: "nt",
1371
- "1CO": "nt",
1372
- "2CO": "nt",
1373
- GAL: "nt",
1374
- EPH: "nt",
1375
- PHP: "nt",
1376
- COL: "nt",
1377
- "1TH": "nt",
1378
- "2TH": "nt",
1379
- "1TI": "nt",
1380
- "2TI": "nt",
1381
- TIT: "nt",
1382
- PHM: "nt",
1383
- HEB: "nt",
1384
- JAS: "nt",
1385
- "1PE": "nt",
1386
- "2PE": "nt",
1387
- "1JN": "nt",
1388
- "2JN": "nt",
1389
- "3JN": "nt",
1390
- JUD: "nt",
1391
- REV: "nt",
1392
- TOB: "dc",
1393
- JDT: "dc",
1394
- ESG: "dc",
1395
- WIS: "dc",
1396
- SIR: "dc",
1397
- BAR: "dc",
1398
- LJE: "dc",
1399
- S3Y: "dc",
1400
- SUS: "dc",
1401
- BEL: "dc",
1402
- "1MA": "dc",
1403
- "2MA": "dc",
1404
- "3MA": "dc",
1405
- "4MA": "dc",
1406
- "1ES": "dc",
1407
- "2ES": "dc",
1408
- MAN: "dc",
1409
- PS2: "dc",
1410
- ODA: "dc",
1411
- PSS: "dc",
1412
- "3ES": "dc",
1413
- EZA: "dc",
1414
- "5EZ": "dc",
1415
- "6EZ": "dc",
1416
- DAG: "dc",
1417
- PS3: "dc",
1418
- "2BA": "dc",
1419
- LBA: "dc",
1420
- JUB: "dc",
1421
- ENO: "dc",
1422
- "1MQ": "dc",
1423
- "2MQ": "dc",
1424
- "3MQ": "dc",
1425
- REP: "dc",
1426
- "4BA": "dc",
1427
- LAO: "dc",
1428
- LKA: "nt"
1274
+ GEN: "old_testament",
1275
+ EXO: "old_testament",
1276
+ LEV: "old_testament",
1277
+ NUM: "old_testament",
1278
+ DEU: "old_testament",
1279
+ JOS: "old_testament",
1280
+ JDG: "old_testament",
1281
+ RUT: "old_testament",
1282
+ "1SA": "old_testament",
1283
+ "2SA": "old_testament",
1284
+ "1KI": "old_testament",
1285
+ "2KI": "old_testament",
1286
+ "1CH": "old_testament",
1287
+ "2CH": "old_testament",
1288
+ EZR: "old_testament",
1289
+ NEH: "old_testament",
1290
+ EST: "old_testament",
1291
+ JOB: "old_testament",
1292
+ PSA: "old_testament",
1293
+ PRO: "old_testament",
1294
+ ECC: "old_testament",
1295
+ SNG: "old_testament",
1296
+ ISA: "old_testament",
1297
+ JER: "old_testament",
1298
+ LAM: "old_testament",
1299
+ EZK: "old_testament",
1300
+ DAN: "old_testament",
1301
+ HOS: "old_testament",
1302
+ JOL: "old_testament",
1303
+ AMO: "old_testament",
1304
+ OBA: "old_testament",
1305
+ JON: "old_testament",
1306
+ MIC: "old_testament",
1307
+ NAM: "old_testament",
1308
+ HAB: "old_testament",
1309
+ ZEP: "old_testament",
1310
+ HAG: "old_testament",
1311
+ ZEC: "old_testament",
1312
+ MAL: "old_testament",
1313
+ MAT: "new_testament",
1314
+ MRK: "new_testament",
1315
+ LUK: "new_testament",
1316
+ JHN: "new_testament",
1317
+ ACT: "new_testament",
1318
+ ROM: "new_testament",
1319
+ "1CO": "new_testament",
1320
+ "2CO": "new_testament",
1321
+ GAL: "new_testament",
1322
+ EPH: "new_testament",
1323
+ PHP: "new_testament",
1324
+ COL: "new_testament",
1325
+ "1TH": "new_testament",
1326
+ "2TH": "new_testament",
1327
+ "1TI": "new_testament",
1328
+ "2TI": "new_testament",
1329
+ TIT: "new_testament",
1330
+ PHM: "new_testament",
1331
+ HEB: "new_testament",
1332
+ JAS: "new_testament",
1333
+ "1PE": "new_testament",
1334
+ "2PE": "new_testament",
1335
+ "1JN": "new_testament",
1336
+ "2JN": "new_testament",
1337
+ "3JN": "new_testament",
1338
+ JUD: "new_testament",
1339
+ REV: "new_testament",
1340
+ TOB: "deuterocanon",
1341
+ JDT: "deuterocanon",
1342
+ ESG: "deuterocanon",
1343
+ WIS: "deuterocanon",
1344
+ SIR: "deuterocanon",
1345
+ BAR: "deuterocanon",
1346
+ LJE: "deuterocanon",
1347
+ S3Y: "deuterocanon",
1348
+ SUS: "deuterocanon",
1349
+ BEL: "deuterocanon",
1350
+ "1MA": "deuterocanon",
1351
+ "2MA": "deuterocanon",
1352
+ "3MA": "deuterocanon",
1353
+ "4MA": "deuterocanon",
1354
+ "1ES": "deuterocanon",
1355
+ "2ES": "deuterocanon",
1356
+ MAN: "deuterocanon",
1357
+ PS2: "deuterocanon",
1358
+ ODA: "deuterocanon",
1359
+ PSS: "deuterocanon",
1360
+ "3ES": "deuterocanon",
1361
+ EZA: "deuterocanon",
1362
+ "5EZ": "deuterocanon",
1363
+ "6EZ": "deuterocanon",
1364
+ DAG: "deuterocanon",
1365
+ PS3: "deuterocanon",
1366
+ "2BA": "deuterocanon",
1367
+ LBA: "deuterocanon",
1368
+ JUB: "deuterocanon",
1369
+ ENO: "deuterocanon",
1370
+ "1MQ": "deuterocanon",
1371
+ "2MQ": "deuterocanon",
1372
+ "3MQ": "deuterocanon",
1373
+ REP: "deuterocanon",
1374
+ "4BA": "deuterocanon",
1375
+ LAO: "deuterocanon",
1376
+ LKA: "new_testament"
1429
1377
  // Luke-Acts combo, treated canonically as New Testament
1430
1378
  };
1431
1379
  // Annotate the CommonJS export names for ESM import in node:
@@ -1440,7 +1388,6 @@ var BOOK_CANON = {
1440
1388
  SessionStorageStrategy,
1441
1389
  SignInWithYouVersionPermission,
1442
1390
  SignInWithYouVersionResult,
1443
- URLBuilder,
1444
1391
  YouVersionAPI,
1445
1392
  YouVersionAPIUsers,
1446
1393
  YouVersionPlatformConfiguration,
package/dist/index.d.cts CHANGED
@@ -18,9 +18,9 @@ declare const BibleVersionSchema: z.ZodObject<{
18
18
  type BibleVersion = z.infer<typeof BibleVersionSchema>;
19
19
 
20
20
  declare const CanonSchema: z.ZodEnum<{
21
- ot: "ot";
22
- nt: "nt";
23
- dc: "dc";
21
+ old_testament: "old_testament";
22
+ new_testament: "new_testament";
23
+ deuterocanon: "deuterocanon";
24
24
  }>;
25
25
  type Canon = z.infer<typeof CanonSchema>;
26
26
  declare const BookUsfmSchema: 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>>]>;
@@ -31,9 +31,9 @@ declare const BibleBookSchema: z.ZodObject<{
31
31
  full_title: z.ZodString;
32
32
  abbreviation: z.ZodOptional<z.ZodString>;
33
33
  canon: z.ZodEnum<{
34
- ot: "ot";
35
- nt: "nt";
36
- dc: "dc";
34
+ old_testament: "old_testament";
35
+ new_testament: "new_testament";
36
+ deuterocanon: "deuterocanon";
37
37
  }>;
38
38
  chapters: z.ZodOptional<z.ZodArray<z.ZodObject<{
39
39
  id: z.ZodString;
@@ -101,9 +101,9 @@ declare const BibleIndexBookSchema: z.ZodObject<{
101
101
  full_title: z.ZodString;
102
102
  abbreviation: z.ZodString;
103
103
  canon: z.ZodEnum<{
104
- ot: "ot";
105
- nt: "nt";
106
- dc: "dc";
104
+ old_testament: "old_testament";
105
+ new_testament: "new_testament";
106
+ deuterocanon: "deuterocanon";
107
107
  }>;
108
108
  chapters: z.ZodArray<z.ZodObject<{
109
109
  id: z.ZodString;
@@ -123,9 +123,9 @@ declare const _BibleIndexSchema: z.ZodObject<{
123
123
  full_title: z.ZodString;
124
124
  abbreviation: z.ZodString;
125
125
  canon: z.ZodEnum<{
126
- ot: "ot";
127
- nt: "nt";
128
- dc: "dc";
126
+ old_testament: "old_testament";
127
+ new_testament: "new_testament";
128
+ deuterocanon: "deuterocanon";
129
129
  }>;
130
130
  chapters: z.ZodArray<z.ZodObject<{
131
131
  id: z.ZodString;
@@ -209,7 +209,6 @@ type SignInWithYouVersionResultProps = {
209
209
  expiresIn?: number;
210
210
  refreshToken?: string;
211
211
  idToken?: string;
212
- permissions?: SignInWithYouVersionPermissionValues[];
213
212
  yvpUserId?: string;
214
213
  name?: string;
215
214
  profilePicture?: string;
@@ -220,12 +219,11 @@ declare class SignInWithYouVersionResult {
220
219
  readonly expiryDate: Date | undefined;
221
220
  readonly refreshToken: string | undefined;
222
221
  readonly idToken: string | undefined;
223
- readonly permissions: SignInWithYouVersionPermissionValues[] | undefined;
224
222
  readonly yvpUserId: string | undefined;
225
223
  readonly name: string | undefined;
226
224
  readonly profilePicture: string | undefined;
227
225
  readonly email: string | undefined;
228
- constructor({ accessToken, expiresIn, refreshToken, idToken, permissions, yvpUserId, name, profilePicture, email, }: SignInWithYouVersionResultProps);
226
+ constructor({ accessToken, expiresIn, refreshToken, idToken, yvpUserId, name, profilePicture, email, }: SignInWithYouVersionResultProps);
229
227
  }
230
228
 
231
229
  type SignInWithYouVersionPermissionValues = (typeof SignInWithYouVersionPermission)[keyof typeof SignInWithYouVersionPermission];
@@ -237,6 +235,7 @@ interface AuthenticationState {
237
235
  result: SignInWithYouVersionResult | null;
238
236
  error: Error | null;
239
237
  }
238
+ type AuthenticationScopes = 'profile' | 'email';
240
239
 
241
240
  /**
242
241
  * Legacy type for highlight colors (constants only)
@@ -337,7 +336,7 @@ declare class BibleClient {
337
336
  /**
338
337
  * Fetches all books for a given Bible version.
339
338
  * @param versionId The version ID.
340
- * @param canon Optional canon filter ('ot', 'nt', 'deuterocanon').
339
+ * @param canon Optional canon filter ("old_testament", 'new_testament', 'deuterocanon').
341
340
  * @returns An array of BibleBook objects.
342
341
  */
343
342
  getBooks(versionId: number, canon?: CANON): Promise<Collection<BibleBook>>;
@@ -593,14 +592,14 @@ declare class YouVersionAPIUsers {
593
592
  /**
594
593
  * Presents the YouVersion login flow to the user and returns the login result upon completion.
595
594
  *
596
- * This function authenticates the user with YouVersion, requesting the specified required and optional permissions.
595
+ * This function authenticates the user with YouVersion.
597
596
  * The function redirects to the YouVersion authorization URL and expects the callback to be handled separately.
598
597
  *
599
- * @param permissions - The set of permissions that must be granted by the user for successful login.
598
+ * @param scopes - The scopes given to the authentication call.
600
599
  * @param redirectURL - The URL to redirect back to after authentication.
601
600
  * @throws An error if authentication fails or configuration is invalid.
602
601
  */
603
- static signIn(permissions: Set<SignInWithYouVersionPermissionValues>, redirectURL: string): Promise<void>;
602
+ static signIn(redirectURL: string, scopes?: AuthenticationScopes[]): Promise<void>;
604
603
  /**
605
604
  * Handles the OAuth callback after user authentication.
606
605
  *
@@ -668,11 +667,6 @@ declare class YouVersionAPI {
668
667
  static addStandardHeaders(url: URL): Request;
669
668
  }
670
669
 
671
- declare class URLBuilder {
672
- private static get baseURL();
673
- static authURL(appKey: string, requiredPermissions?: Set<SignInWithYouVersionPermissionValues>, optionalPermissions?: Set<SignInWithYouVersionPermissionValues>): URL;
674
- }
675
-
676
670
  /**
677
671
  * Security Note: Tokens are stored in localStorage for persistence.
678
672
  * Ensure your application follows XSS prevention best practices:
@@ -712,4 +706,4 @@ declare const BOOK_IDS: readonly ["GEN", "EXO", "LEV", "NUM", "DEU", "JOS", "JDG
712
706
  */
713
707
  declare const BOOK_CANON: Record<BookUsfm, Canon>;
714
708
 
715
- export { ApiClient, type ApiConfig, type AuthenticationState, BOOK_CANON, BOOK_IDS, type BibleBook, type BibleChapter, BibleClient, type BibleIndex, type BibleIndexBook, type BibleIndexChapter, type BibleIndexVerse, type BiblePassage, type BibleVerse, type BibleVersion, type CANON, type Collection, type CreateHighlight, type DeleteHighlightOptions, type GetHighlightsOptions, type GetLanguagesOptions, type Highlight, type HighlightColor, HighlightsClient, type Language, LanguagesClient, MemoryStorageStrategy, SessionStorageStrategy, SignInWithYouVersionPermission, type SignInWithYouVersionPermissionValues, SignInWithYouVersionResult, type StorageStrategy, URLBuilder, type User, type VOTD, YouVersionAPI, YouVersionAPIUsers, YouVersionPlatformConfiguration, YouVersionUserInfo, type YouVersionUserInfoJSON };
709
+ export { ApiClient, type ApiConfig, type AuthenticationScopes, type AuthenticationState, BOOK_CANON, BOOK_IDS, type BibleBook, type BibleChapter, BibleClient, type BibleIndex, type BibleIndexBook, type BibleIndexChapter, type BibleIndexVerse, type BiblePassage, type BibleVerse, type BibleVersion, type CANON, type Collection, type CreateHighlight, type DeleteHighlightOptions, type GetHighlightsOptions, type GetLanguagesOptions, type Highlight, type HighlightColor, HighlightsClient, type Language, LanguagesClient, MemoryStorageStrategy, SessionStorageStrategy, SignInWithYouVersionPermission, type SignInWithYouVersionPermissionValues, SignInWithYouVersionResult, type StorageStrategy, type User, type VOTD, YouVersionAPI, YouVersionAPIUsers, YouVersionPlatformConfiguration, YouVersionUserInfo, type YouVersionUserInfoJSON };