waha-shared 1.0.430 → 1.0.432
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/data/bibleAudios/bibleAudios.json +12 -0
- package/dist/data/bibleTexts/bibleTexts.json +11 -0
- package/dist/data/dblAudioLicenses/dblAudioLicenses.json +29 -0
- package/dist/data/dblTextLicenses/dblTextLicenses.json +30 -0
- package/dist/data/languages/index.d.ts +1 -0
- package/dist/data/languages/languages.json +63 -0
- package/dist/data/languages/languages.schema.json +6 -0
- package/dist/data/languages/languages.zod.d.ts +1 -0
- package/dist/data/languages/languages.zod.js +4 -0
- package/dist/data/releaseNotes/releaseNotes.json +49 -2
- package/dist/data/translationsApp/index.d.ts +2 -0
- package/dist/data/translationsApp/translationsApp.json +82 -0
- package/dist/data/translationsApp/translationsApp.schema.json +3 -1
- package/dist/data/translationsApp/translationsApp.zod.d.ts +4 -0
- package/dist/data/translationsApp/translationsApp.zod.js +2 -0
- package/dist/functions/feedback.d.ts +15 -0
- package/dist/functions/feedback.js +25 -0
- package/dist/functions/magicLink.d.ts +31 -0
- package/dist/functions/magicLink.js +51 -0
- package/dist/types/socialProof.d.ts +30 -0
- package/dist/types/socialProof.js +23 -0
- package/package.json +4 -4
|
@@ -341,6 +341,8 @@ export declare const LanguageTranslationsApp: z.ZodObject<{
|
|
|
341
341
|
exit: z.ZodString;
|
|
342
342
|
stay: z.ZodString;
|
|
343
343
|
popups_exit_micro_lesson: z.ZodString;
|
|
344
|
+
finish_signing_in: z.ZodOptional<z.ZodString>;
|
|
345
|
+
open_in_waha: z.ZodOptional<z.ZodString>;
|
|
344
346
|
}, z.core.$strip>;
|
|
345
347
|
export type LanguageTranslationsApp = z.infer<typeof LanguageTranslationsApp>;
|
|
346
348
|
export declare const TranslationsApp: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -685,5 +687,7 @@ export declare const TranslationsApp: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
685
687
|
exit: z.ZodString;
|
|
686
688
|
stay: z.ZodString;
|
|
687
689
|
popups_exit_micro_lesson: z.ZodString;
|
|
690
|
+
finish_signing_in: z.ZodOptional<z.ZodString>;
|
|
691
|
+
open_in_waha: z.ZodOptional<z.ZodString>;
|
|
688
692
|
}, z.core.$strip>>;
|
|
689
693
|
export type TranslationsApp = z.infer<typeof TranslationsApp>;
|
|
@@ -347,6 +347,8 @@ exports.LanguageTranslationsApp = zod_1.z.object({
|
|
|
347
347
|
exit: zod_1.z.string(),
|
|
348
348
|
stay: zod_1.z.string(),
|
|
349
349
|
popups_exit_micro_lesson: zod_1.z.string(),
|
|
350
|
+
finish_signing_in: zod_1.z.string().optional(),
|
|
351
|
+
open_in_waha: zod_1.z.string().optional(),
|
|
350
352
|
});
|
|
351
353
|
exports.TranslationsApp = zod_1.z
|
|
352
354
|
.record(zod_1.z.string(), exports.LanguageTranslationsApp.describe('Translations for a single language (identified by a 3-letter code)_'))
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AppTranslations } from '../types/languages';
|
|
2
|
+
export declare const CODE_REQUEST_FORM_NAME = "code_request";
|
|
3
|
+
export declare const JOURNEY_OPTION_KEYS: readonly ["question_god_journey_option_1", "question_god_journey_option_2", "question_god_journey_option_3", "question_god_journey_option_4"];
|
|
4
|
+
export type JourneyOptionKey = (typeof JOURNEY_OPTION_KEYS)[number];
|
|
5
|
+
export declare const AUTO_UNLOCK_JOURNEY_KEY: JourneyOptionKey;
|
|
6
|
+
/**
|
|
7
|
+
* The journey options in display order, each paired with the key that
|
|
8
|
+
* identifies it. Callers render `label` and track `key`, so the answer a user
|
|
9
|
+
* picked stays identifiable no matter what language it was rendered in.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getJourneyOptions(translations: Pick<AppTranslations, JourneyOptionKey>): {
|
|
12
|
+
key: JourneyOptionKey;
|
|
13
|
+
label: string;
|
|
14
|
+
}[];
|
|
15
|
+
export declare function sanitizeFeedbackText(value: string): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AUTO_UNLOCK_JOURNEY_KEY = exports.JOURNEY_OPTION_KEYS = exports.CODE_REQUEST_FORM_NAME = void 0;
|
|
4
|
+
exports.getJourneyOptions = getJourneyOptions;
|
|
5
|
+
exports.sanitizeFeedbackText = sanitizeFeedbackText;
|
|
6
|
+
exports.CODE_REQUEST_FORM_NAME = 'code_request';
|
|
7
|
+
exports.JOURNEY_OPTION_KEYS = [
|
|
8
|
+
'question_god_journey_option_1',
|
|
9
|
+
'question_god_journey_option_2',
|
|
10
|
+
'question_god_journey_option_3',
|
|
11
|
+
'question_god_journey_option_4',
|
|
12
|
+
];
|
|
13
|
+
exports.AUTO_UNLOCK_JOURNEY_KEY = 'question_god_journey_option_4';
|
|
14
|
+
/**
|
|
15
|
+
* The journey options in display order, each paired with the key that
|
|
16
|
+
* identifies it. Callers render `label` and track `key`, so the answer a user
|
|
17
|
+
* picked stays identifiable no matter what language it was rendered in.
|
|
18
|
+
*/
|
|
19
|
+
function getJourneyOptions(translations) {
|
|
20
|
+
return exports.JOURNEY_OPTION_KEYS.map((key) => ({ key, label: translations[key] }));
|
|
21
|
+
}
|
|
22
|
+
const MAX_FIELD_LENGTH = 1000;
|
|
23
|
+
function sanitizeFeedbackText(value) {
|
|
24
|
+
return value.trim().slice(0, MAX_FIELD_LENGTH);
|
|
25
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Firebase passwordless ("magic link") helpers used by both the app
|
|
3
|
+
* (`waha-app`) and the web fallback page (`waha-web`). Sharing keeps the
|
|
4
|
+
* sign-in-link detection and the deep-link token encoding from drifting between
|
|
5
|
+
* the two, which would silently break the hand-off between them.
|
|
6
|
+
*
|
|
7
|
+
* Relies on `btoa`/`atob`, which every target runtime provides (Hermes, Node
|
|
8
|
+
* ≥16, browsers) and the DOM lib types.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Whether a URL is a Firebase passwordless sign-in link — i.e. carries the
|
|
12
|
+
* `mode=signIn` + `oobCode` action params at the top level. Used by the app's
|
|
13
|
+
* `+native-intent` (to route a reopened link to `auth-callback`) and by the web
|
|
14
|
+
* fallback page (to decide whether to show its "finish signing in" UI).
|
|
15
|
+
*/
|
|
16
|
+
export declare function isMagicSignInLink(url: URL): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Base64url-encodes a Firebase sign-in URL for transport in a deep-link query
|
|
19
|
+
* param.
|
|
20
|
+
*
|
|
21
|
+
* The sign-in URL contains its own `?`, `&` and `=`. Nesting it in a query
|
|
22
|
+
* param and percent-encoding isn't enough: deep links get URL-decoded an
|
|
23
|
+
* unpredictable number of times before the app's router reads them
|
|
24
|
+
* (expo-router's query parser ultimately splits on a literal `&`), so an inner
|
|
25
|
+
* `&` re-emerges and the value is truncated at it. base64url carries none of
|
|
26
|
+
* those characters, so it survives intact through any number of decode passes.
|
|
27
|
+
* Sign-in URLs are ASCII, so `btoa`/`atob` round-trip them exactly.
|
|
28
|
+
*/
|
|
29
|
+
export declare function encodeMagicLinkToken(url: string): string;
|
|
30
|
+
/** Reverses {@link encodeMagicLinkToken}; null on a malformed token. */
|
|
31
|
+
export declare function decodeMagicLinkToken(token: string): string | null;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared Firebase passwordless ("magic link") helpers used by both the app
|
|
4
|
+
* (`waha-app`) and the web fallback page (`waha-web`). Sharing keeps the
|
|
5
|
+
* sign-in-link detection and the deep-link token encoding from drifting between
|
|
6
|
+
* the two, which would silently break the hand-off between them.
|
|
7
|
+
*
|
|
8
|
+
* Relies on `btoa`/`atob`, which every target runtime provides (Hermes, Node
|
|
9
|
+
* ≥16, browsers) and the DOM lib types.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.isMagicSignInLink = isMagicSignInLink;
|
|
13
|
+
exports.encodeMagicLinkToken = encodeMagicLinkToken;
|
|
14
|
+
exports.decodeMagicLinkToken = decodeMagicLinkToken;
|
|
15
|
+
/**
|
|
16
|
+
* Whether a URL is a Firebase passwordless sign-in link — i.e. carries the
|
|
17
|
+
* `mode=signIn` + `oobCode` action params at the top level. Used by the app's
|
|
18
|
+
* `+native-intent` (to route a reopened link to `auth-callback`) and by the web
|
|
19
|
+
* fallback page (to decide whether to show its "finish signing in" UI).
|
|
20
|
+
*/
|
|
21
|
+
function isMagicSignInLink(url) {
|
|
22
|
+
return (url.searchParams.get('mode') === 'signIn' &&
|
|
23
|
+
!!url.searchParams.get('oobCode'));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Base64url-encodes a Firebase sign-in URL for transport in a deep-link query
|
|
27
|
+
* param.
|
|
28
|
+
*
|
|
29
|
+
* The sign-in URL contains its own `?`, `&` and `=`. Nesting it in a query
|
|
30
|
+
* param and percent-encoding isn't enough: deep links get URL-decoded an
|
|
31
|
+
* unpredictable number of times before the app's router reads them
|
|
32
|
+
* (expo-router's query parser ultimately splits on a literal `&`), so an inner
|
|
33
|
+
* `&` re-emerges and the value is truncated at it. base64url carries none of
|
|
34
|
+
* those characters, so it survives intact through any number of decode passes.
|
|
35
|
+
* Sign-in URLs are ASCII, so `btoa`/`atob` round-trip them exactly.
|
|
36
|
+
*/
|
|
37
|
+
function encodeMagicLinkToken(url) {
|
|
38
|
+
return btoa(url).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
39
|
+
}
|
|
40
|
+
/** Reverses {@link encodeMagicLinkToken}; null on a malformed token. */
|
|
41
|
+
function decodeMagicLinkToken(token) {
|
|
42
|
+
try {
|
|
43
|
+
const b64 = token.replace(/-/g, '+').replace(/_/g, '/');
|
|
44
|
+
const padded = b64 + '='.repeat((4 - (b64.length % 4)) % 4);
|
|
45
|
+
return atob(padded);
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
console.error('[auth] failed to decode magic link token:', e);
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export declare const SocialProofBase: z.ZodObject<{
|
|
3
|
+
lastUpdated: z.ZodNumber;
|
|
4
|
+
weekStartDate: z.ZodNumber;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type SocialProofBase = z.infer<typeof SocialProofBase>;
|
|
7
|
+
export declare const ShareSocialProof: z.ZodObject<{
|
|
8
|
+
lastUpdated: z.ZodNumber;
|
|
9
|
+
weekStartDate: z.ZodNumber;
|
|
10
|
+
totalWeeklyShares: z.ZodNumber;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type ShareSocialProof = z.infer<typeof ShareSocialProof>;
|
|
13
|
+
export declare const MeetingsSocialProof: z.ZodObject<{
|
|
14
|
+
lastUpdated: z.ZodNumber;
|
|
15
|
+
weekStartDate: z.ZodNumber;
|
|
16
|
+
totalWeeklyMeetings: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type MeetingsSocialProof = z.infer<typeof MeetingsSocialProof>;
|
|
19
|
+
export declare const BibleSessionsSocialProof: z.ZodObject<{
|
|
20
|
+
lastUpdated: z.ZodNumber;
|
|
21
|
+
weekStartDate: z.ZodNumber;
|
|
22
|
+
totalWeeklyBibleSessions: z.ZodNumber;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type BibleSessionsSocialProof = z.infer<typeof BibleSessionsSocialProof>;
|
|
25
|
+
export declare const ArticleSessionsSocialProof: z.ZodObject<{
|
|
26
|
+
lastUpdated: z.ZodNumber;
|
|
27
|
+
weekStartDate: z.ZodNumber;
|
|
28
|
+
totalWeeklyArticleSessions: z.ZodNumber;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type ArticleSessionsSocialProof = z.infer<typeof ArticleSessionsSocialProof>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ArticleSessionsSocialProof = exports.BibleSessionsSocialProof = exports.MeetingsSocialProof = exports.ShareSocialProof = exports.SocialProofBase = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
exports.SocialProofBase = zod_1.default.object({
|
|
9
|
+
lastUpdated: zod_1.default.number(),
|
|
10
|
+
weekStartDate: zod_1.default.number(),
|
|
11
|
+
});
|
|
12
|
+
exports.ShareSocialProof = exports.SocialProofBase.extend({
|
|
13
|
+
totalWeeklyShares: zod_1.default.number(),
|
|
14
|
+
});
|
|
15
|
+
exports.MeetingsSocialProof = exports.SocialProofBase.extend({
|
|
16
|
+
totalWeeklyMeetings: zod_1.default.number(),
|
|
17
|
+
});
|
|
18
|
+
exports.BibleSessionsSocialProof = exports.SocialProofBase.extend({
|
|
19
|
+
totalWeeklyBibleSessions: zod_1.default.number(),
|
|
20
|
+
});
|
|
21
|
+
exports.ArticleSessionsSocialProof = exports.SocialProofBase.extend({
|
|
22
|
+
totalWeeklyArticleSessions: zod_1.default.number(),
|
|
23
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "waha-shared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.432",
|
|
4
4
|
"author": "Waha",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@types/signale": "^1.4.7",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
],
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"scripts": {
|
|
29
|
-
"build": "npx tsc && copyfiles \"data/**/*.json\" dist",
|
|
30
|
-
"update": "yarn build && REGISTRY_VERSION=$(npm view waha-shared version) && npm version $REGISTRY_VERSION --no-git-tag-version --allow-same-version && npm version patch --no-git-tag-version && git add . && (git commit -m 'chore:
|
|
31
|
-
"updateManual": "(npm whoami || npm login) && yarn build && REGISTRY_VERSION=$(npm view waha-shared version) && npm version $REGISTRY_VERSION --no-git-tag-version --allow-same-version && npm version patch --no-git-tag-version && git add dist package.json && (git commit -m 'chore:
|
|
29
|
+
"build": "npx tsc && npx copyfiles \"data/**/*.json\" dist",
|
|
30
|
+
"update": "yarn build && REGISTRY_VERSION=$(npm view waha-shared version) && npm version $REGISTRY_VERSION --no-git-tag-version --allow-same-version && npm version patch --no-git-tag-version && git add . && (git commit -m 'chore: build waha-shared' || true) && bash -c 'npm publish --access public --registry https://registry.npmjs.org --//registry.npmjs.org/:_authToken=$(grep NPM_TOKEN= ../.env | cut -d \"=\" -f2-)'",
|
|
31
|
+
"updateManual": "(npm whoami || npm login) && yarn build && REGISTRY_VERSION=$(npm view waha-shared version) && npm version $REGISTRY_VERSION --no-git-tag-version --allow-same-version && npm version patch --no-git-tag-version && git add dist package.json && (git commit -m 'chore: build waha-shared' || true) && npm publish"
|
|
32
32
|
}
|
|
33
33
|
}
|