kizlo 0.17.0 → 0.18.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/category/index.js +4 -4
- package/dist/category/schema.d.ts +153 -0
- package/dist/category/schema.js +4 -3
- package/dist/cli/daemon/generate.js +6 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.js +8 -3
- package/dist/package.js +1 -1
- package/dist/page/index.js +3 -3
- package/dist/page/schema.d.ts +226 -0
- package/dist/page/schema.js +4 -3
- package/dist/post/index.js +3 -3
- package/dist/post/schema.d.ts +268 -0
- package/dist/post/schema.js +4 -3
- package/dist/procedures.d.ts +31 -897
- package/dist/seo/index.js +1 -1
- package/dist/seo/schema.d.ts +5 -5
- package/dist/shared/contract.d.ts +1 -1
- package/dist/shared/procedure.d.ts +12 -3
- package/dist/shared/procedure.js +4 -0
- package/dist/shared/result.d.ts +16 -7
- package/dist/shared/types.d.ts +1 -1
- package/dist/tag/index.js +3 -3
- package/dist/tag/schema.d.ts +151 -0
- package/dist/tag/schema.js +4 -3
- package/dist/wordpress/generate.js +41 -3
- package/dist/wordpress/index.d.ts +1 -1
- package/dist/wordpress/types.d.ts +34 -12
- package/package.json +1 -1
package/dist/category/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Category, CategoryList, ListCategoryInput, RetrieveCategoryInput } from "./schema.js";
|
|
2
|
+
import { createProcedure, schemaType } from "../shared/procedure.js";
|
|
2
3
|
import { parseIdentifier } from "../shared/identifier.js";
|
|
3
4
|
import { deserializeListMetadata } from "../shared/serialize.js";
|
|
4
5
|
import { GET_CATEGORY_ERROR_MAP, LIST_CATEGORY_ERROR_MAP } from "./error.js";
|
|
5
|
-
import { Category, CategoryList, ListCategoryInput, RetrieveCategoryInput } from "./schema.js";
|
|
6
6
|
import { deserializeCategory } from "./utils.js";
|
|
7
7
|
import { normalizeArrayableValue } from "@kizlo/shared";
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ const CATEGORY_PROCEDURES = {
|
|
|
13
13
|
method: "GET",
|
|
14
14
|
path: "/categories/{identifier}",
|
|
15
15
|
params: RetrieveCategoryInput.pick({ identifier: true }),
|
|
16
|
-
output: Category,
|
|
16
|
+
output: schemaType(Category),
|
|
17
17
|
errors: GET_CATEGORY_ERROR_MAP
|
|
18
18
|
}, async ({ input, context, errors }) => {
|
|
19
19
|
const identifier = parseIdentifier(input.params.identifier);
|
|
@@ -38,7 +38,7 @@ const CATEGORY_PROCEDURES = {
|
|
|
38
38
|
method: "GET",
|
|
39
39
|
path: "/categories",
|
|
40
40
|
query: ListCategoryInput.optional(),
|
|
41
|
-
output: CategoryList,
|
|
41
|
+
output: schemaType(CategoryList),
|
|
42
42
|
errors: LIST_CATEGORY_ERROR_MAP
|
|
43
43
|
}, async ({ input, context, errors }) => {
|
|
44
44
|
const response = await context.wordpress.taxonomies.category.list({
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { WP_CustomFields } from "../wordpress/types.js";
|
|
2
|
+
import "../wordpress/index.js";
|
|
3
|
+
import * as _kizlo_shared0 from "@kizlo/shared";
|
|
4
|
+
import z from "zod/v4";
|
|
5
|
+
|
|
6
|
+
//#region src/category/schema.d.ts
|
|
7
|
+
type CategoryCustomFields = WP_CustomFields<"taxonomies.category">;
|
|
8
|
+
declare const CategoryCustomFieldsSchema: z.ZodType<CategoryCustomFields, CategoryCustomFields>;
|
|
9
|
+
declare const Category: z.ZodObject<{
|
|
10
|
+
id: z.ZodNumber;
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
slug: z.ZodString;
|
|
13
|
+
url: z.ZodNullable<z.ZodString>;
|
|
14
|
+
description: z.ZodNullable<z.ZodString>;
|
|
15
|
+
parent: z.ZodNullable<z.ZodNumber>;
|
|
16
|
+
postCount: z.ZodNumber;
|
|
17
|
+
seo: z.ZodNullable<z.ZodObject<{
|
|
18
|
+
head: z.ZodObject<{
|
|
19
|
+
title: z.ZodString;
|
|
20
|
+
canonical: z.ZodString;
|
|
21
|
+
robots: z.ZodObject<{
|
|
22
|
+
index: z.ZodString;
|
|
23
|
+
follow: z.ZodString;
|
|
24
|
+
maxSnippet: z.ZodString;
|
|
25
|
+
maxImagePreview: z.ZodString;
|
|
26
|
+
maxVideoPreview: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
og: z.ZodObject<{
|
|
29
|
+
locale: z.ZodString;
|
|
30
|
+
type: z.ZodString;
|
|
31
|
+
title: z.ZodString;
|
|
32
|
+
url: z.ZodString;
|
|
33
|
+
siteName: z.ZodString;
|
|
34
|
+
description: z.ZodString;
|
|
35
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
36
|
+
url: z.ZodString;
|
|
37
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
38
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
39
|
+
type: z.ZodNullable<z.ZodString>;
|
|
40
|
+
alt: z.ZodNullable<z.ZodString>;
|
|
41
|
+
}, z.core.$strip>>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
twitter: z.ZodObject<{
|
|
44
|
+
card: z.ZodEnum<{
|
|
45
|
+
summary: "summary";
|
|
46
|
+
summary_large_image: "summary_large_image";
|
|
47
|
+
}>;
|
|
48
|
+
title: z.ZodString;
|
|
49
|
+
site: z.ZodNullable<z.ZodString>;
|
|
50
|
+
creator: z.ZodNullable<z.ZodString>;
|
|
51
|
+
description: z.ZodString;
|
|
52
|
+
image: z.ZodNullable<z.ZodString>;
|
|
53
|
+
imageAlt: z.ZodNullable<z.ZodString>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
article: z.ZodNullable<z.ZodObject<{
|
|
56
|
+
publishedTime: z.ZodString;
|
|
57
|
+
modifiedTime: z.ZodString;
|
|
58
|
+
author: z.ZodString;
|
|
59
|
+
authorUrl: z.ZodString;
|
|
60
|
+
section: z.ZodString;
|
|
61
|
+
tags: z.ZodArray<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
schema: z.ZodObject<{
|
|
65
|
+
"@context": z.ZodLiteral<"https://schema.org">;
|
|
66
|
+
"@graph": z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
custom: z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>;
|
|
70
|
+
meta: z.ZodRecord<z.ZodString, z.ZodType<_kizlo_shared0.JSONValue, unknown, z.core.$ZodTypeInternals<_kizlo_shared0.JSONValue, unknown>>>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
type Category = Omit<z.output<typeof Category>, "custom"> & {
|
|
73
|
+
custom: CategoryCustomFields;
|
|
74
|
+
};
|
|
75
|
+
declare const CategoryList: z.ZodObject<{
|
|
76
|
+
items: z.ZodArray<z.ZodObject<{
|
|
77
|
+
id: z.ZodNumber;
|
|
78
|
+
name: z.ZodString;
|
|
79
|
+
slug: z.ZodString;
|
|
80
|
+
url: z.ZodNullable<z.ZodString>;
|
|
81
|
+
description: z.ZodNullable<z.ZodString>;
|
|
82
|
+
parent: z.ZodNullable<z.ZodNumber>;
|
|
83
|
+
postCount: z.ZodNumber;
|
|
84
|
+
seo: z.ZodNullable<z.ZodObject<{
|
|
85
|
+
head: z.ZodObject<{
|
|
86
|
+
title: z.ZodString;
|
|
87
|
+
canonical: z.ZodString;
|
|
88
|
+
robots: z.ZodObject<{
|
|
89
|
+
index: z.ZodString;
|
|
90
|
+
follow: z.ZodString;
|
|
91
|
+
maxSnippet: z.ZodString;
|
|
92
|
+
maxImagePreview: z.ZodString;
|
|
93
|
+
maxVideoPreview: z.ZodString;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
og: z.ZodObject<{
|
|
96
|
+
locale: z.ZodString;
|
|
97
|
+
type: z.ZodString;
|
|
98
|
+
title: z.ZodString;
|
|
99
|
+
url: z.ZodString;
|
|
100
|
+
siteName: z.ZodString;
|
|
101
|
+
description: z.ZodString;
|
|
102
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
103
|
+
url: z.ZodString;
|
|
104
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
105
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
106
|
+
type: z.ZodNullable<z.ZodString>;
|
|
107
|
+
alt: z.ZodNullable<z.ZodString>;
|
|
108
|
+
}, z.core.$strip>>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
twitter: z.ZodObject<{
|
|
111
|
+
card: z.ZodEnum<{
|
|
112
|
+
summary: "summary";
|
|
113
|
+
summary_large_image: "summary_large_image";
|
|
114
|
+
}>;
|
|
115
|
+
title: z.ZodString;
|
|
116
|
+
site: z.ZodNullable<z.ZodString>;
|
|
117
|
+
creator: z.ZodNullable<z.ZodString>;
|
|
118
|
+
description: z.ZodString;
|
|
119
|
+
image: z.ZodNullable<z.ZodString>;
|
|
120
|
+
imageAlt: z.ZodNullable<z.ZodString>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
article: z.ZodNullable<z.ZodObject<{
|
|
123
|
+
publishedTime: z.ZodString;
|
|
124
|
+
modifiedTime: z.ZodString;
|
|
125
|
+
author: z.ZodString;
|
|
126
|
+
authorUrl: z.ZodString;
|
|
127
|
+
section: z.ZodString;
|
|
128
|
+
tags: z.ZodArray<z.ZodString>;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
schema: z.ZodObject<{
|
|
132
|
+
"@context": z.ZodLiteral<"https://schema.org">;
|
|
133
|
+
"@graph": z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
custom: z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>;
|
|
137
|
+
meta: z.ZodRecord<z.ZodString, z.ZodType<_kizlo_shared0.JSONValue, unknown, z.core.$ZodTypeInternals<_kizlo_shared0.JSONValue, unknown>>>;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
meta: z.ZodObject<{
|
|
140
|
+
page: z.ZodNumber;
|
|
141
|
+
totalItems: z.ZodNumber;
|
|
142
|
+
totalPages: z.ZodNumber;
|
|
143
|
+
nextPage: z.ZodNullable<z.ZodNumber>;
|
|
144
|
+
prevPage: z.ZodNullable<z.ZodNumber>;
|
|
145
|
+
hasNextPage: z.ZodBoolean;
|
|
146
|
+
hasPrevPage: z.ZodBoolean;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
}, z.core.$strip>;
|
|
149
|
+
type CategoryList = Omit<z.output<typeof CategoryList>, "items"> & {
|
|
150
|
+
items: Category[];
|
|
151
|
+
};
|
|
152
|
+
//#endregion
|
|
153
|
+
export { Category, CategoryCustomFields, CategoryCustomFieldsSchema, CategoryList };
|
package/dist/category/schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IdentifierInput, ListMetadata, ListOrder, customFieldsSchema } from "../shared/schema.js";
|
|
2
1
|
import { Seo } from "../seo/schema.js";
|
|
2
|
+
import { IdentifierInput, ListMetadata, ListOrder, customFieldsSchema } from "../shared/schema.js";
|
|
3
3
|
import { BooleanLike, Metadata, NumberLike, arrayable, lenient } from "@kizlo/shared";
|
|
4
4
|
import z from "zod/v4";
|
|
5
5
|
|
|
@@ -14,6 +14,7 @@ const WP_CATEGORY_ORDER_BYS = [
|
|
|
14
14
|
"description",
|
|
15
15
|
"count"
|
|
16
16
|
];
|
|
17
|
+
const CategoryCustomFieldsSchema = customFieldsSchema();
|
|
17
18
|
const Category = z.object({
|
|
18
19
|
id: z.number(),
|
|
19
20
|
name: z.string(),
|
|
@@ -23,7 +24,7 @@ const Category = z.object({
|
|
|
23
24
|
parent: z.number().nullable(),
|
|
24
25
|
postCount: z.number(),
|
|
25
26
|
seo: Seo.nullable(),
|
|
26
|
-
custom:
|
|
27
|
+
custom: CategoryCustomFieldsSchema,
|
|
27
28
|
meta: Metadata
|
|
28
29
|
});
|
|
29
30
|
const RetrieveCategoryInput = z.object({ identifier: IdentifierInput });
|
|
@@ -47,4 +48,4 @@ const ListCategoryInput = z.object({
|
|
|
47
48
|
});
|
|
48
49
|
|
|
49
50
|
//#endregion
|
|
50
|
-
export { Category, CategoryList, ListCategoryInput, RetrieveCategoryInput };
|
|
51
|
+
export { Category, CategoryCustomFieldsSchema, CategoryList, ListCategoryInput, RetrieveCategoryInput };
|
|
@@ -51,6 +51,12 @@ const WORDPRESS_STUB = [
|
|
|
51
51
|
`\tinterface WordPressClientRegistry {`,
|
|
52
52
|
`\t\tendpoints: typeof endpoints`,
|
|
53
53
|
`\t}`,
|
|
54
|
+
`\tinterface WordPressEndpointRegistry {`,
|
|
55
|
+
`\t\t[path: string]: any`,
|
|
56
|
+
`\t}`,
|
|
57
|
+
`\tinterface WordPressCustomFieldsRegistry {`,
|
|
58
|
+
`\t\t[path: string]: Record<string, unknown>`,
|
|
59
|
+
`\t}`,
|
|
54
60
|
`}`,
|
|
55
61
|
``
|
|
56
62
|
].join("\n");
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WP_Error } from "./wordpress/error.js";
|
|
2
|
-
import { ActiveWordPressClient, WP_CallOptions, WP_Client, WP_CommonErrorCode, WP_CurrencyFormat, WP_Endpoint, WP_EndpointData, WP_EndpointDefinition, WP_EndpointInput, WP_EndpointResult, WP_ErrorData, WP_Failure, WP_List, WP_ListMetadata, WP_RequestBuild, WP_RequestContentType, WP_RequestInput, WP_RequestMethod, WP_ResponseContentType, WP_Result, WP_Success, WP_TransportFailure, WP_TypedHeaders, WordPressClientRegistry, WordPressCredentials } from "./wordpress/types.js";
|
|
2
|
+
import { ActiveWordPressClient, WP_CallOptions, WP_Client, WP_CommonErrorCode, WP_CurrencyFormat, WP_CustomFields, WP_CustomFieldsPath, WP_Endpoint, WP_EndpointData, WP_EndpointDefinition, WP_EndpointError, WP_EndpointInput, WP_EndpointPath, WP_EndpointResult, WP_ErrorData, WP_Failure, WP_List, WP_ListMetadata, WP_RequestBuild, WP_RequestContentType, WP_RequestInput, WP_RequestMethod, WP_ResponseContentType, WP_Result, WP_Success, WP_TransportFailure, WP_TypedHeaders, WordPressClientRegistry, WordPressCredentials, WordPressCustomFieldsRegistry, WordPressEndpointRegistry } from "./wordpress/types.js";
|
|
3
3
|
import { WordPressTransport, WordPressTransportOptions, WordPressTransportResult } from "./wordpress/transport.js";
|
|
4
4
|
import { buildWordPressRequest, createWordPressClient, wpEndpoint } from "./wordpress/endpoint.js";
|
|
5
5
|
import { isWordPressResourceError } from "./wordpress/utils.js";
|
|
@@ -19,12 +19,17 @@ import { IconDescriptor, ManifestIcon, ResolvedIcons, resolveIcons } from "./bra
|
|
|
19
19
|
import { CookiesStorage } from "./cookie.js";
|
|
20
20
|
import { SettingsService } from "./settings/service.js";
|
|
21
21
|
import { AuthUserFn, ConnInfoFn, Context, ContextConfig, ProcedureContext, VerifyCaptchaFn, VerifyPreviewTokenFn } from "./context.js";
|
|
22
|
+
import { Post, PostCustomFields, PostCustomFieldsSchema } from "./post/schema.js";
|
|
23
|
+
import { Page, PageCustomFields, PageCustomFieldsSchema } from "./page/schema.js";
|
|
24
|
+
import { Category, CategoryCustomFields, CategoryCustomFieldsSchema } from "./category/schema.js";
|
|
25
|
+
import { Tag, TagCustomFields, TagCustomFieldsSchema } from "./tag/schema.js";
|
|
22
26
|
import { CORE_PROCEDURES, CoreProcedures } from "./procedures.js";
|
|
23
27
|
import { AnyEventSchema, AnyEvents, EventHandler, EventHandlerFn, InferEventUnion, WebhookOptions, createEventHandler, createWebhookRouter } from "./webhook/index.js";
|
|
24
28
|
import { COMMON_ERRORS, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, DefinedErrorMapLike, ErrorDefinition, KizloError, KizloErrorOptions, ThrowableErrorFn, ThrowableErrorMap, WithCommonErrorMap, createThrowableErrorMap, defineErrorMap, isKizloError, toKizloError } from "./shared/error.js";
|
|
25
29
|
import { AnyMiddleware, ExtractMiddlewareContextOutput, InferMiddlewares, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, createMiddleware } from "./shared/middleware.js";
|
|
26
30
|
import { AnyProcedure, AnyProcedureTree, BaseHandlerOptions, ExtractParams, ExtractProcedureByScope, InvocationScope, OpenapiPart, Procedure, ProcedureErrors, ProcedureHandler, ProcedureOptions, ProcedureTreeDepthTuple, ResolveParamsPart, ResolvedSchemaInput, ResolvedSchemaOutput, SchemaIO, buildProcedure, combineDetailed, createProcedure, handleUnexpectedError, schemaType } from "./shared/procedure.js";
|
|
27
31
|
import { AnyIntegration, EnvReader, EnvRecord, EnvSource, ExtractIntegrationProcedures, InferIntegrationProcedures, Integration, IntegrationRequirements, KizloEnv, WordPressEnv, assertIntegrationEndpoints, assertIntegrationEnv, createIntegration, missingEndpoints, missingEnv, readEnv } from "./shared/integration.js";
|
|
32
|
+
import { InferProcedureData, InferProcedureError, InferProcedureInput, InferProcedureResult, KizloErrorUnion, KizloResult, MaybeCallerOptions, ProcedureMethod, ResultClient, createResultClient } from "./shared/result.js";
|
|
28
33
|
import { AnyKizloConfig, CreateKizloOptions, Kizlo, KizloConfig, RootProcedures, S2SClient, createKizlo, integrationEnv, resolveKizloConfig, resolveWordPressConnection } from "./kizlo.js";
|
|
29
34
|
import { WEB_MANIFEST_ROUTE, WebManifest, buildWebManifest, createManifestRoute } from "./brand/manifest.js";
|
|
30
35
|
import "./brand/index.js";
|
|
@@ -38,4 +43,4 @@ import { ShaAlgorithm, compare, hash, hmac } from "./shared/crypto.js";
|
|
|
38
43
|
import { Identifier, parseIdentifier } from "./shared/identifier.js";
|
|
39
44
|
import { createOrpcRouter } from "./shared/router.js";
|
|
40
45
|
import { deserializeCurrencyFormat, deserializeListMetadata, emptyList, serializeCurrencyFormat } from "./shared/serialize.js";
|
|
41
|
-
export { ActiveWordPressClient, AnyContext, AnyEventSchema, AnyEvents, AnyIntegration, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureTree, AuthAdapter, AuthGetUser, AuthUser, AuthUserFn, AuthorsSettings, AuthorsSettingsInput, BaseHandlerOptions, BrandSettings, BrandSettingsInput, COMMON_ERRORS, CONTENT_TYPES, CORE_PROCEDURES, CaptchaAdapter, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, ConnInfo, ConnInfoFn, ConsoleLogAdapterOptions, ContentType, Context, ContextConfig, Contract, ContractProcedure, CookiesAdapter, CookiesDeleteAll, CookiesGetAll, CookiesSetAll, CookiesStorage, CoreProcedures, CrawlingSettings, CrawlingSettingsInput, CreateKizloOptions, CreateSitemapRouteOptions, CurrencyFormat, DefinedErrorMapLike, DevPluginSource, EnvReader, EnvRecord, EnvSource, ErrorDefinition, EventHandler, EventHandlerFn, ExtractIntegrationProcedures, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, Fixture, FixtureCleanupFn, FixtureSeedFn, FixtureSettleFn, GeoAdapter, GeoGetConnInfo, HTTPMethod, HeadlessSettings, HeadlessSettingsInput, IconDescriptor, Identifier, IdentifierInput, IdentitySettings, IdentitySettingsInput, InferEventUnion, InferIntegrationProcedures, InferMiddlewares, Integration, IntegrationRequirements, InvocationScope, JsonValue, Kizlo, KizloClient, KizloClientConfig, KizloConfig, KizloEnv, KizloError, KizloErrorOptions, LIST_ORDER, List, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, LocalPlugin, LogLevel, LogPayload, Logger, LoggerAdapter, ManifestIcon, MaybeOptionalOptions, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, OpenapiPart, OrganizationFounder, OrganizationSettings, OrganizationSettingsInput, PersonSettings, PersonSettingsInput, PluginSource, PostStatusDefinition, PostTypeSettings, PostTypeSettingsInput, PreviewTokenData, PreviewTokenPayload, Procedure, ProcedureContext, ProcedureErrors, ProcedureHandler, ProcedureOptions, ProcedureTreeDepthTuple, RedirectInput, RedirectStatus, ResolveParamsPart, ResolvedIcons, ResolvedSchemaInput, ResolvedSchemaOutput, Robots, RobotsRule, RootProcedures, S2SClient, SITEMAP_BASE, SITEMAP_INDEX_SLUG, SchemaIO, SeedContext, Seo, SeoHead, SeoSchema, ServiceAdapters, Settings, SettingsService, SettleContext, ShaAlgorithm, SiteSettings, SiteSettingsInput, Sitemap, SitemapIndex, SitemapIndexEntry, SitemapList, SitemapRouteExtra, SitemapUrl, SitemapUrlImage, SitemapUrlList, SocialProfile, TaxonomySettings, TaxonomySettingsInput, TestAdminUser, TestCredentials, TestUser, ThrowableErrorFn, ThrowableErrorMap, UploadsSettings, UploadsSettingsInput, VerifyCaptchaFn, VerifyPreviewTokenFn, WEB_MANIFEST_ROUTE, WPK_RobotRule, WPK_Robots, WPK_Seo, WPK_Sitemap, WPK_SitemapUrl, WPK_SitemapUrlImage, WP_CallOptions, WP_Client, WP_CommonErrorCode, WP_CurrencyFormat, WP_Endpoint, WP_EndpointData, WP_EndpointDefinition, WP_EndpointInput, WP_EndpointResult, WP_Error, WP_ErrorData, WP_Failure, WP_List, WP_ListMetadata, WP_RequestBuild, WP_RequestContentType, WP_RequestInput, WP_RequestMethod, WP_ResponseContentType, WP_Result, WP_Success, WP_TransportFailure, WP_TypedHeaders, WebManifest, WebhookOptions, WebhookSettings, WebhookSettingsInput, WithCommonErrorMap, WordPressClientRegistry, WordPressCredentials, WordPressEnv, WordPressTransport, WordPressTransportOptions, WordPressTransportResult, altcha, arkose, assertIntegrationEndpoints, assertIntegrationEnv, authMock, buildProcedure, buildWebManifest, buildWordPressRequest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createGeoAdapter, createIntegration, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, createMiddleware, createOrpcRouter, createProcedure, createSitemapRedirectRoute, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, createWordPressClient, customFieldsSchema, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, deserializeSeo, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, integrationEnv, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, mergeServiceAdapters, missingEndpoints, missingEnv, noopAdapter, parseIdentifier, parseSitemapSlug, readEnv, recaptcha, renderJsonLd, renderSitemapIndex, renderUrlSet, resolveIcons, resolveKizloConfig, resolveWordPressConnection, restoreContract, schemaType, serializeCurrencyFormat, sitemapEntryPath, toKizloError, turnstile, wpEndpoint, xmlResponse };
|
|
46
|
+
export { ActiveWordPressClient, AnyContext, AnyEventSchema, AnyEvents, AnyIntegration, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureTree, AuthAdapter, AuthGetUser, AuthUser, AuthUserFn, AuthorsSettings, AuthorsSettingsInput, BaseHandlerOptions, BrandSettings, BrandSettingsInput, COMMON_ERRORS, CONTENT_TYPES, CORE_PROCEDURES, CaptchaAdapter, type Category, type CategoryCustomFields, CategoryCustomFieldsSchema, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, ConnInfo, ConnInfoFn, ConsoleLogAdapterOptions, ContentType, Context, ContextConfig, Contract, ContractProcedure, CookiesAdapter, CookiesDeleteAll, CookiesGetAll, CookiesSetAll, CookiesStorage, CoreProcedures, CrawlingSettings, CrawlingSettingsInput, CreateKizloOptions, CreateSitemapRouteOptions, CurrencyFormat, DefinedErrorMapLike, DevPluginSource, EnvReader, EnvRecord, EnvSource, ErrorDefinition, EventHandler, EventHandlerFn, ExtractIntegrationProcedures, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, Fixture, FixtureCleanupFn, FixtureSeedFn, FixtureSettleFn, GeoAdapter, GeoGetConnInfo, HTTPMethod, HeadlessSettings, HeadlessSettingsInput, IconDescriptor, Identifier, IdentifierInput, IdentitySettings, IdentitySettingsInput, InferEventUnion, InferIntegrationProcedures, InferMiddlewares, InferProcedureData, InferProcedureError, InferProcedureInput, InferProcedureResult, Integration, IntegrationRequirements, InvocationScope, JsonValue, Kizlo, KizloClient, KizloClientConfig, KizloConfig, KizloEnv, KizloError, KizloErrorOptions, KizloErrorUnion, KizloResult, LIST_ORDER, List, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, LocalPlugin, LogLevel, LogPayload, Logger, LoggerAdapter, ManifestIcon, MaybeCallerOptions, MaybeOptionalOptions, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, OpenapiPart, OrganizationFounder, OrganizationSettings, OrganizationSettingsInput, type Page, type PageCustomFields, PageCustomFieldsSchema, PersonSettings, PersonSettingsInput, PluginSource, type Post, type PostCustomFields, PostCustomFieldsSchema, PostStatusDefinition, PostTypeSettings, PostTypeSettingsInput, PreviewTokenData, PreviewTokenPayload, Procedure, ProcedureContext, ProcedureErrors, ProcedureHandler, ProcedureMethod, ProcedureOptions, ProcedureTreeDepthTuple, RedirectInput, RedirectStatus, ResolveParamsPart, ResolvedIcons, ResolvedSchemaInput, ResolvedSchemaOutput, ResultClient, Robots, RobotsRule, RootProcedures, S2SClient, SITEMAP_BASE, SITEMAP_INDEX_SLUG, SchemaIO, SeedContext, Seo, SeoHead, SeoSchema, ServiceAdapters, Settings, SettingsService, SettleContext, ShaAlgorithm, SiteSettings, SiteSettingsInput, Sitemap, SitemapIndex, SitemapIndexEntry, SitemapList, SitemapRouteExtra, SitemapUrl, SitemapUrlImage, SitemapUrlList, SocialProfile, type Tag, type TagCustomFields, TagCustomFieldsSchema, TaxonomySettings, TaxonomySettingsInput, TestAdminUser, TestCredentials, TestUser, ThrowableErrorFn, ThrowableErrorMap, UploadsSettings, UploadsSettingsInput, VerifyCaptchaFn, VerifyPreviewTokenFn, WEB_MANIFEST_ROUTE, WPK_RobotRule, WPK_Robots, WPK_Seo, WPK_Sitemap, WPK_SitemapUrl, WPK_SitemapUrlImage, WP_CallOptions, WP_Client, WP_CommonErrorCode, WP_CurrencyFormat, WP_CustomFields, WP_CustomFieldsPath, WP_Endpoint, WP_EndpointData, WP_EndpointDefinition, WP_EndpointError, WP_EndpointInput, WP_EndpointPath, WP_EndpointResult, WP_Error, WP_ErrorData, WP_Failure, WP_List, WP_ListMetadata, WP_RequestBuild, WP_RequestContentType, WP_RequestInput, WP_RequestMethod, WP_ResponseContentType, WP_Result, WP_Success, WP_TransportFailure, WP_TypedHeaders, WebManifest, WebhookOptions, WebhookSettings, WebhookSettingsInput, WithCommonErrorMap, WordPressClientRegistry, WordPressCredentials, WordPressCustomFieldsRegistry, WordPressEndpointRegistry, WordPressEnv, WordPressTransport, WordPressTransportOptions, WordPressTransportResult, altcha, arkose, assertIntegrationEndpoints, assertIntegrationEnv, authMock, buildProcedure, buildWebManifest, buildWordPressRequest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createGeoAdapter, createIntegration, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, createMiddleware, createOrpcRouter, createProcedure, createResultClient, createSitemapRedirectRoute, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, createWordPressClient, customFieldsSchema, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, deserializeSeo, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, integrationEnv, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, mergeServiceAdapters, missingEndpoints, missingEnv, noopAdapter, parseIdentifier, parseSitemapSlug, readEnv, recaptcha, renderJsonLd, renderSitemapIndex, renderUrlSet, resolveIcons, resolveKizloConfig, resolveWordPressConnection, restoreContract, schemaType, serializeCurrencyFormat, sitemapEntryPath, toKizloError, turnstile, wpEndpoint, xmlResponse };
|
package/dist/index.js
CHANGED
|
@@ -8,12 +8,15 @@ import { consoleLog, createLoggerAdapter, noopAdapter } from "./adapters/logger.
|
|
|
8
8
|
import { mergeServiceAdapters } from "./adapters/types.js";
|
|
9
9
|
import { resolveIcons } from "./brand/icons.js";
|
|
10
10
|
import { WEB_MANIFEST_ROUTE, buildWebManifest, createManifestRoute } from "./brand/manifest.js";
|
|
11
|
+
import { CONTENT_TYPES, ContentType, ListSitemapUrlInput, ListSitemapUrlInputBase, Robots, RobotsRule, Seo, SeoHead, SeoSchema, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList } from "./seo/schema.js";
|
|
12
|
+
import { CurrencyFormat, IdentifierInput, LIST_ORDER, ListMetadata, ListOrder, PreviewTokenData, PreviewTokenPayload, customFieldsSchema } from "./shared/schema.js";
|
|
13
|
+
import { CategoryCustomFieldsSchema } from "./category/schema.js";
|
|
11
14
|
import { defineFixture, isLocalPlugin } from "./cli/wp/types.js";
|
|
12
15
|
import { COMMON_ERRORS, KizloError, createThrowableErrorMap, defineErrorMap, isKizloError, toKizloError } from "./shared/error.js";
|
|
13
16
|
import { buildProcedure, combineDetailed, createProcedure, handleUnexpectedError, schemaType } from "./shared/procedure.js";
|
|
14
17
|
import { createOrpcRouter } from "./shared/router.js";
|
|
15
18
|
import { generateContract, isContractProcedure, restoreContract } from "./shared/contract.js";
|
|
16
|
-
import {
|
|
19
|
+
import { createResultClient } from "./shared/result.js";
|
|
17
20
|
import { KizloClient, createKizloClient } from "./client.js";
|
|
18
21
|
import { CookiesStorage } from "./cookie.js";
|
|
19
22
|
import { SettingsService } from "./settings/service.js";
|
|
@@ -24,8 +27,10 @@ import { WordPressTransport } from "./wordpress/transport.js";
|
|
|
24
27
|
import { Context } from "./context.js";
|
|
25
28
|
import { parseIdentifier } from "./shared/identifier.js";
|
|
26
29
|
import { deserializeCurrencyFormat, deserializeListMetadata, emptyList, serializeCurrencyFormat } from "./shared/serialize.js";
|
|
27
|
-
import { CONTENT_TYPES, ContentType, ListSitemapUrlInput, ListSitemapUrlInputBase, Robots, RobotsRule, Seo, SeoHead, SeoSchema, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList } from "./seo/schema.js";
|
|
28
30
|
import { deserializeSeo, parseSitemapSlug, renderJsonLd, renderSitemapIndex, renderUrlSet, sitemapEntryPath, xmlResponse } from "./seo/utils.js";
|
|
31
|
+
import { PageCustomFieldsSchema } from "./page/schema.js";
|
|
32
|
+
import { PostCustomFieldsSchema } from "./post/schema.js";
|
|
33
|
+
import { TagCustomFieldsSchema } from "./tag/schema.js";
|
|
29
34
|
import { CORE_PROCEDURES } from "./procedures.js";
|
|
30
35
|
import { assertIntegrationEndpoints, assertIntegrationEnv, createIntegration, missingEndpoints, missingEnv, readEnv } from "./shared/integration.js";
|
|
31
36
|
import { createEventHandler, createWebhookRouter } from "./webhook/index.js";
|
|
@@ -33,4 +38,4 @@ import { Kizlo, createKizlo, integrationEnv, resolveKizloConfig, resolveWordPres
|
|
|
33
38
|
import { SITEMAP_BASE, SITEMAP_INDEX_SLUG, createSitemapRedirectRoute, createSitemapRoute } from "./seo/sitemap.js";
|
|
34
39
|
import { createMiddleware } from "./shared/middleware.js";
|
|
35
40
|
|
|
36
|
-
export { COMMON_ERRORS, CONTENT_TYPES, CORE_PROCEDURES, ContentType, Context, CookiesStorage, CurrencyFormat, IdentifierInput, Kizlo, KizloClient, KizloError, LIST_ORDER, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, PreviewTokenData, PreviewTokenPayload, Robots, RobotsRule, SITEMAP_BASE, SITEMAP_INDEX_SLUG, Seo, SeoHead, SeoSchema, SettingsService, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList, WEB_MANIFEST_ROUTE, WP_Error, WordPressTransport, altcha, arkose, assertIntegrationEndpoints, assertIntegrationEnv, authMock, buildProcedure, buildWebManifest, buildWordPressRequest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createGeoAdapter, createIntegration, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, createMiddleware, createOrpcRouter, createProcedure, createSitemapRedirectRoute, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, createWordPressClient, customFieldsSchema, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, deserializeSeo, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, integrationEnv, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, mergeServiceAdapters, missingEndpoints, missingEnv, noopAdapter, parseIdentifier, parseSitemapSlug, readEnv, recaptcha, renderJsonLd, renderSitemapIndex, renderUrlSet, resolveIcons, resolveKizloConfig, resolveWordPressConnection, restoreContract, schemaType, serializeCurrencyFormat, sitemapEntryPath, toKizloError, turnstile, wpEndpoint, xmlResponse };
|
|
41
|
+
export { COMMON_ERRORS, CONTENT_TYPES, CORE_PROCEDURES, CategoryCustomFieldsSchema, ContentType, Context, CookiesStorage, CurrencyFormat, IdentifierInput, Kizlo, KizloClient, KizloError, LIST_ORDER, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, PageCustomFieldsSchema, PostCustomFieldsSchema, PreviewTokenData, PreviewTokenPayload, Robots, RobotsRule, SITEMAP_BASE, SITEMAP_INDEX_SLUG, Seo, SeoHead, SeoSchema, SettingsService, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList, TagCustomFieldsSchema, WEB_MANIFEST_ROUTE, WP_Error, WordPressTransport, altcha, arkose, assertIntegrationEndpoints, assertIntegrationEnv, authMock, buildProcedure, buildWebManifest, buildWordPressRequest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createGeoAdapter, createIntegration, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, createMiddleware, createOrpcRouter, createProcedure, createResultClient, createSitemapRedirectRoute, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, createWordPressClient, customFieldsSchema, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, deserializeSeo, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, integrationEnv, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, mergeServiceAdapters, missingEndpoints, missingEnv, noopAdapter, parseIdentifier, parseSitemapSlug, readEnv, recaptcha, renderJsonLd, renderSitemapIndex, renderUrlSet, resolveIcons, resolveKizloConfig, resolveWordPressConnection, restoreContract, schemaType, serializeCurrencyFormat, sitemapEntryPath, toKizloError, turnstile, wpEndpoint, xmlResponse };
|
package/dist/package.js
CHANGED
package/dist/page/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compare } from "../shared/crypto.js";
|
|
2
|
-
import { createProcedure } from "../shared/procedure.js";
|
|
2
|
+
import { createProcedure, schemaType } from "../shared/procedure.js";
|
|
3
3
|
import { parseIdentifier } from "../shared/identifier.js";
|
|
4
4
|
import { deserializeListMetadata } from "../shared/serialize.js";
|
|
5
5
|
import { GET_PAGE_ERROR_MAP, LIST_PAGE_ERROR_MAP } from "./error.js";
|
|
@@ -18,7 +18,7 @@ const PAGE_PROCEDURES = {
|
|
|
18
18
|
password: true,
|
|
19
19
|
previewToken: true
|
|
20
20
|
}).optional(),
|
|
21
|
-
output: Page,
|
|
21
|
+
output: schemaType(Page),
|
|
22
22
|
errors: GET_PAGE_ERROR_MAP
|
|
23
23
|
}, async ({ input, context, errors }) => {
|
|
24
24
|
if (input.query?.previewToken) {
|
|
@@ -73,7 +73,7 @@ const PAGE_PROCEDURES = {
|
|
|
73
73
|
method: "GET",
|
|
74
74
|
path: "/pages",
|
|
75
75
|
query: ListPageInput.optional(),
|
|
76
|
-
output: PageList,
|
|
76
|
+
output: schemaType(PageList),
|
|
77
77
|
errors: LIST_PAGE_ERROR_MAP
|
|
78
78
|
}, async ({ input, context, errors }) => {
|
|
79
79
|
const q = input.query;
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { WP_CustomFields } from "../wordpress/types.js";
|
|
2
|
+
import "../wordpress/index.js";
|
|
3
|
+
import * as _kizlo_shared3 from "@kizlo/shared";
|
|
4
|
+
import z from "zod/v4";
|
|
5
|
+
|
|
6
|
+
//#region src/page/schema.d.ts
|
|
7
|
+
|
|
8
|
+
type PageCustomFields = WP_CustomFields<"postTypes.page">;
|
|
9
|
+
declare const PageCustomFieldsSchema: z.ZodType<PageCustomFields, PageCustomFields>;
|
|
10
|
+
declare const Page: z.ZodObject<{
|
|
11
|
+
id: z.ZodNumber;
|
|
12
|
+
slug: z.ZodString;
|
|
13
|
+
url: z.ZodNullable<z.ZodString>;
|
|
14
|
+
parent: z.ZodNullable<z.ZodNumber>;
|
|
15
|
+
menuOrder: z.ZodNumber;
|
|
16
|
+
template: z.ZodString;
|
|
17
|
+
title: z.ZodNullable<z.ZodString>;
|
|
18
|
+
content: z.ZodNullable<z.ZodString>;
|
|
19
|
+
excerpt: z.ZodNullable<z.ZodString>;
|
|
20
|
+
commentsEnabled: z.ZodBoolean;
|
|
21
|
+
protected: z.ZodBoolean;
|
|
22
|
+
preview: z.ZodBoolean;
|
|
23
|
+
status: z.ZodEnum<{
|
|
24
|
+
publish: "publish";
|
|
25
|
+
future: "future";
|
|
26
|
+
draft: "draft";
|
|
27
|
+
pending: "pending";
|
|
28
|
+
private: "private";
|
|
29
|
+
}>;
|
|
30
|
+
author: z.ZodNullable<z.ZodObject<{
|
|
31
|
+
id: z.ZodNumber;
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
slug: z.ZodString;
|
|
34
|
+
avatarUrl: z.ZodNullable<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
featuredMedia: z.ZodNullable<z.ZodObject<{
|
|
37
|
+
id: z.ZodNumber;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
src: z.ZodString;
|
|
40
|
+
mime: z.ZodOptional<z.ZodString>;
|
|
41
|
+
type: z.ZodLiteral<"image">;
|
|
42
|
+
alt: z.ZodString;
|
|
43
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
46
|
+
src: z.ZodString;
|
|
47
|
+
width: z.ZodNumber;
|
|
48
|
+
height: z.ZodNumber;
|
|
49
|
+
}, z.core.$strict>>>;
|
|
50
|
+
srcset: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
52
|
+
seo: z.ZodNullable<z.ZodObject<{
|
|
53
|
+
head: z.ZodObject<{
|
|
54
|
+
title: z.ZodString;
|
|
55
|
+
canonical: z.ZodString;
|
|
56
|
+
robots: z.ZodObject<{
|
|
57
|
+
index: z.ZodString;
|
|
58
|
+
follow: z.ZodString;
|
|
59
|
+
maxSnippet: z.ZodString;
|
|
60
|
+
maxImagePreview: z.ZodString;
|
|
61
|
+
maxVideoPreview: z.ZodString;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
og: z.ZodObject<{
|
|
64
|
+
locale: z.ZodString;
|
|
65
|
+
type: z.ZodString;
|
|
66
|
+
title: z.ZodString;
|
|
67
|
+
url: z.ZodString;
|
|
68
|
+
siteName: z.ZodString;
|
|
69
|
+
description: z.ZodString;
|
|
70
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
71
|
+
url: z.ZodString;
|
|
72
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
73
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
74
|
+
type: z.ZodNullable<z.ZodString>;
|
|
75
|
+
alt: z.ZodNullable<z.ZodString>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
twitter: z.ZodObject<{
|
|
79
|
+
card: z.ZodEnum<{
|
|
80
|
+
summary: "summary";
|
|
81
|
+
summary_large_image: "summary_large_image";
|
|
82
|
+
}>;
|
|
83
|
+
title: z.ZodString;
|
|
84
|
+
site: z.ZodNullable<z.ZodString>;
|
|
85
|
+
creator: z.ZodNullable<z.ZodString>;
|
|
86
|
+
description: z.ZodString;
|
|
87
|
+
image: z.ZodNullable<z.ZodString>;
|
|
88
|
+
imageAlt: z.ZodNullable<z.ZodString>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
article: z.ZodNullable<z.ZodObject<{
|
|
91
|
+
publishedTime: z.ZodString;
|
|
92
|
+
modifiedTime: z.ZodString;
|
|
93
|
+
author: z.ZodString;
|
|
94
|
+
authorUrl: z.ZodString;
|
|
95
|
+
section: z.ZodString;
|
|
96
|
+
tags: z.ZodArray<z.ZodString>;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
schema: z.ZodObject<{
|
|
100
|
+
"@context": z.ZodLiteral<"https://schema.org">;
|
|
101
|
+
"@graph": z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
custom: z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>;
|
|
105
|
+
createdAt: z.ZodNumber;
|
|
106
|
+
updatedAt: z.ZodNumber;
|
|
107
|
+
meta: z.ZodRecord<z.ZodString, z.ZodType<_kizlo_shared3.JSONValue, unknown, z.core.$ZodTypeInternals<_kizlo_shared3.JSONValue, unknown>>>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
type Page = Omit<z.output<typeof Page>, "custom"> & {
|
|
110
|
+
custom: PageCustomFields;
|
|
111
|
+
};
|
|
112
|
+
declare const PageList: z.ZodObject<{
|
|
113
|
+
items: z.ZodArray<z.ZodObject<{
|
|
114
|
+
id: z.ZodNumber;
|
|
115
|
+
slug: z.ZodString;
|
|
116
|
+
url: z.ZodNullable<z.ZodString>;
|
|
117
|
+
parent: z.ZodNullable<z.ZodNumber>;
|
|
118
|
+
menuOrder: z.ZodNumber;
|
|
119
|
+
template: z.ZodString;
|
|
120
|
+
title: z.ZodNullable<z.ZodString>;
|
|
121
|
+
content: z.ZodNullable<z.ZodString>;
|
|
122
|
+
excerpt: z.ZodNullable<z.ZodString>;
|
|
123
|
+
commentsEnabled: z.ZodBoolean;
|
|
124
|
+
protected: z.ZodBoolean;
|
|
125
|
+
preview: z.ZodBoolean;
|
|
126
|
+
status: z.ZodEnum<{
|
|
127
|
+
publish: "publish";
|
|
128
|
+
future: "future";
|
|
129
|
+
draft: "draft";
|
|
130
|
+
pending: "pending";
|
|
131
|
+
private: "private";
|
|
132
|
+
}>;
|
|
133
|
+
author: z.ZodNullable<z.ZodObject<{
|
|
134
|
+
id: z.ZodNumber;
|
|
135
|
+
name: z.ZodString;
|
|
136
|
+
slug: z.ZodString;
|
|
137
|
+
avatarUrl: z.ZodNullable<z.ZodString>;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
featuredMedia: z.ZodNullable<z.ZodObject<{
|
|
140
|
+
id: z.ZodNumber;
|
|
141
|
+
name: z.ZodString;
|
|
142
|
+
src: z.ZodString;
|
|
143
|
+
mime: z.ZodOptional<z.ZodString>;
|
|
144
|
+
type: z.ZodLiteral<"image">;
|
|
145
|
+
alt: z.ZodString;
|
|
146
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
149
|
+
src: z.ZodString;
|
|
150
|
+
width: z.ZodNumber;
|
|
151
|
+
height: z.ZodNumber;
|
|
152
|
+
}, z.core.$strict>>>;
|
|
153
|
+
srcset: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, z.core.$strict>>;
|
|
155
|
+
seo: z.ZodNullable<z.ZodObject<{
|
|
156
|
+
head: z.ZodObject<{
|
|
157
|
+
title: z.ZodString;
|
|
158
|
+
canonical: z.ZodString;
|
|
159
|
+
robots: z.ZodObject<{
|
|
160
|
+
index: z.ZodString;
|
|
161
|
+
follow: z.ZodString;
|
|
162
|
+
maxSnippet: z.ZodString;
|
|
163
|
+
maxImagePreview: z.ZodString;
|
|
164
|
+
maxVideoPreview: z.ZodString;
|
|
165
|
+
}, z.core.$strip>;
|
|
166
|
+
og: z.ZodObject<{
|
|
167
|
+
locale: z.ZodString;
|
|
168
|
+
type: z.ZodString;
|
|
169
|
+
title: z.ZodString;
|
|
170
|
+
url: z.ZodString;
|
|
171
|
+
siteName: z.ZodString;
|
|
172
|
+
description: z.ZodString;
|
|
173
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
174
|
+
url: z.ZodString;
|
|
175
|
+
width: z.ZodNullable<z.ZodNumber>;
|
|
176
|
+
height: z.ZodNullable<z.ZodNumber>;
|
|
177
|
+
type: z.ZodNullable<z.ZodString>;
|
|
178
|
+
alt: z.ZodNullable<z.ZodString>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
twitter: z.ZodObject<{
|
|
182
|
+
card: z.ZodEnum<{
|
|
183
|
+
summary: "summary";
|
|
184
|
+
summary_large_image: "summary_large_image";
|
|
185
|
+
}>;
|
|
186
|
+
title: z.ZodString;
|
|
187
|
+
site: z.ZodNullable<z.ZodString>;
|
|
188
|
+
creator: z.ZodNullable<z.ZodString>;
|
|
189
|
+
description: z.ZodString;
|
|
190
|
+
image: z.ZodNullable<z.ZodString>;
|
|
191
|
+
imageAlt: z.ZodNullable<z.ZodString>;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
article: z.ZodNullable<z.ZodObject<{
|
|
194
|
+
publishedTime: z.ZodString;
|
|
195
|
+
modifiedTime: z.ZodString;
|
|
196
|
+
author: z.ZodString;
|
|
197
|
+
authorUrl: z.ZodString;
|
|
198
|
+
section: z.ZodString;
|
|
199
|
+
tags: z.ZodArray<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>>;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
schema: z.ZodObject<{
|
|
203
|
+
"@context": z.ZodLiteral<"https://schema.org">;
|
|
204
|
+
"@graph": z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
}, z.core.$strip>>;
|
|
207
|
+
custom: z.ZodType<Record<string, unknown>, Record<string, unknown>, z.core.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>;
|
|
208
|
+
createdAt: z.ZodNumber;
|
|
209
|
+
updatedAt: z.ZodNumber;
|
|
210
|
+
meta: z.ZodRecord<z.ZodString, z.ZodType<_kizlo_shared3.JSONValue, unknown, z.core.$ZodTypeInternals<_kizlo_shared3.JSONValue, unknown>>>;
|
|
211
|
+
}, z.core.$strip>>;
|
|
212
|
+
meta: z.ZodObject<{
|
|
213
|
+
page: z.ZodNumber;
|
|
214
|
+
totalItems: z.ZodNumber;
|
|
215
|
+
totalPages: z.ZodNumber;
|
|
216
|
+
nextPage: z.ZodNullable<z.ZodNumber>;
|
|
217
|
+
prevPage: z.ZodNullable<z.ZodNumber>;
|
|
218
|
+
hasNextPage: z.ZodBoolean;
|
|
219
|
+
hasPrevPage: z.ZodBoolean;
|
|
220
|
+
}, z.core.$strip>;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
type PageList = Omit<z.output<typeof PageList>, "items"> & {
|
|
223
|
+
items: Page[];
|
|
224
|
+
};
|
|
225
|
+
//#endregion
|
|
226
|
+
export { Page, PageCustomFields, PageCustomFieldsSchema, PageList };
|
package/dist/page/schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IdentifierInput, ListMetadata, ListOrder, customFieldsSchema } from "../shared/schema.js";
|
|
2
1
|
import { Seo } from "../seo/schema.js";
|
|
2
|
+
import { IdentifierInput, ListMetadata, ListOrder, customFieldsSchema } from "../shared/schema.js";
|
|
3
3
|
import { MediaImage, Metadata, NumberLike, arrayable, lenient } from "@kizlo/shared";
|
|
4
4
|
import z from "zod/v4";
|
|
5
5
|
|
|
@@ -32,6 +32,7 @@ const PageAuthorRef = z.object({
|
|
|
32
32
|
slug: z.string(),
|
|
33
33
|
avatarUrl: z.string().nullable()
|
|
34
34
|
});
|
|
35
|
+
const PageCustomFieldsSchema = customFieldsSchema();
|
|
35
36
|
const Page = z.object({
|
|
36
37
|
id: z.number(),
|
|
37
38
|
slug: z.string(),
|
|
@@ -49,7 +50,7 @@ const Page = z.object({
|
|
|
49
50
|
author: PageAuthorRef.nullable(),
|
|
50
51
|
featuredMedia: MediaImage.nullable(),
|
|
51
52
|
seo: Seo.nullable(),
|
|
52
|
-
custom:
|
|
53
|
+
custom: PageCustomFieldsSchema,
|
|
53
54
|
createdAt: z.number(),
|
|
54
55
|
updatedAt: z.number(),
|
|
55
56
|
meta: Metadata
|
|
@@ -93,4 +94,4 @@ const ListPageInput = z.object({
|
|
|
93
94
|
});
|
|
94
95
|
|
|
95
96
|
//#endregion
|
|
96
|
-
export { ListPageInput, Page, PageList, RetrievePageInput };
|
|
97
|
+
export { ListPageInput, Page, PageCustomFieldsSchema, PageList, RetrievePageInput };
|
package/dist/post/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compare } from "../shared/crypto.js";
|
|
2
|
-
import { createProcedure } from "../shared/procedure.js";
|
|
2
|
+
import { createProcedure, schemaType } from "../shared/procedure.js";
|
|
3
3
|
import { parseIdentifier } from "../shared/identifier.js";
|
|
4
4
|
import { deserializeListMetadata } from "../shared/serialize.js";
|
|
5
5
|
import { GET_POST_ERROR_MAP, LIST_POST_ERROR_MAP } from "./error.js";
|
|
@@ -18,7 +18,7 @@ const POST_PROCEDURES = {
|
|
|
18
18
|
password: true,
|
|
19
19
|
previewToken: true
|
|
20
20
|
}).optional(),
|
|
21
|
-
output: Post,
|
|
21
|
+
output: schemaType(Post),
|
|
22
22
|
errors: GET_POST_ERROR_MAP
|
|
23
23
|
}, async ({ input, context, errors }) => {
|
|
24
24
|
if (input.query?.previewToken) {
|
|
@@ -73,7 +73,7 @@ const POST_PROCEDURES = {
|
|
|
73
73
|
method: "GET",
|
|
74
74
|
path: "/posts",
|
|
75
75
|
query: ListPostInput.optional(),
|
|
76
|
-
output: PostList,
|
|
76
|
+
output: schemaType(PostList),
|
|
77
77
|
errors: LIST_POST_ERROR_MAP
|
|
78
78
|
}, async ({ input, context, errors }) => {
|
|
79
79
|
const q = input.query;
|