tonightpass 0.0.25 → 0.0.27
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +259 -123
- package/dist/index.d.ts +259 -123
- package/dist/index.js +34 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/rest/dtos/organizations/events/create-organization-event.dto.ts +15 -0
- package/src/rest/dtos/organizations/events/events/create-organization-event-style.dto.ts +7 -0
- package/src/rest/dtos/organizations/events/events/index.ts +2 -0
- package/src/rest/dtos/organizations/events/events/update-organization-event-style.dto.ts +3 -0
- package/src/rest/dtos/organizations/events/index.ts +3 -0
- package/src/rest/dtos/organizations/events/tickets/create-organization-event-ticket.dto.ts +19 -0
- package/src/rest/dtos/organizations/events/tickets/index.ts +2 -0
- package/src/rest/dtos/organizations/events/tickets/update-organization-event-ticket.dto.ts +3 -0
- package/src/rest/dtos/organizations/events/update-organization-event.dto.ts +3 -0
- package/src/rest/dtos/organizations/index.ts +1 -0
- package/src/rest/types/index.ts +0 -1
- package/src/rest/types/order/index.ts +3 -3
- package/src/rest/types/organizations/events/index.ts +83 -0
- package/src/rest/types/organizations/events/styles/index.ts +46 -0
- package/src/rest/types/organizations/events/tickets/index.ts +71 -0
- package/src/rest/types/organizations/index.ts +14 -58
- package/src/rest/types/organizations/members/index.ts +52 -0
- package/src/sdk/organizations/billing/index.ts +28 -0
- package/src/sdk/organizations/events/index.ts +39 -0
- package/src/sdk/organizations/events/styles/index.ts +17 -0
- package/src/sdk/organizations/events/tickets/index.ts +53 -0
- package/src/sdk/organizations/index.ts +19 -0
- package/src/sdk/organizations/members/index.ts +7 -0
- package/src/rest/types/event/index.ts +0 -60
- package/src/rest/types/event/ticket/index.ts +0 -36
- package/src/sdk/organizations.ts +0 -44
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import type Stripe from "stripe";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "../../dtos";
|
|
9
|
-
import { UpdateOrganizationMemberDto } from "../../dtos/organizations/members/update-organization-member.dto";
|
|
3
|
+
import { OrganizationEvent, OrganizationEventEndpoints } from "./events";
|
|
4
|
+
import { OrganizationEventTicket } from "./events/tickets";
|
|
5
|
+
import { OrganizationMember, OrganizationMembersEndpoints } from "./members";
|
|
6
|
+
import { Location, Profile, ProfileMetadata } from "..";
|
|
7
|
+
import { CreateOrganizationDto, UpdateOrganizationDto } from "../../dtos";
|
|
10
8
|
import { Endpoint } from "../../endpoints";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
|
|
10
|
+
export * from "./events";
|
|
11
|
+
export * from "./members";
|
|
14
12
|
|
|
15
13
|
export type Organization = {
|
|
16
14
|
id: string;
|
|
@@ -18,8 +16,8 @@ export type Organization = {
|
|
|
18
16
|
identity: OrganizationIdentity;
|
|
19
17
|
members: OrganizationMember[];
|
|
20
18
|
location?: Location;
|
|
21
|
-
events:
|
|
22
|
-
savedTickets:
|
|
19
|
+
events: OrganizationEvent[];
|
|
20
|
+
savedTickets: OrganizationEventTicket[];
|
|
23
21
|
verified: boolean;
|
|
24
22
|
billing: OrganizationBilling;
|
|
25
23
|
updatedAt: Date;
|
|
@@ -56,60 +54,18 @@ export enum OrganizationSocialType {
|
|
|
56
54
|
Website = "website",
|
|
57
55
|
}
|
|
58
56
|
|
|
59
|
-
export type OrganizationMember = {
|
|
60
|
-
organization: Organization;
|
|
61
|
-
role: OrganizationMemberRole;
|
|
62
|
-
status: OrganizationMemberStatus;
|
|
63
|
-
updatedAt: Date;
|
|
64
|
-
createdAt: Date;
|
|
65
|
-
user?: User;
|
|
66
|
-
token?: UserToken;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export enum OrganizationMemberStatus {
|
|
70
|
-
Pending = "pending",
|
|
71
|
-
Accepted = "accepted",
|
|
72
|
-
Rejected = "rejected",
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export enum OrganizationMemberRole {
|
|
76
|
-
Member = "member",
|
|
77
|
-
Manager = "manager",
|
|
78
|
-
Admin = "admin",
|
|
79
|
-
Owner = "owner",
|
|
80
|
-
}
|
|
81
|
-
|
|
82
57
|
export type OrganizationEndpoints =
|
|
83
58
|
| Endpoint<"GET", "/organizations", Organization[]>
|
|
84
59
|
| Endpoint<"GET", "/organizations/:slug", Organization>
|
|
85
60
|
| Endpoint<"POST", "/organizations", Organization, CreateOrganizationDto>
|
|
86
61
|
| Endpoint<"PUT", "/organizations/:slug", Organization, UpdateOrganizationDto>
|
|
87
|
-
| Endpoint<"DELETE", "/organizations/:slug",
|
|
88
|
-
| Endpoint<"GET", "/organizations/members", OrganizationMember[]>
|
|
89
|
-
| Endpoint<"DELETE", "/organizations/members/:id", OrganizationMember[], null>
|
|
90
|
-
| Endpoint<"GET", "/organizations/:slug/members", OrganizationMember[]>
|
|
91
|
-
| Endpoint<
|
|
92
|
-
"POST",
|
|
93
|
-
"/organizations/:slug/members",
|
|
94
|
-
OrganizationMember,
|
|
95
|
-
OrganizationMemberDto
|
|
96
|
-
>
|
|
97
|
-
| Endpoint<
|
|
98
|
-
"PUT",
|
|
99
|
-
"/organizations/:organizationSlug/members/:userId",
|
|
100
|
-
OrganizationMember,
|
|
101
|
-
UpdateOrganizationMemberDto
|
|
102
|
-
>
|
|
103
|
-
| Endpoint<
|
|
104
|
-
"DELETE",
|
|
105
|
-
"/organizations/:organizationSlug/members/:userId",
|
|
106
|
-
OrganizationMember[],
|
|
107
|
-
null
|
|
108
|
-
>
|
|
62
|
+
| Endpoint<"DELETE", "/organizations/:slug", Organization, null>
|
|
109
63
|
| Endpoint<
|
|
110
64
|
"GET",
|
|
111
65
|
"/organizations/:slug/billing/account",
|
|
112
66
|
OrganizationBillingAccount
|
|
113
67
|
>
|
|
114
68
|
| Endpoint<"GET", "/organizations/:slug/billing/link", void>
|
|
115
|
-
| Endpoint<"GET", "/organizations/:slug/billing/dashboard", void
|
|
69
|
+
| Endpoint<"GET", "/organizations/:slug/billing/dashboard", void>
|
|
70
|
+
| OrganizationEventEndpoints
|
|
71
|
+
| OrganizationMembersEndpoints;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Organization } from "..";
|
|
2
|
+
import { OrganizationMemberDto } from "../../../dtos";
|
|
3
|
+
import { UpdateOrganizationMemberDto } from "../../../dtos/organizations/members/update-organization-member.dto";
|
|
4
|
+
import { Endpoint } from "../../../endpoints";
|
|
5
|
+
import { UserToken } from "../../token";
|
|
6
|
+
import { User } from "../../users";
|
|
7
|
+
|
|
8
|
+
export type OrganizationMember = {
|
|
9
|
+
organization: Organization;
|
|
10
|
+
role: OrganizationMemberRole;
|
|
11
|
+
status: OrganizationMemberStatus;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
user?: User;
|
|
15
|
+
token?: UserToken;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export enum OrganizationMemberStatus {
|
|
19
|
+
Pending = "pending",
|
|
20
|
+
Accepted = "accepted",
|
|
21
|
+
Rejected = "rejected",
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export enum OrganizationMemberRole {
|
|
25
|
+
Member = "member",
|
|
26
|
+
Manager = "manager",
|
|
27
|
+
Admin = "admin",
|
|
28
|
+
Owner = "owner",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type OrganizationMembersEndpoints =
|
|
32
|
+
| Endpoint<"GET", "/organizations/members", OrganizationMember[]>
|
|
33
|
+
| Endpoint<"DELETE", "/organizations/members/:id", OrganizationMember[], null>
|
|
34
|
+
| Endpoint<"GET", "/organizations/:slug/members", OrganizationMember[]>
|
|
35
|
+
| Endpoint<
|
|
36
|
+
"POST",
|
|
37
|
+
"/organizations/:slug/members",
|
|
38
|
+
OrganizationMember,
|
|
39
|
+
OrganizationMemberDto
|
|
40
|
+
>
|
|
41
|
+
| Endpoint<
|
|
42
|
+
"PUT",
|
|
43
|
+
"/organizations/:organizationSlug/members/:userId",
|
|
44
|
+
OrganizationMember,
|
|
45
|
+
UpdateOrganizationMemberDto
|
|
46
|
+
>
|
|
47
|
+
| Endpoint<
|
|
48
|
+
"DELETE",
|
|
49
|
+
"/organizations/:organizationSlug/members/:userId",
|
|
50
|
+
OrganizationMember[],
|
|
51
|
+
null
|
|
52
|
+
>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isBrowser } from "../../../utils";
|
|
2
|
+
import { sdk } from "../../builder";
|
|
3
|
+
|
|
4
|
+
export const organizationsBilling = sdk((client) => ({
|
|
5
|
+
account: async (slug: string) =>
|
|
6
|
+
client.get("/organizations/:slug/billing/account", { slug }),
|
|
7
|
+
link: (slug: string) => {
|
|
8
|
+
if (isBrowser) {
|
|
9
|
+
window.location.href = client.url("/organizations/:slug/billing/link", {
|
|
10
|
+
slug,
|
|
11
|
+
});
|
|
12
|
+
} else {
|
|
13
|
+
throw new Error("Billing link is only available in the browser");
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
dashboard: (slug: string) => {
|
|
17
|
+
if (isBrowser) {
|
|
18
|
+
window.location.href = client.url(
|
|
19
|
+
"/organizations/:slug/billing/dashboard",
|
|
20
|
+
{
|
|
21
|
+
slug,
|
|
22
|
+
},
|
|
23
|
+
);
|
|
24
|
+
} else {
|
|
25
|
+
throw new Error("Billing dashboard is only available in the browser");
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { organizationsEventsStyles } from "./styles";
|
|
2
|
+
import { organizationsEventsTickets } from "./tickets";
|
|
3
|
+
import {
|
|
4
|
+
CreateOrganizationEventDto,
|
|
5
|
+
UpdateOrganizationEventDto,
|
|
6
|
+
} from "../../../rest";
|
|
7
|
+
import { sdk } from "../../builder";
|
|
8
|
+
|
|
9
|
+
export const organizationsEvents = sdk((client) => ({
|
|
10
|
+
getAll: async (organizationSlug: string) =>
|
|
11
|
+
client.get("/organizations/:organizationSlug/events", {
|
|
12
|
+
organizationSlug,
|
|
13
|
+
}),
|
|
14
|
+
get: async (organizationSlug: string, eventSlug: string) =>
|
|
15
|
+
client.get("/organizations/:organizationSlug/events/:eventSlug", {
|
|
16
|
+
organizationSlug,
|
|
17
|
+
eventSlug,
|
|
18
|
+
}),
|
|
19
|
+
create: async (organizationSlug: string, data: CreateOrganizationEventDto) =>
|
|
20
|
+
client.post("/organizations/:organizationSlug/events", data, {
|
|
21
|
+
organizationSlug,
|
|
22
|
+
}),
|
|
23
|
+
update: async (
|
|
24
|
+
organizationSlug: string,
|
|
25
|
+
eventSlug: string,
|
|
26
|
+
data: UpdateOrganizationEventDto,
|
|
27
|
+
) =>
|
|
28
|
+
client.put("/organizations/:organizationSlug/events/:eventSlug", data, {
|
|
29
|
+
organizationSlug,
|
|
30
|
+
eventSlug,
|
|
31
|
+
}),
|
|
32
|
+
delete: async (organizationSlug: string, eventSlug: string) =>
|
|
33
|
+
client.delete("/organizations/:organizationSlug/events/:eventSlug", null, {
|
|
34
|
+
organizationSlug,
|
|
35
|
+
eventSlug,
|
|
36
|
+
}),
|
|
37
|
+
styles: organizationsEventsStyles,
|
|
38
|
+
tickets: organizationsEventsTickets,
|
|
39
|
+
}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CreateOrganizationEventStyleDto,
|
|
3
|
+
UpdateOrganizationEventStyleDto,
|
|
4
|
+
} from "../../../../rest/dtos/organizations/events/events";
|
|
5
|
+
import { sdk } from "../../../builder";
|
|
6
|
+
|
|
7
|
+
export const organizationsEventsStyles = sdk((client) => ({
|
|
8
|
+
getAll: async () => client.get("/organizations/events/styles"),
|
|
9
|
+
get: async (slug: string) =>
|
|
10
|
+
client.get("/organizations/events/styles/:slug", { slug }),
|
|
11
|
+
create: async (data: CreateOrganizationEventStyleDto) =>
|
|
12
|
+
client.post("/organizations/events/styles", data),
|
|
13
|
+
update: async (slug: string, data: UpdateOrganizationEventStyleDto) =>
|
|
14
|
+
client.put("/organizations/events/styles/:slug", data, { slug }),
|
|
15
|
+
delete: async (slug: string) =>
|
|
16
|
+
client.delete("/organizations/events/styles/:slug", null, { slug }),
|
|
17
|
+
}));
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CreateOrganizationEventTicketDto,
|
|
3
|
+
UpdateOrganizationEventTicketDto,
|
|
4
|
+
} from "../../../../rest";
|
|
5
|
+
import { sdk } from "../../../builder";
|
|
6
|
+
|
|
7
|
+
export const organizationsEventsTickets = sdk((client) => ({
|
|
8
|
+
getAll: async (slug: string, eventSlug: string) =>
|
|
9
|
+
client.get("/organizations/:slug/events/:eventSlug/tickets", {
|
|
10
|
+
slug,
|
|
11
|
+
eventSlug,
|
|
12
|
+
}),
|
|
13
|
+
get: async (slug: string, eventSlug: string, ticketId: string) =>
|
|
14
|
+
client.get("/organizations/:slug/events/:eventSlug/tickets/:ticketId", {
|
|
15
|
+
slug,
|
|
16
|
+
eventSlug,
|
|
17
|
+
ticketId,
|
|
18
|
+
}),
|
|
19
|
+
create: async (
|
|
20
|
+
slug: string,
|
|
21
|
+
eventSlug: string,
|
|
22
|
+
data: CreateOrganizationEventTicketDto,
|
|
23
|
+
) =>
|
|
24
|
+
client.post("/organizations/:slug/events/:eventSlug/tickets", data, {
|
|
25
|
+
slug,
|
|
26
|
+
eventSlug,
|
|
27
|
+
}),
|
|
28
|
+
update: async (
|
|
29
|
+
slug: string,
|
|
30
|
+
eventSlug: string,
|
|
31
|
+
ticketId: string,
|
|
32
|
+
data: UpdateOrganizationEventTicketDto,
|
|
33
|
+
) =>
|
|
34
|
+
client.put(
|
|
35
|
+
"/organizations/:slug/events/:eventSlug/tickets/:ticketId",
|
|
36
|
+
data,
|
|
37
|
+
{
|
|
38
|
+
slug,
|
|
39
|
+
eventSlug,
|
|
40
|
+
ticketId,
|
|
41
|
+
},
|
|
42
|
+
),
|
|
43
|
+
delete: async (slug: string, eventSlug: string, ticketId: string) =>
|
|
44
|
+
client.delete(
|
|
45
|
+
"/organizations/:slug/events/:eventSlug/tickets/:ticketId",
|
|
46
|
+
null,
|
|
47
|
+
{
|
|
48
|
+
slug,
|
|
49
|
+
eventSlug,
|
|
50
|
+
ticketId,
|
|
51
|
+
},
|
|
52
|
+
),
|
|
53
|
+
}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { organizationsBilling } from "./billing";
|
|
2
|
+
import { organizationsEvents } from "./events";
|
|
3
|
+
import { organizationsMembers } from "./members";
|
|
4
|
+
import { CreateOrganizationDto, UpdateOrganizationDto } from "../../rest";
|
|
5
|
+
import { sdk } from "../builder";
|
|
6
|
+
|
|
7
|
+
export const organizations = sdk((client) => ({
|
|
8
|
+
getAll: async () => client.get("/organizations"),
|
|
9
|
+
get: async (slug: string) => client.get("/organizations/:slug", { slug }),
|
|
10
|
+
create: async (data: CreateOrganizationDto) =>
|
|
11
|
+
client.post("/organizations", data),
|
|
12
|
+
update: async (slug: string, data: UpdateOrganizationDto) =>
|
|
13
|
+
client.put("/organizations/:slug", data, { slug }),
|
|
14
|
+
delete: async (slug: string) =>
|
|
15
|
+
client.delete("/organizations/:slug", null, { slug }),
|
|
16
|
+
billing: organizationsBilling,
|
|
17
|
+
events: organizationsEvents,
|
|
18
|
+
members: organizationsMembers,
|
|
19
|
+
}));
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { EventTicket } from "./ticket";
|
|
2
|
-
import { Location } from "..";
|
|
3
|
-
import { Organization } from "../organizations";
|
|
4
|
-
|
|
5
|
-
export * from "./ticket";
|
|
6
|
-
|
|
7
|
-
export type Event = {
|
|
8
|
-
title: string;
|
|
9
|
-
description: string;
|
|
10
|
-
slug: string;
|
|
11
|
-
organization: Organization;
|
|
12
|
-
type: EventType;
|
|
13
|
-
public: boolean;
|
|
14
|
-
flyers: string[];
|
|
15
|
-
trailers: string[];
|
|
16
|
-
location: Location;
|
|
17
|
-
tickets: EventTicket[];
|
|
18
|
-
styles: EventStyle[];
|
|
19
|
-
startAt: Date;
|
|
20
|
-
endAt: Date;
|
|
21
|
-
updatedAt: Date;
|
|
22
|
-
createdAt: Date;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export enum EventType {
|
|
26
|
-
Clubbing = "clubbing",
|
|
27
|
-
Concert = "concert",
|
|
28
|
-
Afterwork = "afterwork",
|
|
29
|
-
DancingLunch = "dancing_lunch",
|
|
30
|
-
Diner = "diner",
|
|
31
|
-
Garden = "garden",
|
|
32
|
-
AfterBeach = "after_beach",
|
|
33
|
-
Festival = "festival",
|
|
34
|
-
Spectacle = "spectacle",
|
|
35
|
-
Cruise = "cruise",
|
|
36
|
-
OutsideAnimation = "outside_animation",
|
|
37
|
-
Sport = "sport",
|
|
38
|
-
Match = "match",
|
|
39
|
-
Seminar = "seminar",
|
|
40
|
-
Conference = "conference",
|
|
41
|
-
WellnessDay = "wellness_day",
|
|
42
|
-
Workshop = "workshop",
|
|
43
|
-
TradeFair = "trade_fair",
|
|
44
|
-
ConsumerShow = "consumer_show",
|
|
45
|
-
Membership = "membership",
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export type EventStyle = {
|
|
49
|
-
type: EventStyleType;
|
|
50
|
-
emoji: string;
|
|
51
|
-
name: string;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export enum EventStyleType {
|
|
55
|
-
Music = "music",
|
|
56
|
-
Dress = "dress",
|
|
57
|
-
Sport = "sport",
|
|
58
|
-
Food = "food",
|
|
59
|
-
Art = "art",
|
|
60
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Currency } from "../..";
|
|
2
|
-
|
|
3
|
-
export type EventTicket = {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
price: number;
|
|
8
|
-
displayPrice: number;
|
|
9
|
-
quantity: number;
|
|
10
|
-
type: EventTicketType;
|
|
11
|
-
category: EventTicketCategory;
|
|
12
|
-
currency: Currency;
|
|
13
|
-
vatRate: number;
|
|
14
|
-
externalId?: string;
|
|
15
|
-
isVisible: boolean;
|
|
16
|
-
isFeesIncluded: boolean;
|
|
17
|
-
startAt: Date;
|
|
18
|
-
endAt: Date;
|
|
19
|
-
updatedAt: Date;
|
|
20
|
-
createdAt: Date;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type EventTicketType = "e-ticket" | "other";
|
|
24
|
-
|
|
25
|
-
export enum EventTicketCategory {
|
|
26
|
-
Entry = "entry",
|
|
27
|
-
Package = "package",
|
|
28
|
-
Meal = "meal",
|
|
29
|
-
Drink = "drink",
|
|
30
|
-
Parking = "parking",
|
|
31
|
-
Accommodation = "accommodation",
|
|
32
|
-
Camping = "camping",
|
|
33
|
-
Locker = "locker",
|
|
34
|
-
Shuttle = "shuttle",
|
|
35
|
-
Other = "other",
|
|
36
|
-
}
|
package/src/sdk/organizations.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { sdk } from "./builder";
|
|
2
|
-
import { CreateOrganizationDto, UpdateOrganizationDto } from "../rest";
|
|
3
|
-
import { isBrowser } from "../utils";
|
|
4
|
-
|
|
5
|
-
export const organizations = sdk((client) => ({
|
|
6
|
-
getAll: async () => client.get("/organizations"),
|
|
7
|
-
get: async (slug: string) => client.get("/organizations/:slug", { slug }),
|
|
8
|
-
create: async (data: CreateOrganizationDto) =>
|
|
9
|
-
client.post("/organizations", data),
|
|
10
|
-
update: async (slug: string, data: UpdateOrganizationDto) =>
|
|
11
|
-
client.put("/organizations/:slug", data, { slug }),
|
|
12
|
-
delete: async (slug: string) =>
|
|
13
|
-
client.delete("/organizations/:slug", null, { slug }),
|
|
14
|
-
members: {
|
|
15
|
-
getAll: async () => client.get("/organizations/members"),
|
|
16
|
-
delete: async (id: string) =>
|
|
17
|
-
client.delete("/organizations/members/:id", null, { id }),
|
|
18
|
-
},
|
|
19
|
-
billing: {
|
|
20
|
-
account: async (slug: string) =>
|
|
21
|
-
client.get("/organizations/:slug/billing/account", { slug }),
|
|
22
|
-
link: (slug: string) => {
|
|
23
|
-
if (isBrowser) {
|
|
24
|
-
window.location.href = client.url("/organizations/:slug/billing/link", {
|
|
25
|
-
slug,
|
|
26
|
-
});
|
|
27
|
-
} else {
|
|
28
|
-
throw new Error("Billing link is only available in the browser");
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
dashboard: (slug: string) => {
|
|
32
|
-
if (isBrowser) {
|
|
33
|
-
window.location.href = client.url(
|
|
34
|
-
"/organizations/:slug/billing/dashboard",
|
|
35
|
-
{
|
|
36
|
-
slug,
|
|
37
|
-
},
|
|
38
|
-
);
|
|
39
|
-
} else {
|
|
40
|
-
throw new Error("Billing dashboard is only available in the browser");
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
}));
|