@revealui/services 0.0.3 → 0.2.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.
Files changed (144) hide show
  1. package/LICENSE +22 -0
  2. package/LICENSE.commercial +112 -0
  3. package/README.md +177 -0
  4. package/dist/api/create-checkout-session/index.d.ts +2 -0
  5. package/dist/api/create-checkout-session/index.d.ts.map +1 -0
  6. package/dist/api/create-checkout-session/index.js +61 -0
  7. package/dist/api/create-checkout-session/index.js.map +1 -0
  8. package/dist/api/create-portal-link/index.d.ts +2 -0
  9. package/dist/api/create-portal-link/index.d.ts.map +1 -0
  10. package/dist/api/create-portal-link/index.js +37 -0
  11. package/dist/api/create-portal-link/index.js.map +1 -0
  12. package/dist/api/handlers/customer-handlers.d.ts +27 -0
  13. package/dist/api/handlers/customer-handlers.d.ts.map +1 -0
  14. package/dist/api/handlers/customer-handlers.js +86 -0
  15. package/dist/api/handlers/customer-handlers.js.map +1 -0
  16. package/dist/api/handlers/index.d.ts +18 -0
  17. package/dist/api/handlers/index.d.ts.map +1 -0
  18. package/dist/api/handlers/index.js +18 -0
  19. package/dist/api/handlers/index.js.map +1 -0
  20. package/dist/api/handlers/invoice-handlers.d.ts +9 -0
  21. package/dist/api/handlers/invoice-handlers.d.ts.map +1 -0
  22. package/dist/api/handlers/invoice-handlers.js +52 -0
  23. package/dist/api/handlers/invoice-handlers.js.map +1 -0
  24. package/dist/api/handlers/payment-handlers.d.ts +13 -0
  25. package/dist/api/handlers/payment-handlers.d.ts.map +1 -0
  26. package/dist/api/handlers/payment-handlers.js +133 -0
  27. package/dist/api/handlers/payment-handlers.js.map +1 -0
  28. package/dist/api/handlers/payment-intent.d.ts +21 -0
  29. package/dist/api/handlers/payment-intent.d.ts.map +1 -0
  30. package/dist/api/handlers/payment-intent.js +87 -0
  31. package/dist/api/handlers/payment-intent.js.map +1 -0
  32. package/dist/api/handlers/product-handlers.d.ts +11 -0
  33. package/dist/api/handlers/product-handlers.d.ts.map +1 -0
  34. package/dist/api/handlers/product-handlers.js +43 -0
  35. package/dist/api/handlers/product-handlers.js.map +1 -0
  36. package/dist/api/handlers/subscription-handlers.d.ts +17 -0
  37. package/dist/api/handlers/subscription-handlers.d.ts.map +1 -0
  38. package/dist/api/handlers/subscription-handlers.js +119 -0
  39. package/dist/api/handlers/subscription-handlers.js.map +1 -0
  40. package/dist/api/index.d.ts +8 -0
  41. package/dist/api/index.d.ts.map +1 -0
  42. package/dist/api/index.js +8 -0
  43. package/dist/api/index.js.map +1 -0
  44. package/dist/api/types/stripe.d.ts +42 -0
  45. package/dist/api/types/stripe.d.ts.map +1 -0
  46. package/dist/api/types/stripe.js +72 -0
  47. package/dist/api/types/stripe.js.map +1 -0
  48. package/dist/api/update-price/index.d.ts +42 -0
  49. package/dist/api/update-price/index.d.ts.map +1 -0
  50. package/dist/api/update-price/index.js +78 -0
  51. package/dist/api/update-price/index.js.map +1 -0
  52. package/dist/api/update-product/index.d.ts +44 -0
  53. package/dist/api/update-product/index.d.ts.map +1 -0
  54. package/dist/api/update-product/index.js +85 -0
  55. package/dist/api/update-product/index.js.map +1 -0
  56. package/dist/api/utils.d.ts +34 -0
  57. package/dist/api/utils.d.ts.map +1 -0
  58. package/dist/api/utils.js +66 -0
  59. package/dist/api/utils.js.map +1 -0
  60. package/dist/api/webhooks/index.d.ts +12 -0
  61. package/dist/api/webhooks/index.d.ts.map +1 -0
  62. package/dist/api/webhooks/index.js +280 -0
  63. package/dist/api/webhooks/index.js.map +1 -0
  64. package/dist/client/index.d.ts +11 -0
  65. package/dist/client/index.d.ts.map +1 -0
  66. package/dist/client/index.js +12 -0
  67. package/dist/client/index.js.map +1 -0
  68. package/dist/index.d.ts +33 -24
  69. package/dist/index.d.ts.map +1 -0
  70. package/dist/index.js +46 -41
  71. package/dist/index.js.map +1 -0
  72. package/dist/revealcoin/__tests__/client.test.d.ts +2 -0
  73. package/dist/revealcoin/__tests__/client.test.d.ts.map +1 -0
  74. package/dist/revealcoin/__tests__/client.test.js +207 -0
  75. package/dist/revealcoin/__tests__/client.test.js.map +1 -0
  76. package/dist/revealcoin/__tests__/config.test.d.ts +2 -0
  77. package/dist/revealcoin/__tests__/config.test.d.ts.map +1 -0
  78. package/dist/revealcoin/__tests__/config.test.js +91 -0
  79. package/dist/revealcoin/__tests__/config.test.js.map +1 -0
  80. package/dist/revealcoin/__tests__/oracle.test.d.ts +2 -0
  81. package/dist/revealcoin/__tests__/oracle.test.d.ts.map +1 -0
  82. package/dist/revealcoin/__tests__/oracle.test.js +238 -0
  83. package/dist/revealcoin/__tests__/oracle.test.js.map +1 -0
  84. package/dist/revealcoin/__tests__/safeguards.test.d.ts +2 -0
  85. package/dist/revealcoin/__tests__/safeguards.test.d.ts.map +1 -0
  86. package/dist/revealcoin/__tests__/safeguards.test.js +571 -0
  87. package/dist/revealcoin/__tests__/safeguards.test.js.map +1 -0
  88. package/dist/revealcoin/client.d.ts +51 -0
  89. package/dist/revealcoin/client.d.ts.map +1 -0
  90. package/dist/revealcoin/client.js +211 -0
  91. package/dist/revealcoin/client.js.map +1 -0
  92. package/dist/revealcoin/config.d.ts +32 -0
  93. package/dist/revealcoin/config.d.ts.map +1 -0
  94. package/dist/revealcoin/config.js +54 -0
  95. package/dist/revealcoin/config.js.map +1 -0
  96. package/dist/revealcoin/index.d.ts +5 -0
  97. package/dist/revealcoin/index.d.ts.map +1 -0
  98. package/dist/revealcoin/index.js +5 -0
  99. package/dist/revealcoin/index.js.map +1 -0
  100. package/dist/revealcoin/oracle.d.ts +81 -0
  101. package/dist/revealcoin/oracle.d.ts.map +1 -0
  102. package/dist/revealcoin/oracle.js +211 -0
  103. package/dist/revealcoin/oracle.js.map +1 -0
  104. package/dist/revealcoin/safeguards.d.ts +92 -0
  105. package/dist/revealcoin/safeguards.d.ts.map +1 -0
  106. package/dist/revealcoin/safeguards.js +240 -0
  107. package/dist/revealcoin/safeguards.js.map +1 -0
  108. package/dist/stripe/db-circuit-breaker.d.ts +47 -0
  109. package/dist/stripe/db-circuit-breaker.d.ts.map +1 -0
  110. package/dist/stripe/db-circuit-breaker.js +223 -0
  111. package/dist/stripe/db-circuit-breaker.js.map +1 -0
  112. package/dist/stripe/index.d.ts +2 -0
  113. package/dist/stripe/index.d.ts.map +1 -0
  114. package/dist/stripe/index.js +2 -0
  115. package/dist/stripe/index.js.map +1 -0
  116. package/dist/stripe/stripeClient.d.ts +126 -0
  117. package/dist/stripe/stripeClient.d.ts.map +1 -0
  118. package/dist/stripe/stripeClient.js +226 -0
  119. package/dist/stripe/stripeClient.js.map +1 -0
  120. package/dist/supabase/index.d.ts +6 -0
  121. package/dist/supabase/index.d.ts.map +1 -0
  122. package/dist/supabase/index.js +5 -0
  123. package/dist/supabase/index.js.map +1 -0
  124. package/dist/supabase/resilience.d.ts +50 -0
  125. package/dist/supabase/resilience.d.ts.map +1 -0
  126. package/dist/supabase/resilience.js +166 -0
  127. package/dist/supabase/resilience.js.map +1 -0
  128. package/dist/supabase/types.d.ts +206 -0
  129. package/dist/supabase/types.d.ts.map +1 -0
  130. package/dist/supabase/types.js +19 -0
  131. package/dist/supabase/types.js.map +1 -0
  132. package/dist/supabase/utils/client.d.ts +4 -0
  133. package/dist/supabase/utils/client.d.ts.map +1 -0
  134. package/dist/supabase/utils/client.js +12 -0
  135. package/dist/supabase/utils/client.js.map +1 -0
  136. package/dist/supabase/utils/server.d.ts +10 -0
  137. package/dist/supabase/utils/server.d.ts.map +1 -0
  138. package/dist/supabase/utils/server.js +49 -0
  139. package/dist/supabase/utils/server.js.map +1 -0
  140. package/dist/supabase/utils/web.d.ts +4 -0
  141. package/dist/supabase/utils/web.d.ts.map +1 -0
  142. package/dist/supabase/utils/web.js +37 -0
  143. package/dist/supabase/utils/web.js.map +1 -0
  144. package/package.json +79 -16
