heartraite 1.0.224 → 1.0.226
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/enum/cloudfunction.enum.d.ts +1 -0
- package/dist/enum/cloudfunction.enum.js +1 -0
- package/dist/types/cloud-function-types.d.ts +6 -2
- package/dist/types/event-showcase.types.d.ts +17 -0
- package/dist/types/event-showcase.types.js +2 -0
- package/dist/types/event.types.d.ts +4 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/request.types.d.ts +1 -0
- package/dist/types/response.types.d.ts +2 -0
- package/package.json +1 -1
- package/src/enum/cloudfunction.enum.ts +1 -0
- package/src/types/cloud-function-types.ts +6 -0
- package/src/types/event-showcase.types.ts +19 -0
- package/src/types/event.types.ts +4 -0
- package/src/types/index.ts +1 -0
- package/src/types/request.types.ts +1 -0
- package/src/types/response.types.ts +2 -0
- package/dist/types/ticket.types.test.d.ts +0 -1
- package/dist/types/ticket.types.test.js +0 -37
- package/src/types/ticket.types.test.ts +0 -66
|
@@ -21,6 +21,7 @@ export declare enum CloudFunction {
|
|
|
21
21
|
CREATE_CHECKOUT = "ticket/create-checkout",
|
|
22
22
|
CONFIRM_ORDER = "ticket/confirm",
|
|
23
23
|
ABANDON_ORDER = "ticket/abandon",
|
|
24
|
+
GET_EVENT_SHOWCASE = "event/get-event-showcase",
|
|
24
25
|
SUBMIT_CATEGORY_FEEDBACK = "ca/submit-category-feedback",
|
|
25
26
|
CREATE_LIKE = "like/create-like",
|
|
26
27
|
HANDLE_LIKE_SEEN = "like/handle-like-seen",
|
|
@@ -25,6 +25,7 @@ var CloudFunction;
|
|
|
25
25
|
CloudFunction["CREATE_CHECKOUT"] = "ticket/create-checkout";
|
|
26
26
|
CloudFunction["CONFIRM_ORDER"] = "ticket/confirm";
|
|
27
27
|
CloudFunction["ABANDON_ORDER"] = "ticket/abandon";
|
|
28
|
+
CloudFunction["GET_EVENT_SHOWCASE"] = "event/get-event-showcase";
|
|
28
29
|
CloudFunction["SUBMIT_CATEGORY_FEEDBACK"] = "ca/submit-category-feedback";
|
|
29
30
|
CloudFunction["CREATE_LIKE"] = "like/create-like";
|
|
30
31
|
CloudFunction["HANDLE_LIKE_SEEN"] = "like/handle-like-seen";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CloudFunction } from "../enum";
|
|
2
|
-
import { AddImagesRequest, AuthenticateBankIDRequest, CollectBankIDRequest, CreateLikeRequest, CreatePLSInputRequest, CreatePLSSubmissionRequest, CreateReportRequest, DeleteUserRequest, GetCARequest, GetMatchableUserRequest, GetMatchCheckRequest, GetMatchesRequest, GetAdvancedMatchRequest, GetMessagesRequest, GetPLSSubmissionRequest, GetSelfAwarenessRequest, GetUserRequest, HandleLastMessageSeenRequest, HandleLikeSeenRequest, HandleMatchSeenRequest, RegisterOnboardingRequest, RegisterUserRequest, RemoveMatchRequest, SendMessageRequest, SubmitAnswerRequest, SubmitCategoryFeedbackRequest, SubmitPLSCategoryFeedbackRequest, SubmitPLSDemographicsRequest, UpdatePLSAnswerRequest, UpdateQuestionsRequest, UpdateUserRequest, SubmitFeedbackRequest, ExpressConsultationInterestRequest, GetMyConsultationInterestRequest, GetConsultationInterestsRequest, UpdateConsultationInterestRequest, SyncAffiliateRequest, JoinEventRequest, GetEventRequest, GetEventMatchRequest, SendEventFeedbackRequest, GetEventParticipantsRequest, GetPublicEventsRequest, SetEventInterestRequest, CreateCheckoutRequest, ConfirmOrderRequest, AbandonOrderRequest } from "./request.types";
|
|
3
|
-
import { AddImagesResponse, AuthenticateBankIDResponse, CollectBankIDResponse, CreateLikeResponse, CreatePLSInputResponse, CreatePLSSubmissionResponse, CreateReportResponse, DeleteUserResponse, GetCAResponse, GetMatchableUserResponse, GetMatchableUsersResponse, GetMatchCheckResponse, GetMatchesResponse, GetAdvancedMatchResponse, GetMessagesResponse, GetPLSSubmissionResponse, GetSelfAwarenessReponse, GetUserResponse, HandleLastMessageSeenResponse, HandleLikeSeenResponse, HandleMatchSeenResponse, RegisterOnboardingResponse, RegisterUserResponse, RemoveMatchResponse, SendMessageResponse, SubmitAnswerResponse, SubmitCategoryFeedbackResponse, SubmitPLSCategoryFeedbackResponse, SubmitPLSDemographicsResponse, UpdatePLSAnswerResponse, UpdateQuestionsResponse, UpdateUserResponse, SubmitFeedbackResponse, ExpressConsultationInterestResponse, GetMyConsultationInterestResponse, GetConsultationInterestsResponse, UpdateConsultationInterestResponse, SyncAffiliateResponse, GetUserEventsResponse, JoinEventResponse, GetEventResponse, GetEventMatchResponse, SendEventFeedbackResponse, GetEventParticipantsResponse, GetPublicEventsResponse, SetEventInterestResponse, CreateCheckoutResponse, ConfirmOrderResponse, AbandonOrderResponse } from "./response.types";
|
|
2
|
+
import { AddImagesRequest, AuthenticateBankIDRequest, CollectBankIDRequest, CreateLikeRequest, CreatePLSInputRequest, CreatePLSSubmissionRequest, CreateReportRequest, DeleteUserRequest, GetCARequest, GetMatchableUserRequest, GetMatchCheckRequest, GetMatchesRequest, GetAdvancedMatchRequest, GetMessagesRequest, GetPLSSubmissionRequest, GetSelfAwarenessRequest, GetUserRequest, HandleLastMessageSeenRequest, HandleLikeSeenRequest, HandleMatchSeenRequest, RegisterOnboardingRequest, RegisterUserRequest, RemoveMatchRequest, SendMessageRequest, SubmitAnswerRequest, SubmitCategoryFeedbackRequest, SubmitPLSCategoryFeedbackRequest, SubmitPLSDemographicsRequest, UpdatePLSAnswerRequest, UpdateQuestionsRequest, UpdateUserRequest, SubmitFeedbackRequest, ExpressConsultationInterestRequest, GetMyConsultationInterestRequest, GetConsultationInterestsRequest, UpdateConsultationInterestRequest, SyncAffiliateRequest, JoinEventRequest, GetEventRequest, GetEventMatchRequest, SendEventFeedbackRequest, GetEventParticipantsRequest, GetPublicEventsRequest, SetEventInterestRequest, CreateCheckoutRequest, ConfirmOrderRequest, AbandonOrderRequest, GetEventShowcaseRequest } from "./request.types";
|
|
3
|
+
import { AddImagesResponse, AuthenticateBankIDResponse, CollectBankIDResponse, CreateLikeResponse, CreatePLSInputResponse, CreatePLSSubmissionResponse, CreateReportResponse, DeleteUserResponse, GetCAResponse, GetMatchableUserResponse, GetMatchableUsersResponse, GetMatchCheckResponse, GetMatchesResponse, GetAdvancedMatchResponse, GetMessagesResponse, GetPLSSubmissionResponse, GetSelfAwarenessReponse, GetUserResponse, HandleLastMessageSeenResponse, HandleLikeSeenResponse, HandleMatchSeenResponse, RegisterOnboardingResponse, RegisterUserResponse, RemoveMatchResponse, SendMessageResponse, SubmitAnswerResponse, SubmitCategoryFeedbackResponse, SubmitPLSCategoryFeedbackResponse, SubmitPLSDemographicsResponse, UpdatePLSAnswerResponse, UpdateQuestionsResponse, UpdateUserResponse, SubmitFeedbackResponse, ExpressConsultationInterestResponse, GetMyConsultationInterestResponse, GetConsultationInterestsResponse, UpdateConsultationInterestResponse, SyncAffiliateResponse, GetUserEventsResponse, JoinEventResponse, GetEventResponse, GetEventMatchResponse, SendEventFeedbackResponse, GetEventParticipantsResponse, GetPublicEventsResponse, SetEventInterestResponse, CreateCheckoutResponse, ConfirmOrderResponse, AbandonOrderResponse, GetEventShowcaseResponse } from "./response.types";
|
|
4
4
|
/**
|
|
5
5
|
* @deprecated This function is deprecated.
|
|
6
6
|
* Use `CloudFunctionTypes` inside application code instead.
|
|
@@ -79,6 +79,10 @@ export type CloudFunctionTypes = {
|
|
|
79
79
|
payload: AbandonOrderRequest;
|
|
80
80
|
response: AbandonOrderResponse;
|
|
81
81
|
};
|
|
82
|
+
[CloudFunction.GET_EVENT_SHOWCASE]: {
|
|
83
|
+
payload: GetEventShowcaseRequest;
|
|
84
|
+
response: GetEventShowcaseResponse;
|
|
85
|
+
};
|
|
82
86
|
[CloudFunction.SUBMIT_FEEDBACK]: {
|
|
83
87
|
payload: SubmitFeedbackRequest;
|
|
84
88
|
response: SubmitFeedbackResponse;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type EventShowcaseMemberCard = {
|
|
2
|
+
id: string;
|
|
3
|
+
heldOn: string;
|
|
4
|
+
city?: string;
|
|
5
|
+
venueName?: string;
|
|
6
|
+
participantCount: number;
|
|
7
|
+
matchCount?: number;
|
|
8
|
+
};
|
|
9
|
+
export type EventShowcaseTotals = {
|
|
10
|
+
events: number;
|
|
11
|
+
participants: number;
|
|
12
|
+
matches?: number;
|
|
13
|
+
};
|
|
14
|
+
export type EventShowcase = {
|
|
15
|
+
cards: EventShowcaseMemberCard[];
|
|
16
|
+
totals: EventShowcaseTotals;
|
|
17
|
+
};
|
|
@@ -28,6 +28,8 @@ export type Event = {
|
|
|
28
28
|
lastCAReminderAt?: string;
|
|
29
29
|
homeMarket?: Market;
|
|
30
30
|
city?: string;
|
|
31
|
+
venueName?: string;
|
|
32
|
+
showcaseHidden?: boolean;
|
|
31
33
|
eligibility?: EventEligibility;
|
|
32
34
|
priceOre?: number;
|
|
33
35
|
currency?: EventCurrency;
|
|
@@ -37,6 +39,7 @@ export type Event = {
|
|
|
37
39
|
salesOpenAt?: string;
|
|
38
40
|
salesCloseAt?: string;
|
|
39
41
|
decisionAt?: string;
|
|
42
|
+
imageUrl?: string;
|
|
40
43
|
};
|
|
41
44
|
export type EventEligibilityInterest = "opposite_gender";
|
|
42
45
|
export type EventEligibility = {
|
|
@@ -62,7 +65,7 @@ export type EventSeats = {
|
|
|
62
65
|
export type EventAvailability = "scheduled" | "on_sale" | "sold_out_for_you" | "sales_closed" | "not_eligible";
|
|
63
66
|
export type EventIneligibleReason = "outside_area" | "out_of_age_range" | "assessment_required";
|
|
64
67
|
export type EventUserOrderStatus = "none" | "pending" | "paid";
|
|
65
|
-
type EventOfferDetails = Pick<Event, "id" | "title" | "description" | "hostBrand" | "eventDateTime" | "matchRevealTime" | "location" | "city" | "access"> & Required<Pick<Event, "priceOre" | "currency" | "salesOpenAt" | "salesCloseAt">> & Pick<EventEligibility, "minAge" | "maxAge"> & {
|
|
68
|
+
type EventOfferDetails = Pick<Event, "id" | "title" | "description" | "hostBrand" | "eventDateTime" | "matchRevealTime" | "location" | "city" | "access" | "imageUrl"> & Required<Pick<Event, "priceOre" | "currency" | "salesOpenAt" | "salesCloseAt">> & Pick<EventEligibility, "minAge" | "maxAge"> & {
|
|
66
69
|
userOrderStatus?: EventUserOrderStatus;
|
|
67
70
|
userInterested?: boolean;
|
|
68
71
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./dq.types";
|
|
|
7
7
|
export * from "./error.types";
|
|
8
8
|
export * from "./event.types";
|
|
9
9
|
export * from "./event-interest.types";
|
|
10
|
+
export * from "./event-showcase.types";
|
|
10
11
|
export * from "./feedback.types";
|
|
11
12
|
export * from "./helper.types";
|
|
12
13
|
export * from "./like.types";
|
package/dist/types/index.js
CHANGED
|
@@ -23,6 +23,7 @@ __exportStar(require("./dq.types"), exports);
|
|
|
23
23
|
__exportStar(require("./error.types"), exports);
|
|
24
24
|
__exportStar(require("./event.types"), exports);
|
|
25
25
|
__exportStar(require("./event-interest.types"), exports);
|
|
26
|
+
__exportStar(require("./event-showcase.types"), exports);
|
|
26
27
|
__exportStar(require("./feedback.types"), exports);
|
|
27
28
|
__exportStar(require("./helper.types"), exports);
|
|
28
29
|
__exportStar(require("./like.types"), exports);
|
|
@@ -2,6 +2,7 @@ import { ConsultationInterest, ConsultationInterestSummary } from "./consultatio
|
|
|
2
2
|
import { Submission, CategoryEvaluation } from "./submission.types";
|
|
3
3
|
import { Event, EventOffer, FullParticipant, FullParticipantWithCS } from "./event.types";
|
|
4
4
|
import { EventInterestView } from "./event-interest.types";
|
|
5
|
+
import { EventShowcase } from "./event-showcase.types";
|
|
5
6
|
import { EventOrderView } from "./ticket.types";
|
|
6
7
|
import { UserMatch } from "./match.types";
|
|
7
8
|
import { MatchableUser, MatchCheck } from "./matchmaking.types";
|
|
@@ -58,6 +59,7 @@ export type CreateCheckoutResponse = {
|
|
|
58
59
|
};
|
|
59
60
|
export type ConfirmOrderResponse = EventOrderView;
|
|
60
61
|
export type AbandonOrderResponse = void;
|
|
62
|
+
export type GetEventShowcaseResponse = EventShowcase;
|
|
61
63
|
export type SubmitFeedbackResponse = undefined;
|
|
62
64
|
export type ExpressConsultationInterestResponse = ConsultationInterestSummary;
|
|
63
65
|
export type GetMyConsultationInterestResponse = ConsultationInterestSummary;
|
package/package.json
CHANGED
|
@@ -21,6 +21,7 @@ export enum CloudFunction {
|
|
|
21
21
|
CREATE_CHECKOUT = "ticket/create-checkout",
|
|
22
22
|
CONFIRM_ORDER = "ticket/confirm",
|
|
23
23
|
ABANDON_ORDER = "ticket/abandon",
|
|
24
|
+
GET_EVENT_SHOWCASE = "event/get-event-showcase",
|
|
24
25
|
SUBMIT_CATEGORY_FEEDBACK = "ca/submit-category-feedback",
|
|
25
26
|
CREATE_LIKE = "like/create-like",
|
|
26
27
|
HANDLE_LIKE_SEEN = "like/handle-like-seen",
|
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
CreateCheckoutRequest,
|
|
48
48
|
ConfirmOrderRequest,
|
|
49
49
|
AbandonOrderRequest,
|
|
50
|
+
GetEventShowcaseRequest,
|
|
50
51
|
} from "./request.types";
|
|
51
52
|
import {
|
|
52
53
|
AddImagesResponse,
|
|
@@ -98,6 +99,7 @@ import {
|
|
|
98
99
|
CreateCheckoutResponse,
|
|
99
100
|
ConfirmOrderResponse,
|
|
100
101
|
AbandonOrderResponse,
|
|
102
|
+
GetEventShowcaseResponse,
|
|
101
103
|
} from "./response.types";
|
|
102
104
|
|
|
103
105
|
/**
|
|
@@ -186,6 +188,10 @@ export type CloudFunctionTypes = {
|
|
|
186
188
|
payload: AbandonOrderRequest;
|
|
187
189
|
response: AbandonOrderResponse;
|
|
188
190
|
};
|
|
191
|
+
[CloudFunction.GET_EVENT_SHOWCASE]: {
|
|
192
|
+
payload: GetEventShowcaseRequest;
|
|
193
|
+
response: GetEventShowcaseResponse;
|
|
194
|
+
};
|
|
189
195
|
|
|
190
196
|
// feedback
|
|
191
197
|
[CloudFunction.SUBMIT_FEEDBACK]: {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type EventShowcaseMemberCard = {
|
|
2
|
+
id: string;
|
|
3
|
+
heldOn: string;
|
|
4
|
+
city?: string;
|
|
5
|
+
venueName?: string;
|
|
6
|
+
participantCount: number;
|
|
7
|
+
matchCount?: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type EventShowcaseTotals = {
|
|
11
|
+
events: number;
|
|
12
|
+
participants: number;
|
|
13
|
+
matches?: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type EventShowcase = {
|
|
17
|
+
cards: EventShowcaseMemberCard[];
|
|
18
|
+
totals: EventShowcaseTotals;
|
|
19
|
+
};
|
package/src/types/event.types.ts
CHANGED
|
@@ -31,6 +31,8 @@ export type Event = {
|
|
|
31
31
|
lastCAReminderAt?: string;
|
|
32
32
|
homeMarket?: Market;
|
|
33
33
|
city?: string;
|
|
34
|
+
venueName?: string;
|
|
35
|
+
showcaseHidden?: boolean;
|
|
34
36
|
eligibility?: EventEligibility;
|
|
35
37
|
priceOre?: number;
|
|
36
38
|
currency?: EventCurrency;
|
|
@@ -40,6 +42,7 @@ export type Event = {
|
|
|
40
42
|
salesOpenAt?: string;
|
|
41
43
|
salesCloseAt?: string;
|
|
42
44
|
decisionAt?: string;
|
|
45
|
+
imageUrl?: string;
|
|
43
46
|
};
|
|
44
47
|
|
|
45
48
|
export type EventEligibilityInterest = "opposite_gender";
|
|
@@ -94,6 +97,7 @@ type EventOfferDetails = Pick<
|
|
|
94
97
|
| "location"
|
|
95
98
|
| "city"
|
|
96
99
|
| "access"
|
|
100
|
+
| "imageUrl"
|
|
97
101
|
> &
|
|
98
102
|
Required<
|
|
99
103
|
Pick<Event, "priceOre" | "currency" | "salesOpenAt" | "salesCloseAt">
|
package/src/types/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./dq.types";
|
|
|
7
7
|
export * from "./error.types";
|
|
8
8
|
export * from "./event.types";
|
|
9
9
|
export * from "./event-interest.types";
|
|
10
|
+
export * from "./event-showcase.types";
|
|
10
11
|
export * from "./feedback.types";
|
|
11
12
|
export * from "./helper.types";
|
|
12
13
|
export * from "./like.types";
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
FullParticipantWithCS,
|
|
11
11
|
} from "./event.types";
|
|
12
12
|
import { EventInterestView } from "./event-interest.types";
|
|
13
|
+
import { EventShowcase } from "./event-showcase.types";
|
|
13
14
|
import { EventOrderView } from "./ticket.types";
|
|
14
15
|
import { UserMatch } from "./match.types";
|
|
15
16
|
import { MatchableUser, MatchCheck } from "./matchmaking.types";
|
|
@@ -77,6 +78,7 @@ export type CreateCheckoutResponse = {
|
|
|
77
78
|
};
|
|
78
79
|
export type ConfirmOrderResponse = EventOrderView;
|
|
79
80
|
export type AbandonOrderResponse = void;
|
|
81
|
+
export type GetEventShowcaseResponse = EventShowcase;
|
|
80
82
|
|
|
81
83
|
// feedback
|
|
82
84
|
export type SubmitFeedbackResponse = undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const assertType = (_value) => undefined;
|
|
4
|
-
describe("paymentsheet ticket types", () => {
|
|
5
|
-
it("CreateCheckoutRequest carries eventId and termsVersion", () => {
|
|
6
|
-
assertType();
|
|
7
|
-
const request = {
|
|
8
|
-
eventId: "e1",
|
|
9
|
-
termsVersion: "2026-11-01",
|
|
10
|
-
};
|
|
11
|
-
expect(Object.keys(request).sort()).toEqual(["eventId", "termsVersion"]);
|
|
12
|
-
});
|
|
13
|
-
it("CreateCheckoutResponse exposes the sheet secrets and no checkoutUrl", () => {
|
|
14
|
-
assertType();
|
|
15
|
-
const freeClaim = {
|
|
16
|
-
orderId: "e1_u1",
|
|
17
|
-
expiresAt: "2026-11-01T10:00:00.000Z",
|
|
18
|
-
clientSecret: "",
|
|
19
|
-
publishableKey: "",
|
|
20
|
-
};
|
|
21
|
-
expect(freeClaim.clientSecret).toBe("");
|
|
22
|
-
});
|
|
23
|
-
it("ConfirmOrderRequest is keyed by eventId", () => {
|
|
24
|
-
assertType();
|
|
25
|
-
expect({ eventId: "e1" }).toEqual({
|
|
26
|
-
eventId: "e1",
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
it("EventOrder records optional terms and drops the Checkout Session fields", () => {
|
|
30
|
-
assertType();
|
|
31
|
-
assertType();
|
|
32
|
-
assertType();
|
|
33
|
-
assertType();
|
|
34
|
-
assertType();
|
|
35
|
-
expect(true).toBe(true);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ConfirmOrderRequest,
|
|
3
|
-
CreateCheckoutRequest,
|
|
4
|
-
} from "./request.types";
|
|
5
|
-
import { CreateCheckoutResponse } from "./response.types";
|
|
6
|
-
import { EventOrder, EventOrderTerms } from "./ticket.types";
|
|
7
|
-
|
|
8
|
-
type Equal<A, B> =
|
|
9
|
-
(<T>() => T extends A ? 1 : 2) extends <T>() => T extends B ? 1 : 2
|
|
10
|
-
? true
|
|
11
|
-
: false;
|
|
12
|
-
const assertType = <T extends true>(_value?: T) => undefined;
|
|
13
|
-
|
|
14
|
-
describe("paymentsheet ticket types", () => {
|
|
15
|
-
it("CreateCheckoutRequest carries eventId and termsVersion", () => {
|
|
16
|
-
assertType<
|
|
17
|
-
Equal<CreateCheckoutRequest, { eventId: string; termsVersion: string }>
|
|
18
|
-
>();
|
|
19
|
-
const request: CreateCheckoutRequest = {
|
|
20
|
-
eventId: "e1",
|
|
21
|
-
termsVersion: "2026-11-01",
|
|
22
|
-
};
|
|
23
|
-
expect(Object.keys(request).sort()).toEqual(["eventId", "termsVersion"]);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it("CreateCheckoutResponse exposes the sheet secrets and no checkoutUrl", () => {
|
|
27
|
-
assertType<
|
|
28
|
-
Equal<
|
|
29
|
-
CreateCheckoutResponse,
|
|
30
|
-
{
|
|
31
|
-
orderId: string;
|
|
32
|
-
expiresAt: string;
|
|
33
|
-
clientSecret: string;
|
|
34
|
-
publishableKey: string;
|
|
35
|
-
}
|
|
36
|
-
>
|
|
37
|
-
>();
|
|
38
|
-
const freeClaim: CreateCheckoutResponse = {
|
|
39
|
-
orderId: "e1_u1",
|
|
40
|
-
expiresAt: "2026-11-01T10:00:00.000Z",
|
|
41
|
-
clientSecret: "",
|
|
42
|
-
publishableKey: "",
|
|
43
|
-
};
|
|
44
|
-
expect(freeClaim.clientSecret).toBe("");
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("ConfirmOrderRequest is keyed by eventId", () => {
|
|
48
|
-
assertType<Equal<ConfirmOrderRequest, { eventId: string }>>();
|
|
49
|
-
expect({ eventId: "e1" } satisfies ConfirmOrderRequest).toEqual({
|
|
50
|
-
eventId: "e1",
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it("EventOrder records optional terms and drops the Checkout Session fields", () => {
|
|
55
|
-
assertType<
|
|
56
|
-
Equal<EventOrder["terms"], EventOrderTerms | undefined>
|
|
57
|
-
>();
|
|
58
|
-
assertType<
|
|
59
|
-
Equal<EventOrderTerms, { version: string; acceptedAt: string }>
|
|
60
|
-
>();
|
|
61
|
-
assertType<Equal<"stripeCheckoutSessionId" extends keyof EventOrder ? 1 : 0, 0>>();
|
|
62
|
-
assertType<Equal<"stripeProductId" extends keyof EventOrder ? 1 : 0, 0>>();
|
|
63
|
-
assertType<Equal<"stripePaymentIntentId" extends keyof EventOrder ? 1 : 0, 1>>();
|
|
64
|
-
expect(true).toBe(true);
|
|
65
|
-
});
|
|
66
|
-
});
|