@antlur/backstage 1.12.15 → 1.13.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/cli/actions/sync-blocks.d.ts.map +1 -1
- package/dist/cli/actions/sync-blocks.js +1 -0
- package/dist/cli/cli.js +0 -0
- package/dist/client.d.ts +6 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +9 -0
- package/dist/endpoints/blocks.d.ts +5 -3
- package/dist/endpoints/blocks.d.ts.map +1 -1
- package/dist/endpoints/frontstage.d.ts +9 -0
- package/dist/endpoints/frontstage.d.ts.map +1 -0
- package/dist/endpoints/frontstage.js +32 -0
- package/dist/endpoints/layouts.d.ts +5 -3
- package/dist/endpoints/layouts.d.ts.map +1 -1
- package/dist/endpoints/media.d.ts +5 -0
- package/dist/endpoints/media.d.ts.map +1 -1
- package/dist/endpoints/media.js +12 -0
- package/dist/endpoints/modules.d.ts +7 -0
- package/dist/endpoints/modules.d.ts.map +1 -0
- package/dist/endpoints/modules.js +11 -0
- package/dist/endpoints/navigation.d.ts +14 -1
- package/dist/endpoints/navigation.d.ts.map +1 -1
- package/dist/endpoints/navigation.js +22 -2
- package/dist/endpoints/reviews.d.ts +18 -0
- package/dist/endpoints/reviews.d.ts.map +1 -0
- package/dist/endpoints/reviews.js +30 -0
- package/dist/endpoints/website.d.ts +2 -0
- package/dist/endpoints/website.d.ts.map +1 -1
- package/dist/endpoints/website.js +14 -3
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/studio/define-block.d.ts +2 -0
- package/dist/studio/define-block.d.ts.map +1 -1
- package/dist/studio/types/block.d.ts +9 -0
- package/dist/studio/types/block.d.ts.map +1 -1
- package/dist/types/account-block.d.ts +17 -1
- package/dist/types/account-block.d.ts.map +1 -1
- package/dist/types/account-layout.d.ts +29 -9
- package/dist/types/account-layout.d.ts.map +1 -1
- package/dist/types/account-module.d.ts +26 -0
- package/dist/types/account-module.d.ts.map +1 -0
- package/dist/types/account-module.js +12 -0
- package/dist/types/frontstage.d.ts +213 -0
- package/dist/types/frontstage.d.ts.map +1 -0
- package/dist/types/frontstage.js +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/location.d.ts +1 -0
- package/dist/types/location.d.ts.map +1 -1
- package/dist/types/review.d.ts +17 -0
- package/dist/types/review.d.ts.map +1 -0
- package/dist/types/review.js +1 -0
- package/dist/util/special-hours.d.ts +1 -1
- package/dist/util/special-hours.d.ts.map +1 -1
- package/dist/util/special-hours.js +8 -7
- package/package.json +1 -1
- package/readme.md +14 -0
- package/src/cli/actions/sync-blocks.ts +1 -0
- package/src/client.ts +9 -0
- package/src/endpoints/blocks.ts +5 -3
- package/src/endpoints/frontstage.ts +50 -0
- package/src/endpoints/layouts.ts +5 -3
- package/src/endpoints/media.ts +20 -1
- package/src/endpoints/modules.ts +14 -0
- package/src/endpoints/navigation.ts +35 -4
- package/src/endpoints/reviews.ts +57 -0
- package/src/endpoints/website.ts +15 -3
- package/src/index.ts +3 -0
- package/src/studio/define-block.ts +2 -0
- package/src/studio/types/block.ts +10 -0
- package/src/types/account-block.ts +22 -1
- package/src/types/account-layout.ts +32 -9
- package/src/types/account-module.ts +38 -0
- package/src/types/frontstage.ts +254 -0
- package/src/types/index.ts +4 -0
- package/src/types/location.ts +1 -0
- package/src/types/review.ts +16 -0
- package/src/util/special-hours.ts +10 -6
package/src/endpoints/layouts.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import type { ApiCollectionResponse, ApiSingleResponse
|
|
1
|
+
import type { AccountLayout, AccountLayoutSchema, AccountLayoutValues, ApiCollectionResponse, ApiSingleResponse } from "../types/index";
|
|
2
2
|
import { BaseService } from "./base.js";
|
|
3
3
|
|
|
4
4
|
export interface CreateLayoutParams {
|
|
5
5
|
name: string;
|
|
6
6
|
slug: string;
|
|
7
|
-
schema:
|
|
7
|
+
schema: AccountLayoutSchema;
|
|
8
|
+
values?: AccountLayoutValues;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export interface UpdateLayoutParams {
|
|
11
12
|
name?: string;
|
|
12
13
|
slug?: string;
|
|
13
|
-
schema?:
|
|
14
|
+
schema?: AccountLayoutSchema;
|
|
15
|
+
values?: AccountLayoutValues;
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export class LayoutService extends BaseService {
|
package/src/endpoints/media.ts
CHANGED
|
@@ -20,7 +20,7 @@ export class MediaService extends BaseService {
|
|
|
20
20
|
const { data } = await this.client.post<ApiSingleResponse<Media>>(
|
|
21
21
|
"/media",
|
|
22
22
|
{ source_url, name: options?.name, alt: options?.alt },
|
|
23
|
-
options
|
|
23
|
+
options,
|
|
24
24
|
);
|
|
25
25
|
return data;
|
|
26
26
|
}
|
|
@@ -41,6 +41,25 @@ export class MediaService extends BaseService {
|
|
|
41
41
|
return data;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
async uploadToMediaEndpoint(
|
|
45
|
+
file: Blob,
|
|
46
|
+
options?: { name?: string; alt?: string; request?: RequestInit },
|
|
47
|
+
): Promise<Media> {
|
|
48
|
+
const formData = new FormData();
|
|
49
|
+
formData.append("file", file);
|
|
50
|
+
|
|
51
|
+
if (options?.name) {
|
|
52
|
+
formData.append("name", options.name);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (options?.alt) {
|
|
56
|
+
formData.append("alt", options.alt);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const { data } = await this.client.post<ApiSingleResponse<Media>>("/media/upload", formData, options?.request);
|
|
60
|
+
return data;
|
|
61
|
+
}
|
|
62
|
+
|
|
44
63
|
async update(id: string, params: { name?: string; alt?: string }, options?: RequestInit): Promise<Media> {
|
|
45
64
|
const { data } = await this.client.put<ApiSingleResponse<Media>>(`/media/${id}`, params, options);
|
|
46
65
|
return data;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AccountModule, AccountModuleKey, ApiCollectionResponse } from "../types/index";
|
|
2
|
+
import { BaseService } from "./base.js";
|
|
3
|
+
|
|
4
|
+
export class ModulesService extends BaseService {
|
|
5
|
+
async list(options?: RequestInit): Promise<AccountModule[]> {
|
|
6
|
+
const { data } = await this.client.get<ApiCollectionResponse<AccountModule>>("/modules", options);
|
|
7
|
+
return data;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async isEnabled(moduleKey: AccountModuleKey, options?: RequestInit): Promise<boolean> {
|
|
11
|
+
const modules = await this.list(options);
|
|
12
|
+
return modules.some((module) => module.key === moduleKey && module.enabled);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,16 +1,47 @@
|
|
|
1
|
-
import type { ApiSingleResponse, ApiCollectionResponse, Navigation } from "../types/index";
|
|
1
|
+
import type { ApiSingleResponse, ApiCollectionResponse, Navigation, NavigationItem } from "../types/index";
|
|
2
2
|
import { BaseService } from "./base.js";
|
|
3
3
|
|
|
4
|
+
export interface CreateNavigationParams {
|
|
5
|
+
name: string;
|
|
6
|
+
items?: Array<Partial<NavigationItem> & { parent_id?: string | null }>;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface UpdateNavigationParams extends Partial<CreateNavigationParams> {}
|
|
11
|
+
|
|
4
12
|
export class NavigationService extends BaseService {
|
|
5
|
-
async
|
|
13
|
+
async list(options?: RequestInit): Promise<Navigation[]> {
|
|
6
14
|
const res = await this.client.get<ApiCollectionResponse<Navigation>>("/navigations", options);
|
|
7
|
-
|
|
15
|
+
return res.data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async getById(id: string, options?: RequestInit): Promise<Navigation | null> {
|
|
19
|
+
try {
|
|
20
|
+
const res = await this.client.get<ApiSingleResponse<Navigation>>(`/navigations/${id}`, options);
|
|
21
|
+
return res.data;
|
|
22
|
+
} catch (error) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async createNavigation(params: CreateNavigationParams, options?: RequestInit): Promise<Navigation> {
|
|
28
|
+
const { data } = await this.client.post<ApiSingleResponse<Navigation>>("/navigations", params, options);
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async updateNavigation(id: string, params: UpdateNavigationParams, options?: RequestInit): Promise<Navigation> {
|
|
33
|
+
const { data } = await this.client.put<ApiSingleResponse<Navigation>>(`/navigations/${id}`, params, options);
|
|
34
|
+
return data;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async getNavigations(options?: RequestInit): Promise<Navigation[]> {
|
|
38
|
+
const navigations = await this.list(options);
|
|
8
39
|
|
|
9
40
|
return Promise.all(
|
|
10
41
|
navigations.map(async (navigation: any) => {
|
|
11
42
|
const res = await this.client.get<ApiCollectionResponse<Navigation>>("/navigations/" + navigation.id, options);
|
|
12
43
|
return res.data[0];
|
|
13
|
-
})
|
|
44
|
+
}),
|
|
14
45
|
);
|
|
15
46
|
}
|
|
16
47
|
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ApiCollectionResponse,
|
|
3
|
+
ApiSingleResponse,
|
|
4
|
+
Review,
|
|
5
|
+
} from "../types/index";
|
|
6
|
+
import { BaseService } from "./base.js";
|
|
7
|
+
|
|
8
|
+
export interface CreateReviewParams {
|
|
9
|
+
response_text: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface ReviewFilters {
|
|
13
|
+
source?: string;
|
|
14
|
+
location_id?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class ReviewService extends BaseService {
|
|
18
|
+
async getReviews(filters?: ReviewFilters, options?: RequestInit): Promise<Review[]> {
|
|
19
|
+
const query = new URLSearchParams();
|
|
20
|
+
if (filters?.source) query.append("source", filters.source);
|
|
21
|
+
if (filters?.location_id) query.append("location_id", filters.location_id);
|
|
22
|
+
|
|
23
|
+
const queryString = query.toString();
|
|
24
|
+
const url = queryString ? `/reviews?${queryString}` : "/reviews";
|
|
25
|
+
|
|
26
|
+
const { data } = await this.client.get<ApiCollectionResponse<Review>>(
|
|
27
|
+
url,
|
|
28
|
+
options
|
|
29
|
+
);
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async getReview(id: string, options?: RequestInit): Promise<Review | null> {
|
|
34
|
+
try {
|
|
35
|
+
const { data } = await this.client.get<ApiSingleResponse<Review>>(
|
|
36
|
+
`/reviews/${id}`,
|
|
37
|
+
options
|
|
38
|
+
);
|
|
39
|
+
return data;
|
|
40
|
+
} catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async updateReview(id: string, params: CreateReviewParams, options?: RequestInit): Promise<Review> {
|
|
46
|
+
const { data } = await this.client.put<ApiSingleResponse<Review>>(
|
|
47
|
+
`/reviews/${id}`,
|
|
48
|
+
params,
|
|
49
|
+
options
|
|
50
|
+
);
|
|
51
|
+
return data;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async pullReviews(options?: RequestInit): Promise<{ message: string }> {
|
|
55
|
+
return this.client.post<{ message: string }>("/reviews/pull", {}, options);
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/endpoints/website.ts
CHANGED
|
@@ -19,6 +19,15 @@ export class WebsiteService extends BaseService {
|
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
async getWebsiteById(id: string, options?: RequestInit): Promise<Website | null> {
|
|
23
|
+
try {
|
|
24
|
+
const { data } = await this.client.get<ApiSingleResponse<Website>>(`/websites/${id}`, options);
|
|
25
|
+
return data;
|
|
26
|
+
} catch (error) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
22
31
|
async getWebsite(options?: RequestInit): Promise<Website> {
|
|
23
32
|
// Handle case where id might be an object (e.g., RequestInit passed as first param)
|
|
24
33
|
// if (id && typeof id === "string") {
|
|
@@ -39,9 +48,12 @@ export class WebsiteService extends BaseService {
|
|
|
39
48
|
return data;
|
|
40
49
|
}
|
|
41
50
|
|
|
51
|
+
async getWebsiteRoutes(websiteId: string, options?: RequestInit): Promise<string[]> {
|
|
52
|
+
return this.client.get<string[]>(`/websites/${websiteId}/routes`, options);
|
|
53
|
+
}
|
|
54
|
+
|
|
42
55
|
async routes(options?: RequestInit): Promise<string[]> {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return this.client.get<string[]>(`/websites/${website.id}/routes`, options);
|
|
56
|
+
const website = await this.getWebsite(options);
|
|
57
|
+
return this.getWebsiteRoutes(website.id, options);
|
|
46
58
|
}
|
|
47
59
|
}
|
package/src/index.ts
CHANGED
|
@@ -12,16 +12,19 @@ export * from "./endpoints/blueprints.js";
|
|
|
12
12
|
export * from "./endpoints/entries.js";
|
|
13
13
|
export * from "./endpoints/events.js";
|
|
14
14
|
export * from "./endpoints/forms.js";
|
|
15
|
+
export * from "./endpoints/frontstage.js";
|
|
15
16
|
export * from "./endpoints/instagram.js";
|
|
16
17
|
export * from "./endpoints/layouts.js";
|
|
17
18
|
export * from "./endpoints/locations.js";
|
|
18
19
|
export * from "./endpoints/media.js";
|
|
19
20
|
export * from "./endpoints/menus.js";
|
|
20
21
|
export * from "./endpoints/menu-items.js";
|
|
22
|
+
export * from "./endpoints/modules.js";
|
|
21
23
|
export * from "./endpoints/navigation.js";
|
|
22
24
|
export * from "./endpoints/pages.js";
|
|
23
25
|
export * from "./endpoints/press.js";
|
|
24
26
|
export * from "./endpoints/redirects.js";
|
|
27
|
+
export * from "./endpoints/reviews.js";
|
|
25
28
|
export * from "./endpoints/routes.js";
|
|
26
29
|
export * from "./endpoints/website.js";
|
|
27
30
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { BlockSchema, BlockDefinition, BlockComponent, Field } from "./types";
|
|
2
|
+
import type { BlockFrontstageConfig } from "./types/block";
|
|
2
3
|
|
|
3
4
|
export function defineBlock<TFields extends readonly Field[]>(options: {
|
|
4
5
|
name: string;
|
|
5
6
|
slug: string;
|
|
6
7
|
description?: string;
|
|
7
8
|
schema: BlockSchema<TFields>;
|
|
9
|
+
frontstage?: BlockFrontstageConfig;
|
|
8
10
|
component: BlockComponent<BlockSchema<TFields>>;
|
|
9
11
|
}): BlockDefinition<TFields> {
|
|
10
12
|
// Runtime validation
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Field, FieldType, FieldTypeToValue } from "./field";
|
|
2
2
|
import { Entry } from "../../types/entry";
|
|
3
|
+
import type { FrontstageStandardBlockType, FrontstageStandardBlockVariant } from "../../types/frontstage";
|
|
3
4
|
|
|
4
5
|
type Nullable<T> = T | null;
|
|
5
6
|
|
|
@@ -28,6 +29,7 @@ export interface BlockDefinition<TFields extends readonly Field[]> {
|
|
|
28
29
|
slug: string;
|
|
29
30
|
description?: string;
|
|
30
31
|
schema: BlockSchema<TFields>;
|
|
32
|
+
frontstage?: BlockFrontstageConfig;
|
|
31
33
|
component: BlockComponent<BlockSchema<TFields>>;
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -35,6 +37,14 @@ export interface BlockProperties {
|
|
|
35
37
|
customClassName?: string;
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
export interface BlockFrontstageConfig {
|
|
41
|
+
enabled?: boolean;
|
|
42
|
+
type?: FrontstageStandardBlockType | string;
|
|
43
|
+
defaultVariant?: FrontstageStandardBlockVariant | string;
|
|
44
|
+
variants?: Array<FrontstageStandardBlockVariant | string>;
|
|
45
|
+
category?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
38
48
|
export interface BuilderBlock<TSchema extends BlockSchema<readonly Field[]>> {
|
|
39
49
|
id: string;
|
|
40
50
|
type: string;
|
|
@@ -1,9 +1,30 @@
|
|
|
1
|
+
import type { FrontstageBlockDefinition } from "./frontstage";
|
|
2
|
+
import type { Field } from "../studio/types/field";
|
|
3
|
+
|
|
4
|
+
export interface AccountBlockSchema {
|
|
5
|
+
fields?: readonly Field[];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AccountBlockFrontstageConfig {
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
type?: FrontstageBlockDefinition["frontstage"] extends infer T
|
|
11
|
+
? T extends { type: infer Type }
|
|
12
|
+
? Type
|
|
13
|
+
: string
|
|
14
|
+
: string;
|
|
15
|
+
defaultVariant?: string;
|
|
16
|
+
variants?: string[];
|
|
17
|
+
category?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
1
20
|
export interface AccountBlock {
|
|
2
21
|
id: string;
|
|
3
22
|
account_id: string;
|
|
4
23
|
slug: string;
|
|
5
24
|
name: string;
|
|
6
|
-
|
|
25
|
+
description?: string | null;
|
|
26
|
+
schema: AccountBlockSchema;
|
|
27
|
+
frontstage?: AccountBlockFrontstageConfig | null;
|
|
7
28
|
created_at: string;
|
|
8
29
|
updated_at: string;
|
|
9
30
|
}
|
|
@@ -1,14 +1,37 @@
|
|
|
1
|
+
import type { Field } from "../studio/types/field";
|
|
2
|
+
import type { FrontstageBlock, FrontstageNavItem, FrontstageTheme } from "./frontstage";
|
|
3
|
+
|
|
4
|
+
export interface AccountLayoutSchema {
|
|
5
|
+
fields: Field[];
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface AccountLayoutValues {
|
|
10
|
+
theme?: Partial<FrontstageTheme["layout"]>;
|
|
11
|
+
navigation?: {
|
|
12
|
+
primary?: FrontstageNavItem[];
|
|
13
|
+
footer?: FrontstageNavItem[];
|
|
14
|
+
};
|
|
15
|
+
regions?: {
|
|
16
|
+
beforeHeader?: FrontstageBlock[];
|
|
17
|
+
afterHeader?: FrontstageBlock[];
|
|
18
|
+
beforeMain?: FrontstageBlock[];
|
|
19
|
+
afterMain?: FrontstageBlock[];
|
|
20
|
+
beforeFooter?: FrontstageBlock[];
|
|
21
|
+
footer?: FrontstageBlock[];
|
|
22
|
+
afterFooter?: FrontstageBlock[];
|
|
23
|
+
};
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
|
|
1
27
|
export interface AccountLayout {
|
|
2
28
|
id: string;
|
|
29
|
+
account_id?: string;
|
|
3
30
|
name: string;
|
|
4
31
|
slug: string;
|
|
5
|
-
schema:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
}>;
|
|
12
|
-
};
|
|
13
|
-
data: Record<string, any>;
|
|
32
|
+
schema: AccountLayoutSchema;
|
|
33
|
+
values?: AccountLayoutValues;
|
|
34
|
+
data?: AccountLayoutValues;
|
|
35
|
+
created_at?: string;
|
|
36
|
+
updated_at?: string;
|
|
14
37
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type AccountModuleKey =
|
|
2
|
+
| "core.modules"
|
|
3
|
+
| "core.media"
|
|
4
|
+
| "core.change_management"
|
|
5
|
+
| "core.deployments"
|
|
6
|
+
| "cms.site_builder"
|
|
7
|
+
| "cms.custom_blocks"
|
|
8
|
+
| "cms.custom_layouts"
|
|
9
|
+
| "restaurant.menus"
|
|
10
|
+
| "engagement.events"
|
|
11
|
+
| "engagement.press"
|
|
12
|
+
| (string & {});
|
|
13
|
+
|
|
14
|
+
export interface AccountModule {
|
|
15
|
+
key: AccountModuleKey;
|
|
16
|
+
label: string;
|
|
17
|
+
category: string;
|
|
18
|
+
description: string;
|
|
19
|
+
default_enabled: boolean;
|
|
20
|
+
dependencies: AccountModuleKey[];
|
|
21
|
+
plan_entitlement: string | null;
|
|
22
|
+
active: boolean;
|
|
23
|
+
entitled: boolean;
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const AccountModules = {
|
|
28
|
+
CoreModules: "core.modules",
|
|
29
|
+
CoreMedia: "core.media",
|
|
30
|
+
CoreChangeManagement: "core.change_management",
|
|
31
|
+
CoreDeployments: "core.deployments",
|
|
32
|
+
CmsSiteBuilder: "cms.site_builder",
|
|
33
|
+
CmsCustomBlocks: "cms.custom_blocks",
|
|
34
|
+
CmsCustomLayouts: "cms.custom_layouts",
|
|
35
|
+
RestaurantMenus: "restaurant.menus",
|
|
36
|
+
EngagementEvents: "engagement.events",
|
|
37
|
+
EngagementPress: "engagement.press",
|
|
38
|
+
} as const satisfies Record<string, AccountModuleKey>;
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
export type FrontstageContractVersion = "2026-05-frontstage-v1";
|
|
2
|
+
|
|
3
|
+
export interface FrontstageImage {
|
|
4
|
+
url: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface FrontstageNavItem {
|
|
11
|
+
label: string;
|
|
12
|
+
href: string;
|
|
13
|
+
variant?: "link" | "button";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type FrontstageThemePreset = "classic-restaurant" | "premium-hospitality" | "fast-casual" | (string & {});
|
|
17
|
+
export type FrontstageAlertType = "banner" | "popup";
|
|
18
|
+
export type FrontstageAlertPosition = "top" | "bottom" | "center" | "bottom-right";
|
|
19
|
+
|
|
20
|
+
export interface FrontstageHourRow {
|
|
21
|
+
label: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface FrontstageSpecialHour {
|
|
26
|
+
id?: string;
|
|
27
|
+
date: string;
|
|
28
|
+
label: string;
|
|
29
|
+
title?: string;
|
|
30
|
+
value?: string;
|
|
31
|
+
notes?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface FrontstageAlert {
|
|
35
|
+
id: string;
|
|
36
|
+
title: string;
|
|
37
|
+
type: FrontstageAlertType;
|
|
38
|
+
position?: FrontstageAlertPosition;
|
|
39
|
+
dismissible: boolean;
|
|
40
|
+
content?: string;
|
|
41
|
+
media?: FrontstageImage;
|
|
42
|
+
cta?: {
|
|
43
|
+
label: string;
|
|
44
|
+
href: string;
|
|
45
|
+
};
|
|
46
|
+
analytics?: {
|
|
47
|
+
name?: string;
|
|
48
|
+
category?: string;
|
|
49
|
+
label?: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface FrontstageBlock<TProps = Record<string, unknown>> {
|
|
54
|
+
id: string;
|
|
55
|
+
type: FrontstageStandardBlockType | string;
|
|
56
|
+
variant?: string;
|
|
57
|
+
props: TProps;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type FrontstageStandardBlockType =
|
|
61
|
+
| "hero"
|
|
62
|
+
| "content"
|
|
63
|
+
| "feature-grid"
|
|
64
|
+
| "gallery"
|
|
65
|
+
| "media-feature"
|
|
66
|
+
| "menu-preview"
|
|
67
|
+
| "menu-section"
|
|
68
|
+
| "locations"
|
|
69
|
+
| "hours"
|
|
70
|
+
| "ordering"
|
|
71
|
+
| "cta"
|
|
72
|
+
| "events"
|
|
73
|
+
| "event-spotlight"
|
|
74
|
+
| "private-events"
|
|
75
|
+
| "contact-form"
|
|
76
|
+
| "testimonials"
|
|
77
|
+
| "press"
|
|
78
|
+
| "awards"
|
|
79
|
+
| "reviews"
|
|
80
|
+
| "newsletter"
|
|
81
|
+
| "faq"
|
|
82
|
+
| "html-embed";
|
|
83
|
+
|
|
84
|
+
export type FrontstageStandardBlockVariant =
|
|
85
|
+
| "default"
|
|
86
|
+
| "full-bleed-image"
|
|
87
|
+
| "background-video"
|
|
88
|
+
| "image-collage"
|
|
89
|
+
| "masonry"
|
|
90
|
+
| "carousel"
|
|
91
|
+
| "editorial-strip"
|
|
92
|
+
| "mixed-media"
|
|
93
|
+
| "full-width"
|
|
94
|
+
| "inline";
|
|
95
|
+
|
|
96
|
+
export interface FrontstageTheme {
|
|
97
|
+
preset?: FrontstageThemePreset;
|
|
98
|
+
colors: {
|
|
99
|
+
background: string;
|
|
100
|
+
foreground: string;
|
|
101
|
+
primary: string;
|
|
102
|
+
primaryForeground: string;
|
|
103
|
+
muted: string;
|
|
104
|
+
mutedForeground: string;
|
|
105
|
+
border: string;
|
|
106
|
+
secondary?: string;
|
|
107
|
+
secondaryForeground?: string;
|
|
108
|
+
accent?: string;
|
|
109
|
+
accentForeground?: string;
|
|
110
|
+
topbar?: string;
|
|
111
|
+
topbarForeground?: string;
|
|
112
|
+
};
|
|
113
|
+
fonts: {
|
|
114
|
+
heading: FrontstageFont;
|
|
115
|
+
body: FrontstageFont;
|
|
116
|
+
};
|
|
117
|
+
radius: string;
|
|
118
|
+
layout: {
|
|
119
|
+
container: "narrow" | "default" | "wide" | "full";
|
|
120
|
+
header: "default" | "centered-logo" | "split-nav" | "minimal";
|
|
121
|
+
footer: "simple" | "multi-column" | "location-heavy";
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface FrontstageFont {
|
|
126
|
+
source: "system" | "google" | "custom";
|
|
127
|
+
name: string;
|
|
128
|
+
family: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface FrontstageSiteResponse {
|
|
132
|
+
contractVersion: FrontstageContractVersion;
|
|
133
|
+
site: {
|
|
134
|
+
id: string;
|
|
135
|
+
accountId: string;
|
|
136
|
+
name: string;
|
|
137
|
+
baseUrl: string;
|
|
138
|
+
locale: string;
|
|
139
|
+
timezone: string;
|
|
140
|
+
description?: string | null;
|
|
141
|
+
status: "draft" | "published" | "archived";
|
|
142
|
+
};
|
|
143
|
+
brand: {
|
|
144
|
+
logo?: FrontstageImage;
|
|
145
|
+
favicon?: { url: string };
|
|
146
|
+
social?: Record<string, string>;
|
|
147
|
+
};
|
|
148
|
+
contact?: {
|
|
149
|
+
address?: string;
|
|
150
|
+
mapUrl?: string;
|
|
151
|
+
phone?: string;
|
|
152
|
+
email?: string;
|
|
153
|
+
neighborhood?: string;
|
|
154
|
+
hours?: FrontstageHourRow[];
|
|
155
|
+
specialHours?: FrontstageSpecialHour[];
|
|
156
|
+
};
|
|
157
|
+
theme: FrontstageTheme;
|
|
158
|
+
navigation: {
|
|
159
|
+
primary: FrontstageNavItem[];
|
|
160
|
+
footer: FrontstageNavItem[];
|
|
161
|
+
};
|
|
162
|
+
alerts?: FrontstageAlert[];
|
|
163
|
+
integrations?: {
|
|
164
|
+
analytics?: { gtmId?: string };
|
|
165
|
+
ordering?: { provider?: string; url?: string };
|
|
166
|
+
reservations?: { provider?: string; url?: string };
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface FrontstageResolvedLayout {
|
|
171
|
+
id: string | null;
|
|
172
|
+
name: string | null;
|
|
173
|
+
slug: string | null;
|
|
174
|
+
source?: "page" | "site" | "fallback" | "preview" | "override" | null;
|
|
175
|
+
theme?: Partial<FrontstageTheme["layout"]>;
|
|
176
|
+
navigation?: {
|
|
177
|
+
primary?: FrontstageNavItem[];
|
|
178
|
+
footer?: FrontstageNavItem[];
|
|
179
|
+
};
|
|
180
|
+
regions?: {
|
|
181
|
+
beforeHeader?: FrontstageBlock[];
|
|
182
|
+
afterHeader?: FrontstageBlock[];
|
|
183
|
+
beforeMain?: FrontstageBlock[];
|
|
184
|
+
afterMain?: FrontstageBlock[];
|
|
185
|
+
beforeFooter?: FrontstageBlock[];
|
|
186
|
+
footer?: FrontstageBlock[];
|
|
187
|
+
afterFooter?: FrontstageBlock[];
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface FrontstageSeo {
|
|
192
|
+
title: string;
|
|
193
|
+
description?: string;
|
|
194
|
+
canonical?: string;
|
|
195
|
+
noindex?: boolean;
|
|
196
|
+
image?: FrontstageImage;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface FrontstagePageResponse {
|
|
200
|
+
contractVersion: FrontstageContractVersion;
|
|
201
|
+
page: {
|
|
202
|
+
id: string;
|
|
203
|
+
title: string;
|
|
204
|
+
slug: string;
|
|
205
|
+
status: "draft" | "published" | "archived";
|
|
206
|
+
seo: FrontstageSeo;
|
|
207
|
+
blocks: FrontstageBlock[];
|
|
208
|
+
layout?: FrontstageResolvedLayout;
|
|
209
|
+
alerts?: FrontstageAlert[];
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface FrontstageRoute {
|
|
214
|
+
id?: string | null;
|
|
215
|
+
path: string;
|
|
216
|
+
slug?: string;
|
|
217
|
+
type?: string | null;
|
|
218
|
+
model?: string | null;
|
|
219
|
+
modelId?: string | null;
|
|
220
|
+
title?: string | null;
|
|
221
|
+
lastModified?: string | null;
|
|
222
|
+
changeFrequency?: "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never";
|
|
223
|
+
priority?: number;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export interface FrontstageRoutesResponse {
|
|
227
|
+
routes: FrontstageRoute[];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface FrontstageBlockDefinition {
|
|
231
|
+
id: string;
|
|
232
|
+
name: string;
|
|
233
|
+
type: FrontstageStandardBlockType | string;
|
|
234
|
+
category: string;
|
|
235
|
+
description: string;
|
|
236
|
+
variants: FrontstageStandardBlockVariant[] | string[];
|
|
237
|
+
fields: unknown[];
|
|
238
|
+
frontstage?: {
|
|
239
|
+
enabled: boolean;
|
|
240
|
+
type: FrontstageStandardBlockType | string;
|
|
241
|
+
defaultVariant?: FrontstageStandardBlockVariant | string;
|
|
242
|
+
variants: FrontstageStandardBlockVariant[] | string[];
|
|
243
|
+
category: string;
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export interface FrontstageBlocksResponse {
|
|
248
|
+
blocks: FrontstageBlockDefinition[];
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export interface FrontstagePreviewParams {
|
|
252
|
+
preview?: boolean;
|
|
253
|
+
previewId?: string;
|
|
254
|
+
}
|
package/src/types/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type * from "./api";
|
|
|
5
5
|
export type * from "./blueprint";
|
|
6
6
|
export type * from "./entry";
|
|
7
7
|
export type * from "./event";
|
|
8
|
+
export type * from "./frontstage";
|
|
8
9
|
export type * from "./instagram";
|
|
9
10
|
export type * from "./location";
|
|
10
11
|
export type * from "./media-item";
|
|
@@ -12,10 +13,13 @@ export type * from "./menu-category-item";
|
|
|
12
13
|
export type * from "./menu-category";
|
|
13
14
|
export type * from "./menu-item";
|
|
14
15
|
export type * from "./menu";
|
|
16
|
+
export { AccountModules } from "./account-module";
|
|
17
|
+
export type * from "./account-module";
|
|
15
18
|
export type * from "./navigation";
|
|
16
19
|
export type * from "./page";
|
|
17
20
|
export type * from "./press";
|
|
18
21
|
export type * from "./redirect";
|
|
22
|
+
export type * from "./review";
|
|
19
23
|
export type * from "./route";
|
|
20
24
|
export type * from "./website";
|
|
21
25
|
|