kizlo 0.17.0 → 0.19.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.
Files changed (58) hide show
  1. package/dist/adapters/auth.d.ts +17 -16
  2. package/dist/adapters/auth.js +4 -5
  3. package/dist/category/index.js +4 -4
  4. package/dist/category/schema.d.ts +153 -0
  5. package/dist/category/schema.js +4 -3
  6. package/dist/cli/commands/_wiring.js +9 -8
  7. package/dist/cli/commands/check.js +11 -15
  8. package/dist/cli/commands/dev.js +3 -3
  9. package/dist/cli/commands/generate.js +15 -17
  10. package/dist/cli/commands/test.js +3 -3
  11. package/dist/cli/daemon/config.js +148 -82
  12. package/dist/cli/daemon/generate.js +54 -54
  13. package/dist/cli/daemon/watch.js +41 -54
  14. package/dist/cli/wp/constants.d.ts +2 -4
  15. package/dist/cli/wp/constants.js +2 -4
  16. package/dist/cli/wp/types.d.ts +6 -3
  17. package/dist/cli/wp/utils.d.ts +3 -3
  18. package/dist/cli/wp/utils.js +9 -3
  19. package/dist/comment/errors.js +0 -1
  20. package/dist/comment/index.js +6 -6
  21. package/dist/config.d.ts +61 -47
  22. package/dist/context.d.ts +7 -7
  23. package/dist/context.js +4 -4
  24. package/dist/index.d.ts +9 -4
  25. package/dist/index.js +8 -3
  26. package/dist/package.js +1 -1
  27. package/dist/page/index.js +3 -3
  28. package/dist/page/schema.d.ts +226 -0
  29. package/dist/page/schema.js +4 -3
  30. package/dist/post/index.js +3 -3
  31. package/dist/post/schema.d.ts +268 -0
  32. package/dist/post/schema.js +4 -3
  33. package/dist/procedures.d.ts +35 -902
  34. package/dist/seo/index.js +1 -1
  35. package/dist/seo/schema.d.ts +5 -5
  36. package/dist/shared/contract.d.ts +1 -1
  37. package/dist/shared/procedure.d.ts +12 -3
  38. package/dist/shared/procedure.js +4 -0
  39. package/dist/shared/result.d.ts +16 -7
  40. package/dist/shared/types.d.ts +1 -1
  41. package/dist/tag/index.js +3 -3
  42. package/dist/tag/schema.d.ts +151 -0
  43. package/dist/tag/schema.js +4 -3
  44. package/dist/test/auth.js +2 -3
  45. package/dist/test/users.d.ts +2 -4
  46. package/dist/test/users.js +4 -9
  47. package/dist/test.d.ts +2 -2
  48. package/dist/test.js +2 -2
  49. package/dist/wordpress/endpoint.js +2 -1
  50. package/dist/wordpress/error.d.ts +1 -0
  51. package/dist/wordpress/error.js +2 -0
  52. package/dist/wordpress/fetch-introspection.js +1 -1
  53. package/dist/wordpress/generate.js +51 -7
  54. package/dist/wordpress/index.d.ts +1 -1
  55. package/dist/wordpress/transport.js +5 -3
  56. package/dist/wordpress/types.d.ts +38 -12
  57. package/dist/wordpress/utils.d.ts +1 -0
  58. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
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";
6
6
  import "./wordpress/index.js";
7
7
  import { DevPluginSource, Fixture, FixtureCleanupFn, FixtureSeedFn, FixtureSettleFn, JsonValue, LocalPlugin, PluginSource, SeedContext, SettleContext, TestAdminUser, TestCredentials, TestUser, defineFixture, isLocalPlugin } from "./cli/wp/types.js";
8
- import { AuthAdapter, AuthGetUser, AuthUser, authMock, createAuthAdapter } from "./adapters/auth.js";
8
+ import { AuthAdapter, AuthGetSession, AuthUser, authMock, createAuthAdapter } from "./adapters/auth.js";
9
9
  import { CaptchaAdapter, altcha, arkose, createCaptchaAdapter, friendlyCaptcha, hcaptcha, recaptcha, turnstile } from "./adapters/captcha.js";
10
10
  import { CurrencyFormat, IdentifierInput, LIST_ORDER, ListMetadata, ListOrder, PreviewTokenData, PreviewTokenPayload, customFieldsSchema } from "./shared/schema.js";
11
11
  import { AnyContext, AnyNestedClient, CookiesAdapter, CookiesDeleteAll, CookiesGetAll, CookiesSetAll, HTTPMethod, List, MaybeOptionalOptions, RedirectInput, RedirectStatus } from "./shared/types.js";
@@ -18,13 +18,18 @@ import { AuthorsSettings, AuthorsSettingsInput, BrandSettings, BrandSettingsInpu
18
18
  import { IconDescriptor, ManifestIcon, ResolvedIcons, resolveIcons } from "./brand/icons.js";
19
19
  import { CookiesStorage } from "./cookie.js";
20
20
  import { SettingsService } from "./settings/service.js";
21
- import { AuthUserFn, ConnInfoFn, Context, ContextConfig, ProcedureContext, VerifyCaptchaFn, VerifyPreviewTokenFn } from "./context.js";
21
+ import { ConnInfoFn, Context, ContextConfig, ProcedureContext, SessionFn, 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, AuthGetSession, AuthUser, 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, SessionFn, 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 { CurrencyFormat, IdentifierInput, LIST_ORDER, ListMetadata, ListOrder, PreviewTokenData, PreviewTokenPayload, customFieldsSchema } from "./shared/schema.js";
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
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.17.0";
2
+ var version = "0.19.0";
3
3
 
4
4
  //#endregion
5
5
  export { version };
@@ -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 };
@@ -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: customFieldsSchema(),
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 };
@@ -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;