me3-protocol 2.4.0 → 2.6.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 CHANGED
@@ -59,6 +59,14 @@ export interface Me3Footer {
59
59
  /** Optional custom footer link */
60
60
  link?: Me3FooterLink;
61
61
  }
62
+ export interface Me3Verification {
63
+ /** Whether the author is a verified human */
64
+ verified: boolean;
65
+ /** The domain used for verification */
66
+ verifiedDomain?: string;
67
+ /** When verification occurred (ISO timestamp) */
68
+ verifiedAt?: string;
69
+ }
62
70
  /**
63
71
  * Newsletter subscription intent.
64
72
  * When enabled, the site accepts email subscriptions via POST /api/subscribe
@@ -91,6 +99,22 @@ export interface Me3BookingAvailability {
91
99
  sunday?: string[];
92
100
  };
93
101
  }
102
+ /**
103
+ * Booking pricing configuration.
104
+ * Allows hosts to charge for meetings with a sliding scale pay-what-you-want model.
105
+ */
106
+ export interface Me3BookingPricing {
107
+ /** Whether paid meetings are enabled */
108
+ enabled: boolean;
109
+ /** Suggested price amount in dollars (e.g., 50 for $50) */
110
+ suggestedAmount: number;
111
+ /** Currency code */
112
+ currency: "USD" | "GBP" | "EUR";
113
+ /** Minimum amount bookers can pay (always $5) */
114
+ minimumAmount: 5;
115
+ /** Whether to allow free meetings alongside paid ones */
116
+ allowFree: boolean;
117
+ }
94
118
  /**
95
119
  * Booking/scheduling intent.
96
120
  * Declares that the person accepts meeting bookings.
@@ -110,6 +134,8 @@ export interface Me3IntentBook {
110
134
  url?: string;
111
135
  /** Availability windows - for native me3 booking */
112
136
  availability?: Me3BookingAvailability;
137
+ /** Pricing configuration for paid meetings (optional) */
138
+ pricing?: Me3BookingPricing;
113
139
  }
114
140
  /**
115
141
  * Intents object - declares what actions visitors/agents can take.
@@ -155,6 +181,10 @@ export interface Me3Profile {
155
181
  * This is the API contract for interacting with the person.
156
182
  */
157
183
  intents?: Me3Intents;
184
+ /**
185
+ * Human verification status (populated from account, not editable per-site)
186
+ */
187
+ verification?: Me3Verification;
158
188
  }
159
189
  export interface ValidationError {
160
190
  field: string;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "me3-protocol",
3
- "version": "2.4.0",
3
+ "version": "2.6.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
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"
@@ -381,6 +425,10 @@
381
425
  },
382
426
  "type": "array"
383
427
  },
428
+ "verification": {
429
+ "$ref": "#/definitions/Me3Verification",
430
+ "description": "Human verification status (populated from account, not editable per-site)"
431
+ },
384
432
  "version": {
385
433
  "description": "Protocol version",
386
434
  "type": "string"
@@ -391,6 +439,27 @@
391
439
  "name"
392
440
  ],
393
441
  "type": "object"
442
+ },
443
+ "Me3Verification": {
444
+ "additionalProperties": false,
445
+ "properties": {
446
+ "verified": {
447
+ "description": "Whether the author is a verified human",
448
+ "type": "boolean"
449
+ },
450
+ "verifiedAt": {
451
+ "description": "When verification occurred (ISO timestamp)",
452
+ "type": "string"
453
+ },
454
+ "verifiedDomain": {
455
+ "description": "The domain used for verification",
456
+ "type": "string"
457
+ }
458
+ },
459
+ "required": [
460
+ "verified"
461
+ ],
462
+ "type": "object"
394
463
  }
395
464
  }
396
465
  }