@@ -0,0 +1,280 @@
1
+ /**
2
+ * @deprecated This Supabase-based webhook handler is legacy code.
3
+ *
4
+ * The production webhook handler is in apps/api/src/routes/webhooks.ts,
5
+ * which uses NeonDB (Drizzle ORM) directly and handles all subscription
6
+ * lifecycle events including disputes, refunds, and payment recovery.
7
+ *
8
+ * This file is retained for backward compatibility with any external
9
+ * consumers of @revealui/services, but is NOT used by the API app.
10
+ */
11
+ import { generateLicenseKey } from '@revealui/core/license';
12
+ import { logger } from '@revealui/core/utils/logger';
13
+ import { getClient } from '@revealui/db/client';
14
+ import { processedWebhookEvents } from '@revealui/db/schema';
15
+ import { eq } from 'drizzle-orm';
16
+ import { protectedStripe } from '../../stripe/stripeClient.js';
17
+ import { createServerClientFromRequest } from '../../supabase/index.js';
18
+ import { handleInvoicePaymentFailed, handleInvoicePaymentSucceeded, handlePaymentMethodAttached, manageSubscriptionStatusChange, upsertPriceRecord, upsertProductRecord, } from '../utils.js';
19
+ const relevantEvents = new Set([
20
+ 'product.created',
21
+ 'product.updated',
22
+ 'price.created',
23
+ 'price.updated',
24
+ 'checkout.session.completed',
25
+ 'customer.subscription.created',
26
+ 'customer.subscription.updated',
27
+ 'customer.subscription.deleted',
28
+ 'invoice.payment_succeeded',
29
+ 'invoice.payment_failed',
30
+ 'payment_method.attached',
31
+ ]);
32
+ /** Maximum webhook payload size (10 MB). Stripe payloads are tiny; this guards against DoS. */
33
+ const MAX_BODY_BYTES = 10 * 1024 * 1024;
34
+ /**
35
+ * Resolve the webhook secret from environment variables.
36
+ * Throws at startup/request time if no secret is configured, preventing
37
+ * unsigned webhook acceptance.
38
+ */
39
+ function getWebhookSecret() {
40
+ const secret = (typeof import.meta.env.STRIPE_WEBHOOK_SECRET_LIVE === 'string'
41
+ ? import.meta.env.STRIPE_WEBHOOK_SECRET_LIVE
42
+ : undefined) ??
43
+ (typeof import.meta.env.STRIPE_WEBHOOK_SECRET === 'string'
44
+ ? import.meta.env.STRIPE_WEBHOOK_SECRET
45
+ : undefined);
46
+ if (!secret) {
47
+ throw new Error('STRIPE_WEBHOOK_SECRET or STRIPE_WEBHOOK_SECRET_LIVE must be configured. ' +
48
+ 'Refusing to process webhooks without signature verification.');
49
+ }
50
+ return secret;
51
+ }
52
+ /**
53
+ * Database-backed idempotency check. Prevents duplicate webhook processing
54
+ * across Vercel cold starts, multi-region deployments, and server restarts.
55
+ */
56
+ async function isEventAlreadyProcessed(eventId) {
57
+ const db = getClient();
58
+ const [existing] = await db
59
+ .select({ id: processedWebhookEvents.id })
60
+ .from(processedWebhookEvents)
61
+ .where(eq(processedWebhookEvents.id, eventId))
62
+ .limit(1);
63
+ return !!existing;
64
+ }
65
+ async function markEventProcessed(eventId, eventType) {
66
+ const db = getClient();
67
+ await db.insert(processedWebhookEvents).values({ id: eventId, eventType }).onConflictDoNothing();
68
+ }
69
+ export async function POST(request) {
70
+ const supabase = createServerClientFromRequest(request);
71
+ if (!supabase) {
72
+ return new Response('Supabase client not available', { status: 500 });
73
+ }
74
+ let webhookSecret;
75
+ try {
76
+ webhookSecret = getWebhookSecret();
77
+ }
78
+ catch (err) {
79
+ const msg = err instanceof Error ? err.message : 'Unknown error';
80
+ logger.error('Webhook secret not configured', { error: msg });
81
+ return new Response('Webhook endpoint not configured', { status: 500 });
82
+ }
83
+ // Reject oversized payloads before reading into memory (DoS protection).
84
+ // Content-Length is advisory; we still enforce after reading.
85
+ const contentLength = request.headers.get('content-length');
86
+ if (contentLength !== null && Number(contentLength) > MAX_BODY_BYTES) {
87
+ return new Response('Payload too large', { status: 413 });
88
+ }
89
+ const body = await request.text();
90
+ if (body.length > MAX_BODY_BYTES) {
91
+ return new Response('Payload too large', { status: 413 });
92
+ }
93
+ const sig = request.headers.get('Stripe-Signature');
94
+ if (!sig) {
95
+ return new Response('Missing Stripe-Signature header', { status: 400 });
96
+ }
97
+ let event;
98
+ try {
99
+ event = protectedStripe.webhooks.constructEvent(body, sig, webhookSecret);
100
+ }
101
+ catch (err) {
102
+ const errorMessage = err instanceof Error ? err.message : 'Unknown error';
103
+ logger.error('Webhook signature verification failed', {
104
+ error: errorMessage,
105
+ });
106
+ return new Response(`Webhook Error: ${errorMessage}`, { status: 400 });
107
+ }
108
+ // Idempotency check: skip already-processed events
109
+ if (await isEventAlreadyProcessed(event.id)) {
110
+ logger.debug('Skipping duplicate webhook event', { eventId: event.id });
111
+ return new Response(JSON.stringify({ received: true, duplicate: true }), { status: 200 });
112
+ }
113
+ if (relevantEvents.has(event.type)) {
114
+ try {
115
+ // Mark event as processing BEFORE handling — prevents duplicate processing
116
+ // on Stripe retries even if the handler throws below.
117
+ await markEventProcessed(event.id, event.type);
118
+ switch (event.type) {
119
+ case 'product.created':
120
+ case 'product.updated': {
121
+ const product = event.data.object;
122
+ if (product.object === 'product') {
123
+ await upsertProductRecord(supabase, product);
124
+ }
125
+ break;
126
+ }
127
+ case 'price.created':
128
+ case 'price.updated': {
129
+ const price = event.data.object;
130
+ if (price.object === 'price') {
131
+ await upsertPriceRecord(supabase, price);
132
+ }
133
+ break;
134
+ }
135
+ case 'customer.subscription.created':
136
+ case 'customer.subscription.updated':
137
+ case 'customer.subscription.deleted': {
138
+ const subscription = event.data.object;
139
+ if (subscription.object === 'subscription') {
140
+ const customerId = typeof subscription.customer === 'string'
141
+ ? subscription.customer
142
+ : subscription.customer?.id;
143
+ if (!customerId) {
144
+ throw new Error('Subscription missing customer');
145
+ }
146
+ await manageSubscriptionStatusChange(subscription.id, customerId, event.type === 'customer.subscription.created', supabase);
147
+ // Flag license for revocation on subscription cancellation
148
+ if (event.type === 'customer.subscription.deleted') {
149
+ logger.info('Subscription deleted — license should be revoked', {
150
+ customerId,
151
+ subscriptionId: subscription.id,
152
+ });
153
+ }
154
+ }
155
+ break;
156
+ }
157
+ case 'checkout.session.completed': {
158
+ const checkoutSession = event.data.object;
159
+ if (checkoutSession.object === 'checkout.session') {
160
+ const session = checkoutSession;
161
+ if (session.mode === 'subscription' && session.subscription) {
162
+ const subscriptionId = typeof session.subscription === 'string'
163
+ ? session.subscription
164
+ : session.subscription.id;
165
+ const customerId = typeof session.customer === 'string' ? session.customer : session.customer?.id;
166
+ if (subscriptionId && customerId) {
167
+ await manageSubscriptionStatusChange(subscriptionId, customerId, true, supabase);
168
+ // Retrieve the subscription to:
169
+ // (a) check if a license key was already generated (idempotency across retries)
170
+ // (b) get the actual price ID for authoritative tier resolution
171
+ const subscription = await protectedStripe.subscriptions.retrieve(subscriptionId);
172
+ if (subscription.metadata?.license_key) {
173
+ // Already generated — Stripe retried the webhook. Safe to skip.
174
+ logger.info('License key already present, skipping generation (idempotent)', {
175
+ customerId,
176
+ subscriptionId,
177
+ });
178
+ }
179
+ else {
180
+ const priceId = subscription.items.data[0]?.price?.id ?? null;
181
+ const tier = resolveTierFromMetadata(session.metadata, priceId);
182
+ const privateKey = process.env.REVEALUI_LICENSE_PRIVATE_KEY;
183
+ if (!privateKey) {
184
+ // This is a configuration error, not a customer error.
185
+ // The subscription is active but no license can be issued.
186
+ logger.error('CRITICAL: REVEALUI_LICENSE_PRIVATE_KEY not set — license not generated. ' +
187
+ 'Manual intervention required.', { customerId, subscriptionId, tier });
188
+ }
189
+ else if (tier !== 'free') {
190
+ try {
191
+ const licenseKey = await generateLicenseKey({ tier, customerId }, privateKey);
192
+ await protectedStripe.subscriptions.update(subscriptionId, {
193
+ metadata: { license_key: licenseKey, license_tier: tier },
194
+ });
195
+ logger.info('License key generated for checkout', { tier, customerId });
196
+ }
197
+ catch (licenseErr) {
198
+ logger.error('CRITICAL: License generation failed after successful checkout. ' +
199
+ 'Manual intervention required.', {
200
+ error: licenseErr instanceof Error ? licenseErr.message : 'Unknown error',
201
+ customerId,
202
+ subscriptionId,
203
+ tier,
204
+ });
205
+ }
206
+ }
207
+ }
208
+ logger.info('Subscription session completed');
209
+ }
210
+ }
211
+ }
212
+ break;
213
+ }
214
+ case 'invoice.payment_succeeded': {
215
+ const invoiceEvent = event;
216
+ await handleInvoicePaymentSucceeded(invoiceEvent, supabase);
217
+ break;
218
+ }
219
+ case 'invoice.payment_failed': {
220
+ const invoiceEvent = event;
221
+ await handleInvoicePaymentFailed(invoiceEvent, supabase);
222
+ break;
223
+ }
224
+ case 'payment_method.attached': {
225
+ const pmEvent = event;
226
+ await handlePaymentMethodAttached(pmEvent, supabase);
227
+ break;
228
+ }
229
+ default:
230
+ throw new Error('Unhandled relevant event!');
231
+ }
232
+ }
233
+ catch (error) {
234
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
235
+ logger.error('Webhook handler error', { error: errorMessage });
236
+ return new Response(`Webhook error: "Webhook handler failed. View logs." Error: ${errorMessage}`, {
237
+ status: 400,
238
+ });
239
+ }
240
+ }
241
+ return new Response(JSON.stringify({ received: true }), { status: 200 });
242
+ }
243
+ /**
244
+ * Resolve license tier from the subscription's actual price ID and checkout metadata.
245
+ *
246
+ * Price ID takes precedence — it cannot be spoofed because it comes from
247
+ * Stripe's own subscription record, not from client-supplied data.
248
+ * Metadata is a fallback for products that predate the env-var tier mapping.
249
+ */
250
+ function resolveTierFromMetadata(metadata, priceId) {
251
+ // Primary: validate against known price IDs from environment
252
+ if (priceId) {
253
+ const proPriceId = process.env.STRIPE_PRO_PRICE_ID;
254
+ const maxPriceId = process.env.STRIPE_MAX_PRICE_ID;
255
+ const enterprisePriceId = process.env.STRIPE_ENTERPRISE_PRICE_ID;
256
+ if (proPriceId && priceId === proPriceId)
257
+ return 'pro';
258
+ if (maxPriceId && priceId === maxPriceId)
259
+ return 'max';
260
+ if (enterprisePriceId && priceId === enterprisePriceId)
261
+ return 'enterprise';
262
+ }
263
+ // Fallback: metadata set server-side during checkout session creation (not customer-supplied)
264
+ const tier = metadata?.tier;
265
+ if (tier === 'enterprise')
266
+ return 'enterprise';
267
+ if (tier === 'max')
268
+ return 'max';
269
+ if (tier === 'pro')
270
+ return 'pro';
271
+ // No tier could be resolved — this is a configuration error.
272
+ // Throw so Stripe retries (500) and the team can investigate.
273
+ logger.error('Cannot resolve license tier — unknown price ID and no metadata', {
274
+ priceId,
275
+ metadata,
276
+ });
277
+ throw new Error(`Cannot resolve license tier: price ID "${priceId}" does not match any configured tier. ` +
278
+ 'Check STRIPE_PRO_PRICE_ID, STRIPE_MAX_PRICE_ID, and STRIPE_ENTERPRISE_PRICE_ID env vars.');
279
+ }
280
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/webhooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,kBAAkB,EAAoB,MAAM,wBAAwB,CAAA;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AACvE,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC7B,2BAA2B,EAC3B,8BAA8B,EAC9B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,aAAa,CAAA;AAEpB,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,iBAAiB;IACjB,iBAAiB;IACjB,eAAe;IACf,eAAe;IACf,4BAA4B;IAC5B,+BAA+B;IAC/B,+BAA+B;IAC/B,+BAA+B;IAC/B,2BAA2B;IAC3B,wBAAwB;IACxB,yBAAyB;CAC1B,CAAC,CAAA;AAEF,+FAA+F;AAC/F,MAAM,cAAc,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAA;AAEvC;;;;GAIG;AACH,SAAS,gBAAgB;IACvB,MAAM,MAAM,GACV,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,0BAA0B,KAAK,QAAQ;QAC7D,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,0BAA0B;QAC5C,CAAC,CAAC,SAAS,CAAC;QACd,CAAC,OAAO,MAAM,CAAC,IAAI,CAA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AAI,OAAO,KAAK,iBAAiB;YAAE,OAAO,YAAY,CAAA;IAC7E,CAAC;IACD,8FAA8F;IAC9F,MAAM,IAAI,GAAG,QAAQ,EAAE,IAAI,CAAA;IAC3B,IAAI,IAAI,KAAK,YAAY;QAAE,OAAO,YAAY,CAAA;IAC9C,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,KAAK,CAAA;IAChC,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,KAAK,CAAA;IAEhC,6DAA6D;IAC7D,8DAA8D;IAC9D,MAAM,CAAC,KAAK,CAAC,gEAAgE,EAAE;QAC7E,OAAO;QACP,QAAQ;KACT,CAAC,CAAA;IACF,MAAM,IAAI,KAAK,CACb,0CAA0C,OAAO,wCAAwC;QACvF,0FAA0F,CAC7F,CAAA;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * services/client - Client-side Services
3
+ *
4
+ * Client-side service integrations for browser environments:
5
+ * - Browser clients
6
+ *
7
+ * These are client-side implementations for use in React
8
+ * components and browser environments.
9
+ */
10
+ export { createBrowserClient } from '../supabase/index.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * services/client - Client-side Services
3
+ *
4
+ * Client-side service integrations for browser environments:
5
+ * - Browser clients
6
+ *
7
+ * These are client-side implementations for use in React
8
+ * components and browser environments.
9
+ */
10
+ // Export browser client creation functions
11
+ export { createBrowserClient } from '../supabase/index.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2CAA2C;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,27 +1,36 @@
1
1
  /**
2
- * @revealui/services type stubs for public repo typecheck
2
+ * services - Shared Services Package
3
3
  *
4
- * The full implementation is in the Pro package.
5
- * These stubs satisfy TypeScript while the Pro package awaits
6
- * its first proper npm publish.
4
+ * Provides server-side and client-side service integrations:
5
+ * - Stripe payment processing
6
+ * - Supabase database and auth
7
+ * - API routes
8
+ *
9
+ * ## Usage
10
+ *
11
+ * ### Full Package (Recommended)
12
+ * ```typescript
13
+ * import { protectedStripe, createServerClient, createBrowserClient } from 'services'
14
+ * ```
15
+ *
16
+ * ### Core (Server-side)
17
+ * ```typescript
18
+ * import { createServerClient, protectedStripe } from 'services/server'
19
+ * ```
20
+ *
21
+ * ### Client (Browser)
22
+ * ```typescript
23
+ * import { createBrowserClient } from 'services/client'
24
+ * ```
25
+ */
26
+ /**
27
+ * Check if payment services are licensed for use.
28
+ * Returns false with a warning log if no Pro/Enterprise license is active.
7
29
  */
