@foxscheduling/shared 0.1.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 +56 -0
- package/dist/cjs/constants/emailUnsubscribeReasons.cjs +13 -0
- package/dist/cjs/constants/emailUnsubscribeReasons.d.ts +4 -0
- package/dist/cjs/constants/emailUnsubscribeReasons.d.ts.map +1 -0
- package/dist/cjs/index.cjs +24 -0
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/types/db.availability.cjs +12 -0
- package/dist/cjs/types/db.availability.d.ts +33 -0
- package/dist/cjs/types/db.availability.d.ts.map +1 -0
- package/dist/cjs/types/db.booking.cjs +2 -0
- package/dist/cjs/types/db.booking.d.ts +101 -0
- package/dist/cjs/types/db.booking.d.ts.map +1 -0
- package/dist/cjs/types/db.cjs +2 -0
- package/dist/cjs/types/db.customers.cjs +2 -0
- package/dist/cjs/types/db.customers.d.ts +14 -0
- package/dist/cjs/types/db.customers.d.ts.map +1 -0
- package/dist/cjs/types/db.d.ts +11 -0
- package/dist/cjs/types/db.d.ts.map +1 -0
- package/dist/cjs/types/db.directory.cjs +2 -0
- package/dist/cjs/types/db.directory.d.ts +38 -0
- package/dist/cjs/types/db.directory.d.ts.map +1 -0
- package/dist/cjs/types/db.emailFlow.cjs +2 -0
- package/dist/cjs/types/db.emailFlow.d.ts +29 -0
- package/dist/cjs/types/db.emailFlow.d.ts.map +1 -0
- package/dist/cjs/types/db.mcpUserContext.cjs +2 -0
- package/dist/cjs/types/db.mcpUserContext.d.ts +29 -0
- package/dist/cjs/types/db.mcpUserContext.d.ts.map +1 -0
- package/dist/cjs/types/db.notification.cjs +2 -0
- package/dist/cjs/types/db.notification.d.ts +27 -0
- package/dist/cjs/types/db.notification.d.ts.map +1 -0
- package/dist/cjs/types/db.oauth.cjs +2 -0
- package/dist/cjs/types/db.oauth.d.ts +55 -0
- package/dist/cjs/types/db.oauth.d.ts.map +1 -0
- package/dist/cjs/types/db.partnerApiKey.cjs +2 -0
- package/dist/cjs/types/db.partnerApiKey.d.ts +15 -0
- package/dist/cjs/types/db.partnerApiKey.d.ts.map +1 -0
- package/dist/cjs/types/db.paymentPending.cjs +2 -0
- package/dist/cjs/types/db.paymentPending.d.ts +16 -0
- package/dist/cjs/types/db.paymentPending.d.ts.map +1 -0
- package/dist/cjs/types/db.service.cjs +15 -0
- package/dist/cjs/types/db.service.d.ts +145 -0
- package/dist/cjs/types/db.service.d.ts.map +1 -0
- package/dist/cjs/types/db.tax.cjs +2 -0
- package/dist/cjs/types/db.tax.d.ts.map +1 -0
- package/dist/cjs/types/db.tenant.cjs +2 -0
- package/dist/cjs/types/db.tenant.d.ts +118 -0
- package/dist/cjs/types/db.tenant.d.ts.map +1 -0
- package/dist/cjs/types/db.tenantGroupedStat.cjs +2 -0
- package/dist/cjs/types/db.tenantGroupedStat.d.ts +13 -0
- package/dist/cjs/types/db.tenantGroupedStat.d.ts.map +1 -0
- package/dist/cjs/types/db.user.cjs +7 -0
- package/dist/cjs/types/db.user.d.ts +81 -0
- package/dist/cjs/types/db.user.d.ts.map +1 -0
- package/dist/cjs/types/db.userConfirmation.cjs +2 -0
- package/dist/cjs/types/db.userConfirmation.d.ts +17 -0
- package/dist/cjs/types/db.userConfirmation.d.ts.map +1 -0
- package/dist/cjs/types/db.userLoginSession.cjs +2 -0
- package/dist/cjs/types/db.userLoginSession.d.ts +28 -0
- package/dist/cjs/types/db.userLoginSession.d.ts.map +1 -0
- package/dist/cjs/types/db.webhook.cjs +10 -0
- package/dist/cjs/types/db.webhook.d.ts +16 -0
- package/dist/cjs/types/db.webhook.d.ts.map +1 -0
- package/dist/cjs/types/discover.cjs +2 -0
- package/dist/cjs/types/discover.d.ts +45 -0
- package/dist/cjs/types/discover.d.ts.map +1 -0
- package/dist/cjs/types/errorCodes.cjs +150 -0
- package/dist/cjs/types/errorCodes.d.ts +147 -0
- package/dist/cjs/types/errorCodes.d.ts.map +1 -0
- package/dist/cjs/types/index.cjs +44 -0
- package/dist/cjs/types/index.d.ts +84 -0
- package/dist/cjs/types/index.d.ts.map +1 -0
- package/dist/cjs/types/oauthScopes.cjs +33 -0
- package/dist/cjs/types/oauthScopes.d.ts +7 -0
- package/dist/cjs/types/oauthScopes.d.ts.map +1 -0
- package/dist/cjs/types/partnerDto.cjs +2 -0
- package/dist/cjs/types/partnerDto.d.ts +69 -0
- package/dist/cjs/types/partnerDto.d.ts.map +1 -0
- package/dist/cjs/types/pricing.cjs +2 -0
- package/dist/cjs/types/pricing.d.ts +31 -0
- package/dist/cjs/types/pricing.d.ts.map +1 -0
- package/dist/cjs/types/requestResponse.cjs +2 -0
- package/dist/cjs/types/requestResponse.d.ts +93 -0
- package/dist/cjs/types/requestResponse.d.ts.map +1 -0
- package/dist/cjs/types/subscription.cjs +2 -0
- package/dist/cjs/types/subscription.d.ts +50 -0
- package/dist/cjs/types/subscription.d.ts.map +1 -0
- package/dist/cjs/utils/bookingEmbed.cjs +178 -0
- package/dist/cjs/utils/bookingEmbed.d.ts +61 -0
- package/dist/cjs/utils/bookingEmbed.d.ts.map +1 -0
- package/dist/cjs/utils/bookingPageIcons.cjs +218 -0
- package/dist/cjs/utils/bookingPageIcons.d.ts +160 -0
- package/dist/cjs/utils/bookingPageIcons.d.ts.map +1 -0
- package/dist/cjs/utils/bookingProviders.cjs +27 -0
- package/dist/cjs/utils/bookingProviders.d.ts +25 -0
- package/dist/cjs/utils/bookingProviders.d.ts.map +1 -0
- package/dist/cjs/utils/currencies.cjs +148 -0
- package/dist/cjs/utils/currencies.d.ts +6 -0
- package/dist/cjs/utils/currencies.d.ts.map +1 -0
- package/dist/cjs/utils/dateTime.cjs +192 -0
- package/dist/cjs/utils/dateTime.d.ts +57 -0
- package/dist/cjs/utils/dateTime.d.ts.map +1 -0
- package/dist/cjs/utils/embedFrameLoader.cjs +76 -0
- package/dist/cjs/utils/embedFrameLoader.d.ts +15 -0
- package/dist/cjs/utils/embedFrameLoader.d.ts.map +1 -0
- package/dist/cjs/utils/extensionToContentType.cjs +24 -0
- package/dist/cjs/utils/extensionToContentType.d.ts +21 -0
- package/dist/cjs/utils/extensionToContentType.d.ts.map +1 -0
- package/dist/cjs/utils/generateUsername.cjs +7 -0
- package/dist/cjs/utils/generateUsername.d.ts.map +1 -0
- package/dist/cjs/utils/index.cjs +65 -0
- package/dist/cjs/utils/index.d.ts +26 -0
- package/dist/cjs/utils/index.d.ts.map +1 -0
- package/dist/cjs/utils/random.cjs +13 -0
- package/dist/cjs/utils/random.d.ts +3 -0
- package/dist/cjs/utils/random.d.ts.map +1 -0
- package/dist/cjs/utils/serviceReminderLabels.cjs +22 -0
- package/dist/cjs/utils/serviceReminderLabels.d.ts +5 -0
- package/dist/cjs/utils/serviceReminderLabels.d.ts.map +1 -0
- package/dist/cjs/utils/tenantSlug.cjs +299 -0
- package/dist/cjs/utils/tenantSlug.d.ts +7 -0
- package/dist/cjs/utils/tenantSlug.d.ts.map +1 -0
- package/dist/cjs/utils/textSlug.cjs +14 -0
- package/dist/cjs/utils/textSlug.d.ts +3 -0
- package/dist/cjs/utils/textSlug.d.ts.map +1 -0
- package/dist/cjs/utils/timezone.cjs +96 -0
- package/dist/cjs/utils/timezone.d.ts +2 -0
- package/dist/cjs/utils/timezone.d.ts.map +1 -0
- package/dist/cjs/utils/ucfirst.cjs +9 -0
- package/dist/cjs/utils/ucfirst.d.ts +2 -0
- package/dist/cjs/utils/ucfirst.d.ts.map +1 -0
- package/dist/constants/emailUnsubscribeReasons.d.ts +4 -0
- package/dist/constants/emailUnsubscribeReasons.d.ts.map +1 -0
- package/dist/constants/emailUnsubscribeReasons.js +10 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/types/db.availability.d.ts +33 -0
- package/dist/types/db.availability.d.ts.map +1 -0
- package/dist/types/db.availability.js +9 -0
- package/dist/types/db.booking.d.ts +101 -0
- package/dist/types/db.booking.d.ts.map +1 -0
- package/dist/types/db.booking.js +1 -0
- package/dist/types/db.customers.d.ts +14 -0
- package/dist/types/db.customers.d.ts.map +1 -0
- package/dist/types/db.customers.js +1 -0
- package/dist/types/db.d.ts +11 -0
- package/dist/types/db.d.ts.map +1 -0
- package/dist/types/db.directory.d.ts +38 -0
- package/dist/types/db.directory.d.ts.map +1 -0
- package/dist/types/db.directory.js +1 -0
- package/dist/types/db.emailFlow.d.ts +29 -0
- package/dist/types/db.emailFlow.d.ts.map +1 -0
- package/dist/types/db.emailFlow.js +1 -0
- package/dist/types/db.js +1 -0
- package/dist/types/db.mcpUserContext.d.ts +29 -0
- package/dist/types/db.mcpUserContext.d.ts.map +1 -0
- package/dist/types/db.mcpUserContext.js +1 -0
- package/dist/types/db.notification.d.ts +27 -0
- package/dist/types/db.notification.d.ts.map +1 -0
- package/dist/types/db.notification.js +1 -0
- package/dist/types/db.oauth.d.ts +55 -0
- package/dist/types/db.oauth.d.ts.map +1 -0
- package/dist/types/db.oauth.js +1 -0
- package/dist/types/db.partnerApiKey.d.ts +15 -0
- package/dist/types/db.partnerApiKey.d.ts.map +1 -0
- package/dist/types/db.partnerApiKey.js +1 -0
- package/dist/types/db.paymentPending.d.ts +16 -0
- package/dist/types/db.paymentPending.d.ts.map +1 -0
- package/dist/types/db.paymentPending.js +1 -0
- package/dist/types/db.service.d.ts +145 -0
- package/dist/types/db.service.d.ts.map +1 -0
- package/dist/types/db.service.js +12 -0
- package/dist/types/db.tax.d.ts.map +1 -0
- package/dist/types/db.tenant.d.ts +118 -0
- package/dist/types/db.tenant.d.ts.map +1 -0
- package/dist/types/db.tenant.js +1 -0
- package/dist/types/db.tenantGroupedStat.d.ts +13 -0
- package/dist/types/db.tenantGroupedStat.d.ts.map +1 -0
- package/dist/types/db.tenantGroupedStat.js +1 -0
- package/dist/types/db.user.d.ts +81 -0
- package/dist/types/db.user.d.ts.map +1 -0
- package/dist/types/db.user.js +4 -0
- package/dist/types/db.userConfirmation.d.ts +17 -0
- package/dist/types/db.userConfirmation.d.ts.map +1 -0
- package/dist/types/db.userConfirmation.js +1 -0
- package/dist/types/db.userLoginSession.d.ts +28 -0
- package/dist/types/db.userLoginSession.d.ts.map +1 -0
- package/dist/types/db.userLoginSession.js +1 -0
- package/dist/types/db.webhook.d.ts +16 -0
- package/dist/types/db.webhook.d.ts.map +1 -0
- package/dist/types/db.webhook.js +7 -0
- package/dist/types/discover.d.ts +45 -0
- package/dist/types/discover.d.ts.map +1 -0
- package/dist/types/discover.js +1 -0
- package/dist/types/errorCodes.d.ts +147 -0
- package/dist/types/errorCodes.d.ts.map +1 -0
- package/dist/types/errorCodes.js +147 -0
- package/dist/types/index.d.ts +84 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +28 -0
- package/dist/types/oauthScopes.d.ts +7 -0
- package/dist/types/oauthScopes.d.ts.map +1 -0
- package/dist/types/oauthScopes.js +28 -0
- package/dist/types/partnerDto.d.ts +69 -0
- package/dist/types/partnerDto.d.ts.map +1 -0
- package/dist/types/partnerDto.js +1 -0
- package/dist/types/pricing.d.ts +31 -0
- package/dist/types/pricing.d.ts.map +1 -0
- package/dist/types/pricing.js +1 -0
- package/dist/types/requestResponse.d.ts +93 -0
- package/dist/types/requestResponse.d.ts.map +1 -0
- package/dist/types/requestResponse.js +1 -0
- package/dist/types/subscription.d.ts +50 -0
- package/dist/types/subscription.d.ts.map +1 -0
- package/dist/types/subscription.js +1 -0
- package/dist/utils/bookingEmbed.d.ts +61 -0
- package/dist/utils/bookingEmbed.d.ts.map +1 -0
- package/dist/utils/bookingEmbed.js +161 -0
- package/dist/utils/bookingPageIcons.d.ts +160 -0
- package/dist/utils/bookingPageIcons.d.ts.map +1 -0
- package/dist/utils/bookingPageIcons.js +214 -0
- package/dist/utils/bookingProviders.d.ts +25 -0
- package/dist/utils/bookingProviders.d.ts.map +1 -0
- package/dist/utils/bookingProviders.js +23 -0
- package/dist/utils/currencies.d.ts +6 -0
- package/dist/utils/currencies.d.ts.map +1 -0
- package/dist/utils/currencies.js +145 -0
- package/dist/utils/dateTime.d.ts +57 -0
- package/dist/utils/dateTime.d.ts.map +1 -0
- package/dist/utils/dateTime.js +150 -0
- package/dist/utils/embedFrameLoader.d.ts +15 -0
- package/dist/utils/embedFrameLoader.d.ts.map +1 -0
- package/dist/utils/embedFrameLoader.js +70 -0
- package/dist/utils/extensionToContentType.d.ts +21 -0
- package/dist/utils/extensionToContentType.d.ts.map +1 -0
- package/dist/utils/extensionToContentType.js +20 -0
- package/dist/utils/generateUsername.d.ts.map +1 -0
- package/dist/utils/index.d.ts +26 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +45 -0
- package/dist/utils/random.d.ts +3 -0
- package/dist/utils/random.d.ts.map +1 -0
- package/dist/utils/random.js +8 -0
- package/dist/utils/serviceReminderLabels.d.ts +5 -0
- package/dist/utils/serviceReminderLabels.d.ts.map +1 -0
- package/dist/utils/serviceReminderLabels.js +18 -0
- package/dist/utils/tenantSlug.d.ts +7 -0
- package/dist/utils/tenantSlug.d.ts.map +1 -0
- package/dist/utils/tenantSlug.js +293 -0
- package/dist/utils/textSlug.d.ts +3 -0
- package/dist/utils/textSlug.d.ts.map +1 -0
- package/dist/utils/textSlug.js +10 -0
- package/dist/utils/timezone.d.ts +2 -0
- package/dist/utils/timezone.d.ts.map +1 -0
- package/dist/utils/timezone.js +93 -0
- package/dist/utils/ucfirst.d.ts +2 -0
- package/dist/utils/ucfirst.d.ts.map +1 -0
- package/dist/utils/ucfirst.js +5 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# @foxscheduling/shared
|
|
2
|
+
|
|
3
|
+
Shared utilities and interfaces for FoxScheduling backend and frontend.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
With npm workspaces (already configured in the root `package.json`):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# From project root
|
|
11
|
+
npm install
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Then add the dependency to your backend or frontend:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# In backend or frontend directory
|
|
18
|
+
npm install @foxscheduling/shared
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or add to `package.json`:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@foxscheduling/shared": "file:../shared-library"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
(Use `workspace:*` if using pnpm or yarn workspaces.)
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
// Import everything
|
|
37
|
+
import { formatCurrency, type CDKConfig, type DeploymentEnvironments } from "@foxscheduling/shared";
|
|
38
|
+
|
|
39
|
+
// Or import subpaths
|
|
40
|
+
import { formatCurrency } from "@foxscheduling/shared/utils";
|
|
41
|
+
import type { CDKConfig } from "@foxscheduling/shared/types";
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Development
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
cd src/v1/shared-library
|
|
48
|
+
npm run build # Build once
|
|
49
|
+
npm run dev # Watch mode
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Structure
|
|
53
|
+
|
|
54
|
+
- `src/types/` - Shared interfaces and type definitions
|
|
55
|
+
- `src/utils/` - Shared utility functions
|
|
56
|
+
- `src/index.ts` - Main entry point (re-exports all)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EMAIL_UNSUBSCRIBE_REASON_IDS = void 0;
|
|
4
|
+
/** Stable ids sent to the API when a user picks an unsubscribe reason. */
|
|
5
|
+
exports.EMAIL_UNSUBSCRIBE_REASON_IDS = [
|
|
6
|
+
"too_many_emails",
|
|
7
|
+
"not_relevant",
|
|
8
|
+
"never_signed_up",
|
|
9
|
+
"privacy_concerns",
|
|
10
|
+
"found_alternative",
|
|
11
|
+
"no_longer_using",
|
|
12
|
+
"other",
|
|
13
|
+
];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Stable ids sent to the API when a user picks an unsubscribe reason. */
|
|
2
|
+
export declare const EMAIL_UNSUBSCRIBE_REASON_IDS: readonly ["too_many_emails", "not_relevant", "never_signed_up", "privacy_concerns", "found_alternative", "no_longer_using", "other"];
|
|
3
|
+
export type EmailUnsubscribeReasonId = (typeof EMAIL_UNSUBSCRIBE_REASON_IDS)[number];
|
|
4
|
+
//# sourceMappingURL=emailUnsubscribeReasons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emailUnsubscribeReasons.d.ts","sourceRoot":"","sources":["../../../src/constants/emailUnsubscribeReasons.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,4BAA4B,sIAQ/B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @foxscheduling/shared
|
|
4
|
+
*
|
|
5
|
+
* Shared utilities and interfaces for FoxScheduling backend and frontend.
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
__exportStar(require("./types/index.cjs"), exports);
|
|
23
|
+
__exportStar(require("./utils/index.cjs"), exports);
|
|
24
|
+
__exportStar(require("./constants/emailUnsubscribeReasons.cjs"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @foxscheduling/shared
|
|
3
|
+
*
|
|
4
|
+
* Shared utilities and interfaces for FoxScheduling backend and frontend.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./types/index.js";
|
|
7
|
+
export * from "./utils/index.js";
|
|
8
|
+
export * from "./constants/emailUnsubscribeReasons.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wCAAwC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DBRecord } from "./db.js";
|
|
2
|
+
export interface TimeWindow {
|
|
3
|
+
open: string;
|
|
4
|
+
close: string;
|
|
5
|
+
}
|
|
6
|
+
/** For specific_dates: each date has its own schedule */
|
|
7
|
+
export interface SpecificDateEntry {
|
|
8
|
+
date: string;
|
|
9
|
+
schedule: TimeWindow;
|
|
10
|
+
}
|
|
11
|
+
/** Per-day schedule: each weekday has its own time windows */
|
|
12
|
+
export type WeeklySchedule = Record<number, TimeWindow[]>;
|
|
13
|
+
/** Block-off override for weekly: closed or custom hours on specific dates */
|
|
14
|
+
export interface BlockOffOverride {
|
|
15
|
+
date: string;
|
|
16
|
+
type: "closed" | "custom";
|
|
17
|
+
schedule?: TimeWindow;
|
|
18
|
+
}
|
|
19
|
+
export interface Availability extends DBRecord {
|
|
20
|
+
name: string;
|
|
21
|
+
recordType: "AVAILABILITY";
|
|
22
|
+
isDefault: boolean;
|
|
23
|
+
tenantId: string;
|
|
24
|
+
type: "weekly" | "specific_dates";
|
|
25
|
+
/** For weekly: per-day schedule (each day has own windows) */
|
|
26
|
+
days?: WeeklySchedule;
|
|
27
|
+
/** For weekly: block off specific dates (override) */
|
|
28
|
+
blockOffOverrides?: BlockOffOverride[];
|
|
29
|
+
/** For specific_dates type */
|
|
30
|
+
specificDates?: SpecificDateEntry[];
|
|
31
|
+
}
|
|
32
|
+
export declare const WEEKDAY_LABELS: Record<number, string>;
|
|
33
|
+
//# sourceMappingURL=db.availability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.availability.d.ts","sourceRoot":"","sources":["../../../src/types/db.availability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,yDAAyD;AACzD,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,CAAC;CACxB;AAED,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;AAE1D,8EAA8E;AAC9E,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,QAAQ,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,cAAc,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,QAAQ,GAAG,gBAAgB,CAAC;IAClC,8DAA8D;IAC9D,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,sDAAsD;IACtD,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACvC,8BAA8B;IAC9B,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACvC;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAQjD,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { DBRecord } from "./db.js";
|
|
2
|
+
import { DurationUnit, ServiceSlot } from "./db.service.js";
|
|
3
|
+
import type { Service, ServiceLocationType, ServiceReminderOffset } from "./db.service.js";
|
|
4
|
+
export type BookingActionRequired = "deposit" | "confirmation";
|
|
5
|
+
export interface BookingPaymentEntry {
|
|
6
|
+
id: string;
|
|
7
|
+
paid: boolean;
|
|
8
|
+
returnUrl?: string;
|
|
9
|
+
provider?: string;
|
|
10
|
+
stripePaymentIntentId?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Booking extends DBRecord {
|
|
13
|
+
name: string;
|
|
14
|
+
slug: string;
|
|
15
|
+
email: string;
|
|
16
|
+
/**
|
|
17
|
+
* The timezone of the booking. This is the timezone of the booking slot.
|
|
18
|
+
* This could be different from the tenant timezone.
|
|
19
|
+
*/
|
|
20
|
+
timezone: string;
|
|
21
|
+
tenantId: string;
|
|
22
|
+
duration: number;
|
|
23
|
+
serviceId: string;
|
|
24
|
+
eventDate: string;
|
|
25
|
+
/**
|
|
26
|
+
* The slot of the booking. This is the slot of the booking.
|
|
27
|
+
* This is in UTC.
|
|
28
|
+
*/
|
|
29
|
+
slot: ServiceSlot;
|
|
30
|
+
providerIds: string[];
|
|
31
|
+
customerId: string;
|
|
32
|
+
recordType: "BOOKING";
|
|
33
|
+
payments: {
|
|
34
|
+
full?: BookingPaymentEntry;
|
|
35
|
+
deposit?: BookingPaymentEntry;
|
|
36
|
+
reminder?: BookingPaymentEntry;
|
|
37
|
+
};
|
|
38
|
+
locationType: ServiceLocationType;
|
|
39
|
+
/** Google Meet or other video meeting URL when service uses google_meet */
|
|
40
|
+
meetingLink?: string;
|
|
41
|
+
meetingInPersonLocation?: string;
|
|
42
|
+
/** Google Calendar event id when `locationType` is google_meet (for attendee updates / cancel). */
|
|
43
|
+
googleCalendarEventId?: string;
|
|
44
|
+
/** Graph `onlineMeetings` id when `locationType` is microsoft_teams (for cancel/delete). */
|
|
45
|
+
microsoftOnlineMeetingId?: string;
|
|
46
|
+
/** Zoom meeting id when `locationType` is zoom (for cancel/delete). */
|
|
47
|
+
zoomMeetingId?: string;
|
|
48
|
+
reservedUntil?: string;
|
|
49
|
+
durationUnit: DurationUnit;
|
|
50
|
+
providerAutoAssigned: boolean;
|
|
51
|
+
actionsRequired: Array<BookingActionRequired>;
|
|
52
|
+
status: "booked" | "cancelled" | "pendingApproval" | "reserved";
|
|
53
|
+
cancelledByUserOrCustomerId?: string;
|
|
54
|
+
lastUpdatedByUserOrCustomerId?: string;
|
|
55
|
+
bookingCancellerType?: "customer" | "serviceProvider" | "system";
|
|
56
|
+
remindersSent?: Array<{
|
|
57
|
+
sentOn: string;
|
|
58
|
+
offset: ServiceReminderOffset;
|
|
59
|
+
}>;
|
|
60
|
+
questionAnswers?: Array<{
|
|
61
|
+
questionId: string;
|
|
62
|
+
question: string;
|
|
63
|
+
answer: string;
|
|
64
|
+
}>;
|
|
65
|
+
/** 1–5 star rating from the booker after the appointment (set once) */
|
|
66
|
+
customerRating?: number;
|
|
67
|
+
/** When the customer submitted their rating (ISO) */
|
|
68
|
+
customerRatedOn?: string;
|
|
69
|
+
/** Per email-flow template id → when that follow-up was sent (ISO) */
|
|
70
|
+
emailFlowSends?: Record<string, string>;
|
|
71
|
+
/**
|
|
72
|
+
* When staff triggered the no-show email flow for this booking (ISO).
|
|
73
|
+
* Used only with flowType `no_show` templates.
|
|
74
|
+
*/
|
|
75
|
+
noShowFlowTriggeredAt?: string;
|
|
76
|
+
}
|
|
77
|
+
/** Booking enriched with service and provider display info for list views */
|
|
78
|
+
export interface BookingWithDetails extends Booking {
|
|
79
|
+
serviceName?: string;
|
|
80
|
+
serviceIconId?: Service["iconId"];
|
|
81
|
+
/** Display names for each assigned provider (same order as `providerIds` / normalized assignees). */
|
|
82
|
+
providerNames?: string[];
|
|
83
|
+
/** Profile image URLs for each assigned provider (parallel to `providerNames`). */
|
|
84
|
+
providerPictureUrls?: (string | undefined)[];
|
|
85
|
+
/** For group bookings: number booked into this exact slot (same service + provider). */
|
|
86
|
+
slotBookedCount?: number;
|
|
87
|
+
/** For group bookings: max participants allowed for this slot. */
|
|
88
|
+
slotMaxParticipants?: number;
|
|
89
|
+
/** For group bookings: slotMaxParticipants - slotBookedCount. */
|
|
90
|
+
slotRemainingSeats?: number;
|
|
91
|
+
}
|
|
92
|
+
export interface BookingSummary {
|
|
93
|
+
id: string;
|
|
94
|
+
meetingLink?: string;
|
|
95
|
+
/** Copied from the booking so the success UI can show address vs link. */
|
|
96
|
+
locationType?: ServiceLocationType;
|
|
97
|
+
meetingInPersonLocation?: string;
|
|
98
|
+
status: Booking["status"];
|
|
99
|
+
actionsRequired: Array<BookingActionRequired>;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=db.booking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.booking.d.ts","sourceRoot":"","sources":["../../../src/types/db.booking.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DBRecord } from "./db.js";
|
|
2
|
+
export interface Customer extends DBRecord {
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
tenantId: string;
|
|
6
|
+
/**
|
|
7
|
+
* Customer ID on JASDK
|
|
8
|
+
*/
|
|
9
|
+
customerId?: string;
|
|
10
|
+
/** When true, this customer cannot book or reschedule via the public booking flow */
|
|
11
|
+
blacklisted?: boolean;
|
|
12
|
+
recordType: "CUSTOMER";
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=db.customers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.customers.d.ts","sourceRoot":"","sources":["../../../src/types/db.customers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,WAAW,QAAS,SAAQ,QAAQ;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,UAAU,CAAC;CAC1B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DBRecord {
|
|
2
|
+
id?: string;
|
|
3
|
+
ttl?: number;
|
|
4
|
+
sortKey?: string;
|
|
5
|
+
updatedOn?: string;
|
|
6
|
+
creationDate?: string;
|
|
7
|
+
schemaVersion?: string;
|
|
8
|
+
recordType?: DBRecordTypes;
|
|
9
|
+
}
|
|
10
|
+
export type DBRecordTypes = "TAX" | "USER" | "TENANT" | "BOOKING" | "SERVICE" | "CUSTOMER" | "DIRECTORY" | "EMAIL_FLOW" | "NOTIFICATION" | "AVAILABILITY" | "USER_CONFIRMATION" | "USER_LOGIN_SESSION" | "TENANT_GROUPED_STAT" | "MCP_USER_CONTEXT" | "PAYMENT_PENDING" | "OAUTH_CLIENT" | "OAUTH_CODE" | "OAUTH_REFRESH_TOKEN" | "OAUTH_CONSENT" | "WEBHOOK_SUBSCRIPTION" | "PARTNER_API_KEY";
|
|
11
|
+
//# sourceMappingURL=db.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../src/types/db.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,MAAM,aAAa,GACrB,KAAK,GACL,MAAM,GACN,QAAQ,GACR,SAAS,GACT,SAAS,GACT,UAAU,GACV,WAAW,GACX,YAAY,GACZ,cAAc,GACd,cAAc,GACd,mBAAmB,GACnB,oBAAoB,GACpB,qBAAqB,GACrB,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,YAAY,GACZ,qBAAqB,GACrB,eAAe,GACf,sBAAsB,GACtB,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DBRecord } from "./db.js";
|
|
2
|
+
import { DurationUnit, ServiceCategory, ServiceLocationType, ServiceRatingSummary } from "./db.service.js";
|
|
3
|
+
import type { DiscoverBusinessAddress } from "./discover.js";
|
|
4
|
+
import { BOOKING_PAGE_ICONS } from "../utils/bookingPageIcons.js";
|
|
5
|
+
export interface Directory extends DBRecord {
|
|
6
|
+
tenantId: string;
|
|
7
|
+
serviceId: string;
|
|
8
|
+
data: {
|
|
9
|
+
business: {
|
|
10
|
+
name: string;
|
|
11
|
+
logoUrl: string;
|
|
12
|
+
accentColor: string;
|
|
13
|
+
customColor?: string;
|
|
14
|
+
};
|
|
15
|
+
/** Optional for backward compatibility with existing records */
|
|
16
|
+
category?: ServiceCategory;
|
|
17
|
+
timezone: string;
|
|
18
|
+
duration: {
|
|
19
|
+
value: number;
|
|
20
|
+
unit: DurationUnit;
|
|
21
|
+
};
|
|
22
|
+
price: {
|
|
23
|
+
value: number;
|
|
24
|
+
currency: string;
|
|
25
|
+
};
|
|
26
|
+
url: string;
|
|
27
|
+
title: string;
|
|
28
|
+
description: string;
|
|
29
|
+
iconId: keyof typeof BOOKING_PAGE_ICONS;
|
|
30
|
+
/** Copied from service when ratings exist (for directory cards) */
|
|
31
|
+
rating?: ServiceRatingSummary;
|
|
32
|
+
locationType?: ServiceLocationType;
|
|
33
|
+
businessAddress?: DiscoverBusinessAddress;
|
|
34
|
+
tenantSlug?: string;
|
|
35
|
+
};
|
|
36
|
+
recordType: "DIRECTORY";
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=db.directory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.directory.d.ts","sourceRoot":"","sources":["../../../src/types/db.directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3G,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE;QACF,QAAQ,EAAE;YACN,IAAI,EAAE,MAAM,CAAC;YACb,OAAO,EAAE,MAAM,CAAC;YAChB,WAAW,EAAE,MAAM,CAAC;YACpB,WAAW,CAAC,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,gEAAgE;QAChE,QAAQ,CAAC,EAAE,eAAe,CAAC;QAC3B,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE;YACN,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,YAAY,CAAC;SACtB,CAAC;QACF,KAAK,EAAE;YACH,KAAK,EAAE,MAAM,CAAC;YACd,QAAQ,EAAE,MAAM,CAAC;SACpB,CAAC;QACF,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,OAAO,kBAAkB,CAAC;QACxC,mEAAmE;QACnE,MAAM,CAAC,EAAE,oBAAoB,CAAC;QAC9B,YAAY,CAAC,EAAE,mBAAmB,CAAC;QACnC,eAAe,CAAC,EAAE,uBAAuB,CAAC;QAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,UAAU,EAAE,WAAW,CAAC;CAC3B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DBRecord } from "./db.js";
|
|
2
|
+
export type EmailFlowType = "no_show" | "after_care";
|
|
3
|
+
/** API / UI shape for one configurable email automation template */
|
|
4
|
+
export interface EmailFlowTemplate {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
flowType: EmailFlowType;
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
subject: string;
|
|
10
|
+
bodyTemplate: string;
|
|
11
|
+
sendAfterMinutes: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Persisted email automation template (DynamoDB item).
|
|
15
|
+
*/
|
|
16
|
+
export interface EmailFlow extends DBRecord {
|
|
17
|
+
recordType: "EMAIL_FLOW";
|
|
18
|
+
tenantId: string;
|
|
19
|
+
id: string;
|
|
20
|
+
/** Label for the dashboard list only */
|
|
21
|
+
name: string;
|
|
22
|
+
flowType: EmailFlowType;
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
subject: string;
|
|
25
|
+
/** HTML body with Handlebars variables */
|
|
26
|
+
bodyTemplate: string;
|
|
27
|
+
sendAfterMinutes: number;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=db.emailFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.emailFlow.d.ts","sourceRoot":"","sources":["../../../src/types/db.emailFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;AAErD,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACvC,UAAU,EAAE,YAAY,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DBRecord } from "./db.js";
|
|
2
|
+
export interface McpRecentBooking {
|
|
3
|
+
tenantId: string;
|
|
4
|
+
serviceId: string;
|
|
5
|
+
businessName: string;
|
|
6
|
+
serviceTitle: string;
|
|
7
|
+
bookedAt: string;
|
|
8
|
+
}
|
|
9
|
+
export interface McpUserLocation {
|
|
10
|
+
lat?: number;
|
|
11
|
+
lng?: number;
|
|
12
|
+
city?: string;
|
|
13
|
+
state?: string;
|
|
14
|
+
country?: string;
|
|
15
|
+
timezone?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface McpUserContext extends DBRecord {
|
|
18
|
+
recordType: "MCP_USER_CONTEXT";
|
|
19
|
+
/** Normalized email (lowercase trim) */
|
|
20
|
+
email: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
defaultLocation?: McpUserLocation;
|
|
23
|
+
/** Boost only on discover — not a scope lock */
|
|
24
|
+
savedTenantId?: string;
|
|
25
|
+
savedServiceId?: string;
|
|
26
|
+
recentBookings?: McpRecentBooking[];
|
|
27
|
+
linkedAt: string;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=db.mcpUserContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.mcpUserContext.d.ts","sourceRoot":"","sources":["../../../src/types/db.mcpUserContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC5C,UAAU,EAAE,kBAAkB,CAAC;IAC/B,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACpC,QAAQ,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DBRecord } from "./db.js";
|
|
2
|
+
export type NotificationType = "newBookingConfirmed" | "bookingCancelled" | "bookingPendingApproval" | "bookingReserved" | "bookingDeleted" | "bookingReminder" | "bookingUpdated" | "integrationDisconnected";
|
|
3
|
+
export type IntegrationDisconnectReason = "oauth_revoked" | "user_disconnect";
|
|
4
|
+
export type IntegrationNotificationKey = "google" | "microsoft" | "zoom";
|
|
5
|
+
export interface Notification extends DBRecord {
|
|
6
|
+
recordType: "NOTIFICATION";
|
|
7
|
+
tenantId: string;
|
|
8
|
+
userId: string;
|
|
9
|
+
type: NotificationType;
|
|
10
|
+
status: "read" | "unread";
|
|
11
|
+
sendEmail: boolean;
|
|
12
|
+
group: "notification" | "announcement";
|
|
13
|
+
titleKey: string;
|
|
14
|
+
messageKey: string;
|
|
15
|
+
actionUrl?: string;
|
|
16
|
+
actionLabelKey?: string;
|
|
17
|
+
bookingSortKey?: string;
|
|
18
|
+
serviceId?: string;
|
|
19
|
+
customerId?: string;
|
|
20
|
+
serviceProviderId?: string;
|
|
21
|
+
priority?: "info" | "low" | "medium" | "high";
|
|
22
|
+
readOn?: string;
|
|
23
|
+
expiresOn?: string;
|
|
24
|
+
metadata: Record<string, string | number | boolean>;
|
|
25
|
+
groupReminderSentAt?: string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=db.notification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.notification.d.ts","sourceRoot":"","sources":["../../../src/types/db.notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC,MAAM,MAAM,gBAAgB,GACtB,qBAAqB,GACrB,kBAAkB,GAClB,wBAAwB,GACxB,iBAAiB,GACjB,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,yBAAyB,CAAC;AAEhC,MAAM,MAAM,2BAA2B,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAC9E,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,CAAC;AAEzE,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC1C,UAAU,EAAE,cAAc,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IAGf,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IAEnB,KAAK,EAAE,cAAc,GAAG,cAAc,CAAC;IAGvC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IAGnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IAGxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IAInB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IAEpD,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { DBRecord } from "./db.js";
|
|
2
|
+
import type { OAuthScope } from "./oauthScopes.js";
|
|
3
|
+
export interface OAuthClient extends DBRecord {
|
|
4
|
+
recordType: "OAUTH_CLIENT";
|
|
5
|
+
id: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
clientSecretHash: string;
|
|
9
|
+
redirectUris: string[];
|
|
10
|
+
allowedScopes: OAuthScope[];
|
|
11
|
+
}
|
|
12
|
+
export interface OAuthConsent extends DBRecord {
|
|
13
|
+
recordType: "OAUTH_CONSENT";
|
|
14
|
+
id: string;
|
|
15
|
+
userId: string;
|
|
16
|
+
clientId: string;
|
|
17
|
+
tenantId: string;
|
|
18
|
+
scopes: OAuthScope[];
|
|
19
|
+
grantedAt: string;
|
|
20
|
+
}
|
|
21
|
+
export interface OAuthAuthorizationCode extends DBRecord {
|
|
22
|
+
recordType: "OAUTH_CODE";
|
|
23
|
+
id: string;
|
|
24
|
+
code: string;
|
|
25
|
+
userId: string;
|
|
26
|
+
clientId: string;
|
|
27
|
+
tenantId: string;
|
|
28
|
+
scopes: OAuthScope[];
|
|
29
|
+
redirectUri: string;
|
|
30
|
+
codeChallenge: string;
|
|
31
|
+
codeChallengeMethod: "S256";
|
|
32
|
+
expiresAt: string;
|
|
33
|
+
}
|
|
34
|
+
export interface OAuthRefreshToken extends DBRecord {
|
|
35
|
+
recordType: "OAUTH_REFRESH_TOKEN";
|
|
36
|
+
id: string;
|
|
37
|
+
tokenHash: string;
|
|
38
|
+
userId: string;
|
|
39
|
+
clientId: string;
|
|
40
|
+
tenantId: string;
|
|
41
|
+
scopes: OAuthScope[];
|
|
42
|
+
expiresAt: string;
|
|
43
|
+
}
|
|
44
|
+
export interface PartnerAccessTokenClaims {
|
|
45
|
+
sub: string;
|
|
46
|
+
client_id: string;
|
|
47
|
+
tenant_id: string;
|
|
48
|
+
scope: string;
|
|
49
|
+
aud: string;
|
|
50
|
+
iss: string;
|
|
51
|
+
exp: number;
|
|
52
|
+
iat: number;
|
|
53
|
+
jti: string;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=db.oauth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.oauth.d.ts","sourceRoot":"","sources":["../../../src/types/db.oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,WAAY,SAAQ,QAAQ;IAC3C,UAAU,EAAE,cAAc,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,UAAU,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,YAAa,SAAQ,QAAQ;IAC5C,UAAU,EAAE,eAAe,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAuB,SAAQ,QAAQ;IACtD,UAAU,EAAE,YAAY,CAAC;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,QAAQ;IACjD,UAAU,EAAE,qBAAqB,CAAC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DBRecord } from "./db.js";
|
|
2
|
+
import type { OAuthScope } from "./oauthScopes.js";
|
|
3
|
+
export interface PartnerApiKey extends DBRecord {
|
|
4
|
+
recordType: "PARTNER_API_KEY";
|
|
5
|
+
id: string;
|
|
6
|
+
tenantId: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
name: string;
|
|
9
|
+
keyPrefix: string;
|
|
10
|
+
keyHash: string;
|
|
11
|
+
allowedScopes: OAuthScope[];
|
|
12
|
+
lastUsedAt?: string;
|
|
13
|
+
revokedAt?: string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=db.partnerApiKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.partnerApiKey.d.ts","sourceRoot":"","sources":["../../../src/types/db.partnerApiKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,aAAc,SAAQ,QAAQ;IAC7C,UAAU,EAAE,iBAAiB,CAAC;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,UAAU,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DBRecord } from "./db.js";
|
|
2
|
+
import type { Booking } from "./db.booking.js";
|
|
3
|
+
/** Short-lived lookup for payment provider return URLs (Paystack reference, Stripe payment_intent). */
|
|
4
|
+
export interface PaymentPending extends DBRecord {
|
|
5
|
+
recordType: "PAYMENT_PENDING";
|
|
6
|
+
tenantId: string;
|
|
7
|
+
bookingId: string;
|
|
8
|
+
serviceId: string;
|
|
9
|
+
customerId: string;
|
|
10
|
+
type: keyof Booking["payments"];
|
|
11
|
+
provider: string;
|
|
12
|
+
/** Primary payment attempt id (Paystack reference / JASDK attempt id). */
|
|
13
|
+
paymentAttemptId: string;
|
|
14
|
+
returnUrl: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=db.paymentPending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db.paymentPending.d.ts","sourceRoot":"","sources":["../../../src/types/db.paymentPending.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,uGAAuG;AACvG,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC5C,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SERVICE_REMINDER_OFFSETS = void 0;
|
|
4
|
+
/** All valid reminder lead times before the appointment (relative to start) */
|
|
5
|
+
exports.SERVICE_REMINDER_OFFSETS = [
|
|
6
|
+
"15_minutes",
|
|
7
|
+
"30_minutes",
|
|
8
|
+
"1_hour",
|
|
9
|
+
"3_hours",
|
|
10
|
+
"6_hours",
|
|
11
|
+
"12_hours",
|
|
12
|
+
"1_day",
|
|
13
|
+
"1_week",
|
|
14
|
+
"1_month",
|
|
15
|
+
];
|