@ordinatio/scheduling-api 0.7.0 → 0.9.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.
@@ -313,6 +313,22 @@ interface TextMessageSettings {
313
313
  /** The providers this server has accounts for. Default: Telnyx and Twilio. */
314
314
  providers?: readonly TextProvider[];
315
315
  }
316
+ /**
317
+ * Switches API keys on: a request with `Authorization: Bearer <key>` acts as that key's organization. A host that supplies
318
+ * none has them off, and the routes answer 501.
319
+ */
320
+ interface ApiKeySettings {
321
+ /**
322
+ * The database that holds the API key table, asked before the request's organization is known. It must be the same
323
+ * database the signed-in staff's `db` points at, because the key routes make keys through that one.
324
+ */
325
+ db(): Promise<SchedulingDb>;
326
+ }
327
+ /**
328
+ * Switches gift certificates on. A host that supplies none has them off: the routes answer 501. Needs the
329
+ * GiftCertificate and GiftCertificateTransaction tables from @ordinatio/scheduling 0.8.0.
330
+ */
331
+ type GiftCertificateSettings = Record<string, never>;
316
332
  /** Switches data export and erasure on. A host that supplies none has them off: the routes answer 501. */
317
333
  type PrivacySettings = Record<string, never>;
318
334
  interface SchedulingHost {
@@ -375,6 +391,12 @@ interface SchedulingHost {
375
391
  * Turns on per-organization text-message settings. Needs the text-settings table. Default: off, so the routes answer 501.
376
392
  */
377
393
  textMessages?: TextMessageSettings | null;
394
+ /**
395
+ * Turns on API keys for outside tools. Needs the API key table. Default: off, so a Bearer key is ignored and the key routes answer 501.
396
+ */
397
+ apiKeys?: ApiKeySettings | null;
398
+ /** Turns gift certificates on. Needs their two tables. Default: off, so the gift certificate routes answer 501. */
399
+ giftCertificates?: GiftCertificateSettings | null;
378
400
  /** The domain used after the "@" in calendar-file event ids. Keep it unchanged once calendars have subscribed. Default: ordinatio-scheduling. */
379
401
  icalUidDomain?(): string | null | undefined;
380
402
  /** Records what happened in the activity feed. Default: nothing is recorded. */
@@ -439,7 +461,9 @@ interface Route {
439
461
  path: string;
440
462
  /** A public route is called from other websites, so it also answers a CORS preflight. */
441
463
  public: boolean;
464
+ /** Needs a person at a browser (a consent screen, a cookie): a request made with an API key is refused with 403, whatever the key's access. */
465
+ personOnly?: boolean;
442
466
  handler: RouteHandler;
443
467
  }
444
468
 
445
- export { type AvailabilityCache as A, type BalancePaymentControl as B, type CacheOptions as C, type DnsResolver as D, type RouteHandler as E, type RoutingFormSettings as F, type StaffDirectory as G, type HttpMethod as H, type InternalAccess as I, type WebhookSettings as J, type WorkerCommands as K, checkSendingDomain as L, normalizeSendingDomain as M, type NoShowPolicy as N, type PublicBookingResolver as P, type Route as R, type SchedulingHost as S, type WaitlistSettings as W, type RateLimitTier as a, type SchedulingCache as b, type PublicOrganizationResolver as c, type SendingDomainCheck as d, type SendingDomainRecord as e, type SendingDomainRecords as f, type StaffResolver as g, type StaffContext as h, type ActivityEntry as i, type ActivityLog as j, type AppointmentEventSink as k, type BookingClientResolver as l, type BookingPolicy as m, type BrandSettings as n, type CalendarConnectOutcome as o, type CalendarConnector as p, type CalendarConnectors as q, type CalendarVisibility as r, type PrivacySettings as s, type PublicBookingContext as t, type PublicBookingKind as u, type PublicOrganization as v, type RecordCheck as w, type RecordStatus as x, type ResolvedHost as y, type RouteContext as z };
469
+ export { type AvailabilityCache as A, type BalancePaymentControl as B, type CacheOptions as C, type DnsResolver as D, type RouteContext as E, type RouteHandler as F, type RoutingFormSettings as G, type HttpMethod as H, type InternalAccess as I, type StaffDirectory as J, type WebhookSettings as K, type WorkerCommands as L, checkSendingDomain as M, type NoShowPolicy as N, normalizeSendingDomain as O, type PublicBookingResolver as P, type Route as R, type SchedulingHost as S, type WaitlistSettings as W, type RateLimitTier as a, type SchedulingCache as b, type PublicOrganizationResolver as c, type SendingDomainCheck as d, type SendingDomainRecord as e, type SendingDomainRecords as f, type StaffResolver as g, type StaffContext as h, type ActivityEntry as i, type ActivityLog as j, type ApiKeySettings as k, type AppointmentEventSink as l, type BookingClientResolver as m, type BookingPolicy as n, type BrandSettings as o, type CalendarConnectOutcome as p, type CalendarConnector as q, type CalendarConnectors as r, type CalendarVisibility as s, type PrivacySettings as t, type PublicBookingContext as u, type PublicBookingKind as v, type PublicOrganization as w, type RecordCheck as x, type RecordStatus as y, type ResolvedHost as z };
@@ -313,6 +313,22 @@ interface TextMessageSettings {
313
313
  /** The providers this server has accounts for. Default: Telnyx and Twilio. */
314
314
  providers?: readonly TextProvider[];
315
315
  }
316
+ /**
317
+ * Switches API keys on: a request with `Authorization: Bearer <key>` acts as that key's organization. A host that supplies
318
+ * none has them off, and the routes answer 501.
319
+ */
320
+ interface ApiKeySettings {
321
+ /**
322
+ * The database that holds the API key table, asked before the request's organization is known. It must be the same
323
+ * database the signed-in staff's `db` points at, because the key routes make keys through that one.
324
+ */
325
+ db(): Promise<SchedulingDb>;
326
+ }
327
+ /**
328
+ * Switches gift certificates on. A host that supplies none has them off: the routes answer 501. Needs the
329
+ * GiftCertificate and GiftCertificateTransaction tables from @ordinatio/scheduling 0.8.0.
330
+ */
331
+ type GiftCertificateSettings = Record<string, never>;
316
332
  /** Switches data export and erasure on. A host that supplies none has them off: the routes answer 501. */
317
333
  type PrivacySettings = Record<string, never>;
318
334
  interface SchedulingHost {
@@ -375,6 +391,12 @@ interface SchedulingHost {
375
391
  * Turns on per-organization text-message settings. Needs the text-settings table. Default: off, so the routes answer 501.
376
392
  */
377
393
  textMessages?: TextMessageSettings | null;
394
+ /**
395
+ * Turns on API keys for outside tools. Needs the API key table. Default: off, so a Bearer key is ignored and the key routes answer 501.
396
+ */
397
+ apiKeys?: ApiKeySettings | null;
398
+ /** Turns gift certificates on. Needs their two tables. Default: off, so the gift certificate routes answer 501. */
399
+ giftCertificates?: GiftCertificateSettings | null;
378
400
  /** The domain used after the "@" in calendar-file event ids. Keep it unchanged once calendars have subscribed. Default: ordinatio-scheduling. */
379
401
  icalUidDomain?(): string | null | undefined;
380
402
  /** Records what happened in the activity feed. Default: nothing is recorded. */
@@ -439,7 +461,9 @@ interface Route {
439
461
  path: string;
440
462
  /** A public route is called from other websites, so it also answers a CORS preflight. */
441
463
  public: boolean;
464
+ /** Needs a person at a browser (a consent screen, a cookie): a request made with an API key is refused with 403, whatever the key's access. */
465
+ personOnly?: boolean;
442
466
  handler: RouteHandler;
443
467
  }
444
468
 
445
- export { type AvailabilityCache as A, type BalancePaymentControl as B, type CacheOptions as C, type DnsResolver as D, type RouteHandler as E, type RoutingFormSettings as F, type StaffDirectory as G, type HttpMethod as H, type InternalAccess as I, type WebhookSettings as J, type WorkerCommands as K, checkSendingDomain as L, normalizeSendingDomain as M, type NoShowPolicy as N, type PublicBookingResolver as P, type Route as R, type SchedulingHost as S, type WaitlistSettings as W, type RateLimitTier as a, type SchedulingCache as b, type PublicOrganizationResolver as c, type SendingDomainCheck as d, type SendingDomainRecord as e, type SendingDomainRecords as f, type StaffResolver as g, type StaffContext as h, type ActivityEntry as i, type ActivityLog as j, type AppointmentEventSink as k, type BookingClientResolver as l, type BookingPolicy as m, type BrandSettings as n, type CalendarConnectOutcome as o, type CalendarConnector as p, type CalendarConnectors as q, type CalendarVisibility as r, type PrivacySettings as s, type PublicBookingContext as t, type PublicBookingKind as u, type PublicOrganization as v, type RecordCheck as w, type RecordStatus as x, type ResolvedHost as y, type RouteContext as z };
469
+ export { type AvailabilityCache as A, type BalancePaymentControl as B, type CacheOptions as C, type DnsResolver as D, type RouteContext as E, type RouteHandler as F, type RoutingFormSettings as G, type HttpMethod as H, type InternalAccess as I, type StaffDirectory as J, type WebhookSettings as K, type WorkerCommands as L, checkSendingDomain as M, type NoShowPolicy as N, normalizeSendingDomain as O, type PublicBookingResolver as P, type Route as R, type SchedulingHost as S, type WaitlistSettings as W, type RateLimitTier as a, type SchedulingCache as b, type PublicOrganizationResolver as c, type SendingDomainCheck as d, type SendingDomainRecord as e, type SendingDomainRecords as f, type StaffResolver as g, type StaffContext as h, type ActivityEntry as i, type ActivityLog as j, type ApiKeySettings as k, type AppointmentEventSink as l, type BookingClientResolver as m, type BookingPolicy as n, type BrandSettings as o, type CalendarConnectOutcome as p, type CalendarConnector as q, type CalendarConnectors as r, type CalendarVisibility as s, type PrivacySettings as t, type PublicBookingContext as u, type PublicBookingKind as v, type PublicOrganization as w, type RecordCheck as x, type RecordStatus as y, type ResolvedHost as z };
@@ -521,4 +521,32 @@ declare const TextSettingsSchema: z.ZodObject<{
521
521
  enabled: z.ZodOptional<z.ZodBoolean>;
522
522
  }, z.core.$strict>;
523
523
 
524
- export { type BookingPageConfig, BookingPageConfigSchema, type BookingPageTheme, BookingPageThemeSchema, BrandSchema, CancelRecurringScopeSchema, type CancelRecurringSeriesInput, CancelRecurringSeriesSchema, type CreateAppointmentCategoryInput, CreateAppointmentCategorySchema, type CreateAppointmentTypeInput, CreateAppointmentTypeSchema, type CreateAvailabilityRuleInput, CreateAvailabilityRuleSchema, type CreateCalendarInput, CreateCalendarSchema, type CreateCouponCodeInput, CreateCouponCodeSchema, type CreateNotificationTemplateInput, CreateNotificationTemplateSchema, type CreatePackagePurchaseInput, CreatePackagePurchaseSchema, type CreateRecurringSeriesInput, CreateRecurringSeriesSchema, type CreateRoutingFormInput, CreateRoutingFormSchema, type CreateServicePackageInput, CreateServicePackageSchema, type CreateWebhookEndpointInput, CreateWebhookEndpointSchema, DEFAULT_CANCELLATION_POLICY, IntakeFormFieldSchema, type NoShowPrevention, type NoShowPreventionAction, NoShowPreventionActionSchema, NotificationChannelSchema, NotificationTriggerSchema, type OrgCancellationPolicy, OrgCancellationPolicySchema, PrivacyEraseSchema, PrivacySubjectSchema, RecurringFrequencySchema, RouteClientSchema, SLOT_GRANULARITY_DEFAULT, SLOT_GRANULARITY_OPTIONS, type SlotGranularityMinutes, TestRoutingFormSchema, TextSettingsSchema, type UpdateAppointmentCategoryInput, UpdateAppointmentCategorySchema, type UpdateAppointmentTypeInput, UpdateAppointmentTypeSchema, type UpdateBookingPageInput, UpdateBookingPageSchema, type UpdateCalendarInput, UpdateCalendarSchema, type UpdateCouponCodeInput, UpdateCouponCodeSchema, type UpdateNotificationTemplateInput, UpdateNotificationTemplateSchema, type UpdatePackagePurchaseInput, UpdatePackagePurchaseSchema, type UpdateRoutingFormInput, UpdateRoutingFormSchema, type UpdateServicePackageInput, UpdateServicePackageSchema };
524
+ declare const ApiKeySchema: z.ZodObject<{
525
+ name: z.ZodString;
526
+ access: z.ZodString;
527
+ }, z.core.$strict>;
528
+
529
+ declare const GiftCertificateSchema: z.ZodObject<{
530
+ amountCents: z.ZodNumber;
531
+ currency: z.ZodOptional<z.ZodString>;
532
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
533
+ recipientName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
534
+ recipientEmail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
535
+ purchaserName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
536
+ purchaserEmail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
537
+ message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
538
+ paymentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
539
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
540
+ }, z.core.$strict>;
541
+ declare const GiftCertificateRestoreSchema: z.ZodObject<{
542
+ amountCents: z.ZodNumber;
543
+ appointmentId: z.ZodOptional<z.ZodString>;
544
+ note: z.ZodOptional<z.ZodString>;
545
+ }, z.core.$strict>;
546
+ /** A visitor's balance check. The calendar says which business's certificates to look in. */
547
+ declare const GiftCertificateCheckSchema: z.ZodObject<{
548
+ code: z.ZodString;
549
+ calendarId: z.ZodString;
550
+ }, z.core.$strict>;
551
+
552
+ export { ApiKeySchema, type BookingPageConfig, BookingPageConfigSchema, type BookingPageTheme, BookingPageThemeSchema, BrandSchema, CancelRecurringScopeSchema, type CancelRecurringSeriesInput, CancelRecurringSeriesSchema, type CreateAppointmentCategoryInput, CreateAppointmentCategorySchema, type CreateAppointmentTypeInput, CreateAppointmentTypeSchema, type CreateAvailabilityRuleInput, CreateAvailabilityRuleSchema, type CreateCalendarInput, CreateCalendarSchema, type CreateCouponCodeInput, CreateCouponCodeSchema, type CreateNotificationTemplateInput, CreateNotificationTemplateSchema, type CreatePackagePurchaseInput, CreatePackagePurchaseSchema, type CreateRecurringSeriesInput, CreateRecurringSeriesSchema, type CreateRoutingFormInput, CreateRoutingFormSchema, type CreateServicePackageInput, CreateServicePackageSchema, type CreateWebhookEndpointInput, CreateWebhookEndpointSchema, DEFAULT_CANCELLATION_POLICY, GiftCertificateCheckSchema, GiftCertificateRestoreSchema, GiftCertificateSchema, IntakeFormFieldSchema, type NoShowPrevention, type NoShowPreventionAction, NoShowPreventionActionSchema, NotificationChannelSchema, NotificationTriggerSchema, type OrgCancellationPolicy, OrgCancellationPolicySchema, PrivacyEraseSchema, PrivacySubjectSchema, RecurringFrequencySchema, RouteClientSchema, SLOT_GRANULARITY_DEFAULT, SLOT_GRANULARITY_OPTIONS, type SlotGranularityMinutes, TestRoutingFormSchema, TextSettingsSchema, type UpdateAppointmentCategoryInput, UpdateAppointmentCategorySchema, type UpdateAppointmentTypeInput, UpdateAppointmentTypeSchema, type UpdateBookingPageInput, UpdateBookingPageSchema, type UpdateCalendarInput, UpdateCalendarSchema, type UpdateCouponCodeInput, UpdateCouponCodeSchema, type UpdateNotificationTemplateInput, UpdateNotificationTemplateSchema, type UpdatePackagePurchaseInput, UpdatePackagePurchaseSchema, type UpdateRoutingFormInput, UpdateRoutingFormSchema, type UpdateServicePackageInput, UpdateServicePackageSchema };
@@ -521,4 +521,32 @@ declare const TextSettingsSchema: z.ZodObject<{
521
521
  enabled: z.ZodOptional<z.ZodBoolean>;
522
522
  }, z.core.$strict>;
523
523
 
524
- export { type BookingPageConfig, BookingPageConfigSchema, type BookingPageTheme, BookingPageThemeSchema, BrandSchema, CancelRecurringScopeSchema, type CancelRecurringSeriesInput, CancelRecurringSeriesSchema, type CreateAppointmentCategoryInput, CreateAppointmentCategorySchema, type CreateAppointmentTypeInput, CreateAppointmentTypeSchema, type CreateAvailabilityRuleInput, CreateAvailabilityRuleSchema, type CreateCalendarInput, CreateCalendarSchema, type CreateCouponCodeInput, CreateCouponCodeSchema, type CreateNotificationTemplateInput, CreateNotificationTemplateSchema, type CreatePackagePurchaseInput, CreatePackagePurchaseSchema, type CreateRecurringSeriesInput, CreateRecurringSeriesSchema, type CreateRoutingFormInput, CreateRoutingFormSchema, type CreateServicePackageInput, CreateServicePackageSchema, type CreateWebhookEndpointInput, CreateWebhookEndpointSchema, DEFAULT_CANCELLATION_POLICY, IntakeFormFieldSchema, type NoShowPrevention, type NoShowPreventionAction, NoShowPreventionActionSchema, NotificationChannelSchema, NotificationTriggerSchema, type OrgCancellationPolicy, OrgCancellationPolicySchema, PrivacyEraseSchema, PrivacySubjectSchema, RecurringFrequencySchema, RouteClientSchema, SLOT_GRANULARITY_DEFAULT, SLOT_GRANULARITY_OPTIONS, type SlotGranularityMinutes, TestRoutingFormSchema, TextSettingsSchema, type UpdateAppointmentCategoryInput, UpdateAppointmentCategorySchema, type UpdateAppointmentTypeInput, UpdateAppointmentTypeSchema, type UpdateBookingPageInput, UpdateBookingPageSchema, type UpdateCalendarInput, UpdateCalendarSchema, type UpdateCouponCodeInput, UpdateCouponCodeSchema, type UpdateNotificationTemplateInput, UpdateNotificationTemplateSchema, type UpdatePackagePurchaseInput, UpdatePackagePurchaseSchema, type UpdateRoutingFormInput, UpdateRoutingFormSchema, type UpdateServicePackageInput, UpdateServicePackageSchema };
524
+ declare const ApiKeySchema: z.ZodObject<{
525
+ name: z.ZodString;
526
+ access: z.ZodString;
527
+ }, z.core.$strict>;
528
+
529
+ declare const GiftCertificateSchema: z.ZodObject<{
530
+ amountCents: z.ZodNumber;
531
+ currency: z.ZodOptional<z.ZodString>;
532
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
533
+ recipientName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
534
+ recipientEmail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
535
+ purchaserName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
536
+ purchaserEmail: z.ZodOptional<z.ZodNullable<z.ZodString>>;
537
+ message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
538
+ paymentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
539
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
540
+ }, z.core.$strict>;
541
+ declare const GiftCertificateRestoreSchema: z.ZodObject<{
542
+ amountCents: z.ZodNumber;
543
+ appointmentId: z.ZodOptional<z.ZodString>;
544
+ note: z.ZodOptional<z.ZodString>;
545
+ }, z.core.$strict>;
546
+ /** A visitor's balance check. The calendar says which business's certificates to look in. */
547
+ declare const GiftCertificateCheckSchema: z.ZodObject<{
548
+ code: z.ZodString;
549
+ calendarId: z.ZodString;
550
+ }, z.core.$strict>;
551
+
552
+ export { ApiKeySchema, type BookingPageConfig, BookingPageConfigSchema, type BookingPageTheme, BookingPageThemeSchema, BrandSchema, CancelRecurringScopeSchema, type CancelRecurringSeriesInput, CancelRecurringSeriesSchema, type CreateAppointmentCategoryInput, CreateAppointmentCategorySchema, type CreateAppointmentTypeInput, CreateAppointmentTypeSchema, type CreateAvailabilityRuleInput, CreateAvailabilityRuleSchema, type CreateCalendarInput, CreateCalendarSchema, type CreateCouponCodeInput, CreateCouponCodeSchema, type CreateNotificationTemplateInput, CreateNotificationTemplateSchema, type CreatePackagePurchaseInput, CreatePackagePurchaseSchema, type CreateRecurringSeriesInput, CreateRecurringSeriesSchema, type CreateRoutingFormInput, CreateRoutingFormSchema, type CreateServicePackageInput, CreateServicePackageSchema, type CreateWebhookEndpointInput, CreateWebhookEndpointSchema, DEFAULT_CANCELLATION_POLICY, GiftCertificateCheckSchema, GiftCertificateRestoreSchema, GiftCertificateSchema, IntakeFormFieldSchema, type NoShowPrevention, type NoShowPreventionAction, NoShowPreventionActionSchema, NotificationChannelSchema, NotificationTriggerSchema, type OrgCancellationPolicy, OrgCancellationPolicySchema, PrivacyEraseSchema, PrivacySubjectSchema, RecurringFrequencySchema, RouteClientSchema, SLOT_GRANULARITY_DEFAULT, SLOT_GRANULARITY_OPTIONS, type SlotGranularityMinutes, TestRoutingFormSchema, TextSettingsSchema, type UpdateAppointmentCategoryInput, UpdateAppointmentCategorySchema, type UpdateAppointmentTypeInput, UpdateAppointmentTypeSchema, type UpdateBookingPageInput, UpdateBookingPageSchema, type UpdateCalendarInput, UpdateCalendarSchema, type UpdateCouponCodeInput, UpdateCouponCodeSchema, type UpdateNotificationTemplateInput, UpdateNotificationTemplateSchema, type UpdatePackagePurchaseInput, UpdatePackagePurchaseSchema, type UpdateRoutingFormInput, UpdateRoutingFormSchema, type UpdateServicePackageInput, UpdateServicePackageSchema };
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/schemas/index.ts
21
21
  var schemas_exports = {};
22
22
  __export(schemas_exports, {
23
+ ApiKeySchema: () => ApiKeySchema,
23
24
  BookingPageConfigSchema: () => BookingPageConfigSchema,
24
25
  BookingPageThemeSchema: () => BookingPageThemeSchema,
25
26
  BrandSchema: () => BrandSchema,
@@ -37,6 +38,9 @@ __export(schemas_exports, {
37
38
  CreateServicePackageSchema: () => CreateServicePackageSchema,
38
39
  CreateWebhookEndpointSchema: () => CreateWebhookEndpointSchema,
39
40
  DEFAULT_CANCELLATION_POLICY: () => DEFAULT_CANCELLATION_POLICY,
41
+ GiftCertificateCheckSchema: () => GiftCertificateCheckSchema,
42
+ GiftCertificateRestoreSchema: () => GiftCertificateRestoreSchema,
43
+ GiftCertificateSchema: () => GiftCertificateSchema,
40
44
  IntakeFormFieldSchema: () => IntakeFormFieldSchema,
41
45
  NoShowPreventionActionSchema: () => NoShowPreventionActionSchema,
42
46
  NotificationChannelSchema: () => NotificationChannelSchema,
@@ -500,8 +504,41 @@ var TextSettingsSchema = import_zod9.z.object({
500
504
  fromNumber: import_zod9.z.string().max(40),
501
505
  enabled: import_zod9.z.boolean().optional()
502
506
  }).strict();
507
+
508
+ // src/schemas/api-key.schema.ts
509
+ var import_zod10 = require("zod");
510
+ var ApiKeySchema = import_zod10.z.object({
511
+ name: import_zod10.z.string().max(200),
512
+ access: import_zod10.z.string().max(20)
513
+ }).strict();
514
+
515
+ // src/schemas/gift-certificate.schema.ts
516
+ var import_zod11 = require("zod");
517
+ var text = (max) => import_zod11.z.string().max(max).nullable().optional();
518
+ var GiftCertificateSchema = import_zod11.z.object({
519
+ amountCents: import_zod11.z.number(),
520
+ currency: import_zod11.z.string().max(10).optional(),
521
+ expiresAt: import_zod11.z.string().max(40).nullable().optional(),
522
+ recipientName: text(300),
523
+ recipientEmail: text(300),
524
+ purchaserName: text(300),
525
+ purchaserEmail: text(300),
526
+ message: text(1e3),
527
+ paymentId: text(300),
528
+ notes: text(2e3)
529
+ }).strict();
530
+ var GiftCertificateRestoreSchema = import_zod11.z.object({
531
+ amountCents: import_zod11.z.number(),
532
+ appointmentId: import_zod11.z.string().max(200).optional(),
533
+ note: import_zod11.z.string().max(1e3).optional()
534
+ }).strict();
535
+ var GiftCertificateCheckSchema = import_zod11.z.object({
536
+ code: import_zod11.z.string().max(64),
537
+ calendarId: import_zod11.z.string().min(1).max(200)
538
+ }).strict();
503
539
  // Annotate the CommonJS export names for ESM import in node:
504
540
  0 && (module.exports = {
541
+ ApiKeySchema,
505
542
  BookingPageConfigSchema,
506
543
  BookingPageThemeSchema,
507
544
  BrandSchema,
@@ -519,6 +556,9 @@ var TextSettingsSchema = import_zod9.z.object({
519
556
  CreateServicePackageSchema,
520
557
  CreateWebhookEndpointSchema,
521
558
  DEFAULT_CANCELLATION_POLICY,
559
+ GiftCertificateCheckSchema,
560
+ GiftCertificateRestoreSchema,
561
+ GiftCertificateSchema,
522
562
  IntakeFormFieldSchema,
523
563
  NoShowPreventionActionSchema,
524
564
  NotificationChannelSchema,
@@ -1,4 +1,5 @@
1
1
  import {
2
+ ApiKeySchema,
2
3
  BookingPageConfigSchema,
3
4
  BookingPageThemeSchema,
4
5
  BrandSchema,
@@ -16,6 +17,9 @@ import {
16
17
  CreateServicePackageSchema,
17
18
  CreateWebhookEndpointSchema,
18
19
  DEFAULT_CANCELLATION_POLICY,
20
+ GiftCertificateCheckSchema,
21
+ GiftCertificateRestoreSchema,
22
+ GiftCertificateSchema,
19
23
  IntakeFormFieldSchema,
20
24
  NoShowPreventionActionSchema,
21
25
  NotificationChannelSchema,
@@ -38,8 +42,9 @@ import {
38
42
  UpdatePackagePurchaseSchema,
39
43
  UpdateRoutingFormSchema,
40
44
  UpdateServicePackageSchema
41
- } from "../chunk-IW6AN5WE.mjs";
45
+ } from "../chunk-W3SY2DAU.mjs";
42
46
  export {
47
+ ApiKeySchema,
43
48
  BookingPageConfigSchema,
44
49
  BookingPageThemeSchema,
45
50
  BrandSchema,
@@ -57,6 +62,9 @@ export {
57
62
  CreateServicePackageSchema,
58
63
  CreateWebhookEndpointSchema,
59
64
  DEFAULT_CANCELLATION_POLICY,
65
+ GiftCertificateCheckSchema,
66
+ GiftCertificateRestoreSchema,
67
+ GiftCertificateSchema,
60
68
  IntakeFormFieldSchema,
61
69
  NoShowPreventionActionSchema,
62
70
  NotificationChannelSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ordinatio/scheduling-api",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "license": "MIT",
5
5
  "description": "HTTP API for @ordinatio/scheduling. Every handler takes a Request and returns a Response.",
6
6
  "main": "./dist/index.js",
@@ -11,7 +11,7 @@
11
11
  "sanitize-html": "^2.16.0"
12
12
  },
13
13
  "peerDependencies": {
14
- "@ordinatio/scheduling": "^0.6.1"
14
+ "@ordinatio/scheduling": "^0.8.0"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/sanitize-html": "^2.13.0",
@@ -19,7 +19,7 @@
19
19
  "tsup": "^8.0.0",
20
20
  "typescript": "5",
21
21
  "vitest": "4.0.18",
22
- "@ordinatio/scheduling": "0.6.1"
22
+ "@ordinatio/scheduling": "0.8.0"
23
23
  },
24
24
  "engines": {
25
25
  "node": ">=22.0.0"