me3-protocol 2.4.0 → 2.5.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/dist/index.d.ts +18 -0
- package/dist/index.js +52 -0
- package/package.json +1 -1
- package/schema.json +44 -0
package/dist/index.d.ts
CHANGED
|
@@ -91,6 +91,22 @@ export interface Me3BookingAvailability {
|
|
|
91
91
|
sunday?: string[];
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Booking pricing configuration.
|
|
96
|
+
* Allows hosts to charge for meetings with a sliding scale pay-what-you-want model.
|
|
97
|
+
*/
|
|
98
|
+
export interface Me3BookingPricing {
|
|
99
|
+
/** Whether paid meetings are enabled */
|
|
100
|
+
enabled: boolean;
|
|
101
|
+
/** Suggested price amount in dollars (e.g., 50 for $50) */
|
|
102
|
+
suggestedAmount: number;
|
|
103
|
+
/** Currency code */
|
|
104
|
+
currency: "USD" | "GBP" | "EUR";
|
|
105
|
+
/** Minimum amount bookers can pay (always $5) */
|
|
106
|
+
minimumAmount: 5;
|
|
107
|
+
/** Whether to allow free meetings alongside paid ones */
|
|
108
|
+
allowFree: boolean;
|
|
109
|
+
}
|
|
94
110
|
/**
|
|
95
111
|
* Booking/scheduling intent.
|
|
96
112
|
* Declares that the person accepts meeting bookings.
|
|
@@ -110,6 +126,8 @@ export interface Me3IntentBook {
|
|
|
110
126
|
url?: string;
|
|
111
127
|
/** Availability windows - for native me3 booking */
|
|
112
128
|
availability?: Me3BookingAvailability;
|
|
129
|
+
/** Pricing configuration for paid meetings (optional) */
|
|
130
|
+
pricing?: Me3BookingPricing;
|
|
113
131
|
}
|
|
114
132
|
/**
|
|
115
133
|
* Intents object - declares what actions visitors/agents can take.
|
package/dist/index.js
CHANGED
|
@@ -534,6 +534,58 @@ function validateProfile(data) {
|
|
|
534
534
|
message: "Book intent requires either a URL (for external booking) or availability (for native booking)",
|
|
535
535
|
});
|
|
536
536
|
}
|
|
537
|
+
// Validate pricing if present
|
|
538
|
+
if (book.pricing !== undefined) {
|
|
539
|
+
if (typeof book.pricing !== "object" || book.pricing === null) {
|
|
540
|
+
errors.push({
|
|
541
|
+
field: "intents.book.pricing",
|
|
542
|
+
message: "Book pricing must be an object",
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
else {
|
|
546
|
+
const pricing = book.pricing;
|
|
547
|
+
if (typeof pricing.enabled !== "boolean") {
|
|
548
|
+
errors.push({
|
|
549
|
+
field: "intents.book.pricing.enabled",
|
|
550
|
+
message: "Pricing enabled must be a boolean",
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
if (pricing.enabled) {
|
|
554
|
+
if (typeof pricing.suggestedAmount !== "number") {
|
|
555
|
+
errors.push({
|
|
556
|
+
field: "intents.book.pricing.suggestedAmount",
|
|
557
|
+
message: "Suggested amount must be a number",
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
else if (pricing.suggestedAmount < 5) {
|
|
561
|
+
errors.push({
|
|
562
|
+
field: "intents.book.pricing.suggestedAmount",
|
|
563
|
+
message: "Suggested amount must be at least $5",
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
const validCurrencies = ["USD", "GBP", "EUR"];
|
|
567
|
+
if (typeof pricing.currency !== "string" ||
|
|
568
|
+
!validCurrencies.includes(pricing.currency)) {
|
|
569
|
+
errors.push({
|
|
570
|
+
field: "intents.book.pricing.currency",
|
|
571
|
+
message: `Currency must be one of: ${validCurrencies.join(", ")}`,
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
if (pricing.minimumAmount !== 5) {
|
|
575
|
+
errors.push({
|
|
576
|
+
field: "intents.book.pricing.minimumAmount",
|
|
577
|
+
message: "Minimum amount must be 5",
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
if (typeof pricing.allowFree !== "boolean") {
|
|
581
|
+
errors.push({
|
|
582
|
+
field: "intents.book.pricing.allowFree",
|
|
583
|
+
message: "Allow free must be a boolean",
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
537
589
|
}
|
|
538
590
|
}
|
|
539
591
|
}
|
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -66,6 +66,46 @@
|
|
|
66
66
|
],
|
|
67
67
|
"type": "object"
|
|
68
68
|
},
|
|
69
|
+
"Me3BookingPricing": {
|
|
70
|
+
"additionalProperties": false,
|
|
71
|
+
"description": "Booking pricing configuration. Allows hosts to charge for meetings with a sliding scale pay-what-you-want model.",
|
|
72
|
+
"properties": {
|
|
73
|
+
"allowFree": {
|
|
74
|
+
"description": "Whether to allow free meetings alongside paid ones",
|
|
75
|
+
"type": "boolean"
|
|
76
|
+
},
|
|
77
|
+
"currency": {
|
|
78
|
+
"description": "Currency code",
|
|
79
|
+
"enum": [
|
|
80
|
+
"USD",
|
|
81
|
+
"GBP",
|
|
82
|
+
"EUR"
|
|
83
|
+
],
|
|
84
|
+
"type": "string"
|
|
85
|
+
},
|
|
86
|
+
"enabled": {
|
|
87
|
+
"description": "Whether paid meetings are enabled",
|
|
88
|
+
"type": "boolean"
|
|
89
|
+
},
|
|
90
|
+
"minimumAmount": {
|
|
91
|
+
"const": 5,
|
|
92
|
+
"description": "Minimum amount bookers can pay (always $5)",
|
|
93
|
+
"type": "number"
|
|
94
|
+
},
|
|
95
|
+
"suggestedAmount": {
|
|
96
|
+
"description": "Suggested price amount in dollars (e.g., 50 for $50)",
|
|
97
|
+
"type": "number"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"required": [
|
|
101
|
+
"enabled",
|
|
102
|
+
"suggestedAmount",
|
|
103
|
+
"currency",
|
|
104
|
+
"minimumAmount",
|
|
105
|
+
"allowFree"
|
|
106
|
+
],
|
|
107
|
+
"type": "object"
|
|
108
|
+
},
|
|
69
109
|
"Me3Button": {
|
|
70
110
|
"additionalProperties": false,
|
|
71
111
|
"properties": {
|
|
@@ -149,6 +189,10 @@
|
|
|
149
189
|
"description": "Whether booking is enabled",
|
|
150
190
|
"type": "boolean"
|
|
151
191
|
},
|
|
192
|
+
"pricing": {
|
|
193
|
+
"$ref": "#/definitions/Me3BookingPricing",
|
|
194
|
+
"description": "Pricing configuration for paid meetings (optional)"
|
|
195
|
+
},
|
|
152
196
|
"provider": {
|
|
153
197
|
"description": "Booking provider (e.g., \"cal.com\", \"calendly\") - for external providers",
|
|
154
198
|
"type": "string"
|