@mrcharles/sdk 0.0.0-stage → 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.
- package/README.md +132 -2
- package/dist/mrcharles.esm.js +1175 -0
- package/dist/mrcharles.esm.js.map +21 -0
- package/dist/mrcharles.min.js +4 -0
- package/dist/mrcharles.min.js.map +22 -0
- package/dist/types/client.d.ts +79 -0
- package/dist/types/embed.d.ts +28 -0
- package/dist/types/env.d.ts +36 -0
- package/dist/types/errors.d.ts +15 -0
- package/dist/types/format.d.ts +24 -0
- package/dist/types/http.d.ts +7 -0
- package/dist/types/i18n.d.ts +50 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/links.d.ts +34 -0
- package/dist/types/rooms.d.ts +76 -0
- package/dist/types/slots.d.ts +19 -0
- package/dist/types/types.d.ts +340 -0
- package/dist/types/uuid.d.ts +2 -0
- package/package.json +55 -4
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Http } from './http';
|
|
2
|
+
import { MrCharlesError } from './errors';
|
|
3
|
+
import type { Links } from './links';
|
|
4
|
+
import { type Locale, type LocaleInput } from './i18n';
|
|
5
|
+
import type { Channel, ConfirmRequest, Confirmation, Hold, PublicRoom, PublicSite, RoomAvailability } from './types';
|
|
6
|
+
export type RoomStep = 'slot' | 'details' | 'verify' | 'pay' | 'done' | 'expired';
|
|
7
|
+
export interface RoomBookingState {
|
|
8
|
+
step: RoomStep;
|
|
9
|
+
site: PublicSite | null;
|
|
10
|
+
room: PublicRoom | null;
|
|
11
|
+
availability: RoomAvailability | null;
|
|
12
|
+
hold: Hold | null;
|
|
13
|
+
confirmation: Confirmation | null;
|
|
14
|
+
/** Last error from any action; cleared on the next successful one */
|
|
15
|
+
error: MrCharlesError | null;
|
|
16
|
+
/** `error` as a sentence in the flow's language — show this one. */
|
|
17
|
+
errorMessage: string | null;
|
|
18
|
+
busy: boolean;
|
|
19
|
+
/** Language of the flow's strings and of the guest's messages. */
|
|
20
|
+
locale: Locale;
|
|
21
|
+
}
|
|
22
|
+
export interface GuestDetails {
|
|
23
|
+
date: string;
|
|
24
|
+
startTime: string;
|
|
25
|
+
durationMinutes: number;
|
|
26
|
+
guestName: string;
|
|
27
|
+
channel: Channel;
|
|
28
|
+
contact: string;
|
|
29
|
+
/** Language of the guest's code and confirmation; defaults to the flow's locale. */
|
|
30
|
+
locale?: LocaleInput;
|
|
31
|
+
captchaToken?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface RoomBookingOptions {
|
|
34
|
+
slug: string;
|
|
35
|
+
roomId: string;
|
|
36
|
+
/** Called on every state change */
|
|
37
|
+
onChange?: (state: RoomBookingState) => void;
|
|
38
|
+
/** Language for strings, errors and the guest's messages. Defaults to the client's locale, then the site's default. */
|
|
39
|
+
locale?: LocaleInput;
|
|
40
|
+
}
|
|
41
|
+
export interface RoomBooking {
|
|
42
|
+
readonly state: RoomBookingState;
|
|
43
|
+
subscribe(fn: (state: RoomBookingState) => void): () => void;
|
|
44
|
+
/** Site payload (cached 60 s server-side). Resolves the room too. */
|
|
45
|
+
loadSite(): Promise<PublicSite>;
|
|
46
|
+
/** Free spans for a window; defaults to the next 14 days from today in the studio's zone. */
|
|
47
|
+
loadAvailability(window?: {
|
|
48
|
+
from?: string;
|
|
49
|
+
to?: string;
|
|
50
|
+
days?: number;
|
|
51
|
+
}): Promise<RoomAvailability>;
|
|
52
|
+
/** Start times for a date and duration, from the loaded availability. */
|
|
53
|
+
startTimesFor(date: string, durationMinutes: number): string[];
|
|
54
|
+
/** Durations that fit after a start time, from the loaded availability. */
|
|
55
|
+
durationsFor(date: string, startTime: string): number[];
|
|
56
|
+
/** Reserve the slot and send the code. One idempotency key per attempt is handled for you. */
|
|
57
|
+
hold(details: GuestDetails): Promise<Hold>;
|
|
58
|
+
verify(code: string): Promise<Hold>;
|
|
59
|
+
resend(): Promise<Hold>;
|
|
60
|
+
confirm(req: ConfirmRequest): Promise<Confirmation>;
|
|
61
|
+
/** Milliseconds until the hold expires; 0 when there is no live hold. */
|
|
62
|
+
remainingMs(): number;
|
|
63
|
+
/** Forget the hold and start over (new idempotency key). Keeps site and availability. */
|
|
64
|
+
reset(): void;
|
|
65
|
+
destroy(): void;
|
|
66
|
+
/** Translate a UI string in the flow's language: `flow.t('action.confirm')`. */
|
|
67
|
+
t(key: string, params?: Record<string, string | number>): string;
|
|
68
|
+
/** Switch language mid-flow (a language switcher on the page). */
|
|
69
|
+
setLocale(locale: LocaleInput): void;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The whole guest flow for one room as a small state machine: availability →
|
|
73
|
+
* hold → code → confirm, with the expiry timer, idempotency key and error
|
|
74
|
+
* classification handled. Render it with any UI.
|
|
75
|
+
*/
|
|
76
|
+
export declare function createRoomBooking(http: Http, links: Links, opts: RoomBookingOptions, clientLocale?: () => LocaleInput | undefined): RoomBooking;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FreeSpan } from './types';
|
|
2
|
+
/** "17:30" → 1050 */
|
|
3
|
+
export declare function toMinutes(hhmm: string): number;
|
|
4
|
+
/** 1050 → "17:30" */
|
|
5
|
+
export declare function toHHMM(minutes: number): string;
|
|
6
|
+
export declare function addMinutes(hhmm: string, minutes: number): string;
|
|
7
|
+
/**
|
|
8
|
+
* Every start time at which a booking of `durationMinutes` fits inside one
|
|
9
|
+
* of the free spans, on the `stepMinutes` grid. Sorted, de-duplicated.
|
|
10
|
+
*/
|
|
11
|
+
export declare function startTimes(free: FreeSpan[], durationMinutes: number, stepMinutes: number): string[];
|
|
12
|
+
/** Durations between min and max, on the step grid, that still fit after `start`. */
|
|
13
|
+
export declare function durationOptions(free: FreeSpan[], start: string, minMinutes: number, maxMinutes: number, stepMinutes: number): number[];
|
|
14
|
+
/** 2500, "EUR" → "25,00 €" (locale-aware; minor units in, string out). */
|
|
15
|
+
export declare function formatPrice(cents: number, currency: string, locale?: string): string;
|
|
16
|
+
/** "2026-10-12" for a Date, in the given IANA zone (today in the studio's zone). */
|
|
17
|
+
export declare function dateKey(date: Date, timeZone: string): string;
|
|
18
|
+
/** YYYY-MM-DD plus n days, calendar arithmetic only (no zone involved). */
|
|
19
|
+
export declare function addDays(key: string, days: number): string;
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public types of the Mr Charles booking API.
|
|
3
|
+
* Mirrors apps/backend-api/internal/sites/dto.go and the lesson DTOs; the
|
|
4
|
+
* API adds fields without notice but never removes or renames one within v1.
|
|
5
|
+
*/
|
|
6
|
+
import type { HostedLocale, Locale } from './i18n';
|
|
7
|
+
export type { HostedLocale, Locale, LocaleInput } from './i18n';
|
|
8
|
+
/** Per-language strings from the site payload: `{ es, ca, en }`. Use `pick()` to read one. */
|
|
9
|
+
export type Localized = Partial<Record<HostedLocale, string>>;
|
|
10
|
+
export type PaymentMode = 'card' | 'on_site';
|
|
11
|
+
export type Channel = 'phone' | 'email';
|
|
12
|
+
export interface OperatingHours {
|
|
13
|
+
/** 0–6, Sunday–Saturday */
|
|
14
|
+
dayOfWeek: number;
|
|
15
|
+
openTime: string;
|
|
16
|
+
closeTime: string;
|
|
17
|
+
isClosed: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface PublicStudio {
|
|
20
|
+
name: string;
|
|
21
|
+
slug: string;
|
|
22
|
+
description: string;
|
|
23
|
+
shortDescription: string | null;
|
|
24
|
+
studioType: string | null;
|
|
25
|
+
logoUrl: string | null;
|
|
26
|
+
coverImageUrl: string | null;
|
|
27
|
+
addressLine1: string;
|
|
28
|
+
addressLine2: string | null;
|
|
29
|
+
city: string;
|
|
30
|
+
postalCode: string;
|
|
31
|
+
country: string;
|
|
32
|
+
latitude: number | null;
|
|
33
|
+
longitude: number | null;
|
|
34
|
+
phone: string | null;
|
|
35
|
+
email: string;
|
|
36
|
+
website: string | null;
|
|
37
|
+
/** IANA zone. Every date and time of this studio belongs to it. */
|
|
38
|
+
timezone: string;
|
|
39
|
+
isVerified: boolean;
|
|
40
|
+
averageRating: number | null;
|
|
41
|
+
totalReviews: number;
|
|
42
|
+
operatingHours: OperatingHours[];
|
|
43
|
+
socialLinks: {
|
|
44
|
+
platform: string;
|
|
45
|
+
url: string;
|
|
46
|
+
}[];
|
|
47
|
+
amenities: {
|
|
48
|
+
name: string;
|
|
49
|
+
category: string;
|
|
50
|
+
}[];
|
|
51
|
+
}
|
|
52
|
+
export interface Equipment {
|
|
53
|
+
name: string;
|
|
54
|
+
category: string;
|
|
55
|
+
brand: string | null;
|
|
56
|
+
model: string | null;
|
|
57
|
+
quantity: number;
|
|
58
|
+
}
|
|
59
|
+
export interface PublicRoom {
|
|
60
|
+
id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
description: string | null;
|
|
63
|
+
capacity: number;
|
|
64
|
+
roomType: string | null;
|
|
65
|
+
/** Minor units: 2500 = €25.00 per hour */
|
|
66
|
+
hourlyCents: number;
|
|
67
|
+
currency: string;
|
|
68
|
+
/** Only these rooms accept online bookings */
|
|
69
|
+
bookable: boolean;
|
|
70
|
+
minMinutes: number;
|
|
71
|
+
maxMinutes: number;
|
|
72
|
+
stepMinutes: number;
|
|
73
|
+
paymentModes: PaymentMode[];
|
|
74
|
+
depositPercent: number;
|
|
75
|
+
cancelNoticeHours: number;
|
|
76
|
+
instructions: Localized;
|
|
77
|
+
photos: string[];
|
|
78
|
+
equipment: Equipment[];
|
|
79
|
+
facilities: string[];
|
|
80
|
+
}
|
|
81
|
+
export interface PublicSiteConfig {
|
|
82
|
+
template: string;
|
|
83
|
+
theme: {
|
|
84
|
+
primary: string;
|
|
85
|
+
accent: string;
|
|
86
|
+
font: string;
|
|
87
|
+
radius: string;
|
|
88
|
+
mode?: string;
|
|
89
|
+
logoUrl: string | null;
|
|
90
|
+
};
|
|
91
|
+
sections: Record<string, boolean>;
|
|
92
|
+
content: {
|
|
93
|
+
tagline: Localized;
|
|
94
|
+
about: Localized;
|
|
95
|
+
bookingNote: Localized;
|
|
96
|
+
whatsapp: string;
|
|
97
|
+
instagram: string;
|
|
98
|
+
gallery: string[];
|
|
99
|
+
};
|
|
100
|
+
legal: {
|
|
101
|
+
legalName: string;
|
|
102
|
+
taxId: string;
|
|
103
|
+
address: string;
|
|
104
|
+
email: string;
|
|
105
|
+
phone: string;
|
|
106
|
+
};
|
|
107
|
+
seo: {
|
|
108
|
+
title: string;
|
|
109
|
+
description: string;
|
|
110
|
+
};
|
|
111
|
+
defaultLocale: HostedLocale;
|
|
112
|
+
locales: HostedLocale[];
|
|
113
|
+
status: string;
|
|
114
|
+
customDomain: string | null;
|
|
115
|
+
canonicalHost: string;
|
|
116
|
+
/**
|
|
117
|
+
* Sandbox: this site exists for testing. Codes come back as `hold.devCode`,
|
|
118
|
+
* nothing is sent to anyone, card payments are off and bookings are purged
|
|
119
|
+
* after seven days. Tell the guest.
|
|
120
|
+
*/
|
|
121
|
+
sandbox: boolean;
|
|
122
|
+
}
|
|
123
|
+
export interface PublicSite {
|
|
124
|
+
studio: PublicStudio;
|
|
125
|
+
rooms: PublicRoom[];
|
|
126
|
+
site: PublicSiteConfig;
|
|
127
|
+
/** At least one room is bookable online */
|
|
128
|
+
bookingOnline: boolean;
|
|
129
|
+
cardPayments: boolean;
|
|
130
|
+
/** Present when holds require a Turnstile token */
|
|
131
|
+
captchaSiteKey?: string;
|
|
132
|
+
/** Present when card deposits are possible — use it to mount Stripe */
|
|
133
|
+
stripePublishableKey?: string;
|
|
134
|
+
}
|
|
135
|
+
/** A continuous free span, "HH:MM" in the studio's zone. "24:00" is a valid end. */
|
|
136
|
+
export interface FreeSpan {
|
|
137
|
+
start: string;
|
|
138
|
+
end: string;
|
|
139
|
+
}
|
|
140
|
+
export interface DayAvailability {
|
|
141
|
+
/** YYYY-MM-DD */
|
|
142
|
+
date: string;
|
|
143
|
+
free: FreeSpan[];
|
|
144
|
+
}
|
|
145
|
+
export interface RoomAvailability {
|
|
146
|
+
roomId: string;
|
|
147
|
+
timezone: string;
|
|
148
|
+
hourlyCents: number;
|
|
149
|
+
currency: string;
|
|
150
|
+
minMinutes: number;
|
|
151
|
+
maxMinutes: number;
|
|
152
|
+
stepMinutes: number;
|
|
153
|
+
minNoticeMin: number;
|
|
154
|
+
maxAdvanceDays: number;
|
|
155
|
+
days: DayAvailability[];
|
|
156
|
+
}
|
|
157
|
+
export interface HoldRequest {
|
|
158
|
+
roomId: string;
|
|
159
|
+
/** YYYY-MM-DD in the studio's zone */
|
|
160
|
+
date: string;
|
|
161
|
+
/** HH:MM in the studio's zone */
|
|
162
|
+
startTime: string;
|
|
163
|
+
durationMinutes: number;
|
|
164
|
+
guestName: string;
|
|
165
|
+
channel: Channel;
|
|
166
|
+
/** E.164 phone (+34…) when channel is phone; an address when email */
|
|
167
|
+
contact: string;
|
|
168
|
+
/** Language of the code, confirmation and reminders. Hosted locales only; the SDK maps others for you. */
|
|
169
|
+
locale?: HostedLocale | Locale;
|
|
170
|
+
/** One per attempt; reuse it when retrying the same request */
|
|
171
|
+
idempotencyKey: string;
|
|
172
|
+
/** Required when the site payload has captchaSiteKey */
|
|
173
|
+
captchaToken?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface Price {
|
|
176
|
+
priceCents: number;
|
|
177
|
+
/** What a card payment charges now */
|
|
178
|
+
depositCents: number;
|
|
179
|
+
currency: string;
|
|
180
|
+
minutes: number;
|
|
181
|
+
}
|
|
182
|
+
export interface Hold {
|
|
183
|
+
holdId: string;
|
|
184
|
+
status: string;
|
|
185
|
+
roomId: string;
|
|
186
|
+
roomName: string;
|
|
187
|
+
date: string;
|
|
188
|
+
startTime: string;
|
|
189
|
+
endTime: string;
|
|
190
|
+
timezone: string;
|
|
191
|
+
price: Price;
|
|
192
|
+
channel: Channel;
|
|
193
|
+
contactMasked: string;
|
|
194
|
+
/** ISO instant; the slot is yours until then (12 minutes) */
|
|
195
|
+
expiresAt: string;
|
|
196
|
+
resendsLeft: number;
|
|
197
|
+
paymentModes: PaymentMode[];
|
|
198
|
+
/** Only on sandbox sites: the code that would have been sent. */
|
|
199
|
+
devCode?: string;
|
|
200
|
+
}
|
|
201
|
+
export interface ConfirmRequest {
|
|
202
|
+
/** Must be one of hold.paymentModes */
|
|
203
|
+
paymentMode: PaymentMode;
|
|
204
|
+
/** Shown to the studio */
|
|
205
|
+
notes?: string;
|
|
206
|
+
/** Optional second contact for the receipt */
|
|
207
|
+
email?: string;
|
|
208
|
+
}
|
|
209
|
+
export interface Booking {
|
|
210
|
+
id: string;
|
|
211
|
+
reference: string;
|
|
212
|
+
status: 'confirmed' | 'pending_payment' | 'cancelled' | 'completed' | 'no_show' | string;
|
|
213
|
+
paymentMode: PaymentMode;
|
|
214
|
+
paymentStatus: string;
|
|
215
|
+
studioName: string;
|
|
216
|
+
roomName: string;
|
|
217
|
+
guestName: string;
|
|
218
|
+
date: string;
|
|
219
|
+
startTime: string;
|
|
220
|
+
endTime: string;
|
|
221
|
+
timezone: string;
|
|
222
|
+
startsAt: string;
|
|
223
|
+
endsAt: string;
|
|
224
|
+
minutes: number;
|
|
225
|
+
priceCents: number;
|
|
226
|
+
depositCents: number;
|
|
227
|
+
currency: string;
|
|
228
|
+
cancelNoticeHours: number;
|
|
229
|
+
mayCancel: boolean;
|
|
230
|
+
notes: string | null;
|
|
231
|
+
paymentDueAt: string | null;
|
|
232
|
+
createdAt: string;
|
|
233
|
+
}
|
|
234
|
+
export interface Confirmation {
|
|
235
|
+
booking: Booking;
|
|
236
|
+
/** Keep it if you build your own manage screen */
|
|
237
|
+
manageToken: string;
|
|
238
|
+
/** Hand it to the guest — the only way back to the booking */
|
|
239
|
+
manageUrl: string;
|
|
240
|
+
/** Stripe PaymentIntent secret, when paymentMode is card */
|
|
241
|
+
clientSecret?: string;
|
|
242
|
+
}
|
|
243
|
+
export interface Money {
|
|
244
|
+
/** Minor units */
|
|
245
|
+
amount: number;
|
|
246
|
+
currency: string;
|
|
247
|
+
}
|
|
248
|
+
export interface TeacherProfile {
|
|
249
|
+
/** Instructor *profile* id — not what the booking endpoints want */
|
|
250
|
+
id: string;
|
|
251
|
+
/** user.id is the id for availability, slots and the booking link */
|
|
252
|
+
user: {
|
|
253
|
+
id: string;
|
|
254
|
+
displayName: string;
|
|
255
|
+
username: string;
|
|
256
|
+
avatarUrl: string | null;
|
|
257
|
+
};
|
|
258
|
+
headline: string | null;
|
|
259
|
+
bio: string;
|
|
260
|
+
teachingPhilosophy: string | null;
|
|
261
|
+
hourlyRate: Money;
|
|
262
|
+
experienceYears: number;
|
|
263
|
+
teachesOnline: boolean;
|
|
264
|
+
teachesInPerson: boolean;
|
|
265
|
+
instruments: {
|
|
266
|
+
instrument: string;
|
|
267
|
+
skillLevel?: string;
|
|
268
|
+
[k: string]: unknown;
|
|
269
|
+
}[];
|
|
270
|
+
genres: string[];
|
|
271
|
+
teachingSpecialties: string[];
|
|
272
|
+
audienceLevels: string[];
|
|
273
|
+
languages: string[];
|
|
274
|
+
locationDisplay: string | null;
|
|
275
|
+
teachingSinceYear: number | null;
|
|
276
|
+
averageRating: number | null;
|
|
277
|
+
totalReviews: number;
|
|
278
|
+
totalStudents: number;
|
|
279
|
+
totalLessons: number;
|
|
280
|
+
isVerified: boolean;
|
|
281
|
+
createdAt: string;
|
|
282
|
+
}
|
|
283
|
+
export interface LessonOffer {
|
|
284
|
+
id: string;
|
|
285
|
+
/** Instructor *profile* id (see TeacherProfile.id) */
|
|
286
|
+
instructorId: string;
|
|
287
|
+
title: string;
|
|
288
|
+
description: string;
|
|
289
|
+
instrument: string;
|
|
290
|
+
audienceLevels: string[];
|
|
291
|
+
price: Money;
|
|
292
|
+
durationMinutes: number;
|
|
293
|
+
format: 'online' | 'in_person' | 'both' | string;
|
|
294
|
+
maxParticipants: number;
|
|
295
|
+
publishedAt: string | null;
|
|
296
|
+
}
|
|
297
|
+
export interface LessonPolicy {
|
|
298
|
+
minNoticeMin: number;
|
|
299
|
+
maxAdvanceDays: number;
|
|
300
|
+
slotGranularityMin: number;
|
|
301
|
+
rescheduleMinNoticeMin: number;
|
|
302
|
+
rescheduleMaxPerBooking: number;
|
|
303
|
+
}
|
|
304
|
+
export interface LessonSlot {
|
|
305
|
+
date: string;
|
|
306
|
+
/** HH:MM in the teacher's zone */
|
|
307
|
+
startTime: string;
|
|
308
|
+
endTime: string;
|
|
309
|
+
}
|
|
310
|
+
export interface LessonSlots {
|
|
311
|
+
instructorId: string;
|
|
312
|
+
offerId: string;
|
|
313
|
+
timezone: string;
|
|
314
|
+
durationMinutes: number;
|
|
315
|
+
days: {
|
|
316
|
+
date: string;
|
|
317
|
+
slots: LessonSlot[];
|
|
318
|
+
}[];
|
|
319
|
+
policy?: LessonPolicy;
|
|
320
|
+
}
|
|
321
|
+
export interface TeacherWindows {
|
|
322
|
+
timezone: string;
|
|
323
|
+
windows: {
|
|
324
|
+
date: string;
|
|
325
|
+
startTime: string;
|
|
326
|
+
endTime: string;
|
|
327
|
+
}[];
|
|
328
|
+
}
|
|
329
|
+
export interface EmbedBookedEvent {
|
|
330
|
+
type: 'mrcharles:booked';
|
|
331
|
+
reference: string;
|
|
332
|
+
bookingId: string;
|
|
333
|
+
manageUrl: string;
|
|
334
|
+
status: string;
|
|
335
|
+
}
|
|
336
|
+
export interface EmbedResizeEvent {
|
|
337
|
+
type: 'mrcharles:resize';
|
|
338
|
+
height: number;
|
|
339
|
+
}
|
|
340
|
+
export type EmbedEvent = EmbedBookedEvent | EmbedResizeEvent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrcharles/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Mr Charles booking SDK \u2014 put studio room bookings and teacher lessons on any website.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://developers.mrcharles.app/integrate/sdk/",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/oryontech-ou/mrcharles.git",
|
|
10
|
+
"directory": "packages/sdk"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"mrcharles",
|
|
14
|
+
"booking",
|
|
15
|
+
"studio",
|
|
16
|
+
"music",
|
|
17
|
+
"lessons",
|
|
18
|
+
"sdk"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"main": "./dist/mrcharles.esm.js",
|
|
23
|
+
"module": "./dist/mrcharles.esm.js",
|
|
24
|
+
"types": "./dist/types/index.d.ts",
|
|
25
|
+
"unpkg": "./dist/mrcharles.min.js",
|
|
26
|
+
"jsdelivr": "./dist/mrcharles.min.js",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/types/index.d.ts",
|
|
30
|
+
"import": "./dist/mrcharles.esm.js",
|
|
31
|
+
"default": "./dist/mrcharles.esm.js"
|
|
32
|
+
},
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "rm -rf dist && bun build src/index.ts --target=browser --format=esm --outdir=dist --entry-naming='mrcharles.esm.[ext]' --sourcemap=linked && bun build src/global.ts --target=browser --format=iife --minify --outdir=dist --entry-naming='mrcharles.min.[ext]' --sourcemap=linked && tsc -p tsconfig.build.json",
|
|
41
|
+
"test": "bun test",
|
|
42
|
+
"typecheck": "tsc --noEmit",
|
|
43
|
+
"clean": "rm -rf dist"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/bun": "^1.0.0",
|
|
47
|
+
"typescript": "^5.9.3"
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"nx": {
|
|
53
|
+
"tags": [
|
|
54
|
+
"scope:sdk"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
}
|