feat: v2 and atoms attendee defined meeting locations (#17224)

* request: allow saving attendee address, location and custom location

* response: return new event type locations

* atoms: make elsewhere location work

* update swagger

* chore: update and use platform libraries

* fix schema

* republish libraries

* update lock file

* fix: make somewhereElse optional in response location

* fix: tests
This commit is contained in:
Lauris Skraucis authored and GitHub committed 2024-10-22 13:24:16 +00:00
1 parent de80ca2aaa
commit b768cc5b44
15 files changed
+331 -31

No files matched your search

+3
View File
@@ -1,3 +1,6 @@
## 0.0.51
Released to support PR https://github.com/calcom/cal.com/pull/17224 which enabled attendee specified location during booking.
## 0.0.41
Released to support handle cancel booking passing oauth client id to webhooks.
@@ -55,6 +55,9 @@ import { Disabled_2024_06_14 } from "./disabled.input";
import { EventTypeColor_2024_06_14 } from "./event-type-color.input";
import {
AddressLocation_2024_06_14,
AttendeeAddressLocation_2024_06_14,
AttendeeDefinedLocation_2024_06_14,
AttendeePhoneLocation_2024_06_14,
IntegrationLocation_2024_06_14,
LinkLocation_2024_06_14,
PhoneLocation_2024_06_14,
@@ -94,7 +97,10 @@ export const CREATE_EVENT_SLUG_EXAMPLE = "learn-the-secrets-of-masterchief";
BaseBookingLimitsDuration_2024_06_14,
Recurrence_2024_06_14,
BaseConfirmationPolicy_2024_06_14,
Seats_2024_06_14
Seats_2024_06_14,
AttendeeAddressLocation_2024_06_14,
AttendeePhoneLocation_2024_06_14,
AttendeeDefinedLocation_2024_06_14
)
export class CreateEventTypeInput_2024_06_14 {
@IsInt()
@@ -125,6 +131,9 @@ export class CreateEventTypeInput_2024_06_14 {
{ $ref: getSchemaPath(LinkLocation_2024_06_14) },
{ $ref: getSchemaPath(IntegrationLocation_2024_06_14) },
{ $ref: getSchemaPath(PhoneLocation_2024_06_14) },
{ $ref: getSchemaPath(AttendeeAddressLocation_2024_06_14) },
{ $ref: getSchemaPath(AttendeePhoneLocation_2024_06_14) },
{ $ref: getSchemaPath(AttendeeDefinedLocation_2024_06_14) },
],
type: "array",
})
@@ -5,7 +5,15 @@ import { IsString, IsUrl, IsIn, IsPhoneNumber, IsBoolean } from "class-validator
import type { ValidationOptions, ValidatorConstraintInterface } from "class-validator";
import { registerDecorator, validate, ValidatorConstraint } from "class-validator";
const locations = ["address", "link", "integration", "phone"] as const;
const locations = [
"address",
"link",
"integration",
"phone",
"attendeeAddress",
"attendeePhone",
"attendeeDefined",
] as const;
export class AddressLocation_2024_06_14 {
@IsIn(locations)
@@ -62,11 +70,37 @@ export class PhoneLocation_2024_06_14 {
public!: boolean;
}
export class AttendeeAddressLocation_2024_06_14 {
@IsIn(locations)
@DocsProperty({
example: "attendeeAddress",
description: "only allowed value for type is `attendeeAddress`",
})
type!: "attendeeAddress";
}
export class AttendeePhoneLocation_2024_06_14 {
@IsIn(locations)
@DocsProperty({ example: "attendeePhone", description: "only allowed value for type is `attendeePhone`" })
type!: "attendeePhone";
}
export class AttendeeDefinedLocation_2024_06_14 {
@IsIn(locations)
@DocsProperty({
example: "attendeeDefined",
description: "only allowed value for type is `attendeeDefined`",
})
type!: "attendeeDefined";
}
export type Location_2024_06_14 =
| AddressLocation_2024_06_14
| LinkLocation_2024_06_14
| IntegrationLocation_2024_06_14
| PhoneLocation_2024_06_14;
| PhoneLocation_2024_06_14
| AttendeeAddressLocation_2024_06_14
| AttendeePhoneLocation_2024_06_14
| AttendeeDefinedLocation_2024_06_14;
@ValidatorConstraint({ async: true })
class LocationValidator_2024_06_14 implements ValidatorConstraintInterface {
@@ -75,6 +109,9 @@ class LocationValidator_2024_06_14 implements ValidatorConstraintInterface {
link: LinkLocation_2024_06_14,
integration: IntegrationLocation_2024_06_14,
phone: PhoneLocation_2024_06_14,
attendeePhone: AttendeePhoneLocation_2024_06_14,
attendeeAddress: AttendeeAddressLocation_2024_06_14,
attendeeDefined: AttendeeDefinedLocation_2024_06_14,
};
async validate(locations: { type: string }[]) {
@@ -51,6 +51,9 @@ import { Disabled_2024_06_14 } from "./disabled.input";
import { EventTypeColor_2024_06_14 } from "./event-type-color.input";
import {
AddressLocation_2024_06_14,
AttendeeAddressLocation_2024_06_14,
AttendeeDefinedLocation_2024_06_14,
AttendeePhoneLocation_2024_06_14,
IntegrationLocation_2024_06_14,
LinkLocation_2024_06_14,
PhoneLocation_2024_06_14,
@@ -84,7 +87,10 @@ import { Seats_2024_06_14 } from "./seats.input";
BaseBookingLimitsDuration_2024_06_14,
Recurrence_2024_06_14,
BaseConfirmationPolicy_2024_06_14,
Seats_2024_06_14
Seats_2024_06_14,
AttendeeAddressLocation_2024_06_14,
AttendeePhoneLocation_2024_06_14,
AttendeeDefinedLocation_2024_06_14
)
export class UpdateEventTypeInput_2024_06_14 {
@IsOptional()
@@ -118,6 +124,9 @@ export class UpdateEventTypeInput_2024_06_14 {
{ $ref: getSchemaPath(LinkLocation_2024_06_14) },
{ $ref: getSchemaPath(IntegrationLocation_2024_06_14) },
{ $ref: getSchemaPath(PhoneLocation_2024_06_14) },
{ $ref: getSchemaPath(AttendeeAddressLocation_2024_06_14) },
{ $ref: getSchemaPath(AttendeePhoneLocation_2024_06_14) },
{ $ref: getSchemaPath(AttendeeDefinedLocation_2024_06_14) },
],
type: "array",
})
@@ -85,6 +85,8 @@ export class LocationDefaultFieldOutput_2024_06_14 {
@IsString()
@DocsProperty({
default: "location",
description:
"This booking field is returned only if the event type has more than one location. The purpose of this field is to allow the user to select the location where the event will take place.",
})
slug!: "location";