@ai-grator/api 0.1.38 → 0.1.39
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/build/admin/endpoints/commands/create-admin-page.command.d.ts +48 -0
- package/build/admin/endpoints/commands/create-admin-page.command.d.ts.map +1 -1
- package/build/admin/endpoints/commands/update-admin-page-status.command.d.ts +24 -0
- package/build/admin/endpoints/commands/update-admin-page-status.command.d.ts.map +1 -1
- package/build/admin/endpoints/commands/update-admin-page.command.d.ts +48 -0
- package/build/admin/endpoints/commands/update-admin-page.command.d.ts.map +1 -1
- package/build/admin/endpoints/queries/get-admin-page.query.d.ts +24 -0
- package/build/admin/endpoints/queries/get-admin-page.query.d.ts.map +1 -1
- package/build/admin/models/admin-page-response.schema.d.ts +12 -0
- package/build/admin/models/admin-page-response.schema.d.ts.map +1 -1
- package/build/model-page/endpoints/model-page.d.ts +4 -0
- package/build/model-page/endpoints/model-page.d.ts.map +1 -1
- package/build/model-page/endpoints/model-page.js +5 -1
- package/build/model-page/endpoints/queries/get-public-model-by-slug.query.d.ts +24 -0
- package/build/model-page/endpoints/queries/get-public-model-by-slug.query.d.ts.map +1 -1
- package/build/model-page/endpoints/queries/get-public-page-by-slug.query.d.ts +387 -0
- package/build/model-page/endpoints/queries/get-public-page-by-slug.query.d.ts.map +1 -0
- package/build/model-page/endpoints/queries/get-public-page-by-slug.query.js +25 -0
- package/build/model-page/endpoints/queries/index.d.ts +1 -0
- package/build/model-page/endpoints/queries/index.d.ts.map +1 -1
- package/build/model-page/endpoints/queries/index.js +1 -0
- package/build/model-page/models/index.d.ts +1 -0
- package/build/model-page/models/index.d.ts.map +1 -1
- package/build/model-page/models/index.js +1 -0
- package/build/model-page/models/page-content.schema.d.ts +37 -0
- package/build/model-page/models/page-content.schema.d.ts.map +1 -1
- package/build/model-page/models/page-content.schema.js +13 -1
- package/build/model-page/models/public-model-detail.schema.d.ts +12 -0
- package/build/model-page/models/public-model-detail.schema.d.ts.map +1 -1
- package/build/model-page/models/public-page.schema.d.ts +187 -0
- package/build/model-page/models/public-page.schema.d.ts.map +1 -0
- package/build/model-page/models/public-page.schema.js +16 -0
- package/build/scripts/generate-openapi.js +62 -491
- package/build/tsconfig.tsbuildinfo +1 -1
- package/model-page/endpoints/model-page.ts +6 -0
- package/model-page/endpoints/queries/get-public-page-by-slug.query.ts +28 -0
- package/model-page/endpoints/queries/index.ts +1 -0
- package/model-page/models/index.ts +1 -0
- package/model-page/models/page-content.schema.ts +15 -0
- package/model-page/models/public-page.schema.ts +17 -0
- package/package.json +1 -1
- package/scripts/generate-openapi.ts +89 -526
|
@@ -4,3 +4,9 @@ export const PUBLIC_MODEL_ROUTES = {
|
|
|
4
4
|
LIST: '',
|
|
5
5
|
GET_BY_SLUG: (slug: string) => `${slug}`,
|
|
6
6
|
} as const;
|
|
7
|
+
|
|
8
|
+
export const PUBLIC_PAGE_CONTROLLER = 'pages' as const;
|
|
9
|
+
|
|
10
|
+
export const PUBLIC_PAGE_ROUTES = {
|
|
11
|
+
GET_BY_SLUG: (slug: string) => `${slug}`,
|
|
12
|
+
} as const;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defineContract, HTTP_METHODS, HttpErrorResponseSchema } from '../../../_common';
|
|
3
|
+
import { PublicPageSchema } from '../../models';
|
|
4
|
+
import { PUBLIC_PAGE_ROUTES } from '../model-page';
|
|
5
|
+
|
|
6
|
+
export const GetPublicPageBySlugQueryParams = z.object({
|
|
7
|
+
slug: z.string().min(1),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const GetPublicPageBySlugQueryResponse = PublicPageSchema;
|
|
11
|
+
|
|
12
|
+
export const GetPublicPageBySlugQuery = defineContract({
|
|
13
|
+
method: HTTP_METHODS.GET,
|
|
14
|
+
path: PUBLIC_PAGE_ROUTES.GET_BY_SLUG(':slug'),
|
|
15
|
+
summary: 'Get published static or hub page by slug',
|
|
16
|
+
request: {
|
|
17
|
+
params: GetPublicPageBySlugQueryParams,
|
|
18
|
+
},
|
|
19
|
+
responses: {
|
|
20
|
+
200: GetPublicPageBySlugQueryResponse,
|
|
21
|
+
404: HttpErrorResponseSchema,
|
|
22
|
+
500: HttpErrorResponseSchema,
|
|
23
|
+
503: HttpErrorResponseSchema,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type GetPublicPageBySlugQueryParamsType = z.infer<typeof GetPublicPageBySlugQueryParams>;
|
|
28
|
+
export type GetPublicPageBySlugQueryResponseType = z.infer<typeof GetPublicPageBySlugQueryResponse>;
|
|
@@ -166,6 +166,20 @@ export const PricingWidgetBlockSchema = BlockBaseSchema.extend({
|
|
|
166
166
|
ctaSlug: z.string().min(1),
|
|
167
167
|
});
|
|
168
168
|
|
|
169
|
+
export const PricingTableBlockSchema = BlockBaseSchema.extend({
|
|
170
|
+
type: z.literal('pricingTable'),
|
|
171
|
+
rows: z
|
|
172
|
+
.array(
|
|
173
|
+
z.object({
|
|
174
|
+
label: z.string().min(1),
|
|
175
|
+
price: z.string().min(1),
|
|
176
|
+
unit: z.string().min(1),
|
|
177
|
+
note: z.string().min(1).nullable(),
|
|
178
|
+
}),
|
|
179
|
+
)
|
|
180
|
+
.min(1),
|
|
181
|
+
});
|
|
182
|
+
|
|
169
183
|
export const PageContentBlockSchema = z.discriminatedUnion('type', [
|
|
170
184
|
RichTextBlockSchema,
|
|
171
185
|
FeatureListBlockSchema,
|
|
@@ -178,6 +192,7 @@ export const PageContentBlockSchema = z.discriminatedUnion('type', [
|
|
|
178
192
|
RelatedLinksBlockSchema,
|
|
179
193
|
DemoBlockSchema,
|
|
180
194
|
PricingWidgetBlockSchema,
|
|
195
|
+
PricingTableBlockSchema,
|
|
181
196
|
]);
|
|
182
197
|
|
|
183
198
|
export const PageContentSchema = z.object({
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PAGE_TYPE } from '../enums';
|
|
3
|
+
import { PageContentSchema } from './page-content.schema';
|
|
4
|
+
import { SchemaTogglesSchema } from './schema-toggles.schema';
|
|
5
|
+
import { PublicSeoMetaSchema } from './seo-meta.schema';
|
|
6
|
+
|
|
7
|
+
export const PUBLIC_PAGE_TYPES = [PAGE_TYPE.STATIC, PAGE_TYPE.HUB] as const;
|
|
8
|
+
|
|
9
|
+
export const PublicPageSchema = z.object({
|
|
10
|
+
slug: z.string().min(1),
|
|
11
|
+
type: z.enum(PUBLIC_PAGE_TYPES),
|
|
12
|
+
seo: PublicSeoMetaSchema,
|
|
13
|
+
schemaToggles: SchemaTogglesSchema,
|
|
14
|
+
content: PageContentSchema.nullable(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type PublicPageSchemaType = z.infer<typeof PublicPageSchema>;
|