@simplelayer/graniteer-core 0.2.1 → 0.2.3
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/adminBookingCredit.d.ts +107 -0
- package/dist/adminBookingCredit.js +163 -0
- package/dist/agreementCheckout.d.ts +34 -0
- package/dist/agreementCheckout.js +211 -0
- package/dist/agreementPortalEmail.d.ts +15 -0
- package/dist/agreementPortalEmail.js +107 -0
- package/dist/availability.d.ts +51 -0
- package/dist/availability.js +152 -0
- package/dist/billingPortalLinkEmail.d.ts +14 -0
- package/dist/billingPortalLinkEmail.js +98 -0
- package/dist/bookingAgreementEmail.d.ts +23 -0
- package/dist/bookingAgreementEmail.js +116 -0
- package/dist/bookingEffects.d.ts +84 -0
- package/dist/bookingEffects.js +309 -0
- package/dist/bookingHoldReclaim.d.ts +16 -0
- package/dist/bookingHoldReclaim.js +74 -0
- package/dist/busClient.d.ts +44 -0
- package/dist/busClient.js +196 -0
- package/dist/busSignature.d.ts +19 -0
- package/{src/busSignature.ts → dist/busSignature.js} +26 -33
- package/dist/checkoutCoupon.d.ts +156 -0
- package/dist/checkoutCoupon.js +369 -0
- package/dist/checkoutSessionParams.d.ts +19 -0
- package/dist/checkoutSessionParams.js +36 -0
- package/dist/commonsContract.d.ts +70 -0
- package/dist/commonsContract.js +142 -0
- package/dist/commonsDeposit.d.ts +78 -0
- package/dist/commonsDeposit.js +199 -0
- package/dist/commonsDepositWebhook.d.ts +37 -0
- package/dist/commonsDepositWebhook.js +147 -0
- package/dist/conductorAdmin.d.ts +76 -0
- package/dist/conductorAdmin.js +88 -0
- package/dist/dayPassConfirmation.d.ts +17 -0
- package/dist/dayPassConfirmation.js +187 -0
- package/dist/dunningEmails.d.ts +40 -0
- package/dist/dunningEmails.js +174 -0
- package/dist/email-templates/brand.d.ts +82 -0
- package/dist/email-templates/brand.js +72 -0
- package/dist/email-templates/email-change.d.ts +10 -0
- package/dist/email-templates/email-change.js +50 -0
- package/dist/email-templates/invite.d.ts +8 -0
- package/dist/email-templates/invite.js +44 -0
- package/dist/email-templates/magic-link.d.ts +10 -0
- package/dist/email-templates/magic-link.js +26 -0
- package/dist/email-templates/reauthentication.d.ts +6 -0
- package/dist/email-templates/reauthentication.js +35 -0
- package/dist/email-templates/recovery.d.ts +10 -0
- package/dist/email-templates/recovery.js +26 -0
- package/dist/email-templates/signup.d.ts +12 -0
- package/dist/email-templates/signup.js +30 -0
- package/dist/functions/admin-cancel-membership.d.ts +1 -0
- package/dist/functions/admin-cancel-membership.js +286 -0
- package/dist/functions/admin-change-membership-plan.d.ts +1 -0
- package/dist/functions/admin-change-membership-plan.js +281 -0
- package/dist/functions/admin-charge-guest-print.d.ts +1 -0
- package/dist/functions/admin-charge-guest-print.js +227 -0
- package/dist/functions/admin-correct-booking.d.ts +1 -0
- package/dist/functions/admin-correct-booking.js +326 -0
- package/dist/functions/admin-create-booking.d.ts +43 -0
- package/dist/functions/admin-create-booking.js +410 -0
- package/dist/functions/admin-create-commons-event.d.ts +1 -0
- package/dist/functions/admin-create-commons-event.js +237 -0
- package/dist/functions/admin-debug-boldsign-doc.d.ts +1 -0
- package/dist/functions/admin-debug-boldsign-doc.js +110 -0
- package/dist/functions/admin-door-write.d.ts +1 -0
- package/dist/functions/admin-door-write.js +267 -0
- package/dist/functions/admin-issue-day-pass.d.ts +14 -0
- package/dist/functions/admin-issue-day-pass.js +213 -0
- package/dist/functions/admin-mark-booking-paid.d.ts +1 -0
- package/dist/functions/admin-mark-booking-paid.js +202 -0
- package/dist/functions/admin-mint-billing-portal-link.d.ts +6 -0
- package/dist/functions/admin-mint-billing-portal-link.js +159 -0
- package/dist/functions/admin-mint-portal-link.d.ts +3 -0
- package/dist/functions/admin-mint-portal-link.js +54 -0
- package/dist/functions/admin-photo-upload.d.ts +1 -0
- package/dist/functions/admin-photo-upload.js +104 -0
- package/dist/functions/admin-remove-team-member.d.ts +1 -0
- package/dist/functions/admin-remove-team-member.js +140 -0
- package/dist/functions/admin-request-trial.d.ts +5 -0
- package/dist/functions/admin-request-trial.js +349 -0
- package/dist/functions/admin-resend-commons-deposit-link.d.ts +7 -0
- package/dist/functions/admin-resend-commons-deposit-link.js +298 -0
- package/dist/functions/admin-reset-mfa.d.ts +1 -0
- package/dist/functions/admin-reset-mfa.js +129 -0
- package/dist/functions/admin-retry-invoice-payment.d.ts +76 -0
- package/dist/functions/admin-retry-invoice-payment.js +269 -0
- package/dist/functions/admin-reverse-coupon-redemption.d.ts +1 -0
- package/dist/functions/admin-reverse-coupon-redemption.js +91 -0
- package/dist/functions/admin-revoke-agreement.d.ts +4 -0
- package/dist/functions/admin-revoke-agreement.js +410 -0
- package/dist/functions/admin-send-commons-agreement.d.ts +1 -0
- package/dist/functions/admin-send-commons-agreement.js +212 -0
- package/dist/functions/admin-set-credit-amount.d.ts +1 -0
- package/dist/functions/admin-set-credit-amount.js +112 -0
- package/dist/functions/admin-skip-commons-contract.d.ts +1 -0
- package/dist/functions/admin-skip-commons-contract.js +170 -0
- package/dist/functions/admin-undo-membership-cancel.d.ts +1 -0
- package/dist/functions/admin-undo-membership-cancel.js +135 -0
- package/dist/functions/admin-wall-photo-write.d.ts +1 -0
- package/dist/functions/admin-wall-photo-write.js +137 -0
- package/dist/functions/auth-email-hook.d.ts +20 -0
- package/dist/functions/auth-email-hook.js +209 -0
- package/dist/functions/boldsign-sender-identity.d.ts +1 -0
- package/dist/functions/boldsign-sender-identity.js +109 -0
- package/dist/functions/booking-availability.d.ts +1 -0
- package/dist/functions/booking-availability.js +355 -0
- package/dist/functions/booking-member-preview.d.ts +1 -0
- package/dist/functions/booking-member-preview.js +123 -0
- package/dist/functions/booking-status.d.ts +3 -0
- package/dist/functions/booking-status.js +139 -0
- package/dist/functions/conductor.d.ts +3 -0
- package/dist/functions/conductor.js +451 -0
- package/dist/functions/create-agreement.d.ts +8 -0
- package/dist/functions/create-agreement.js +498 -0
- package/dist/functions/create-booking.d.ts +44 -0
- package/dist/functions/create-booking.js +538 -0
- package/dist/functions/create-day-pass-checkout.d.ts +4 -0
- package/dist/functions/create-day-pass-checkout.js +196 -0
- package/dist/functions/create-portal-session.d.ts +4 -0
- package/dist/functions/create-portal-session.js +127 -0
- package/dist/functions/create-subscription-checkout.d.ts +4 -0
- package/dist/functions/create-subscription-checkout.js +394 -0
- package/dist/functions/day-pass-status.d.ts +1 -0
- package/dist/functions/day-pass-status.js +70 -0
- package/dist/functions/dayStatus.d.ts +15 -0
- package/dist/functions/dayStatus.js +59 -0
- package/dist/functions/diag-webpush-test.d.ts +1 -0
- package/dist/functions/diag-webpush-test.js +42 -0
- package/dist/functions/event-access-admin.d.ts +17 -0
- package/dist/functions/event-access-admin.js +262 -0
- package/dist/functions/event-access-store.d.ts +1 -0
- package/dist/functions/event-access-store.js +343 -0
- package/dist/functions/ezeep-print-webhook.d.ts +1 -0
- package/dist/functions/ezeep-print-webhook.js +160 -0
- package/dist/functions/ezeep-usage-reconcile.d.ts +1 -0
- package/dist/functions/ezeep-usage-reconcile.js +305 -0
- package/dist/functions/fetch-avatar-original.d.ts +3 -0
- package/dist/functions/fetch-avatar-original.js +423 -0
- package/dist/functions/get-provider-sign-link.d.ts +3 -0
- package/dist/functions/get-provider-sign-link.js +146 -0
- package/dist/functions/get-signing-link.d.ts +1 -0
- package/dist/functions/get-signing-link.js +192 -0
- package/dist/functions/guest-print-setup-confirm.d.ts +1 -0
- package/dist/functions/guest-print-setup-confirm.js +126 -0
- package/dist/functions/guest-print-submit.d.ts +1 -0
- package/dist/functions/guest-print-submit.js +145 -0
- package/dist/functions/luma-webhook.d.ts +1 -0
- package/dist/functions/luma-webhook.js +123 -0
- package/dist/functions/manage-booking.d.ts +75 -0
- package/dist/functions/manage-booking.js +409 -0
- package/dist/functions/mcp.d.ts +16 -0
- package/dist/functions/mcp.js +51 -0
- package/dist/functions/member-door-action.d.ts +60 -0
- package/dist/functions/member-door-action.js +774 -0
- package/dist/functions/member-unifi-mapping.d.ts +15 -0
- package/dist/functions/member-unifi-mapping.js +198 -0
- package/dist/functions/membership-door-sync.d.ts +14 -0
- package/dist/functions/membership-door-sync.js +863 -0
- package/dist/functions/migration-collision-alert.copy.d.ts +7 -0
- package/dist/functions/migration-collision-alert.copy.js +207 -0
- package/dist/functions/migration-collision-alert.d.ts +7 -0
- package/dist/functions/migration-collision-alert.js +207 -0
- package/dist/functions/office-assignment-end.d.ts +12 -0
- package/dist/functions/office-assignment-end.js +140 -0
- package/dist/functions/portal-booking-access.d.ts +22 -0
- package/dist/functions/portal-booking-access.js +163 -0
- package/dist/functions/portal-list-invoices.d.ts +1 -0
- package/dist/functions/portal-list-invoices.js +90 -0
- package/dist/functions/portal-request-login.d.ts +7 -0
- package/dist/functions/portal-request-login.js +199 -0
- package/dist/functions/portal-resend-invite.d.ts +6 -0
- package/dist/functions/portal-resend-invite.js +225 -0
- package/dist/functions/portal-submit-event.d.ts +4 -0
- package/dist/functions/portal-submit-event.js +152 -0
- package/dist/functions/print-billing-recover.d.ts +1 -0
- package/dist/functions/print-billing-recover.js +83 -0
- package/dist/functions/print-billing-run.d.ts +1 -0
- package/dist/functions/print-billing-run.js +153 -0
- package/dist/functions/public-facts.d.ts +1 -0
- package/dist/functions/public-facts.js +141 -0
- package/dist/functions/push-send.d.ts +3 -0
- package/dist/functions/push-send.js +297 -0
- package/dist/functions/push-test.d.ts +3 -0
- package/dist/functions/push-test.js +215 -0
- package/dist/functions/request-portal-link.d.ts +7 -0
- package/dist/functions/request-portal-link.js +178 -0
- package/dist/functions/reschedule-booking.d.ts +50 -0
- package/dist/functions/reschedule-booking.js +571 -0
- package/dist/functions/review-ratings.d.ts +1 -0
- package/dist/functions/review-ratings.js +95 -0
- package/dist/functions/space-availability-range.d.ts +1 -0
- package/dist/functions/space-availability-range.js +109 -0
- package/dist/functions/stripe-db-reconcile.d.ts +3 -0
- package/dist/functions/stripe-db-reconcile.js +314 -0
- package/dist/functions/stripe-webhook.d.ts +46 -0
- package/dist/functions/stripe-webhook.js +2367 -0
- package/dist/functions/sync-gcal-blackouts.d.ts +1 -0
- package/dist/functions/sync-gcal-blackouts.js +251 -0
- package/dist/functions/timetable-event-register.d.ts +1 -0
- package/dist/functions/timetable-event-register.js +155 -0
- package/dist/functions/timetable-event-status.d.ts +1 -0
- package/dist/functions/timetable-event-status.js +86 -0
- package/dist/functions/timetable-spaces.d.ts +1 -0
- package/dist/functions/timetable-spaces.js +161 -0
- package/dist/functions/touch-pass-reconciler.d.ts +1 -0
- package/dist/functions/touch-pass-reconciler.js +688 -0
- package/dist/functions/touch-pass-signup.d.ts +1 -0
- package/dist/functions/touch-pass-signup.js +447 -0
- package/dist/functions/upload-booking-display-image.d.ts +4 -0
- package/dist/functions/upload-booking-display-image.js +159 -0
- package/dist/functions/virtual-onboarding-purge.d.ts +1 -0
- package/dist/functions/virtual-onboarding-purge.js +123 -0
- package/dist/functions/virtual-onboarding-submit.d.ts +1 -0
- package/dist/functions/virtual-onboarding-submit.js +303 -0
- package/dist/functions/voice-booking.d.ts +10 -0
- package/dist/functions/voice-booking.js +360 -0
- package/dist/functions/voice-day-pass.d.ts +15 -0
- package/dist/functions/voice-day-pass.js +269 -0
- package/dist/functions/voice-inquiry.d.ts +1 -0
- package/dist/functions/voice-inquiry.js +156 -0
- package/dist/functions/voice-membership-signup.d.ts +15 -0
- package/dist/functions/voice-membership-signup.js +273 -0
- package/dist/functions/voice-tour-availability.d.ts +1 -0
- package/dist/functions/voice-tour-availability.js +179 -0
- package/dist/functions/voice-tour-booking.d.ts +21 -0
- package/dist/functions/voice-tour-booking.js +308 -0
- package/dist/gcalSync.d.ts +29 -0
- package/dist/gcalSync.js +119 -0
- package/dist/ghlEventInquiry.d.ts +16 -0
- package/dist/ghlEventInquiry.js +116 -0
- package/dist/ghlNote.d.ts +5 -0
- package/dist/ghlNote.js +29 -0
- package/dist/ghlTask.d.ts +7 -0
- package/dist/ghlTask.js +39 -0
- package/dist/ghlVoiceInquiry.d.ts +26 -0
- package/dist/ghlVoiceInquiry.js +68 -0
- package/dist/guestPrintCapture.d.ts +217 -0
- package/dist/guestPrintCapture.js +362 -0
- package/dist/index.d.ts +3 -0
- package/{index.js → dist/index.js} +2 -1
- package/dist/lumaGhl.d.ts +19 -0
- package/dist/lumaGhl.js +147 -0
- package/dist/mailArrivalEmail.d.ts +15 -0
- package/dist/mailArrivalEmail.js +99 -0
- package/dist/manageToken.d.ts +64 -0
- package/dist/manageToken.js +261 -0
- package/dist/membership.d.ts +20 -0
- package/dist/membership.js +87 -0
- package/dist/membershipBusClient.d.ts +139 -0
- package/dist/membershipBusClient.js +443 -0
- package/dist/membershipWelcome.d.ts +117 -0
- package/dist/membershipWelcome.js +497 -0
- package/dist/migrationCheckout.d.ts +169 -0
- package/dist/migrationCheckout.js +250 -0
- package/dist/money.d.ts +20 -0
- package/dist/money.js +35 -0
- package/dist/ops.d.ts +27 -0
- package/dist/ops.js +87 -0
- package/dist/pacificDate.d.ts +8 -0
- package/{src/pacificDate.ts → dist/pacificDate.js} +76 -88
- package/dist/paymentLinkEmail.d.ts +15 -0
- package/dist/paymentLinkEmail.js +102 -0
- package/dist/policyAcknowledgment.d.ts +46 -0
- package/dist/policyAcknowledgment.js +58 -0
- package/dist/portalSession.d.ts +15 -0
- package/dist/portalSession.js +31 -0
- package/dist/pricing.d.ts +306 -0
- package/dist/pricing.js +788 -0
- package/dist/printBilling.d.ts +340 -0
- package/dist/printBilling.js +619 -0
- package/dist/printBillingAdapters.d.ts +29 -0
- package/dist/printBillingAdapters.js +130 -0
- package/dist/printCorrections.d.ts +175 -0
- package/dist/printCorrections.js +328 -0
- package/dist/rateLimit.d.ts +20 -0
- package/dist/rateLimit.js +70 -0
- package/dist/referralCredits.d.ts +5 -0
- package/{src/referralCredits.ts → dist/referralCredits.js} +27 -34
- package/dist/referralGrant.d.ts +49 -0
- package/dist/referralGrant.js +268 -0
- package/dist/rescheduleCredit.d.ts +98 -0
- package/dist/rescheduleCredit.js +263 -0
- package/dist/reservationWifiCode.d.ts +19 -0
- package/{src/reservationWifiCode.ts → dist/reservationWifiCode.js} +67 -81
- package/dist/retellCallAnalyzed.d.ts +18 -0
- package/dist/retellCallAnalyzed.js +91 -0
- package/dist/retellSignature.d.ts +14 -0
- package/dist/retellSignature.js +60 -0
- package/dist/signedUnpaidReminderEmail.d.ts +15 -0
- package/dist/signedUnpaidReminderEmail.js +111 -0
- package/dist/slackAlert.d.ts +13 -0
- package/dist/slackAlert.js +37 -0
- package/dist/stripeCoworkingPortal.d.ts +21 -0
- package/dist/stripeCoworkingPortal.js +80 -0
- package/dist/supabaseTestFakes.d.ts +67 -0
- package/dist/supabaseTestFakes.js +79 -0
- package/dist/supportTicketEmail.d.ts +16 -0
- package/dist/supportTicketEmail.js +98 -0
- package/dist/tier1Agreement.d.ts +51 -0
- package/dist/tier1Agreement.js +86 -0
- package/dist/unifiAccessPolicies.d.ts +36 -0
- package/dist/unifiAccessPolicies.js +185 -0
- package/dist/unifiGroups.d.ts +26 -0
- package/dist/unifiGroups.js +106 -0
- package/package.json +645 -169
- package/src/adminBookingCredit.test.ts +0 -451
- package/src/adminBookingCredit.ts +0 -239
- package/src/agreementCheckout.ts +0 -250
- package/src/agreementPortalEmail.ts +0 -128
- package/src/availability.test.ts +0 -25
- package/src/availability.ts +0 -201
- package/src/billingPortalLinkEmail.ts +0 -117
- package/src/bookingAgreementEmail.ts +0 -149
- package/src/bookingEffects.ts +0 -388
- package/src/bookingHoldReclaim.ts +0 -94
- package/src/busClient.ts +0 -268
- package/src/checkoutCoupon.test.ts +0 -675
- package/src/checkoutCoupon.ts +0 -455
- package/src/checkoutSessionParams.ts +0 -56
- package/src/commonsContract.ts +0 -175
- package/src/commonsDeposit.ts +0 -298
- package/src/commonsDepositWebhook.ts +0 -237
- package/src/conductorAdmin.ts +0 -141
- package/src/dayPassConfirmation.ts +0 -230
- package/src/dunningEmails.test.ts +0 -263
- package/src/dunningEmails.ts +0 -203
- package/src/email-templates/brand.ts +0 -93
- package/src/email-templates/email-change.tsx +0 -92
- package/src/email-templates/invite.tsx +0 -79
- package/src/email-templates/magic-link.tsx +0 -59
- package/src/email-templates/reauthentication.tsx +0 -60
- package/src/email-templates/recovery.tsx +0 -59
- package/src/email-templates/signup.tsx +0 -67
- package/src/functions/admin-cancel-membership.ts +0 -311
- package/src/functions/admin-change-membership-plan.ts +0 -312
- package/src/functions/admin-charge-guest-print.ts +0 -229
- package/src/functions/admin-correct-booking.ts +0 -333
- package/src/functions/admin-create-booking.ts +0 -460
- package/src/functions/admin-create-commons-event.ts +0 -244
- package/src/functions/admin-debug-boldsign-doc.ts +0 -93
- package/src/functions/admin-door-write.ts +0 -272
- package/src/functions/admin-issue-day-pass.ts +0 -231
- package/src/functions/admin-mark-booking-paid.ts +0 -203
- package/src/functions/admin-mint-billing-portal-link.ts +0 -168
- package/src/functions/admin-mint-portal-link.ts +0 -62
- package/src/functions/admin-photo-upload.ts +0 -128
- package/src/functions/admin-remove-team-member.ts +0 -150
- package/src/functions/admin-request-trial.ts +0 -366
- package/src/functions/admin-resend-commons-deposit-link.ts +0 -323
- package/src/functions/admin-reset-mfa.ts +0 -138
- package/src/functions/admin-retry-invoice-payment.test.ts +0 -567
- package/src/functions/admin-retry-invoice-payment.ts +0 -333
- package/src/functions/admin-reverse-coupon-redemption.ts +0 -98
- package/src/functions/admin-revoke-agreement.ts +0 -467
- package/src/functions/admin-send-commons-agreement.ts +0 -214
- package/src/functions/admin-set-credit-amount.ts +0 -123
- package/src/functions/admin-skip-commons-contract.ts +0 -165
- package/src/functions/admin-undo-membership-cancel.ts +0 -144
- package/src/functions/admin-wall-photo-write.ts +0 -141
- package/src/functions/auth-email-hook.ts +0 -259
- package/src/functions/boldsign-sender-identity.ts +0 -114
- package/src/functions/booking-availability.ts +0 -419
- package/src/functions/booking-member-preview.ts +0 -136
- package/src/functions/booking-status.ts +0 -149
- package/src/functions/conductor.ts +0 -505
- package/src/functions/create-agreement.ts +0 -537
- package/src/functions/create-booking.ts +0 -648
- package/src/functions/create-day-pass-checkout.ts +0 -218
- package/src/functions/create-portal-session.ts +0 -142
- package/src/functions/create-subscription-checkout.test.ts +0 -222
- package/src/functions/create-subscription-checkout.ts +0 -440
- package/src/functions/day-pass-status.ts +0 -89
- package/src/functions/dayStatus.ts +0 -71
- package/src/functions/diag-webpush-test.ts +0 -45
- package/src/functions/event-access-admin.ts +0 -277
- package/src/functions/event-access-store.ts +0 -334
- package/src/functions/ezeep-print-webhook.ts +0 -213
- package/src/functions/ezeep-usage-reconcile.ts +0 -299
- package/src/functions/fetch-avatar-original.ts +0 -457
- package/src/functions/get-provider-sign-link.ts +0 -155
- package/src/functions/get-signing-link.ts +0 -211
- package/src/functions/guest-print-setup-confirm.ts +0 -128
- package/src/functions/guest-print-submit.ts +0 -149
- package/src/functions/luma-webhook.ts +0 -165
- package/src/functions/manage-booking.ts +0 -472
- package/src/functions/mcp.ts +0 -67
- package/src/functions/member-door-action.test.ts +0 -1248
- package/src/functions/member-door-action.ts +0 -863
- package/src/functions/member-unifi-mapping.test.ts +0 -516
- package/src/functions/member-unifi-mapping.ts +0 -206
- package/src/functions/membership-door-sync.ts +0 -956
- package/src/functions/migration-collision-alert.copy.ts +0 -232
- package/src/functions/migration-collision-alert.test.ts +0 -349
- package/src/functions/migration-collision-alert.ts +0 -232
- package/src/functions/office-assignment-end.ts +0 -146
- package/src/functions/portal-booking-access.ts +0 -217
- package/src/functions/portal-list-invoices.ts +0 -99
- package/src/functions/portal-request-login.ts +0 -192
- package/src/functions/portal-resend-invite.ts +0 -248
- package/src/functions/portal-submit-event.ts +0 -168
- package/src/functions/print-billing-recover.ts +0 -97
- package/src/functions/print-billing-run.ts +0 -183
- package/src/functions/public-facts.ts +0 -168
- package/src/functions/push-send.ts +0 -348
- package/src/functions/push-test.ts +0 -234
- package/src/functions/request-portal-link.ts +0 -211
- package/src/functions/reschedule-booking.ts +0 -649
- package/src/functions/review-ratings.ts +0 -113
- package/src/functions/space-availability-range.acceptance.test.ts +0 -161
- package/src/functions/space-availability-range.ts +0 -142
- package/src/functions/stripe-db-reconcile.ts +0 -319
- package/src/functions/stripe-webhook.moved-regression.test.ts +0 -78
- package/src/functions/stripe-webhook.ts +0 -2595
- package/src/functions/sync-gcal-blackouts.ts +0 -298
- package/src/functions/timetable-event-register.ts +0 -162
- package/src/functions/timetable-event-status.ts +0 -90
- package/src/functions/timetable-spaces.ts +0 -219
- package/src/functions/touch-pass-reconciler.ts +0 -689
- package/src/functions/touch-pass-signup.ts +0 -478
- package/src/functions/upload-booking-display-image.ts +0 -179
- package/src/functions/virtual-onboarding-purge.ts +0 -134
- package/src/functions/virtual-onboarding-submit.ts +0 -315
- package/src/functions/voice-booking.ts +0 -453
- package/src/functions/voice-day-pass.ts +0 -346
- package/src/functions/voice-inquiry.test.ts +0 -301
- package/src/functions/voice-inquiry.ts +0 -198
- package/src/functions/voice-membership-signup.ts +0 -355
- package/src/functions/voice-tour-availability.ts +0 -204
- package/src/functions/voice-tour-booking.ts +0 -429
- package/src/gcalSync.ts +0 -142
- package/src/ghlEventInquiry.ts +0 -143
- package/src/ghlNote.ts +0 -34
- package/src/ghlTask.ts +0 -48
- package/src/ghlVoiceInquiry.ts +0 -90
- package/src/guestPrintCapture.test.ts +0 -722
- package/src/guestPrintCapture.ts +0 -538
- package/src/lumaGhl.ts +0 -195
- package/src/mailArrivalEmail.ts +0 -121
- package/src/manageToken.ts +0 -363
- package/src/membership.ts +0 -109
- package/src/membershipBusClient.ts +0 -537
- package/src/membershipWelcome.ts +0 -683
- package/src/migrationCheckout.ts +0 -366
- package/src/money.ts +0 -36
- package/src/ops.ts +0 -97
- package/src/paymentLinkEmail.ts +0 -123
- package/src/policyAcknowledgment.test.ts +0 -50
- package/src/policyAcknowledgment.ts +0 -96
- package/src/portalSession.ts +0 -46
- package/src/pricing.test.ts +0 -660
- package/src/pricing.ts +0 -1025
- package/src/printBilling.test.ts +0 -750
- package/src/printBilling.ts +0 -891
- package/src/printBillingAdapters.ts +0 -169
- package/src/printCorrections.test.ts +0 -348
- package/src/printCorrections.ts +0 -496
- package/src/rateLimit.ts +0 -82
- package/src/referralCredits.test.ts +0 -31
- package/src/referralGrant.ts +0 -321
- package/src/rescheduleCredit.test.ts +0 -521
- package/src/rescheduleCredit.ts +0 -337
- package/src/reservationWifiCode.test.ts +0 -69
- package/src/retellCallAnalyzed.test.ts +0 -167
- package/src/retellCallAnalyzed.ts +0 -113
- package/src/retellSignature.test.ts +0 -137
- package/src/retellSignature.ts +0 -82
- package/src/signedUnpaidReminderEmail.test.ts +0 -246
- package/src/signedUnpaidReminderEmail.ts +0 -132
- package/src/slackAlert.ts +0 -38
- package/src/stripeCoworkingPortal.ts +0 -91
- package/src/supabaseTestFakes.ts +0 -131
- package/src/supportTicketEmail.ts +0 -119
- package/src/tier1Agreement.ts +0 -125
- package/src/unifiAccessPolicies.ts +0 -228
- package/src/unifiGroups.ts +0 -129
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
// supabase/functions/admin-issue-day-pass/index.ts
|
|
2
|
-
import { createClient } from 'npm:@supabase/supabase-js@2';
|
|
3
|
-
import Stripe from 'npm:stripe@17.5.0';
|
|
4
|
-
import { z } from 'npm:zod@3.23.8';
|
|
5
|
-
import { jwtVerify, createRemoteJWKSet } from 'npm:jose@5.9.6';
|
|
6
|
-
import { clientIp, checkRateLimit } from 'npm:@simplelayer/graniteer-core/rateLimit';
|
|
7
|
-
import { logOps } from 'npm:@simplelayer/graniteer-core/ops';
|
|
8
|
-
|
|
9
|
-
const corsHeaders = {
|
|
10
|
-
'Access-Control-Allow-Origin': '*',
|
|
11
|
-
'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
|
|
12
|
-
'Access-Control-Allow-Methods': 'POST, OPTIONS',
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const DAY_PASS_SLUG = 'day-pass';
|
|
16
|
-
|
|
17
|
-
interface CallerClaims { sub: string; email?: string; aal?: string }
|
|
18
|
-
|
|
19
|
-
const JWKS_URL_SUFFIX = '/auth/v1/.well-known/jwks.json';
|
|
20
|
-
let jwksCache: ReturnType<typeof createRemoteJWKSet> | null = null;
|
|
21
|
-
function getJwks(supabaseUrl: string) {
|
|
22
|
-
if (!jwksCache) jwksCache = createRemoteJWKSet(new URL(`${supabaseUrl}${JWKS_URL_SUFFIX}`));
|
|
23
|
-
return jwksCache;
|
|
24
|
-
}
|
|
25
|
-
async function verifyCaller(authHeader: string | null, supabaseUrl: string): Promise<CallerClaims | null> {
|
|
26
|
-
if (!authHeader?.toLowerCase().startsWith('bearer ')) return null;
|
|
27
|
-
const token = authHeader.slice(7).trim();
|
|
28
|
-
try {
|
|
29
|
-
const { payload } = await jwtVerify(token, getJwks(supabaseUrl));
|
|
30
|
-
const claims = payload as unknown as CallerClaims;
|
|
31
|
-
if (!claims.sub) return null;
|
|
32
|
-
return claims;
|
|
33
|
-
} catch { return null; }
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function json(status: number, body: unknown) {
|
|
37
|
-
return new Response(JSON.stringify(body), {
|
|
38
|
-
status, headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function todayLA(): string {
|
|
43
|
-
return new Intl.DateTimeFormat('en-CA', {
|
|
44
|
-
timeZone: 'America/Los_Angeles',
|
|
45
|
-
year: 'numeric', month: '2-digit', day: '2-digit',
|
|
46
|
-
}).format(new Date());
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const Body = z.object({
|
|
50
|
-
guest_name: z.string().trim().min(1).max(200),
|
|
51
|
-
guest_email: z.string().trim().email().max(255),
|
|
52
|
-
visit_date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
53
|
-
issue_mode: z.enum(['payment_link', 'paid_offline', 'comp']),
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
export interface AdminIssueDayPassDeps {
|
|
57
|
-
provisionDayPass: (
|
|
58
|
-
admin: ReturnType<typeof createClient>,
|
|
59
|
-
dayPassId: string,
|
|
60
|
-
visitDate: string,
|
|
61
|
-
email: string,
|
|
62
|
-
guestName: string,
|
|
63
|
-
) => Promise<{
|
|
64
|
-
status: 'provisioned' | 'dry_run' | 'disabled' | 'failed';
|
|
65
|
-
credentialStatus: string | null;
|
|
66
|
-
wifiCode: string | null;
|
|
67
|
-
wifiValidFromIso: string | null;
|
|
68
|
-
wifiValidToIso: string | null;
|
|
69
|
-
error: string | null;
|
|
70
|
-
}>;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export async function handle(req: Request, operator: { domain: string }, deps: AdminIssueDayPassDeps): Promise<Response> {
|
|
74
|
-
if (req.method === 'OPTIONS') return new Response('ok', { headers: corsHeaders });
|
|
75
|
-
if (req.method !== 'POST') return json(405, { ok: false, error: 'method_not_allowed' });
|
|
76
|
-
|
|
77
|
-
const SUPABASE_URL = Deno.env.get('SUPABASE_URL')!;
|
|
78
|
-
const SERVICE_ROLE_KEY = Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!;
|
|
79
|
-
|
|
80
|
-
const authHeader = req.headers.get('Authorization') || req.headers.get('authorization');
|
|
81
|
-
const caller = await verifyCaller(authHeader, SUPABASE_URL);
|
|
82
|
-
if (!caller) return json(401, { ok: false, error: 'unauthenticated' });
|
|
83
|
-
if (caller.aal !== 'aal2') return json(403, { ok: false, error: 'mfa_required' });
|
|
84
|
-
const callerEmail = (caller.email ?? '').toLowerCase();
|
|
85
|
-
if (!callerEmail) return json(403, { ok: false, error: 'no_email' });
|
|
86
|
-
|
|
87
|
-
const admin = createClient(SUPABASE_URL, SERVICE_ROLE_KEY, {
|
|
88
|
-
auth: { persistSession: false, autoRefreshToken: false },
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
const [ipOk, emailOk] = await Promise.all([
|
|
92
|
-
checkRateLimit(admin, 'admin-issue-day-pass-ip', clientIp(req), 30, 300),
|
|
93
|
-
checkRateLimit(admin, 'admin-issue-day-pass-email', callerEmail, 20, 300),
|
|
94
|
-
]);
|
|
95
|
-
if (!ipOk || !emailOk) return json(429, { ok: false, error: 'rate_limited' });
|
|
96
|
-
|
|
97
|
-
const { data: allow, error: allowErr } = await admin
|
|
98
|
-
.from('admin_users').select('email').eq('email', callerEmail).maybeSingle();
|
|
99
|
-
if (allowErr) return json(500, { ok: false, error: 'allowlist_lookup_failed' });
|
|
100
|
-
if (!allow) return json(403, { ok: false, error: 'not_authorized' });
|
|
101
|
-
|
|
102
|
-
let raw: unknown;
|
|
103
|
-
try { raw = await req.json(); } catch { return json(400, { ok: false, error: 'invalid_json' }); }
|
|
104
|
-
const parsed = Body.safeParse(raw);
|
|
105
|
-
if (!parsed.success) return json(400, { ok: false, error: 'invalid_body', detail: parsed.error.flatten() });
|
|
106
|
-
const { guest_name, guest_email, visit_date, issue_mode } = parsed.data;
|
|
107
|
-
const emailKey = guest_email.toLowerCase();
|
|
108
|
-
|
|
109
|
-
if (visit_date < todayLA()) return json(400, { ok: false, error: 'visit_date_in_past' });
|
|
110
|
-
|
|
111
|
-
const { data: plan, error: pErr } = await admin
|
|
112
|
-
.from('membership_plans')
|
|
113
|
-
.select('id,slug,name,active,billable,billing_interval,stripe_price_id,price_cents')
|
|
114
|
-
.eq('slug', DAY_PASS_SLUG)
|
|
115
|
-
.maybeSingle();
|
|
116
|
-
if (pErr) return json(500, { ok: false, error: 'load_plan_failed', detail: pErr.message });
|
|
117
|
-
if (!plan || plan.active !== true || plan.billable !== true || plan.billing_interval === 'month') {
|
|
118
|
-
return json(400, { ok: false, error: 'day_pass_plan_unavailable' });
|
|
119
|
-
}
|
|
120
|
-
const planPriceCents = plan.price_cents ?? 0;
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
if (issue_mode === 'payment_link') {
|
|
124
|
-
if (!plan.stripe_price_id) return json(400, { ok: false, error: 'day_pass_price_not_configured' });
|
|
125
|
-
const stripeKey = Deno.env.get('STRIPE_SECRET_KEY');
|
|
126
|
-
if (!stripeKey) return json(500, { ok: false, error: 'stripe_not_configured' });
|
|
127
|
-
const stripe = new Stripe(stripeKey, { apiVersion: '2024-11-20.acacia' as Stripe.LatestApiVersion });
|
|
128
|
-
|
|
129
|
-
let customerId: string | null = null;
|
|
130
|
-
try {
|
|
131
|
-
const listed = await stripe.customers.list({ email: emailKey, limit: 1 });
|
|
132
|
-
if (listed.data.length > 0) customerId = listed.data[0].id;
|
|
133
|
-
} catch (e) {
|
|
134
|
-
console.warn('[admin-issue-day-pass] customers.list failed', e);
|
|
135
|
-
}
|
|
136
|
-
if (!customerId) customerId = (await stripe.customers.create({ email: emailKey, name: guest_name })).id;
|
|
137
|
-
|
|
138
|
-
const origin = req.headers.get('origin');
|
|
139
|
-
const base = origin && /^https?:\/\//.test(origin) ? origin : `https://${operator.domain}`;
|
|
140
|
-
|
|
141
|
-
const session = await stripe.checkout.sessions.create({
|
|
142
|
-
mode: 'payment',
|
|
143
|
-
customer: customerId,
|
|
144
|
-
line_items: [{ price: plan.stripe_price_id, quantity: 1 }],
|
|
145
|
-
allow_promotion_codes: true,
|
|
146
|
-
metadata: {
|
|
147
|
-
checkout_type: 'day_pass',
|
|
148
|
-
plan_slug: plan.slug,
|
|
149
|
-
plan_id: plan.id,
|
|
150
|
-
visit_date,
|
|
151
|
-
issued_by: callerEmail,
|
|
152
|
-
},
|
|
153
|
-
payment_intent_data: { receipt_email: emailKey },
|
|
154
|
-
success_url: `${base}/day-pass/success?session_id={CHECKOUT_SESSION_ID}`,
|
|
155
|
-
cancel_url: `${base}/pricing`,
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
return json(200, {
|
|
159
|
-
ok: true, issue_mode, url: session.url, session_id: session.id,
|
|
160
|
-
amount_cents: planPriceCents,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const source = issue_mode === 'comp' ? 'comp' : 'offline';
|
|
165
|
-
const amountCents = issue_mode === 'comp' ? 0 : planPriceCents;
|
|
166
|
-
const localRef = `${source}_${crypto.randomUUID()}`;
|
|
167
|
-
|
|
168
|
-
const { data: row, error: insErr } = await admin
|
|
169
|
-
.from('day_pass_purchases')
|
|
170
|
-
.insert({
|
|
171
|
-
email: emailKey,
|
|
172
|
-
customer_name: guest_name,
|
|
173
|
-
stripe_checkout_session_id: localRef,
|
|
174
|
-
plan_id: plan.id,
|
|
175
|
-
amount_cents: amountCents,
|
|
176
|
-
visit_date,
|
|
177
|
-
payment_source: source,
|
|
178
|
-
created_by: callerEmail,
|
|
179
|
-
})
|
|
180
|
-
.select('id')
|
|
181
|
-
.single();
|
|
182
|
-
if (insErr) return json(500, { ok: false, error: 'insert_failed', detail: insErr.message });
|
|
183
|
-
|
|
184
|
-
let provisioningStatus: "provisioned" | "dry_run" | "disabled" | "failed" = "failed";
|
|
185
|
-
let wifiCode: string | null = null;
|
|
186
|
-
try {
|
|
187
|
-
const outcome = await deps.provisionDayPass(admin, row.id, visit_date, emailKey, guest_name);
|
|
188
|
-
provisioningStatus = outcome.status;
|
|
189
|
-
wifiCode = outcome.wifiCode;
|
|
190
|
-
const { error: provWriteErr } = await admin
|
|
191
|
-
.from('day_pass_purchases')
|
|
192
|
-
.update({
|
|
193
|
-
provisioning_status: outcome.status,
|
|
194
|
-
credential_status: outcome.credentialStatus,
|
|
195
|
-
wifi_code: outcome.wifiCode,
|
|
196
|
-
wifi_valid_from: outcome.wifiValidFromIso,
|
|
197
|
-
wifi_valid_to: outcome.wifiValidToIso,
|
|
198
|
-
provisioned_at: (outcome.status === 'provisioned' || outcome.status === 'dry_run')
|
|
199
|
-
? new Date().toISOString()
|
|
200
|
-
: null,
|
|
201
|
-
provision_error: outcome.error,
|
|
202
|
-
})
|
|
203
|
-
.eq('id', row.id);
|
|
204
|
-
if (provWriteErr) {
|
|
205
|
-
console.error('[admin-issue-day-pass] provisioning-status write failed', provWriteErr);
|
|
206
|
-
await logOps(admin, 'day_pass_provision_status_write_failed',
|
|
207
|
-
{ day_pass_id: row.id, message: provWriteErr.message, pg_code: (provWriteErr as { code?: string }).code },
|
|
208
|
-
{ severity: 'error' }).catch(() => {});
|
|
209
|
-
}
|
|
210
|
-
} catch (e) {
|
|
211
|
-
console.error('[admin-issue-day-pass] provisioning threw', e);
|
|
212
|
-
await logOps(admin, 'day_pass_provision_threw',
|
|
213
|
-
{ day_pass_id: row.id, message: e instanceof Error ? e.message : String(e) },
|
|
214
|
-
{ severity: 'error' }).catch(() => {});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
return json(200, {
|
|
218
|
-
ok: true, issue_mode, day_pass_id: row.id, amount_cents: amountCents,
|
|
219
|
-
provisioning_status: provisioningStatus,
|
|
220
|
-
wifi_code: wifiCode,
|
|
221
|
-
});
|
|
222
|
-
} catch (e) {
|
|
223
|
-
console.error('admin-issue-day-pass error', e);
|
|
224
|
-
try {
|
|
225
|
-
await logOps(admin, 'admin_issue_day_pass_error',
|
|
226
|
-
{ message: e instanceof Error ? e.message : String(e), issue_mode, actor: callerEmail },
|
|
227
|
-
{ severity: 'error' });
|
|
228
|
-
} catch { /* ignore */ }
|
|
229
|
-
return json(500, { ok: false, error: 'unexpected_error' });
|
|
230
|
-
}
|
|
231
|
-
}
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
// supabase/functions/admin-mark-booking-paid/index.ts
|
|
2
|
-
//
|
|
3
|
-
// Manual "mark fully paid" admin action, for payments collected outside the
|
|
4
|
-
// normal Stripe checkout flow -- cash, a Mercury wire/ACH, a sponsorship, or
|
|
5
|
-
// anything else staff need to record by hand. Works on any booking tier; the
|
|
6
|
-
// Commons (tier-3) contract flow is the main consumer since its remaining
|
|
7
|
-
// balance is explicitly collected by check/ACH per the contract, never
|
|
8
|
-
// through Stripe.
|
|
9
|
-
import { createClient } from 'npm:@supabase/supabase-js@2';
|
|
10
|
-
import { z } from 'npm:zod@3.23.8';
|
|
11
|
-
import { jwtVerify, createRemoteJWKSet } from 'npm:jose@5.9.6';
|
|
12
|
-
import Stripe from 'npm:stripe@17.5.0';
|
|
13
|
-
import { clientIp, checkRateLimit } from 'npm:@simplelayer/graniteer-core/rateLimit';
|
|
14
|
-
import { logOps } from 'npm:@simplelayer/graniteer-core/ops';
|
|
15
|
-
|
|
16
|
-
const corsHeaders = {
|
|
17
|
-
'Access-Control-Allow-Origin': '*',
|
|
18
|
-
'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
|
|
19
|
-
'Access-Control-Allow-Methods': 'POST, OPTIONS',
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
interface CallerClaims { sub: string; email?: string; aal?: string }
|
|
23
|
-
const JWKS_URL_SUFFIX = '/auth/v1/.well-known/jwks.json';
|
|
24
|
-
let jwksCache: ReturnType<typeof createRemoteJWKSet> | null = null;
|
|
25
|
-
function getJwks(supabaseUrl: string) {
|
|
26
|
-
if (!jwksCache) jwksCache = createRemoteJWKSet(new URL(`${supabaseUrl}${JWKS_URL_SUFFIX}`));
|
|
27
|
-
return jwksCache;
|
|
28
|
-
}
|
|
29
|
-
async function verifyCaller(authHeader: string | null, supabaseUrl: string): Promise<CallerClaims | null> {
|
|
30
|
-
if (!authHeader?.toLowerCase().startsWith('bearer ')) return null;
|
|
31
|
-
const token = authHeader.slice(7).trim();
|
|
32
|
-
try {
|
|
33
|
-
const { payload } = await jwtVerify(token, getJwks(supabaseUrl));
|
|
34
|
-
const claims = payload as unknown as CallerClaims;
|
|
35
|
-
if (!claims.sub) return null;
|
|
36
|
-
return claims;
|
|
37
|
-
} catch { return null; }
|
|
38
|
-
}
|
|
39
|
-
function json(status: number, body: unknown) {
|
|
40
|
-
return new Response(JSON.stringify(body), { status, headers: { ...corsHeaders, 'Content-Type': 'application/json' } });
|
|
41
|
-
}
|
|
42
|
-
function fail(status: number, code: string, error: string, extra?: Record<string, unknown>) {
|
|
43
|
-
return json(status, { ok: false, status, code, error, ...(extra ?? {}) });
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const PAYMENT_METHODS = ['cash', 'stripe', 'mercury', 'sponsored', 'other'] as const;
|
|
47
|
-
const Body = z.object({
|
|
48
|
-
booking_id: z.string().uuid(),
|
|
49
|
-
payment_method: z.enum(PAYMENT_METHODS),
|
|
50
|
-
notes: z.string().trim().max(500).optional(),
|
|
51
|
-
}).refine(
|
|
52
|
-
(b) => b.payment_method !== 'stripe' || !!b.notes?.trim(),
|
|
53
|
-
{ message: 'notes (e.g. the Stripe payment/charge ID) are required when payment_method is "stripe" -- this action does not itself touch Stripe.', path: ['notes'] },
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
// Only a live, still-collectible booking can be marked paid. Deliberately an
|
|
57
|
-
// allowlist, not a denylist of terminal statuses -- a new booking_status
|
|
58
|
-
// value added later (e.g. a dispute/chargeback state) should default to
|
|
59
|
-
// NOT payable until someone explicitly decides otherwise.
|
|
60
|
-
const PAYABLE_STATUSES = new Set(['pending', 'deposit_paid']);
|
|
61
|
-
|
|
62
|
-
export async function handle(req: Request): Promise<Response> {
|
|
63
|
-
if (req.method === 'OPTIONS') return new Response('ok', { headers: corsHeaders });
|
|
64
|
-
if (req.method !== 'POST') return fail(405, 'method_not_allowed', 'Method not allowed.');
|
|
65
|
-
|
|
66
|
-
const SUPABASE_URL = Deno.env.get('SUPABASE_URL')!;
|
|
67
|
-
const SERVICE_ROLE_KEY = Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!;
|
|
68
|
-
|
|
69
|
-
const authHeader = req.headers.get('Authorization') || req.headers.get('authorization');
|
|
70
|
-
const caller = await verifyCaller(authHeader, SUPABASE_URL);
|
|
71
|
-
if (!caller) return fail(401, 'unauthenticated', 'Not signed in.');
|
|
72
|
-
if (caller.aal !== 'aal2') return fail(403, 'mfa_required', 'Two-factor authentication is required.');
|
|
73
|
-
const callerEmail = (caller.email ?? '').toLowerCase();
|
|
74
|
-
if (!callerEmail) return fail(403, 'no_email', 'Caller has no email claim.');
|
|
75
|
-
|
|
76
|
-
const admin = createClient(SUPABASE_URL, SERVICE_ROLE_KEY, { auth: { persistSession: false, autoRefreshToken: false } });
|
|
77
|
-
|
|
78
|
-
const [ipOk, emailOk] = await Promise.all([
|
|
79
|
-
checkRateLimit(admin, 'admin-mark-booking-paid-ip', clientIp(req), 20, 300),
|
|
80
|
-
checkRateLimit(admin, 'admin-mark-booking-paid-email', callerEmail, 20, 300),
|
|
81
|
-
]);
|
|
82
|
-
if (!ipOk || !emailOk) return fail(429, 'rate_limited', 'Too many attempts — try again shortly.');
|
|
83
|
-
|
|
84
|
-
const { data: allow, error: allowErr } = await admin.from('admin_users').select('email').eq('email', callerEmail).maybeSingle();
|
|
85
|
-
if (allowErr) return fail(500, 'allowlist_lookup_failed', allowErr.message);
|
|
86
|
-
if (!allow) return fail(403, 'not_authorized', 'Not authorized.');
|
|
87
|
-
|
|
88
|
-
let raw: unknown;
|
|
89
|
-
try { raw = await req.json(); } catch { return fail(400, 'invalid_json', 'Body was not valid JSON.'); }
|
|
90
|
-
const parsed = Body.safeParse(raw);
|
|
91
|
-
if (!parsed.success) return fail(400, 'invalid_body', JSON.stringify(parsed.error.flatten().fieldErrors));
|
|
92
|
-
const { booking_id, payment_method, notes } = parsed.data;
|
|
93
|
-
|
|
94
|
-
const { data: booking, error: bErr } = await admin
|
|
95
|
-
.from('bookings')
|
|
96
|
-
.select('id,status,list_amount_cents,dynamic_discount_cents,credit_applied_cents,discount_applied_cents,charged_amount_cents,paid_method,stripe_session_id,hold_expires_at,deposit_paid_at,payment_source,paid_notes,paid_marked_by_email,paid_marked_at')
|
|
97
|
-
.eq('id', booking_id)
|
|
98
|
-
.maybeSingle();
|
|
99
|
-
if (bErr) return fail(500, 'booking_lookup_failed', bErr.message);
|
|
100
|
-
if (!booking) return fail(404, 'booking_not_found', 'Booking not found.');
|
|
101
|
-
const priorStatus = String(booking.status);
|
|
102
|
-
if (!PAYABLE_STATUSES.has(priorStatus)) {
|
|
103
|
-
return fail(409, 'not_payable', `Booking status is "${priorStatus}"; nothing to mark paid.`);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
// Never guess an amount -- a null list price means the booking isn't
|
|
107
|
-
// priced yet. (Number(null ?? 0) would silently treat that as $0 and a
|
|
108
|
-
// Postgres CHECK constraint passes on a NULL comparison, so nothing else
|
|
109
|
-
// would have caught this.)
|
|
110
|
-
if (booking.list_amount_cents == null) {
|
|
111
|
-
return fail(409, 'missing_list_amount', 'This booking has no list amount set; fix the booking before marking it paid.');
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const grossCents = Number(booking.list_amount_cents)
|
|
115
|
-
- Number(booking.dynamic_discount_cents ?? 0)
|
|
116
|
-
- Number(booking.credit_applied_cents ?? 0)
|
|
117
|
-
- Number(booking.discount_applied_cents ?? 0);
|
|
118
|
-
|
|
119
|
-
// 'sponsored' means the venue comped it -- $0 actually changed hands, so
|
|
120
|
-
// charged_amount_cents must be $0. We fold the remainder into
|
|
121
|
-
// discount_applied_cents so bookings_amount_math_check is satisfied
|
|
122
|
-
// truthfully instead of recording full list revenue for a comped event.
|
|
123
|
-
const isSponsored = payment_method === 'sponsored';
|
|
124
|
-
const netCents = isSponsored ? 0 : grossCents;
|
|
125
|
-
if (!isSponsored && netCents <= 0) {
|
|
126
|
-
return fail(409, 'invalid_amount', `Computed amount is $${(netCents / 100).toFixed(2)}, which isn't a valid amount to mark paid. Check the booking's discounts/credits.`);
|
|
127
|
-
}
|
|
128
|
-
const extraDiscountForSponsored = isSponsored ? grossCents : 0;
|
|
129
|
-
|
|
130
|
-
// If there's still a live, unpaid Stripe checkout session on this booking
|
|
131
|
-
// (the deposit link emailed on contract signature), void it before
|
|
132
|
-
// recording an out-of-band payment. The real deposit-paid webhook is
|
|
133
|
-
// CAS-guarded on status='pending' so it can no longer corrupt this row
|
|
134
|
-
// once we flip to 'paid' below -- but Stripe would still capture real
|
|
135
|
-
// money if the customer clicks that live link later, which is the actual
|
|
136
|
-
// harm this guards against.
|
|
137
|
-
if (booking.stripe_session_id && priorStatus === 'pending') {
|
|
138
|
-
const stripeKey = Deno.env.get('STRIPE_SECRET_KEY');
|
|
139
|
-
if (!stripeKey) {
|
|
140
|
-
return fail(500, 'stripe_not_configured', 'STRIPE_SECRET_KEY is not set; cannot safely void the outstanding deposit link.');
|
|
141
|
-
}
|
|
142
|
-
try {
|
|
143
|
-
const stripe = new Stripe(stripeKey, { apiVersion: '2024-11-20.acacia' as Stripe.LatestApiVersion });
|
|
144
|
-
const session = await stripe.checkout.sessions.retrieve(String(booking.stripe_session_id));
|
|
145
|
-
if (session.status === 'open') {
|
|
146
|
-
await stripe.checkout.sessions.expire(String(booking.stripe_session_id));
|
|
147
|
-
}
|
|
148
|
-
} catch (e) {
|
|
149
|
-
return fail(502, 'stripe_session_expire_failed',
|
|
150
|
-
`Could not void the outstanding Stripe deposit link (${e instanceof Error ? e.message : String(e)}). Void it manually in the Stripe dashboard, then retry.`);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
const markedAt = new Date().toISOString();
|
|
155
|
-
|
|
156
|
-
const { data: updated, error: updErr } = await admin
|
|
157
|
-
.from('bookings')
|
|
158
|
-
.update({
|
|
159
|
-
status: 'paid',
|
|
160
|
-
charged_amount_cents: netCents,
|
|
161
|
-
discount_applied_cents: Number(booking.discount_applied_cents ?? 0) + extraDiscountForSponsored,
|
|
162
|
-
paid_method: payment_method,
|
|
163
|
-
payment_source: payment_method === 'stripe' ? 'stripe' : 'offline',
|
|
164
|
-
paid_notes: notes ?? null,
|
|
165
|
-
paid_marked_by_email: callerEmail,
|
|
166
|
-
paid_marked_at: markedAt,
|
|
167
|
-
hold_expires_at: null,
|
|
168
|
-
})
|
|
169
|
-
.eq('id', booking_id)
|
|
170
|
-
.eq('status', priorStatus) // CAS -- refuse a stale double-click racing a real webhook
|
|
171
|
-
.select('id')
|
|
172
|
-
.maybeSingle();
|
|
173
|
-
if (updErr) return fail(500, 'update_failed', updErr.message);
|
|
174
|
-
if (!updated) return fail(409, 'status_changed', "This booking's status changed before the update landed — reload and try again.");
|
|
175
|
-
|
|
176
|
-
await logOps(admin, 'booking_marked_fully_paid', {
|
|
177
|
-
booking_id, actor: callerEmail, actor_user_id: caller.sub, payment_method, notes: notes ?? null,
|
|
178
|
-
prior_status: priorStatus, charged_amount_cents: netCents,
|
|
179
|
-
// mark_event_at ties this exact log row to the exact row mutation it
|
|
180
|
-
// describes -- admin-correct-booking matches on this instead of trusting
|
|
181
|
-
// "most recent row of this kind," which a swallowed insert error (or a
|
|
182
|
-
// second mark-paid/undo cycle) could otherwise make stale-but-present.
|
|
183
|
-
mark_event_at: markedAt,
|
|
184
|
-
// Full "before" snapshot of every column this action mutates AND every
|
|
185
|
-
// column bookings_amount_math_check depends on, so admin-correct-booking
|
|
186
|
-
// can both revert this exact row and detect drift instead of guessing.
|
|
187
|
-
prior_charged_amount_cents: booking.charged_amount_cents ?? null,
|
|
188
|
-
prior_discount_applied_cents: Number(booking.discount_applied_cents ?? 0),
|
|
189
|
-
prior_list_amount_cents: Number(booking.list_amount_cents),
|
|
190
|
-
prior_dynamic_discount_cents: Number(booking.dynamic_discount_cents ?? 0),
|
|
191
|
-
prior_credit_applied_cents: Number(booking.credit_applied_cents ?? 0),
|
|
192
|
-
prior_paid_method: booking.paid_method ?? null,
|
|
193
|
-
prior_payment_source: booking.payment_source ?? null,
|
|
194
|
-
prior_paid_notes: booking.paid_notes ?? null,
|
|
195
|
-
prior_paid_marked_by_email: booking.paid_marked_by_email ?? null,
|
|
196
|
-
prior_paid_marked_at: booking.paid_marked_at ?? null,
|
|
197
|
-
prior_hold_expires_at: booking.hold_expires_at ?? null,
|
|
198
|
-
prior_deposit_paid_at: booking.deposit_paid_at ?? null,
|
|
199
|
-
}, { severity: 'warning', bookingId: booking_id }).catch(() => {});
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
return json(200, { ok: true, booking_id, status: 'paid', charged_amount_cents: netCents });
|
|
203
|
-
}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
// Staff-triggered Stripe billing-portal link for a specific member.
|
|
2
|
-
//
|
|
3
|
-
// Mints the same kind of Billing Portal session create-portal-session gives
|
|
4
|
-
// a signed-in member -- staff never see or handle a card number, they only
|
|
5
|
-
// get (and optionally email) a Stripe-hosted link the member uses themselves.
|
|
6
|
-
//
|
|
7
|
-
// Auth/allowlist/rate-limit scaffold copied from admin-resend-payment-link-email.
|
|
8
|
-
|
|
9
|
-
import { createClient } from 'npm:@supabase/supabase-js@2';
|
|
10
|
-
import Stripe from 'npm:stripe@17.5.0';
|
|
11
|
-
import { jwtVerify, createRemoteJWKSet } from 'npm:jose@5.9.6';
|
|
12
|
-
import { clientIp, checkRateLimit } from 'npm:@simplelayer/graniteer-core/rateLimit';
|
|
13
|
-
import { logOps } from 'npm:@simplelayer/graniteer-core/ops';
|
|
14
|
-
import { getOrCreateCoworkingPortalConfig } from 'npm:@simplelayer/graniteer-core/stripeCoworkingPortal';
|
|
15
|
-
import { sendBillingPortalLinkEmail } from 'npm:@simplelayer/graniteer-core/billingPortalLinkEmail';
|
|
16
|
-
|
|
17
|
-
const corsHeaders = {
|
|
18
|
-
'Access-Control-Allow-Origin': '*',
|
|
19
|
-
'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
|
|
20
|
-
'Access-Control-Allow-Methods': 'POST, OPTIONS',
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
interface CallerClaims {
|
|
24
|
-
sub: string;
|
|
25
|
-
email?: string;
|
|
26
|
-
aal?: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const JWKS_URL_SUFFIX = '/auth/v1/.well-known/jwks.json';
|
|
30
|
-
let jwksCache: ReturnType<typeof createRemoteJWKSet> | null = null;
|
|
31
|
-
function getJwks(supabaseUrl: string) {
|
|
32
|
-
if (!jwksCache) jwksCache = createRemoteJWKSet(new URL(`${supabaseUrl}${JWKS_URL_SUFFIX}`));
|
|
33
|
-
return jwksCache;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async function verifyCaller(authHeader: string | null, supabaseUrl: string): Promise<CallerClaims | null> {
|
|
37
|
-
if (!authHeader?.toLowerCase().startsWith('bearer ')) return null;
|
|
38
|
-
const token = authHeader.slice(7).trim();
|
|
39
|
-
try {
|
|
40
|
-
const { payload } = await jwtVerify(token, getJwks(supabaseUrl));
|
|
41
|
-
const claims = payload as unknown as CallerClaims;
|
|
42
|
-
if (!claims.sub) return null;
|
|
43
|
-
return claims;
|
|
44
|
-
} catch {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function json(status: number, body: unknown) {
|
|
50
|
-
return new Response(JSON.stringify(body), {
|
|
51
|
-
status,
|
|
52
|
-
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export async function handle(
|
|
57
|
-
req: Request,
|
|
58
|
-
operator: { operatorName: string; operatorShortName: string; domain: string; supportEmail: string },
|
|
59
|
-
): Promise<Response> {
|
|
60
|
-
if (req.method === 'OPTIONS') return new Response('ok', { headers: corsHeaders });
|
|
61
|
-
if (req.method !== 'POST') return json(405, { ok: false, error: 'method_not_allowed' });
|
|
62
|
-
|
|
63
|
-
const SUPABASE_URL = Deno.env.get('SUPABASE_URL')!;
|
|
64
|
-
const SERVICE_ROLE_KEY = Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!;
|
|
65
|
-
const stripeKey = Deno.env.get('STRIPE_SECRET_KEY');
|
|
66
|
-
if (!stripeKey) return json(500, { ok: false, error: 'stripe_not_configured' });
|
|
67
|
-
|
|
68
|
-
const authHeader = req.headers.get('Authorization') || req.headers.get('authorization');
|
|
69
|
-
const caller = await verifyCaller(authHeader, SUPABASE_URL);
|
|
70
|
-
if (!caller) return json(401, { ok: false, error: 'unauthenticated' });
|
|
71
|
-
if (caller.aal !== 'aal2') return json(403, { ok: false, error: 'mfa_required' });
|
|
72
|
-
const callerEmail = (caller.email ?? '').toLowerCase();
|
|
73
|
-
if (!callerEmail) return json(403, { ok: false, error: 'no_email' });
|
|
74
|
-
|
|
75
|
-
const admin = createClient(SUPABASE_URL, SERVICE_ROLE_KEY, {
|
|
76
|
-
auth: { persistSession: false, autoRefreshToken: false },
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
const [ipOk, emailOk] = await Promise.all([
|
|
80
|
-
checkRateLimit(admin, 'admin-mint-billing-portal-ip', clientIp(req), 60, 300),
|
|
81
|
-
checkRateLimit(admin, 'admin-mint-billing-portal-email', callerEmail, 40, 300),
|
|
82
|
-
]);
|
|
83
|
-
if (!ipOk || !emailOk) return json(429, { ok: false, error: 'rate_limited' });
|
|
84
|
-
|
|
85
|
-
const { data: allow, error: allowErr } = await admin
|
|
86
|
-
.from('admin_users').select('email').eq('email', callerEmail).maybeSingle();
|
|
87
|
-
if (allowErr) return json(500, { ok: false, error: 'allowlist_lookup_failed' });
|
|
88
|
-
if (!allow) return json(403, { ok: false, error: 'not_authorized' });
|
|
89
|
-
|
|
90
|
-
let body: { membership_id?: string; send_email?: boolean };
|
|
91
|
-
try {
|
|
92
|
-
body = await req.json();
|
|
93
|
-
} catch {
|
|
94
|
-
return json(400, { ok: false, error: 'invalid_json' });
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const membershipId = (body.membership_id ?? '').trim();
|
|
98
|
-
if (!/^[0-9a-f-]{36}$/i.test(membershipId)) {
|
|
99
|
-
return json(400, { ok: false, error: 'invalid_membership_id' });
|
|
100
|
-
}
|
|
101
|
-
const sendEmail = body.send_email === true;
|
|
102
|
-
|
|
103
|
-
const { data: row, error: rowErr } = await admin
|
|
104
|
-
.from('memberships')
|
|
105
|
-
.select('id,email,customer_name,status,stripe_customer_id')
|
|
106
|
-
.eq('id', membershipId)
|
|
107
|
-
.maybeSingle();
|
|
108
|
-
if (rowErr) return json(500, { ok: false, error: 'lookup_failed' });
|
|
109
|
-
if (!row) return json(404, { ok: false, error: 'not_found' });
|
|
110
|
-
if (!row.stripe_customer_id) return json(400, { ok: false, error: 'no_stripe_customer' });
|
|
111
|
-
|
|
112
|
-
let portalUrl: string;
|
|
113
|
-
try {
|
|
114
|
-
const stripe = new Stripe(stripeKey, { apiVersion: '2024-11-20.acacia' as Stripe.LatestApiVersion });
|
|
115
|
-
const cfgId = await getOrCreateCoworkingPortalConfig(stripe, admin, {
|
|
116
|
-
headline: `Manage your ${operator.operatorName} membership`,
|
|
117
|
-
defaultReturnUrl: `https://${operator.domain}/membership`,
|
|
118
|
-
});
|
|
119
|
-
const session = await stripe.billingPortal.sessions.create({
|
|
120
|
-
customer: row.stripe_customer_id as string,
|
|
121
|
-
configuration: cfgId,
|
|
122
|
-
return_url: `https://${operator.domain}/membership`,
|
|
123
|
-
});
|
|
124
|
-
if (!session.url) throw new Error('stripe_session_missing_url');
|
|
125
|
-
portalUrl = session.url;
|
|
126
|
-
} catch (e) {
|
|
127
|
-
const detail = (e instanceof Error ? e.message : String(e)).slice(0, 500);
|
|
128
|
-
await logOps(admin, 'admin_billing_portal_link_failed',
|
|
129
|
-
{ membership_id: membershipId, actor_email: callerEmail, message: detail },
|
|
130
|
-
{ severity: 'error' }).catch(() => {});
|
|
131
|
-
return json(502, { ok: false, error: 'portal_unavailable', detail });
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
let emailed = false;
|
|
135
|
-
if (sendEmail) {
|
|
136
|
-
if (!row.email) {
|
|
137
|
-
return json(400, { ok: false, error: 'no_member_email', url: portalUrl });
|
|
138
|
-
}
|
|
139
|
-
const result = await sendBillingPortalLinkEmail(admin, {
|
|
140
|
-
email: row.email as string,
|
|
141
|
-
name: row.customer_name as string | null,
|
|
142
|
-
portalUrl,
|
|
143
|
-
}, {
|
|
144
|
-
name: operator.operatorName,
|
|
145
|
-
shortName: operator.operatorShortName,
|
|
146
|
-
domain: operator.domain,
|
|
147
|
-
supportEmail: operator.supportEmail,
|
|
148
|
-
});
|
|
149
|
-
emailed = result === 'sent';
|
|
150
|
-
if (!emailed) {
|
|
151
|
-
// Link was minted successfully; only the email leg failed. Return it
|
|
152
|
-
// anyway so staff can still copy/send it by hand.
|
|
153
|
-
return json(200, { ok: true, url: portalUrl, emailed: false, email_error: result });
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
await admin.from('membership_admin_actions').insert({
|
|
158
|
-
membership_id: membershipId,
|
|
159
|
-
action: sendEmail ? 'billing_portal_link_emailed' : 'billing_portal_link_minted',
|
|
160
|
-
actor_email: callerEmail,
|
|
161
|
-
reason: sendEmail ? `Emailed to ${row.email ?? 'unknown'}` : 'Link copied by staff',
|
|
162
|
-
idempotency_key: crypto.randomUUID(),
|
|
163
|
-
}).then(({ error }) => {
|
|
164
|
-
if (error) console.warn('[admin-mint-billing-portal-link] audit insert failed', error);
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
return json(200, { ok: true, url: portalUrl, emailed });
|
|
168
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
// Internal ops tool: re-mint the agreement portal URL for an existing
|
|
2
|
-
// signature_documents row. Read-only against the DB; reuses MANAGE_TOKEN_SECRET
|
|
3
|
-
// and the same buildAgreementPortalUrl helper as create-agreement.
|
|
4
|
-
|
|
5
|
-
import { createClient } from 'npm:@supabase/supabase-js@2';
|
|
6
|
-
import { buildAgreementPortalUrl } from 'npm:@simplelayer/graniteer-core/manageToken';
|
|
7
|
-
|
|
8
|
-
const corsHeaders = {
|
|
9
|
-
'Access-Control-Allow-Origin': '*',
|
|
10
|
-
'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
|
|
11
|
-
'Access-Control-Allow-Methods': 'POST, OPTIONS',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
function json(status: number, body: unknown) {
|
|
15
|
-
return new Response(JSON.stringify(body), {
|
|
16
|
-
status,
|
|
17
|
-
headers: { ...corsHeaders, 'Content-Type': 'application/json' },
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export async function handle(req: Request, operator: { domain: string }): Promise<Response> {
|
|
22
|
-
if (req.method === 'OPTIONS') return new Response('ok', { headers: corsHeaders });
|
|
23
|
-
if (req.method !== 'POST') return json(405, { ok: false, error: 'method_not_allowed' });
|
|
24
|
-
|
|
25
|
-
let body: { signature_document_id?: unknown; signer_email?: unknown };
|
|
26
|
-
try {
|
|
27
|
-
body = await req.json();
|
|
28
|
-
} catch {
|
|
29
|
-
return json(400, { ok: false, error: 'invalid_json' });
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const id = typeof body.signature_document_id === 'string' ? body.signature_document_id.trim() : '';
|
|
33
|
-
const email = typeof body.signer_email === 'string' ? body.signer_email.trim() : '';
|
|
34
|
-
if (!/^[0-9a-f-]{36}$/i.test(id)) return json(400, { ok: false, error: 'invalid_signature_document_id' });
|
|
35
|
-
if (!email) return json(400, { ok: false, error: 'invalid_signer_email' });
|
|
36
|
-
|
|
37
|
-
const admin = createClient(
|
|
38
|
-
Deno.env.get('SUPABASE_URL')!,
|
|
39
|
-
Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')!,
|
|
40
|
-
{ auth: { persistSession: false, autoRefreshToken: false } },
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const { data: row, error } = await admin
|
|
44
|
-
.from('signature_documents')
|
|
45
|
-
.select('id,signer_email')
|
|
46
|
-
.eq('id', id)
|
|
47
|
-
.maybeSingle();
|
|
48
|
-
|
|
49
|
-
if (error) return json(500, { ok: false, error: 'lookup_failed' });
|
|
50
|
-
if (!row) return json(404, { ok: false, error: 'not_found' });
|
|
51
|
-
|
|
52
|
-
const rowEmail = String(row.signer_email ?? '').toLowerCase();
|
|
53
|
-
if (!rowEmail || rowEmail !== email.toLowerCase()) {
|
|
54
|
-
return json(404, { ok: false, error: 'not_found' });
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const secret = Deno.env.get('MANAGE_TOKEN_SECRET');
|
|
58
|
-
if (!secret) return json(500, { ok: false, error: 'not_configured' });
|
|
59
|
-
|
|
60
|
-
const url = await buildAgreementPortalUrl(`https://${operator.domain}`, String(row.id), rowEmail, secret);
|
|
61
|
-
return json(200, { ok: true, url });
|
|
62
|
-
}
|