waha-shared 1.0.540 → 1.0.541

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,6 +1,6 @@
1
1
  import {
2
2
  donations
3
- } from "./chunk-WABRK7MS.mjs";
3
+ } from "./chunk-ODXJ34BL.mjs";
4
4
  import {
5
5
  forms
6
6
  } from "./chunk-3PIC7WQ6.mjs";
@@ -9,10 +9,10 @@ import {
9
9
  } from "./chunk-B6AHOHTE.mjs";
10
10
  import {
11
11
  resend
12
- } from "./chunk-X4WQHNA6.mjs";
12
+ } from "./chunk-ZIAHYAMZ.mjs";
13
13
  import {
14
14
  content
15
- } from "./chunk-CRBVS26E.mjs";
15
+ } from "./chunk-UPWEPHQW.mjs";
16
16
 
17
17
  // contract/index.ts
18
18
  var contract = {
@@ -0,0 +1,44 @@
1
+ import {
2
+ userProcedure
3
+ } from "./chunk-RQBWI27C.mjs";
4
+ import {
5
+ UPSTREAM_FAILED
6
+ } from "./chunk-NCJ6KJVG.mjs";
7
+ import {
8
+ fromStripeAmount,
9
+ getDonationLimits,
10
+ isValidStripeDonationAmount
11
+ } from "./chunk-HTR7X3OY.mjs";
12
+
13
+ // contract/donations.ts
14
+ import z from "zod";
15
+ var createPaymentIntent = userProcedure.route({ method: "POST", path: "/create-payment-intent" }).errors({ UPSTREAM_FAILED }).input(
16
+ z.object({
17
+ /** In Stripe's units for `currency`, from `toStripeAmount`. */
18
+ amount: z.number().int(),
19
+ /** An ISO 4217 code, in either case. */
20
+ currency: z.string().regex(/^[a-z]{3}$/i),
21
+ /** Charges with Stripe's test key, for testing donations on a build. */
22
+ useTestKey: z.boolean().optional()
23
+ }).superRefine(({ amount, currency }, ctx) => {
24
+ if (isValidStripeDonationAmount(amount, currency)) return;
25
+ const { min, max } = getDonationLimits(currency);
26
+ ctx.addIssue({
27
+ code: "custom",
28
+ path: ["amount"],
29
+ message: `${fromStripeAmount(amount, currency)} ${currency} is outside the ${min}\u2013${max} donation limits.`
30
+ });
31
+ })
32
+ ).output(
33
+ z.object({
34
+ clientSecret: z.string(),
35
+ ephemeralKey: z.string(),
36
+ /** The Stripe customer for the caller's Firebase uid. */
37
+ customer: z.string()
38
+ })
39
+ );
40
+ var donations = { createPaymentIntent };
41
+
42
+ export {
43
+ donations
44
+ };
@@ -20,15 +20,11 @@ var ContentQuery = z.object({
20
20
  /** Includes drafts, which only the test website serves. */
21
21
  "include-drafts": QueryBoolean.optional()
22
22
  });
23
- var ContentLanguagesResponse = z.object({ data: z.array(z.string()) });
24
- var ArticlesResponse = z.object({ data: z.array(ArticleEntry) });
25
- var MicroLessonsResponse = z.object({
26
- data: z.array(MicroLessonEntry)
27
- });
28
- var articleLanguages = publicProcedure.route({ method: "GET", path: "/article-languages" }).input(ContentQuery).output(ContentLanguagesResponse);
29
- var articles = publicProcedure.route({ method: "GET", path: "/{languageId}/articles" }).input(ContentQuery.extend({ languageId: LanguageId })).output(ArticlesResponse);
30
- var microLessonLanguages = publicProcedure.route({ method: "GET", path: "/micro-lessons-languages" }).input(ContentQuery).output(ContentLanguagesResponse);
31
- var microLessons = publicProcedure.route({ method: "GET", path: "/{languageId}/micro-lessons" }).input(ContentQuery.extend({ languageId: LanguageId })).output(MicroLessonsResponse);
23
+ var ContentLanguages = z.object({ data: z.array(z.string()) });
24
+ var articleLanguages = publicProcedure.route({ method: "GET", path: "/article-languages" }).input(ContentQuery).output(ContentLanguages);
25
+ var articles = publicProcedure.route({ method: "GET", path: "/{languageId}/articles" }).input(ContentQuery.extend({ languageId: LanguageId })).output(z.object({ data: z.array(ArticleEntry) }));
26
+ var microLessonLanguages = publicProcedure.route({ method: "GET", path: "/micro-lessons-languages" }).input(ContentQuery).output(ContentLanguages);
27
+ var microLessons = publicProcedure.route({ method: "GET", path: "/{languageId}/micro-lessons" }).input(ContentQuery.extend({ languageId: LanguageId })).output(z.object({ data: z.array(MicroLessonEntry) }));
32
28
  var content = {
33
29
  articleLanguages,
34
30
  articles,
@@ -37,8 +33,5 @@ var content = {
37
33
  };
38
34
 
39
35
  export {
40
- ContentLanguagesResponse,
41
- ArticlesResponse,
42
- MicroLessonsResponse,
43
36
  content
44
37
  };
@@ -18,28 +18,35 @@ import {
18
18
  // contract/resend.ts
19
19
  import z from "zod";
20
20
  var Newsletter = z.boolean().optional();
21
- var SubscribeDripBody = z.object({
22
- sequence: DripSequenceId,
23
- languageId: z.string(),
24
- firstName: Name.optional(),
25
- newsletter: Newsletter
26
- });
27
- var subscribeDrip = accountProcedure.route({ method: "POST", path: "/subscribe-drip" }).errors({ UPSTREAM_FAILED }).input(SubscribeDripBody).output(
21
+ var subscribeDrip = accountProcedure.route({ method: "POST", path: "/subscribe-drip" }).errors({ UPSTREAM_FAILED }).input(
22
+ z.object({
23
+ sequence: DripSequenceId,
24
+ /**
25
+ * Any language is accepted so callers don't need to know which ones have
26
+ * a drip; unsupported ones are a no-op.
27
+ */
28
+ languageId: z.string(),
29
+ firstName: Name.optional(),
30
+ newsletter: Newsletter
31
+ })
32
+ ).output(
28
33
  z.object({
29
34
  status: z.enum(["enrolled", "already_enrolled", "unsupported_language"])
30
35
  })
31
36
  );
32
- var NewsletterSignupBody = z.object({
33
- email: Email,
34
- name: Name.optional()
35
- });
36
- var newsletterSignup = procedure.route({ method: "POST", path: "/submit-subscribe" }).input(NewsletterSignupBody).output(z.object({}));
37
- var DonorSequenceBody = z.object({
38
- email: Email,
39
- name: Name.optional(),
40
- newsletter: Newsletter
41
- });
42
- var donorSequence = procedure.route({ method: "POST", path: "/add-to-donation-sequence" }).input(DonorSequenceBody).output(z.object({}));
37
+ var newsletterSignup = procedure.route({ method: "POST", path: "/submit-subscribe" }).input(
38
+ z.object({
39
+ email: Email,
40
+ name: Name.optional()
41
+ })
42
+ ).output(z.object({}));
43
+ var donorSequence = procedure.route({ method: "POST", path: "/add-to-donation-sequence" }).input(
44
+ z.object({
45
+ email: Email,
46
+ name: Name.optional(),
47
+ newsletter: Newsletter
48
+ })
49
+ ).output(z.object({}));
43
50
  var UnsubscribeBody = z.object({ contactId: z.uuid() });
44
51
  var unsubscribe = publicProcedure.route({ method: "POST", path: "/unsubscribe" }).errors({ CONTACT_NOT_FOUND, UPSTREAM_FAILED }).input(UnsubscribeBody).output(z.object({}));
45
52
  var resend = {
@@ -50,9 +57,6 @@ var resend = {
50
57
  };
51
58
 
52
59
  export {
53
- SubscribeDripBody,
54
- NewsletterSignupBody,
55
- DonorSequenceBody,
56
60
  UnsubscribeBody,
57
61
  resend
58
62
  };
@@ -1,162 +1,4 @@
1
1
  import z from 'zod';
2
- /** The ids of the languages that have content of a kind. */
3
- export declare const ContentLanguagesResponse: z.ZodObject<{
4
- data: z.ZodArray<z.ZodString>;
5
- }, z.core.$strip>;
6
- export type ContentLanguagesResponse = z.infer<typeof ContentLanguagesResponse>;
7
- export declare const ArticlesResponse: z.ZodObject<{
8
- data: z.ZodArray<z.ZodObject<{
9
- id: z.ZodString;
10
- data: z.ZodObject<{
11
- title: z.ZodString;
12
- author: z.ZodOptional<z.ZodString>;
13
- category: z.ZodEnum<{
14
- "Case Studies": "Case Studies";
15
- "Discovering God": "Discovering God";
16
- "Disciple Making Secrets": "Disciple Making Secrets";
17
- "Product Updates": "Product Updates";
18
- Books: "Books";
19
- Films: "Films";
20
- "How Tos": "How Tos";
21
- "Mengenali Tuhan": "Mengenali Tuhan";
22
- "\u00D6rnek Olay \u00C7al\u0131\u015Fmalar\u0131": "Örnek Olay Çalışmaları";
23
- "\u00D6\u011Frenci Yeti\u015Ftirme S\u0131rlar\u0131": "Öğrenci Yetiştirme Sırları";
24
- "Tanr\u0131'y\u0131 Ke\u015Ffetmek": "Tanrı'yı Keşfetmek";
25
- "Historias de la vida real": "Historias de la vida real";
26
- "Secretos para hacer disc\u00EDpulos": "Secretos para hacer discípulos";
27
- "Descubriendo a Dios": "Descubriendo a Dios";
28
- }>;
29
- image: z.ZodOptional<z.ZodString>;
30
- date: z.ZodCoercedDate<unknown>;
31
- isDraft: z.ZodOptional<z.ZodBoolean>;
32
- seekerFriendly: z.ZodOptional<z.ZodBoolean>;
33
- platform: z.ZodEnum<{
34
- "Web Only": "Web Only";
35
- "App Only": "App Only";
36
- All: "All";
37
- }>;
38
- audio: z.ZodOptional<z.ZodObject<{
39
- audioUrl: z.ZodString;
40
- loop: z.ZodOptional<z.ZodBoolean>;
41
- }, z.core.$strip>>;
42
- video: z.ZodOptional<z.ZodObject<{
43
- videoUrl: z.ZodString;
44
- autoplay: z.ZodOptional<z.ZodBoolean>;
45
- loop: z.ZodOptional<z.ZodBoolean>;
46
- disableControls: z.ZodOptional<z.ZodBoolean>;
47
- aspectRatio: z.ZodOptional<z.ZodNumber>;
48
- }, z.core.$strip>>;
49
- impactStoryRegion: z.ZodOptional<z.ZodEnum<{
50
- "North America": "North America";
51
- "Latin America and the Caribbean": "Latin America and the Caribbean";
52
- "Middle East/North Africa": "Middle East/North Africa";
53
- "Sub-Saharan Africa": "Sub-Saharan Africa";
54
- "Western Europe": "Western Europe";
55
- "Eastern Europe": "Eastern Europe";
56
- "Western Asia": "Western Asia";
57
- "Southern Asia": "Southern Asia";
58
- "Central Asia": "Central Asia";
59
- "Southeast Asia": "Southeast Asia";
60
- "Eastern Asia": "Eastern Asia";
61
- Oceania: "Oceania";
62
- }>>;
63
- }, z.core.$strip>;
64
- body: z.ZodString;
65
- }, z.core.$strip>>;
66
- }, z.core.$strip>;
67
- export type ArticlesResponse = z.infer<typeof ArticlesResponse>;
68
- export declare const MicroLessonsResponse: z.ZodObject<{
69
- data: z.ZodArray<z.ZodObject<{
70
- id: z.ZodString;
71
- data: z.ZodObject<{
72
- title: z.ZodString;
73
- subtitle: z.ZodOptional<z.ZodString>;
74
- date: z.ZodCoercedDate<unknown>;
75
- isDraft: z.ZodOptional<z.ZodBoolean>;
76
- seekerFriendly: z.ZodOptional<z.ZodBoolean>;
77
- platform: z.ZodEnum<{
78
- "Web Only": "Web Only";
79
- "App Only": "App Only";
80
- All: "All";
81
- }>;
82
- image: z.ZodString;
83
- category: z.ZodEnum<{
84
- "Case Studies": "Case Studies";
85
- "Discovering God": "Discovering God";
86
- "Disciple Making Secrets": "Disciple Making Secrets";
87
- "Product Updates": "Product Updates";
88
- Books: "Books";
89
- Films: "Films";
90
- "How Tos": "How Tos";
91
- "Mengenali Tuhan": "Mengenali Tuhan";
92
- "\u00D6rnek Olay \u00C7al\u0131\u015Fmalar\u0131": "Örnek Olay Çalışmaları";
93
- "\u00D6\u011Frenci Yeti\u015Ftirme S\u0131rlar\u0131": "Öğrenci Yetiştirme Sırları";
94
- "Tanr\u0131'y\u0131 Ke\u015Ffetmek": "Tanrı'yı Keşfetmek";
95
- "Historias de la vida real": "Historias de la vida real";
96
- "Secretos para hacer disc\u00EDpulos": "Secretos para hacer discípulos";
97
- "Descubriendo a Dios": "Descubriendo a Dios";
98
- }>;
99
- campaign: z.ZodOptional<z.ZodString>;
100
- impactStoryRegion: z.ZodOptional<z.ZodEnum<{
101
- "North America": "North America";
102
- "Latin America and the Caribbean": "Latin America and the Caribbean";
103
- "Middle East/North Africa": "Middle East/North Africa";
104
- "Sub-Saharan Africa": "Sub-Saharan Africa";
105
- "Western Europe": "Western Europe";
106
- "Eastern Europe": "Eastern Europe";
107
- "Western Asia": "Western Asia";
108
- "Southern Asia": "Southern Asia";
109
- "Central Asia": "Central Asia";
110
- "Southeast Asia": "Southeast Asia";
111
- "Eastern Asia": "Eastern Asia";
112
- Oceania: "Oceania";
113
- }>>;
114
- pages: z.ZodArray<z.ZodObject<{
115
- heading: z.ZodString;
116
- body: z.ZodOptional<z.ZodString>;
117
- icon: z.ZodOptional<z.ZodString>;
118
- image: z.ZodOptional<z.ZodString>;
119
- audio: z.ZodOptional<z.ZodObject<{
120
- audioUrl: z.ZodString;
121
- loop: z.ZodOptional<z.ZodBoolean>;
122
- }, z.core.$strip>>;
123
- video: z.ZodOptional<z.ZodObject<{
124
- videoUrl: z.ZodString;
125
- autoplay: z.ZodOptional<z.ZodBoolean>;
126
- loop: z.ZodOptional<z.ZodBoolean>;
127
- disableControls: z.ZodOptional<z.ZodBoolean>;
128
- aspectRatio: z.ZodOptional<z.ZodNumber>;
129
- }, z.core.$strip>>;
130
- textInput: z.ZodOptional<z.ZodObject<{
131
- show: z.ZodBoolean;
132
- placeholder: z.ZodOptional<z.ZodString>;
133
- showCopyButton: z.ZodOptional<z.ZodBoolean>;
134
- prefilledText: z.ZodOptional<z.ZodString>;
135
- }, z.core.$strip>>;
136
- ctaButton: z.ZodOptional<z.ZodObject<{
137
- show: z.ZodBoolean;
138
- label: z.ZodString;
139
- href: z.ZodString;
140
- }, z.core.$strip>>;
141
- radioButtons: z.ZodOptional<z.ZodArray<z.ZodObject<{
142
- heading: z.ZodOptional<z.ZodString>;
143
- body: z.ZodOptional<z.ZodString>;
144
- }, z.core.$strip>>>;
145
- platform: z.ZodOptional<z.ZodEnum<{
146
- "Web Only": "Web Only";
147
- "App Only": "App Only";
148
- All: "All";
149
- }>>;
150
- notification: z.ZodOptional<z.ZodObject<{
151
- title: z.ZodString;
152
- body: z.ZodString;
153
- delayInHours: z.ZodNumber;
154
- }, z.core.$strip>>;
155
- }, z.core.$strip>>;
156
- }, z.core.$strip>;
157
- }, z.core.$strip>>;
158
- }, z.core.$strip>;
159
- export type MicroLessonsResponse = z.infer<typeof MicroLessonsResponse>;
160
2
  export declare const content: {
161
3
  articleLanguages: import("@orpc/contract", { with: { "resolution-mode": "import" } }).ContractProcedureBuilderWithInputOutput<z.ZodObject<{
162
4
  'include-drafts': z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>;
@@ -1,9 +1,6 @@
1
1
  import {
2
- ArticlesResponse,
3
- ContentLanguagesResponse,
4
- MicroLessonsResponse,
5
2
  content
6
- } from "../chunks/chunk-CRBVS26E.mjs";
3
+ } from "../chunks/chunk-UPWEPHQW.mjs";
7
4
  import "../chunks/chunk-3U6OCX3W.mjs";
8
5
  import "../chunks/chunk-RQBWI27C.mjs";
9
6
  import "../chunks/chunk-NCJ6KJVG.mjs";
@@ -14,8 +11,5 @@ import "../chunks/chunk-AYLOYQJX.mjs";
14
11
  import "../chunks/chunk-5WXWDALL.mjs";
15
12
  import "../chunks/chunk-5AVXA5JL.mjs";
16
13
  export {
17
- ArticlesResponse,
18
- ContentLanguagesResponse,
19
- MicroLessonsResponse,
20
14
  content
21
15
  };
@@ -1,17 +1,4 @@
1
1
  import z from 'zod';
2
- export declare const CreatePaymentIntentInput: z.ZodObject<{
3
- amount: z.ZodNumber;
4
- currency: z.ZodString;
5
- useTestKey: z.ZodOptional<z.ZodBoolean>;
6
- }, z.core.$strip>;
7
- export type CreatePaymentIntentInput = z.infer<typeof CreatePaymentIntentInput>;
8
- /** What the app's Stripe PaymentSheet needs to take the payment. */
9
- export declare const PaymentSheetParams: z.ZodObject<{
10
- clientSecret: z.ZodString;
11
- ephemeralKey: z.ZodString;
12
- customer: z.ZodString;
13
- }, z.core.$strip>;
14
- export type PaymentSheetParams = z.infer<typeof PaymentSheetParams>;
15
2
  export declare const donations: {
16
3
  createPaymentIntent: import("@orpc/contract", { with: { "resolution-mode": "import" } }).ContractProcedureBuilderWithInputOutput<z.ZodObject<{
17
4
  amount: z.ZodNumber;
@@ -1,14 +1,10 @@
1
1
  import {
2
- CreatePaymentIntentInput,
3
- PaymentSheetParams,
4
2
  donations
5
- } from "../chunks/chunk-WABRK7MS.mjs";
3
+ } from "../chunks/chunk-ODXJ34BL.mjs";
6
4
  import "../chunks/chunk-RQBWI27C.mjs";
7
5
  import "../chunks/chunk-NCJ6KJVG.mjs";
8
6
  import "../chunks/chunk-HTR7X3OY.mjs";
9
7
  import "../chunks/chunk-5AVXA5JL.mjs";
10
8
  export {
11
- CreatePaymentIntentInput,
12
- PaymentSheetParams,
13
9
  donations
14
10
  };
@@ -1,4 +1,4 @@
1
- import type { ContractRouterClient } from '@orpc/contract';
1
+ import type { ContractRouterClient, InferContractRouterInputs } from '@orpc/contract';
2
2
  import type { ApiMeta } from './procedure';
3
3
  export declare const contract: {
4
4
  resend: {
@@ -645,3 +645,8 @@ export interface WahaApiClientContext {
645
645
  * response against the contract.
646
646
  */
647
647
  export type WahaApiClient = ContractRouterClient<typeof contract, WahaApiClientContext>;
648
+ /**
649
+ * The input of each procedure, by path:
650
+ * `WahaApiInputs['resend']['subscribeDrip']`.
651
+ */
652
+ export type WahaApiInputs = InferContractRouterInputs<typeof contract>;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  contract
3
- } from "../chunks/chunk-OM6VU5I2.mjs";
4
- import "../chunks/chunk-WABRK7MS.mjs";
3
+ } from "../chunks/chunk-6L6UN74E.mjs";
4
+ import "../chunks/chunk-ODXJ34BL.mjs";
5
5
  import "../chunks/chunk-3PIC7WQ6.mjs";
6
6
  import "../chunks/chunk-B6AHOHTE.mjs";
7
- import "../chunks/chunk-X4WQHNA6.mjs";
8
- import "../chunks/chunk-CRBVS26E.mjs";
7
+ import "../chunks/chunk-ZIAHYAMZ.mjs";
8
+ import "../chunks/chunk-UPWEPHQW.mjs";
9
9
  import "../chunks/chunk-3U6OCX3W.mjs";
10
10
  import "../chunks/chunk-RQBWI27C.mjs";
11
11
  import "../chunks/chunk-NCJ6KJVG.mjs";
@@ -1,29 +1,4 @@
1
1
  import z from 'zod';
2
- /**
3
- * Any language is accepted so callers don't need to know which ones have a
4
- * drip; unsupported ones are a no-op.
5
- */
6
- export declare const SubscribeDripBody: z.ZodObject<{
7
- sequence: z.ZodEnum<{
8
- drip_believer: "drip_believer";
9
- drip_seeker: "drip_seeker";
10
- }>;
11
- languageId: z.ZodString;
12
- firstName: z.ZodOptional<z.ZodString>;
13
- newsletter: z.ZodOptional<z.ZodBoolean>;
14
- }, z.core.$strip>;
15
- export type SubscribeDripBody = z.infer<typeof SubscribeDripBody>;
16
- export declare const NewsletterSignupBody: z.ZodObject<{
17
- email: z.ZodPipe<z.ZodString, z.ZodEmail>;
18
- name: z.ZodOptional<z.ZodString>;
19
- }, z.core.$strip>;
20
- export type NewsletterSignupBody = z.infer<typeof NewsletterSignupBody>;
21
- export declare const DonorSequenceBody: z.ZodObject<{
22
- email: z.ZodPipe<z.ZodString, z.ZodEmail>;
23
- name: z.ZodOptional<z.ZodString>;
24
- newsletter: z.ZodOptional<z.ZodBoolean>;
25
- }, z.core.$strip>;
26
- export type DonorSequenceBody = z.infer<typeof DonorSequenceBody>;
27
2
  /** The Resend contact id from a drip email's unsubscribe link. */
28
3
  export declare const UnsubscribeBody: z.ZodObject<{
29
4
  contactId: z.ZodUUID;
@@ -1,19 +1,13 @@
1
1
  import {
2
- DonorSequenceBody,
3
- NewsletterSignupBody,
4
- SubscribeDripBody,
5
2
  UnsubscribeBody,
6
3
  resend
7
- } from "../chunks/chunk-X4WQHNA6.mjs";
4
+ } from "../chunks/chunk-ZIAHYAMZ.mjs";
8
5
  import "../chunks/chunk-3U6OCX3W.mjs";
9
6
  import "../chunks/chunk-RQBWI27C.mjs";
10
7
  import "../chunks/chunk-NCJ6KJVG.mjs";
11
8
  import "../chunks/chunk-ZAZXYO7L.mjs";
12
9
  import "../chunks/chunk-5AVXA5JL.mjs";
13
10
  export {
14
- DonorSequenceBody,
15
- NewsletterSignupBody,
16
- SubscribeDripBody,
17
11
  UnsubscribeBody,
18
12
  resend
19
13
  };
package/dist/contract.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  contract
3
- } from "./chunks/chunk-OM6VU5I2.mjs";
4
- import "./chunks/chunk-WABRK7MS.mjs";
3
+ } from "./chunks/chunk-6L6UN74E.mjs";
4
+ import "./chunks/chunk-ODXJ34BL.mjs";
5
5
  import "./chunks/chunk-3PIC7WQ6.mjs";
6
6
  import "./chunks/chunk-B6AHOHTE.mjs";
7
- import "./chunks/chunk-X4WQHNA6.mjs";
8
- import "./chunks/chunk-CRBVS26E.mjs";
7
+ import "./chunks/chunk-ZIAHYAMZ.mjs";
8
+ import "./chunks/chunk-UPWEPHQW.mjs";
9
9
  import "./chunks/chunk-3U6OCX3W.mjs";
10
10
  import "./chunks/chunk-RQBWI27C.mjs";
11
11
  import "./chunks/chunk-NCJ6KJVG.mjs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  contract
3
- } from "../chunks/chunk-OM6VU5I2.mjs";
4
- import "../chunks/chunk-WABRK7MS.mjs";
3
+ } from "../chunks/chunk-6L6UN74E.mjs";
4
+ import "../chunks/chunk-ODXJ34BL.mjs";
5
5
  import "../chunks/chunk-3PIC7WQ6.mjs";
6
6
  import "../chunks/chunk-B6AHOHTE.mjs";
7
- import "../chunks/chunk-X4WQHNA6.mjs";
8
- import "../chunks/chunk-CRBVS26E.mjs";
7
+ import "../chunks/chunk-ZIAHYAMZ.mjs";
8
+ import "../chunks/chunk-UPWEPHQW.mjs";
9
9
  import "../chunks/chunk-3U6OCX3W.mjs";
10
10
  import {
11
11
  ApiAuth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waha-shared",
3
- "version": "1.0.540",
3
+ "version": "1.0.541",
4
4
  "author": "Waha",
5
5
  "dependencies": {
6
6
  "@types/signale": "^1.4.7",
@@ -25,8 +25,15 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "devDependencies": {
28
+ "@crowdin/crowdin-api-client": "^1.59.2",
29
+ "@orpc/client": "^1.16.1",
30
+ "@orpc/contract": "^1.16.1",
31
+ "@orpc/openapi-client": "^1.16.1",
32
+ "@types/react": "^19.3.0",
28
33
  "esbuild": "^0.28.2",
29
- "typescript": "~5.9.2"
34
+ "react": "^19.3.1",
35
+ "typescript": "~5.9.2",
36
+ "zod": "^4.6.7"
30
37
  },
31
38
  "files": [
32
39
  "dist",
@@ -1,44 +0,0 @@
1
- import {
2
- userProcedure
3
- } from "./chunk-RQBWI27C.mjs";
4
- import {
5
- UPSTREAM_FAILED
6
- } from "./chunk-NCJ6KJVG.mjs";
7
- import {
8
- fromStripeAmount,
9
- getDonationLimits,
10
- isValidStripeDonationAmount
11
- } from "./chunk-HTR7X3OY.mjs";
12
-
13
- // contract/donations.ts
14
- import z from "zod";
15
- var CreatePaymentIntentInput = z.object({
16
- /** In Stripe's units for `currency`, from `toStripeAmount`. */
17
- amount: z.number().int(),
18
- /** An ISO 4217 code, in either case. */
19
- currency: z.string().regex(/^[a-z]{3}$/i),
20
- /** Charges with Stripe's test key, for testing donations on a build. */
21
- useTestKey: z.boolean().optional()
22
- }).superRefine(({ amount, currency }, ctx) => {
23
- if (isValidStripeDonationAmount(amount, currency)) return;
24
- const { min, max } = getDonationLimits(currency);
25
- ctx.addIssue({
26
- code: "custom",
27
- path: ["amount"],
28
- message: `${fromStripeAmount(amount, currency)} ${currency} is outside the ${min}\u2013${max} donation limits.`
29
- });
30
- });
31
- var PaymentSheetParams = z.object({
32
- clientSecret: z.string(),
33
- ephemeralKey: z.string(),
34
- /** The Stripe customer for the caller's Firebase uid. */
35
- customer: z.string()
36
- });
37
- var createPaymentIntent = userProcedure.route({ method: "POST", path: "/create-payment-intent" }).errors({ UPSTREAM_FAILED }).input(CreatePaymentIntentInput).output(PaymentSheetParams);
38
- var donations = { createPaymentIntent };
39
-
40
- export {
41
- CreatePaymentIntentInput,
42
- PaymentSheetParams,
43
- donations
44
- };