kizlo 0.3.1 → 0.4.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/README.md +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/package.js +1 -1
- package/dist/router.d.ts +91 -0
- package/dist/router.js +3 -1
- package/dist/settings/index.js +68 -0
- package/dist/settings/service.d.ts +3 -2
- package/dist/settings/service.interface.d.ts +13 -123
- package/dist/settings/service.js +3 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<a href="https://
|
|
1
|
+
<a href="https://www.kizlo.io"><img width="100%" src="https://cdn.kizlo.io/images/github-kizlo-banner.png" alt="Kizlo headless CMS Admin panel built with React" /></a>
|
|
2
2
|
<br />
|
|
3
3
|
|
|
4
4
|
<p align="center">
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { CaptchaAdapter, altcha, arkose, createCaptchaAdapter, friendlyCaptcha,
|
|
|
20
20
|
import { CONTENT_TYPES, ContentType, ListSitemapUrlInput, ListSitemapUrlInputBase, Robots, RobotsRule, Seo, SeoHead, SeoSchema, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList } from "./seo/schema.js";
|
|
21
21
|
import { WPK_ListSitemapUrlInput, WPK_RobotRule, WPK_Robots, WPK_Seo, WPK_Sitemap, WPK_SitemapContentType, WPK_SitemapIndex, WPK_SitemapUrl, WPK_SitemapUrlImage } from "./seo/types.js";
|
|
22
22
|
import { SitemapIndexEntry } from "./seo/utils.js";
|
|
23
|
-
import { CurrencyFormat, IdentifierInput, LIST_ORDER, ListMetadata, ListOrder, Media, PreviewTokenData, PreviewTokenPayload } from "./shared/schema.js";
|
|
23
|
+
import { CurrencyFormat, IdentifierInput, LIST_ORDER, ListMetadata, ListOrder, Media as Media$1, PreviewTokenData, PreviewTokenPayload } from "./shared/schema.js";
|
|
24
24
|
import { AnyContext, AnyNestedClient, CookiesAdapter, CookiesDeleteAll, CookiesGetAll, CookiesSetAll, HTTPMethod, List, MaybeOptionalOptions, RedirectInput, RedirectStatus } from "./shared/types.js";
|
|
25
25
|
import { createCookiesAdapter } from "./adapters/cookies.js";
|
|
26
26
|
import { ConnInfo, GeoAdapter, GeoGetConnInfo, createGeoAdapter, geoMock } from "./adapters/geo.js";
|
|
@@ -30,7 +30,7 @@ import { AnyEventSchema, AnyEvents, EventHandler, EventHandlerFn, InferEventUnio
|
|
|
30
30
|
import { AnyExtension, Extension, ExtensionInitFn, ExtensionInitOptions, ExtensionInitResult, ExtractExtensionRouter, InferExtensionRouter, createExtension } from "./shared/extension.js";
|
|
31
31
|
import { COMMON_ERRORS, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, DefinedErrorMapLike, ErrorDefinition, KizloError, KizloErrorOptions, ThrowableErrorFn, ThrowableErrorMap, WithCommonErrorMap, createThrowableErrorMap, defineErrorMap, isKizloError, toKizloError } from "./shared/error.js";
|
|
32
32
|
import { AnyKizloConfig, CreateKizloOptions, Kizlo, KizloConfig, KizloTarget, RootRouter, S2SClient, ServiceAdapters, createKizlo, resolveKizloConfig } from "./kizlo.js";
|
|
33
|
-
import {
|
|
33
|
+
import { AuthorsSettings, BrandSettings, CrawlingSettings, IdentitySettings, KizloAuthorsSettingsInput, KizloBrandSettingsInput, KizloCrawlingSettingsInput, KizloIdentitySettingsInput, KizloOrganizationSettingsInput, KizloPersonSettingsInput, KizloPostTypeSettingsInput, KizloSiteSettingsInput, KizloTaxonomySettingsInput, KizloWebhookSettingsInput, Media, OrganizationFounder, OrganizationSettings, PersonSettings, PostStatus, PostTypeSettings, Settings, SiteSettings, SocialProfile, TaxonomySettings, WebhookSettings } from "./settings/service.interface.js";
|
|
34
34
|
import { KizloSettingsService } from "./settings/service.js";
|
|
35
35
|
import { Service, ServiceConfig } from "./service.js";
|
|
36
36
|
import { AuthUserFn, ConnInfoFn, Context, ContextConfig, ServerContext, VerifyCaptchaFn, VerifyPreviewTokenFn } from "./context.js";
|
|
@@ -43,4 +43,4 @@ import { ShaAlgorithm, compare, hash, hmac } from "./shared/crypto.js";
|
|
|
43
43
|
import { Identifier, parseIdentifier } from "./shared/identifier.js";
|
|
44
44
|
import { createOrpcRouter } from "./shared/router.js";
|
|
45
45
|
import { deserializeCurrencyFormat, deserializeListMetadata, emptyList, serializeCurrencyFormat } from "./shared/serialize.js";
|
|
46
|
-
export { AnyContext, AnyEventSchema, AnyEvents, AnyExtension, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureRouter, AuthAdapter, AuthGetUser, AuthUser, AuthUserFn, BaseHandlerOptions, CART_HASH_HEADER_KEY, COMMON_ERRORS, CONTENT_TYPES, CaptchaAdapter, CommentService, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, ConnInfo, ConnInfoFn, ConsoleLogAdapterOptions, ContentType, Context, ContextConfig, Contract, ContractProcedure, CookiesAdapter, CookiesDeleteAll, CookiesGetAll, CookiesSetAll, CreateKizloOptions, CreateSitemapRouteOptions, CurrencyFormat, DefinedErrorMapLike, DevPluginSource, Environment, ErrorDefinition, EventHandler, EventHandlerFn, Extension, ExtensionInitFn, ExtensionInitOptions, ExtensionInitResult, ExtractExtensionRouter, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, Fixture, FixtureCleanupFn, FixtureSeedFn, GeoAdapter, GeoGetConnInfo, HTTPMethod, Identifier, IdentifierInput, InferEventUnion, InferExtensionRouter, InferUses, InvocationScope, JsonValue, Kizlo, KizloAuthorsSettings, KizloAuthorsSettingsInput, KizloClient, KizloClientConfig, KizloConfig, KizloCrawlingSettings, KizloCrawlingSettingsInput, KizloError, KizloErrorOptions, KizloIdentitySettings, KizloIdentitySettingsInput, KizloMedia, KizloOrganizationFounder, KizloOrganizationSettings, KizloOrganizationSettingsInput, KizloPersonSettings, KizloPersonSettingsInput, KizloPostStatus, KizloPostTypeSettings, KizloPostTypeSettingsInput, KizloSettings, KizloSettingsService, KizloSiteSettings, KizloSiteSettingsInput, KizloSocialProfile, KizloTarget, KizloTaxonomySettings, KizloTaxonomySettingsInput, KizloWebhookSettings, KizloWebhookSettingsInput, LIST_ORDER, List, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, LocalPlugin, LogLevel, LogPayload, Logger, LoggerAdapter, MaybeOptionalOptions, Media, MenuItemService, MenuService, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, OpenapiPart, PluginSource, PostService, PreviewTokenData, PreviewTokenPayload, Procedure, ProcedureContext, ProcedureErrors, ProcedureHandler, ProcedureOptions, RedirectInput, RedirectStatus, ResolveParamsPart, ResolvedSchemaInput, ResolvedSchemaOutput, Robots, RobotsRule, RootRouter, RouterDepthTuple, S2SClient, SAFE_REQUEST_TIMEOUT, SITEMAP_BASE, SITEMAP_INDEX_SLUG, SchemaIO, SeedContext, Seo, SeoHead, SeoSchema, ServerContext, Service, ServiceAdapters, ServiceConfig, ShaAlgorithm, Sitemap, SitemapIndex, type SitemapIndexEntry, SitemapList, SitemapRouteExtra, SitemapUrl, SitemapUrlImage, SitemapUrlList, TestAdminUser, TestCredentials, TestUser, ThrowableErrorFn, ThrowableErrorMap, UNEXPECTED_BODY_SNIPPET_LENGTH, UserService, VerifyCaptchaFn, VerifyPreviewTokenFn, WC_CORE_BASE, WC_STORE_BASE, WPK_ListSitemapUrlInput, WPK_RobotRule, WPK_Robots, WPK_Seo, WPK_Sitemap, WPK_SitemapContentType, WPK_SitemapIndex, WPK_SitemapUrl, WPK_SitemapUrlImage, WP_AUTH_HEADER_KEY, WP_AUTH_TYPE, WP_CORE_BASE, WP_Comment, WP_CommentAvatarUrls, WP_CommentContent, WP_CommentContentInput, WP_CommentCreateErrorCode, WP_CommentCreateInput, WP_CommentDeleteErrorCode, WP_CommentDeleteInput, WP_CommentDeleteResponse, WP_CommentLinks, WP_CommentListErrorCode, WP_CommentListInput, WP_CommentOrderBy, WP_CommentRetrieveErrorCode, WP_CommentRetrieveInput, WP_CommentStatus, WP_CommentStatusFilter, WP_CommentStatusInput, WP_CommentType, WP_CommentUpdateErrorCode, WP_CommentUpdateInput, WP_CommonErrorCode, WP_Context, WP_CurrencyFormat, WP_Error, WP_ErrorData, WP_KIZLO_BASE, WP_Link, WP_List, WP_ListMetadata, WP_ListOrder, WP_Menu, WP_MenuCreateErrorCode, WP_MenuCreateInput, WP_MenuDeleteErrorCode, WP_MenuDeleteInput, WP_MenuDeleteResponse, WP_MenuItem, WP_MenuItemCreateErrorCode, WP_MenuItemCreateInput, WP_MenuItemDeleteErrorCode, WP_MenuItemDeleteInput, WP_MenuItemDeleteResponse, WP_MenuItemLinks, WP_MenuItemListErrorCode, WP_MenuItemListInput, WP_MenuItemOrderBy, WP_MenuItemRetrieveErrorCode, WP_MenuItemRetrieveInput, WP_MenuItemStatus, WP_MenuItemStatusFilter, WP_MenuItemTarget, WP_MenuItemTaxRelation, WP_MenuItemTitle, WP_MenuItemTitleInput, WP_MenuItemType, WP_MenuItemUpdateErrorCode, WP_MenuItemUpdateInput, WP_MenuLinks, WP_MenuListErrorCode, WP_MenuListInput, WP_MenuOrderBy, WP_MenuRetrieveErrorCode, WP_MenuRetrieveInput, WP_MenuUpdateErrorCode, WP_MenuUpdateInput, WP_Post, WP_PostCommentStatus, WP_PostContent, WP_PostContentInput, WP_PostCreateErrorCode, WP_PostCreateInput, WP_PostDeleteErrorCode, WP_PostDeleteInput, WP_PostDeleteResponse, WP_PostExcerpt, WP_PostExcerptInput, WP_PostFormat, WP_PostGuid, WP_PostLinks, WP_PostListErrorCode, WP_PostListInput, WP_PostOrderBy, WP_PostRetrieveErrorCode, WP_PostRetrieveInput, WP_PostStatus, WP_PostStatusFilter, WP_PostTaxRelation, WP_PostTitle, WP_PostTitleInput, WP_PostUpdateErrorCode, WP_PostUpdateInput, WP_RequestInput, WP_Result, WP_User, WP_UserAvatarUrls, WP_UserCapabilities, WP_UserCreateErrorCode, WP_UserCreateInput, WP_UserDeleteErrorCode, WP_UserDeleteInput, WP_UserDeleteMeErrorCode, WP_UserDeleteMeInput, WP_UserDeleteMeResponse, WP_UserDeleteResponse, WP_UserLinks, WP_UserListErrorCode, WP_UserListInput, WP_UserOrderBy, WP_UserRetrieveErrorCode, WP_UserRetrieveInput, WP_UserRetrieveMeErrorCode, WP_UserRetrieveMeInput, WP_UserUpdateErrorCode, WP_UserUpdateInput, WP_UserUpdateMeErrorCode, WP_UserUpdateMeInput, WP_UserWho, WebhookOptions, WithCommonErrorMap, WordPressCredentials, WordPressService, altcha, arkose, authMock, buildProcedure, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createExtension, createGeoAdapter, createKizlo, createKizloClient, createLoggerAdapter, createMiddleware, createOrpcRouter, createProcedure, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, noopAdapter, parseIdentifier, recaptcha, resolveKizloConfig, restoreContract, schemaType, serializeCurrencyFormat, toKizloError, turnstile };
|
|
46
|
+
export { AnyContext, AnyEventSchema, AnyEvents, AnyExtension, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureRouter, AuthAdapter, AuthGetUser, AuthUser, AuthUserFn, BaseHandlerOptions, CART_HASH_HEADER_KEY, COMMON_ERRORS, CONTENT_TYPES, CaptchaAdapter, CommentService, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, ConnInfo, ConnInfoFn, ConsoleLogAdapterOptions, ContentType, Context, ContextConfig, Contract, ContractProcedure, CookiesAdapter, CookiesDeleteAll, CookiesGetAll, CookiesSetAll, CreateKizloOptions, CreateSitemapRouteOptions, CurrencyFormat, DefinedErrorMapLike, DevPluginSource, Environment, ErrorDefinition, EventHandler, EventHandlerFn, Extension, ExtensionInitFn, ExtensionInitOptions, ExtensionInitResult, ExtractExtensionRouter, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, Fixture, FixtureCleanupFn, FixtureSeedFn, GeoAdapter, GeoGetConnInfo, HTTPMethod, Identifier, IdentifierInput, InferEventUnion, InferExtensionRouter, InferUses, InvocationScope, JsonValue, Kizlo, AuthorsSettings as KizloAuthorsSettings, KizloAuthorsSettingsInput, BrandSettings as KizloBrandSettings, KizloBrandSettingsInput, KizloClient, KizloClientConfig, KizloConfig, CrawlingSettings as KizloCrawlingSettings, KizloCrawlingSettingsInput, KizloError, KizloErrorOptions, IdentitySettings as KizloIdentitySettings, KizloIdentitySettingsInput, Media as KizloMedia, OrganizationFounder as KizloOrganizationFounder, OrganizationSettings as KizloOrganizationSettings, KizloOrganizationSettingsInput, PersonSettings as KizloPersonSettings, KizloPersonSettingsInput, PostStatus as KizloPostStatus, PostTypeSettings as KizloPostTypeSettings, KizloPostTypeSettingsInput, Settings as KizloSettings, KizloSettingsService, SiteSettings as KizloSiteSettings, KizloSiteSettingsInput, SocialProfile as KizloSocialProfile, KizloTarget, TaxonomySettings as KizloTaxonomySettings, KizloTaxonomySettingsInput, WebhookSettings as KizloWebhookSettings, KizloWebhookSettingsInput, LIST_ORDER, List, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, LocalPlugin, LogLevel, LogPayload, Logger, LoggerAdapter, MaybeOptionalOptions, Media$1 as Media, MenuItemService, MenuService, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, OpenapiPart, PluginSource, PostService, PreviewTokenData, PreviewTokenPayload, Procedure, ProcedureContext, ProcedureErrors, ProcedureHandler, ProcedureOptions, RedirectInput, RedirectStatus, ResolveParamsPart, ResolvedSchemaInput, ResolvedSchemaOutput, Robots, RobotsRule, RootRouter, RouterDepthTuple, S2SClient, SAFE_REQUEST_TIMEOUT, SITEMAP_BASE, SITEMAP_INDEX_SLUG, SchemaIO, SeedContext, Seo, SeoHead, SeoSchema, ServerContext, Service, ServiceAdapters, ServiceConfig, ShaAlgorithm, Sitemap, SitemapIndex, type SitemapIndexEntry, SitemapList, SitemapRouteExtra, SitemapUrl, SitemapUrlImage, SitemapUrlList, TestAdminUser, TestCredentials, TestUser, ThrowableErrorFn, ThrowableErrorMap, UNEXPECTED_BODY_SNIPPET_LENGTH, UserService, VerifyCaptchaFn, VerifyPreviewTokenFn, WC_CORE_BASE, WC_STORE_BASE, WPK_ListSitemapUrlInput, WPK_RobotRule, WPK_Robots, WPK_Seo, WPK_Sitemap, WPK_SitemapContentType, WPK_SitemapIndex, WPK_SitemapUrl, WPK_SitemapUrlImage, WP_AUTH_HEADER_KEY, WP_AUTH_TYPE, WP_CORE_BASE, WP_Comment, WP_CommentAvatarUrls, WP_CommentContent, WP_CommentContentInput, WP_CommentCreateErrorCode, WP_CommentCreateInput, WP_CommentDeleteErrorCode, WP_CommentDeleteInput, WP_CommentDeleteResponse, WP_CommentLinks, WP_CommentListErrorCode, WP_CommentListInput, WP_CommentOrderBy, WP_CommentRetrieveErrorCode, WP_CommentRetrieveInput, WP_CommentStatus, WP_CommentStatusFilter, WP_CommentStatusInput, WP_CommentType, WP_CommentUpdateErrorCode, WP_CommentUpdateInput, WP_CommonErrorCode, WP_Context, WP_CurrencyFormat, WP_Error, WP_ErrorData, WP_KIZLO_BASE, WP_Link, WP_List, WP_ListMetadata, WP_ListOrder, WP_Menu, WP_MenuCreateErrorCode, WP_MenuCreateInput, WP_MenuDeleteErrorCode, WP_MenuDeleteInput, WP_MenuDeleteResponse, WP_MenuItem, WP_MenuItemCreateErrorCode, WP_MenuItemCreateInput, WP_MenuItemDeleteErrorCode, WP_MenuItemDeleteInput, WP_MenuItemDeleteResponse, WP_MenuItemLinks, WP_MenuItemListErrorCode, WP_MenuItemListInput, WP_MenuItemOrderBy, WP_MenuItemRetrieveErrorCode, WP_MenuItemRetrieveInput, WP_MenuItemStatus, WP_MenuItemStatusFilter, WP_MenuItemTarget, WP_MenuItemTaxRelation, WP_MenuItemTitle, WP_MenuItemTitleInput, WP_MenuItemType, WP_MenuItemUpdateErrorCode, WP_MenuItemUpdateInput, WP_MenuLinks, WP_MenuListErrorCode, WP_MenuListInput, WP_MenuOrderBy, WP_MenuRetrieveErrorCode, WP_MenuRetrieveInput, WP_MenuUpdateErrorCode, WP_MenuUpdateInput, WP_Post, WP_PostCommentStatus, WP_PostContent, WP_PostContentInput, WP_PostCreateErrorCode, WP_PostCreateInput, WP_PostDeleteErrorCode, WP_PostDeleteInput, WP_PostDeleteResponse, WP_PostExcerpt, WP_PostExcerptInput, WP_PostFormat, WP_PostGuid, WP_PostLinks, WP_PostListErrorCode, WP_PostListInput, WP_PostOrderBy, WP_PostRetrieveErrorCode, WP_PostRetrieveInput, WP_PostStatus, WP_PostStatusFilter, WP_PostTaxRelation, WP_PostTitle, WP_PostTitleInput, WP_PostUpdateErrorCode, WP_PostUpdateInput, WP_RequestInput, WP_Result, WP_User, WP_UserAvatarUrls, WP_UserCapabilities, WP_UserCreateErrorCode, WP_UserCreateInput, WP_UserDeleteErrorCode, WP_UserDeleteInput, WP_UserDeleteMeErrorCode, WP_UserDeleteMeInput, WP_UserDeleteMeResponse, WP_UserDeleteResponse, WP_UserLinks, WP_UserListErrorCode, WP_UserListInput, WP_UserOrderBy, WP_UserRetrieveErrorCode, WP_UserRetrieveInput, WP_UserRetrieveMeErrorCode, WP_UserRetrieveMeInput, WP_UserUpdateErrorCode, WP_UserUpdateInput, WP_UserUpdateMeErrorCode, WP_UserUpdateMeInput, WP_UserWho, WebhookOptions, WithCommonErrorMap, WordPressCredentials, WordPressService, altcha, arkose, authMock, buildProcedure, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createExtension, createGeoAdapter, createKizlo, createKizloClient, createLoggerAdapter, createMiddleware, createOrpcRouter, createProcedure, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, noopAdapter, parseIdentifier, recaptcha, resolveKizloConfig, restoreContract, schemaType, serializeCurrencyFormat, toKizloError, turnstile };
|
package/dist/package.js
CHANGED
package/dist/router.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DefinedErrorMapLike } from "./shared/error.js";
|
|
2
2
|
import { Procedure } from "./shared/procedure.js";
|
|
3
3
|
import "./index.js";
|
|
4
|
+
import * as _kizlo_shared0 from "@kizlo/shared";
|
|
4
5
|
|
|
5
6
|
//#region src/router.d.ts
|
|
6
7
|
declare const ROUTER_MAP: {
|
|
@@ -676,6 +677,96 @@ declare const ROUTER_MAP: {
|
|
|
676
677
|
};
|
|
677
678
|
}>;
|
|
678
679
|
};
|
|
680
|
+
settings: {
|
|
681
|
+
get: Procedure<"internal", {}, _kizlo_shared0.Settings, DefinedErrorMapLike>;
|
|
682
|
+
updateSite: Procedure<"internal", {
|
|
683
|
+
name?: string | null | undefined;
|
|
684
|
+
url?: string | null | undefined;
|
|
685
|
+
backend_url?: string | null | undefined;
|
|
686
|
+
secret?: string | null | undefined;
|
|
687
|
+
alternate_name?: string | null | undefined;
|
|
688
|
+
tagline?: string | null | undefined;
|
|
689
|
+
title_separator?: string | undefined;
|
|
690
|
+
search_action_structure?: string | null | undefined;
|
|
691
|
+
discourage_search_engines?: boolean | undefined;
|
|
692
|
+
fallback_image?: number | null | undefined;
|
|
693
|
+
}, null, DefinedErrorMapLike>;
|
|
694
|
+
updateBrand: Procedure<"internal", {
|
|
695
|
+
logo?: number | null | undefined;
|
|
696
|
+
logo_dark?: number | null | undefined;
|
|
697
|
+
logo_icon?: number | null | undefined;
|
|
698
|
+
logo_icon_dark?: number | null | undefined;
|
|
699
|
+
logo_wordmark?: number | null | undefined;
|
|
700
|
+
logo_wordmark_dark?: number | null | undefined;
|
|
701
|
+
favicon?: number | null | undefined;
|
|
702
|
+
favicon_dark?: number | null | undefined;
|
|
703
|
+
apple_touch_icon?: number | null | undefined;
|
|
704
|
+
}, null, DefinedErrorMapLike>;
|
|
705
|
+
updateIdentity: Procedure<"internal", {
|
|
706
|
+
type?: "person" | "organization" | undefined;
|
|
707
|
+
person?: Partial<Omit<_kizlo_shared0.PersonSettings, "image"> & {
|
|
708
|
+
image: number | null;
|
|
709
|
+
}> | null | undefined;
|
|
710
|
+
organization?: Partial<Omit<_kizlo_shared0.OrganizationSettings, "logo"> & {
|
|
711
|
+
logo: number | null;
|
|
712
|
+
}> | null | undefined;
|
|
713
|
+
}, null, DefinedErrorMapLike>;
|
|
714
|
+
updateAuthors: Procedure<"internal", {
|
|
715
|
+
enabled?: boolean | undefined;
|
|
716
|
+
pathname_structure?: string | null | undefined;
|
|
717
|
+
title_structure?: string | null | undefined;
|
|
718
|
+
description_structure?: string | null | undefined;
|
|
719
|
+
search_engine_visibility?: boolean | null | undefined;
|
|
720
|
+
breadcrumbs?: (string | number)[] | undefined;
|
|
721
|
+
}, null, DefinedErrorMapLike>;
|
|
722
|
+
updateCrawling: Procedure<"internal", {
|
|
723
|
+
sitemaps?: {
|
|
724
|
+
pathname_structure: string;
|
|
725
|
+
} | undefined;
|
|
726
|
+
robots?: {
|
|
727
|
+
include_sitemap: boolean;
|
|
728
|
+
custom_rules: {
|
|
729
|
+
user_agent: string;
|
|
730
|
+
rule: "allow" | "disallow";
|
|
731
|
+
path: string;
|
|
732
|
+
}[];
|
|
733
|
+
} | undefined;
|
|
734
|
+
}, null, DefinedErrorMapLike>;
|
|
735
|
+
updateWebhook: Procedure<"internal", {
|
|
736
|
+
post_types?: string[] | undefined;
|
|
737
|
+
taxonomies?: string[] | undefined;
|
|
738
|
+
webhook_urls?: string[] | undefined;
|
|
739
|
+
}, null, DefinedErrorMapLike>;
|
|
740
|
+
updatePostType: Procedure<"internal", {
|
|
741
|
+
slug: string;
|
|
742
|
+
data: {
|
|
743
|
+
webpage_type?: string | undefined;
|
|
744
|
+
article_type?: string | null | undefined;
|
|
745
|
+
title_structure?: string | null | undefined;
|
|
746
|
+
description_structure?: string | null | undefined;
|
|
747
|
+
search_engine_visibility?: boolean | null | undefined;
|
|
748
|
+
breadcrumbs?: (string | number)[] | undefined;
|
|
749
|
+
pathname_structure?: string | null | undefined;
|
|
750
|
+
seo_enabled?: boolean | undefined;
|
|
751
|
+
comment_action_structure?: string | null | undefined;
|
|
752
|
+
rest_api_enabled?: boolean | undefined;
|
|
753
|
+
publicly_queryable?: boolean | undefined;
|
|
754
|
+
};
|
|
755
|
+
}, null, DefinedErrorMapLike>;
|
|
756
|
+
updateTaxonomy: Procedure<"internal", {
|
|
757
|
+
slug: string;
|
|
758
|
+
data: {
|
|
759
|
+
title_structure?: string | null | undefined;
|
|
760
|
+
description_structure?: string | null | undefined;
|
|
761
|
+
search_engine_visibility?: boolean | null | undefined;
|
|
762
|
+
breadcrumbs?: (string | number)[] | undefined;
|
|
763
|
+
pathname_structure?: string | null | undefined;
|
|
764
|
+
seo_enabled?: boolean | undefined;
|
|
765
|
+
rest_api_enabled?: boolean | undefined;
|
|
766
|
+
publicly_queryable?: boolean | undefined;
|
|
767
|
+
};
|
|
768
|
+
}, null, DefinedErrorMapLike>;
|
|
769
|
+
};
|
|
679
770
|
};
|
|
680
771
|
type RouterMap = typeof ROUTER_MAP;
|
|
681
772
|
//#endregion
|
package/dist/router.js
CHANGED
|
@@ -2,13 +2,15 @@ import { COMMENT_ROUTER_MAP } from "./comment/index.js";
|
|
|
2
2
|
import { MENU_ROUTER_MAP } from "./menu/index.js";
|
|
3
3
|
import { POST_ROUTER_MAP } from "./post/index.js";
|
|
4
4
|
import { SEO_ROUTER_MAP } from "./seo/index.js";
|
|
5
|
+
import { SETTINGS_ROUTER_MAP } from "./settings/index.js";
|
|
5
6
|
|
|
6
7
|
//#region src/router.ts
|
|
7
8
|
const ROUTER_MAP = {
|
|
8
9
|
posts: POST_ROUTER_MAP,
|
|
9
10
|
seo: SEO_ROUTER_MAP,
|
|
10
11
|
menus: MENU_ROUTER_MAP,
|
|
11
|
-
comments: COMMENT_ROUTER_MAP
|
|
12
|
+
comments: COMMENT_ROUTER_MAP,
|
|
13
|
+
settings: SETTINGS_ROUTER_MAP
|
|
12
14
|
};
|
|
13
15
|
|
|
14
16
|
//#endregion
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { createProcedure, schemaType } from "../shared/procedure.js";
|
|
2
|
+
|
|
3
|
+
//#region src/settings/index.ts
|
|
4
|
+
/** Shared error handling for every settings write: `invalid_param` → 400, anything else → 500. */
|
|
5
|
+
function resolveUpdate(response, context, errors, label) {
|
|
6
|
+
if (response.error) {
|
|
7
|
+
if (response.error.code === "invalid_param") throw errors.BAD_REQUEST({ message: response.error.message });
|
|
8
|
+
context.logger.error(`${label} unhandled error`, response.error);
|
|
9
|
+
throw errors.INTERNAL_SERVER_ERROR();
|
|
10
|
+
}
|
|
11
|
+
return response.data;
|
|
12
|
+
}
|
|
13
|
+
const SETTINGS_ROUTER_MAP = {
|
|
14
|
+
get: createProcedure({
|
|
15
|
+
scope: "internal",
|
|
16
|
+
output: schemaType()
|
|
17
|
+
}, async ({ context, errors }) => {
|
|
18
|
+
const response = await context.service.settings.get();
|
|
19
|
+
if (response.error) {
|
|
20
|
+
context.logger.error("Get settings unhandled error", response.error);
|
|
21
|
+
throw errors.INTERNAL_SERVER_ERROR();
|
|
22
|
+
}
|
|
23
|
+
return response.data;
|
|
24
|
+
}),
|
|
25
|
+
updateSite: createProcedure({
|
|
26
|
+
scope: "internal",
|
|
27
|
+
input: schemaType(),
|
|
28
|
+
output: schemaType()
|
|
29
|
+
}, async ({ context, input, errors }) => resolveUpdate(await context.service.settings.updateSite(input), context, errors, "Update site settings")),
|
|
30
|
+
updateBrand: createProcedure({
|
|
31
|
+
scope: "internal",
|
|
32
|
+
input: schemaType(),
|
|
33
|
+
output: schemaType()
|
|
34
|
+
}, async ({ context, input, errors }) => resolveUpdate(await context.service.settings.updateBrand(input), context, errors, "Update brand settings")),
|
|
35
|
+
updateIdentity: createProcedure({
|
|
36
|
+
scope: "internal",
|
|
37
|
+
input: schemaType(),
|
|
38
|
+
output: schemaType()
|
|
39
|
+
}, async ({ context, input, errors }) => resolveUpdate(await context.service.settings.updateIdentity(input), context, errors, "Update identity settings")),
|
|
40
|
+
updateAuthors: createProcedure({
|
|
41
|
+
scope: "internal",
|
|
42
|
+
input: schemaType(),
|
|
43
|
+
output: schemaType()
|
|
44
|
+
}, async ({ context, input, errors }) => resolveUpdate(await context.service.settings.updateAuthors(input), context, errors, "Update authors settings")),
|
|
45
|
+
updateCrawling: createProcedure({
|
|
46
|
+
scope: "internal",
|
|
47
|
+
input: schemaType(),
|
|
48
|
+
output: schemaType()
|
|
49
|
+
}, async ({ context, input, errors }) => resolveUpdate(await context.service.settings.updateCrawling(input), context, errors, "Update crawling settings")),
|
|
50
|
+
updateWebhook: createProcedure({
|
|
51
|
+
scope: "internal",
|
|
52
|
+
input: schemaType(),
|
|
53
|
+
output: schemaType()
|
|
54
|
+
}, async ({ context, input, errors }) => resolveUpdate(await context.service.settings.updateWebhook(input), context, errors, "Update webhook settings")),
|
|
55
|
+
updatePostType: createProcedure({
|
|
56
|
+
scope: "internal",
|
|
57
|
+
input: schemaType(),
|
|
58
|
+
output: schemaType()
|
|
59
|
+
}, async ({ context, input, errors }) => resolveUpdate(await context.service.settings.updatePostType(input.slug, input.data), context, errors, "Update post type settings")),
|
|
60
|
+
updateTaxonomy: createProcedure({
|
|
61
|
+
scope: "internal",
|
|
62
|
+
input: schemaType(),
|
|
63
|
+
output: schemaType()
|
|
64
|
+
}, async ({ context, input, errors }) => resolveUpdate(await context.service.settings.updateTaxonomy(input.slug, input.data), context, errors, "Update taxonomy settings"))
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { SETTINGS_ROUTER_MAP };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WP_Result } from "../wordpress/types.js";
|
|
2
|
-
import { KizloAuthorsSettingsInput, KizloCrawlingSettingsInput, KizloIdentitySettingsInput, KizloPostTypeSettingsInput,
|
|
2
|
+
import { KizloAuthorsSettingsInput, KizloBrandSettingsInput, KizloCrawlingSettingsInput, KizloIdentitySettingsInput, KizloPostTypeSettingsInput, KizloSiteSettingsInput, KizloTaxonomySettingsInput, KizloWebhookSettingsInput, Settings } from "./service.interface.js";
|
|
3
3
|
import { Service } from "../service.js";
|
|
4
4
|
import "../index.js";
|
|
5
5
|
|
|
@@ -8,8 +8,9 @@ declare class KizloSettingsService {
|
|
|
8
8
|
private readonly service;
|
|
9
9
|
constructor(service: Service);
|
|
10
10
|
/** Fetch every Kizlo settings section in one response. */
|
|
11
|
-
get(): Promise<WP_Result<
|
|
11
|
+
get(): Promise<WP_Result<Settings, never>>;
|
|
12
12
|
updateSite(input: KizloSiteSettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
13
|
+
updateBrand(input: KizloBrandSettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
13
14
|
updateWebhook(input: KizloWebhookSettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
14
15
|
updateIdentity(input: KizloIdentitySettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
15
16
|
updateAuthors(input: KizloAuthorsSettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
@@ -1,135 +1,25 @@
|
|
|
1
|
+
import { AuthorsSettings, BrandSettings, CrawlingSettings, IdentitySettings, Media, OrganizationFounder, OrganizationSettings, PersonSettings, PostStatus, PostTypeSettings, Settings, SiteSettings, SocialProfile, TaxonomySettings, WebhookSettings } from "@kizlo/shared";
|
|
2
|
+
|
|
1
3
|
//#region src/settings/service.interface.d.ts
|
|
2
|
-
|
|
3
|
-
id: number;
|
|
4
|
-
url: string;
|
|
5
|
-
}
|
|
6
|
-
interface KizloSocialProfile {
|
|
7
|
-
url: string;
|
|
8
|
-
platform: string;
|
|
9
|
-
}
|
|
10
|
-
interface KizloSiteSettings {
|
|
11
|
-
url: string | null;
|
|
12
|
-
backend_url: string | null;
|
|
13
|
-
secret: string | null;
|
|
14
|
-
name: string | null;
|
|
15
|
-
alternate_name: string | null;
|
|
16
|
-
tagline: string | null;
|
|
17
|
-
title_separator: string;
|
|
18
|
-
fallback_image: KizloMedia | null;
|
|
19
|
-
search_action_structure: string | null;
|
|
20
|
-
discourage_search_engines: boolean;
|
|
21
|
-
}
|
|
22
|
-
interface KizloPersonSettings {
|
|
23
|
-
name: string;
|
|
24
|
-
image: KizloMedia | null;
|
|
25
|
-
social_profiles: KizloSocialProfile[];
|
|
26
|
-
}
|
|
27
|
-
interface KizloOrganizationFounder {
|
|
28
|
-
name: string;
|
|
29
|
-
social_profiles: KizloSocialProfile[];
|
|
30
|
-
}
|
|
31
|
-
interface KizloOrganizationSettings {
|
|
32
|
-
name: string;
|
|
33
|
-
alternate_name: string | null;
|
|
34
|
-
slogan: string | null;
|
|
35
|
-
description: string | null;
|
|
36
|
-
email: string | null;
|
|
37
|
-
phone: string | null;
|
|
38
|
-
legal_name: string | null;
|
|
39
|
-
founding_date: string | null;
|
|
40
|
-
founder: KizloOrganizationFounder | null;
|
|
41
|
-
employees: number | null;
|
|
42
|
-
logo: KizloMedia | null;
|
|
43
|
-
social_profiles: KizloSocialProfile[];
|
|
44
|
-
}
|
|
45
|
-
interface KizloIdentitySettings {
|
|
46
|
-
type: "person" | "organization";
|
|
47
|
-
person: KizloPersonSettings | null;
|
|
48
|
-
organization: KizloOrganizationSettings | null;
|
|
49
|
-
}
|
|
50
|
-
interface KizloBaseContentSettings {
|
|
51
|
-
title_structure: string | null;
|
|
52
|
-
description_structure: string | null;
|
|
53
|
-
search_engine_visibility: boolean | null;
|
|
54
|
-
webpage_type: string;
|
|
55
|
-
article_type: string | null;
|
|
56
|
-
}
|
|
57
|
-
interface KizloAuthorsSettings extends Omit<KizloBaseContentSettings, "webpage_type" | "article_type"> {
|
|
58
|
-
enabled: boolean;
|
|
59
|
-
pathname_structure: string | null;
|
|
60
|
-
}
|
|
61
|
-
interface KizloPostTypeSettings extends KizloBaseContentSettings {
|
|
62
|
-
name: string;
|
|
63
|
-
slug: string;
|
|
64
|
-
seo_enabled: boolean;
|
|
65
|
-
pathname_structure: string | null;
|
|
66
|
-
comment_action_structure: string | null;
|
|
67
|
-
rest_api_enabled: boolean;
|
|
68
|
-
internal: boolean;
|
|
69
|
-
publicly_queryable: boolean;
|
|
70
|
-
supports: Record<string, boolean>;
|
|
71
|
-
}
|
|
72
|
-
interface KizloTaxonomySettings extends Omit<KizloBaseContentSettings, "webpage_type" | "article_type"> {
|
|
73
|
-
name: string;
|
|
74
|
-
slug: string;
|
|
75
|
-
seo_enabled: boolean;
|
|
76
|
-
pathname_structure: string | null;
|
|
77
|
-
rest_api_enabled: boolean;
|
|
78
|
-
internal: boolean;
|
|
79
|
-
publicly_queryable: boolean;
|
|
80
|
-
}
|
|
81
|
-
interface KizloWebhookSettings {
|
|
82
|
-
post_types: string[];
|
|
83
|
-
taxonomies: string[];
|
|
84
|
-
webhook_urls: string[];
|
|
85
|
-
}
|
|
86
|
-
interface KizloCrawlingSettings {
|
|
87
|
-
sitemaps: {
|
|
88
|
-
pathname_structure: string;
|
|
89
|
-
};
|
|
90
|
-
robots: {
|
|
91
|
-
include_sitemap: boolean;
|
|
92
|
-
custom_rules: {
|
|
93
|
-
user_agent: string;
|
|
94
|
-
rule: "allow" | "disallow";
|
|
95
|
-
path: string;
|
|
96
|
-
}[];
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
interface KizloPostStatus {
|
|
100
|
-
label: string;
|
|
101
|
-
slug: string;
|
|
102
|
-
public: boolean;
|
|
103
|
-
}
|
|
104
|
-
interface KizloSettings {
|
|
105
|
-
site: KizloSiteSettings;
|
|
106
|
-
identity: KizloIdentitySettings;
|
|
107
|
-
authors: KizloAuthorsSettings;
|
|
108
|
-
post_types: KizloPostTypeSettings[];
|
|
109
|
-
taxonomies: KizloTaxonomySettings[];
|
|
110
|
-
crawling: KizloCrawlingSettings;
|
|
111
|
-
webhook: KizloWebhookSettings;
|
|
112
|
-
statuses: KizloPostStatus[];
|
|
113
|
-
plain_permalinks: boolean;
|
|
114
|
-
}
|
|
115
|
-
type KizloSiteSettingsInput = Partial<Omit<KizloSiteSettings, "fallback_image"> & {
|
|
4
|
+
type KizloSiteSettingsInput = Partial<Omit<SiteSettings, "fallback_image"> & {
|
|
116
5
|
fallback_image: number | null;
|
|
117
6
|
}>;
|
|
118
|
-
type
|
|
119
|
-
type
|
|
7
|
+
type KizloBrandSettingsInput = Partial<Record<keyof BrandSettings, number | null>>;
|
|
8
|
+
type KizloWebhookSettingsInput = Partial<WebhookSettings>;
|
|
9
|
+
type KizloPersonSettingsInput = Partial<Omit<PersonSettings, "image"> & {
|
|
120
10
|
image: number | null;
|
|
121
11
|
}>;
|
|
122
|
-
type KizloOrganizationSettingsInput = Partial<Omit<
|
|
12
|
+
type KizloOrganizationSettingsInput = Partial<Omit<OrganizationSettings, "logo"> & {
|
|
123
13
|
logo: number | null;
|
|
124
14
|
}>;
|
|
125
15
|
type KizloIdentitySettingsInput = Partial<{
|
|
126
|
-
type: "
|
|
16
|
+
type: IdentitySettings["type"];
|
|
127
17
|
person: KizloPersonSettingsInput | null;
|
|
128
18
|
organization: KizloOrganizationSettingsInput | null;
|
|
129
19
|
}>;
|
|
130
|
-
type KizloAuthorsSettingsInput = Partial<
|
|
131
|
-
type KizloCrawlingSettingsInput = Partial<
|
|
132
|
-
type KizloPostTypeSettingsInput = Partial<Pick<
|
|
133
|
-
type KizloTaxonomySettingsInput = Partial<Pick<
|
|
20
|
+
type KizloAuthorsSettingsInput = Partial<AuthorsSettings>;
|
|
21
|
+
type KizloCrawlingSettingsInput = Partial<CrawlingSettings>;
|
|
22
|
+
type KizloPostTypeSettingsInput = Partial<Pick<PostTypeSettings, "title_structure" | "description_structure" | "search_engine_visibility" | "webpage_type" | "article_type" | "seo_enabled" | "pathname_structure" | "comment_action_structure" | "rest_api_enabled" | "publicly_queryable" | "breadcrumbs">>;
|
|
23
|
+
type KizloTaxonomySettingsInput = Partial<Pick<TaxonomySettings, "title_structure" | "description_structure" | "search_engine_visibility" | "seo_enabled" | "pathname_structure" | "rest_api_enabled" | "publicly_queryable" | "breadcrumbs">>;
|
|
134
24
|
//#endregion
|
|
135
|
-
export {
|
|
25
|
+
export { AuthorsSettings, BrandSettings, CrawlingSettings, IdentitySettings, KizloAuthorsSettingsInput, KizloBrandSettingsInput, KizloCrawlingSettingsInput, KizloIdentitySettingsInput, KizloOrganizationSettingsInput, KizloPersonSettingsInput, KizloPostTypeSettingsInput, KizloSiteSettingsInput, KizloTaxonomySettingsInput, KizloWebhookSettingsInput, Media, OrganizationFounder, OrganizationSettings, PersonSettings, PostStatus, PostTypeSettings, Settings, SiteSettings, SocialProfile, TaxonomySettings, WebhookSettings };
|
package/dist/settings/service.js
CHANGED
|
@@ -13,6 +13,9 @@ var KizloSettingsService = class {
|
|
|
13
13
|
async updateSite(input) {
|
|
14
14
|
return this.update("/settings/site", input);
|
|
15
15
|
}
|
|
16
|
+
async updateBrand(input) {
|
|
17
|
+
return this.update("/settings/brand", input);
|
|
18
|
+
}
|
|
16
19
|
async updateWebhook(input) {
|
|
17
20
|
return this.update("/settings/webhook", input);
|
|
18
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kizlo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A headless WordPress toolkit for TypeScript.",
|
|
6
6
|
"keywords": [
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@clack/prompts": "^1.5.1",
|
|
79
|
-
"@kizlo/shared": "0.
|
|
79
|
+
"@kizlo/shared": "0.2.0",
|
|
80
80
|
"@orpc/client": "^1.14.3",
|
|
81
81
|
"@orpc/contract": "^1.14.3",
|
|
82
82
|
"@orpc/openapi": "^1.14.3",
|