8
- import type Stripe from 'stripe'
9
-
10
- // ---------------------------------------------------------------------------
11
- // Stripe
12
- // ---------------------------------------------------------------------------
13
-
14
- /** Stripe client wrapped with circuit-breaker protection */
15
- export declare const protectedStripe: Stripe
16
-
17
- // ---------------------------------------------------------------------------
18
- // Supabase
19
- // ---------------------------------------------------------------------------
20
-
21
- export declare function createServerClient(...args: unknown[]): unknown
22
-
23
- // ---------------------------------------------------------------------------
24
- // Payments
25
- // ---------------------------------------------------------------------------
26
-
27
- export declare function createPaymentIntent(...args: unknown[]): Promise<unknown>
30
+ export declare function checkServicesLicense(): boolean;
31
+ export * from './api/index.js';
32
+ export * from './client/index.js';
33
+ export * from './revealcoin/index.js';
34
+ export * from './stripe/index.js';
35
+ export * from './supabase/index.js';
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAS9C;AAGD,cAAc,gBAAgB,CAAA;AAE9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA"}
package/dist/index.js CHANGED
@@ -1,42 +1,47 @@
1
- // @revealui/services — stub for public repo builds
2
- // Full implementation lives in the Pro package.
3
- // These stubs export real named values so bundlers can resolve them.
4
- // Methods throw at call time if the Pro package is not installed.
5
-
6
- function notImplemented(name) {
7
- return function () {
8
- throw new Error(
9
- '@revealui/services: ' + name + ' requires the Pro package or STRIPE_SECRET_KEY.'
10
- )
11
- }
1
+ /**
2
+ * services - Shared Services Package
3
+ *
4
+ * Provides server-side and client-side service integrations:
5
+ * - Stripe payment processing
6
+ * - Supabase database and auth
7
+ * - API routes
8
+ *
9
+ * ## Usage
10
+ *
11
+ * ### Full Package (Recommended)
12
+ * ```typescript
13
+ * import { protectedStripe, createServerClient, createBrowserClient } from 'services'
14
+ * ```
15
+ *
16
+ * ### Core (Server-side)
17
+ * ```typescript
18
+ * import { createServerClient, protectedStripe } from 'services/server'
19
+ * ```
20
+ *
21
+ * ### Client (Browser)
22
+ * ```typescript
23
+ * import { createBrowserClient } from 'services/client'
24
+ * ```
25
+ */
26
+ import { isFeatureEnabled } from '@revealui/core/features';
27
+ import { logger } from '@revealui/core/observability/logger';
28
+ /**
29
+ * Check if payment services are licensed for use.
30
+ * Returns false with a warning log if no Pro/Enterprise license is active.
31
+ */
32
+ export function checkServicesLicense() {
33
+ if (!isFeatureEnabled('payments')) {
34
+ logger.warn('[@revealui/services] Payment and service integrations require a Pro or Enterprise license. ' +
35
+ 'Visit https://revealui.com/pricing for details.');
36
+ return false;
37
+ }
38
+ return true;
12
39
  }
13
-
14
- export const protectedStripe = {
15
- billingPortal: { sessions: { create: notImplemented('billingPortal.sessions.create') } },
16
- customers: {
17
- create: notImplemented('customers.create'),
18
- retrieve: notImplemented('customers.retrieve'),
19
- update: notImplemented('customers.update'),
20
- del: notImplemented('customers.del'),
21
- list: notImplemented('customers.list'),
22
- },
23
- paymentIntents: {
24
- create: notImplemented('paymentIntents.create'),
25
- retrieve: notImplemented('paymentIntents.retrieve'),
26
- update: notImplemented('paymentIntents.update'),
27
- },
28
- checkout: {
29
- sessions: {
30
- create: notImplemented('checkout.sessions.create'),
31
- retrieve: notImplemented('checkout.sessions.retrieve'),
32
- },
33
- },
34
- products: { create: notImplemented('products.create'), retrieve: notImplemented('products.retrieve'), update: notImplemented('products.update'), list: notImplemented('products.list') },
35
- prices: { create: notImplemented('prices.create'), retrieve: notImplemented('prices.retrieve'), update: notImplemented('prices.update'), list: notImplemented('prices.list') },
36
- subscriptions: { retrieve: notImplemented('subscriptions.retrieve'), update: notImplemented('subscriptions.update'), cancel: notImplemented('subscriptions.cancel') },
37
- webhooks: { constructEvent: notImplemented('webhooks.constructEvent') },
38
- balance: { retrieve: notImplemented('balance.retrieve') },
39
- }
40
-
41
- export function createServerClient() { return null }
42
- export function createPaymentIntent() { return Promise.reject(new Error('@revealui/services stub')) }
40
+ // Re-export core (server-side) exports
41
+ export * from './api/index.js';
42
+ // Re-export client (client-side) exports
43
+ export * from './client/index.js';
44
+ export * from './revealcoin/index.js';
45
+ export * from './stripe/index.js';
46
+ export * from './supabase/index.js';
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAA;AAE5D;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC;QAClC,MAAM,CAAC,IAAI,CACT,6FAA6F;YAC3F,iDAAiD,CACpD,CAAA;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,uCAAuC;AACvC,cAAc,gBAAgB,CAAA;AAC9B,yCAAyC;AACzC,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=client.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.test.d.ts","sourceRoot":"","sources":["../../../src/revealcoin/__tests__/client.test.ts"],"names":[],"mappings":""}