@simplelayer/graniteer-core 0.3.18 → 0.3.19-referral.1
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/functions/admin-create-booking.d.ts +0 -3
- package/dist/functions/admin-create-booking.js +2 -15
- package/dist/functions/admin-mark-booking-paid.d.ts +1 -6
- package/dist/functions/admin-mark-booking-paid.js +3 -27
- package/dist/functions/admin-request-trial.js +1 -1
- package/dist/functions/booking-availability.d.ts +1 -2
- package/dist/functions/booking-availability.js +5 -14
- package/dist/functions/create-booking.d.ts +0 -5
- package/dist/functions/create-booking.js +4 -22
- package/dist/functions/create-subscription-checkout.js +4 -1
- package/dist/functions/manage-booking.d.ts +0 -6
- package/dist/functions/manage-booking.js +12 -29
- package/dist/functions/reschedule-booking.d.ts +0 -5
- package/dist/functions/reschedule-booking.js +2 -28
- package/dist/functions/space-availability-range.d.ts +1 -2
- package/dist/functions/space-availability-range.js +1 -8
- package/dist/functions/stripe-webhook.d.ts +0 -4
- package/dist/functions/stripe-webhook.js +9 -182
- package/dist/functions/sync-gcal-blackouts.js +1 -1
- package/dist/gcalSync.d.ts +0 -1
- package/dist/gcalSync.js +0 -5
- package/dist/pricing.d.ts +2 -10
- package/dist/pricing.js +9 -14
- package/dist/referralCodeLookup.d.ts +1 -0
- package/dist/referralCodeLookup.js +3 -0
- package/dist/referralCredits.d.ts +5 -0
- package/dist/referralCredits.js +5 -0
- package/dist/referralGrant.d.ts +4 -31
- package/dist/referralGrant.js +14 -234
- package/package.json +2 -26
- package/dist/bookingSource.d.ts +0 -2
- package/dist/bookingSource.js +0 -11
- package/dist/businessHours.d.ts +0 -11
- package/dist/businessHours.js +0 -55
- package/dist/connectBookingCharge.d.ts +0 -49
- package/dist/connectBookingCharge.js +0 -68
- package/dist/functions/booking-access-revoke-backstop.d.ts +0 -11
- package/dist/functions/booking-access-revoke-backstop.js +0 -121
- package/dist/functions/booking-access-revoke-door-state.d.ts +0 -22
- package/dist/functions/booking-access-revoke-door-state.js +0 -61
- package/dist/functions/booking-access-revoke.d.ts +0 -35
- package/dist/functions/booking-access-revoke.js +0 -279
- package/dist/gcalBookingEvents.d.ts +0 -59
- package/dist/gcalBookingEvents.js +0 -182
- package/dist/stripeConnectEvents.d.ts +0 -11
- package/dist/stripeConnectEvents.js +0 -37
- package/dist/tenant-config.d.ts +0 -8
- package/dist/tenant-config.js +0 -24
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Gate for the Stripe Connect webhook endpoint (createStripeConnectWebhookHandler).
|
|
2
|
-
// Pure: decides whether a verified connected-account event may enter the shared
|
|
3
|
-
// booking logic in stripe-webhook.ts.
|
|
4
|
-
export const CONNECT_BOOKING_EVENT_TYPES = new Set([
|
|
5
|
-
'checkout.session.completed',
|
|
6
|
-
'checkout.session.expired',
|
|
7
|
-
'checkout.session.async_payment_failed',
|
|
8
|
-
'payment_intent.payment_failed',
|
|
9
|
-
'charge.refunded',
|
|
10
|
-
'charge.dispute.created',
|
|
11
|
-
'charge.dispute.closed',
|
|
12
|
-
]);
|
|
13
|
-
export function gateConnectBookingEvent(event, operatorAccountId) {
|
|
14
|
-
const acct = event.account;
|
|
15
|
-
if (typeof acct !== 'string' || acct.length === 0)
|
|
16
|
-
return { accept: false, reason: 'not_connect_event' };
|
|
17
|
-
if (acct !== operatorAccountId)
|
|
18
|
-
return { accept: false, reason: 'account_mismatch' };
|
|
19
|
-
if (!CONNECT_BOOKING_EVENT_TYPES.has(event.type))
|
|
20
|
-
return { accept: false, reason: 'event_type_not_handled' };
|
|
21
|
-
if (event.type.startsWith('checkout.session.')) {
|
|
22
|
-
const s = event.data?.object;
|
|
23
|
-
const md = (s?.metadata ?? {});
|
|
24
|
-
const bookingId = md.booking_id;
|
|
25
|
-
if (typeof bookingId !== 'string' || bookingId.length === 0 ||
|
|
26
|
-
md.checkout_type !== undefined || md.payment_type !== undefined ||
|
|
27
|
-
s?.mode === 'subscription') {
|
|
28
|
-
return { accept: false, reason: 'not_a_booking_session' };
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return { accept: true };
|
|
32
|
-
}
|
|
33
|
-
export function connectAcceptedOpsKind(eventType) {
|
|
34
|
-
return eventType.startsWith('charge.')
|
|
35
|
-
? 'stripe_connect_charge_refund_or_dispute'
|
|
36
|
-
: 'stripe_connect_event_accepted';
|
|
37
|
-
}
|
package/dist/tenant-config.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base origin of this tenant's membership/event-access middleware (the
|
|
3
|
-
* "ftw-middleware"-equivalent service that signs/serves door credentials,
|
|
4
|
-
* organizer links, and grant revokes). No trailing slash.
|
|
5
|
-
*
|
|
6
|
-
* Env var: EVENT_ACCESS_BUS_BASE
|
|
7
|
-
*/
|
|
8
|
-
export declare function getEventAccessBusBase(): string;
|
package/dist/tenant-config.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Centralized tenant-scoped configuration for the handful of values that
|
|
2
|
-
// historically were hardcoded to Granite City Workspaces' own infrastructure
|
|
3
|
-
// instead of being dependency-injected like the rest of the operator identity
|
|
4
|
-
// (GHL_LOCATION_ID, OPERATOR/siteConfig objects, Stripe keys, etc. -- see
|
|
5
|
-
// docs/resale/TENANT-AUDIT.md). Every constant here is backed by an env var,
|
|
6
|
-
// documented in .env.tenant.example at the repo root. When an env var is
|
|
7
|
-
// unset, the fallback is Granite City's current production value, so existing
|
|
8
|
-
// deployments keep working unchanged until their env is configured.
|
|
9
|
-
//
|
|
10
|
-
// Most tenant identity in this codebase is injected by the caller (the
|
|
11
|
-
// gc-connect-style wrapper that imports this package) rather than read from
|
|
12
|
-
// env here. This module exists only for the small number of call sites
|
|
13
|
-
// (manage-booking.ts, booking-access-revoke.ts) that don't already receive a
|
|
14
|
-
// busBase-shaped config object from their caller.
|
|
15
|
-
/**
|
|
16
|
-
* Base origin of this tenant's membership/event-access middleware (the
|
|
17
|
-
* "ftw-middleware"-equivalent service that signs/serves door credentials,
|
|
18
|
-
* organizer links, and grant revokes). No trailing slash.
|
|
19
|
-
*
|
|
20
|
-
* Env var: EVENT_ACCESS_BUS_BASE
|
|
21
|
-
*/
|
|
22
|
-
export function getEventAccessBusBase() {
|
|
23
|
-
return Deno.env.get('EVENT_ACCESS_BUS_BASE') ?? 'https://ftw.granitecity.io';
|
|
24
|
-
}
|