kizlo 0.3.2 → 0.5.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/brand/icons.d.ts +42 -0
- package/dist/brand/icons.js +108 -0
- package/dist/brand/index.d.ts +2 -0
- package/dist/brand/manifest.d.ts +21 -0
- package/dist/brand/manifest.js +28 -0
- package/dist/cli/presets/nextjs.js +19 -0
- package/dist/client.d.ts +1 -1
- package/dist/context.d.ts +1 -1
- package/dist/index.d.ts +10 -7
- package/dist/index.js +4 -2
- package/dist/integrations/nextjs/manifest.d.ts +8 -0
- package/dist/integrations/nextjs/manifest.js +18 -0
- package/dist/integrations/nextjs/metadata.d.ts +17 -0
- package/dist/integrations/nextjs/metadata.js +90 -0
- package/dist/kizlo.d.ts +1 -1
- package/dist/nextjs/server.d.ts +4 -1
- package/dist/nextjs/server.js +4 -1
- package/dist/nextjs.d.ts +2 -2
- package/dist/nextjs.js +2 -2
- package/dist/package.js +1 -1
- package/dist/router.d.ts +175 -0
- package/dist/router.js +3 -1
- package/dist/service.d.ts +2 -2
- package/dist/service.js +2 -2
- package/dist/settings/index.js +68 -0
- package/dist/settings/service.d.ts +12 -11
- package/dist/settings/service.interface.d.ts +16 -126
- package/dist/settings/service.js +5 -2
- package/dist/shared/middleware.d.ts +1 -1
- package/dist/shared/procedure.d.ts +1 -1
- package/dist/shared/schema.d.ts +1 -7
- package/dist/shared/schema.js +1 -7
- package/dist/webhook/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/integrations/nextjs/seo.d.ts +0 -7
- package/dist/integrations/nextjs/seo.js +0 -41
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: {
|
|
@@ -31,6 +32,14 @@ declare const ROUTER_MAP: {
|
|
|
31
32
|
name: string;
|
|
32
33
|
alt: string;
|
|
33
34
|
src: string;
|
|
35
|
+
mime?: string | undefined;
|
|
36
|
+
width?: number | undefined;
|
|
37
|
+
height?: number | undefined;
|
|
38
|
+
variants?: {
|
|
39
|
+
src: string;
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
}[] | undefined;
|
|
34
43
|
} | null;
|
|
35
44
|
} | null;
|
|
36
45
|
featuredMedia: {
|
|
@@ -38,6 +47,14 @@ declare const ROUTER_MAP: {
|
|
|
38
47
|
name: string;
|
|
39
48
|
alt: string;
|
|
40
49
|
src: string;
|
|
50
|
+
mime?: string | undefined;
|
|
51
|
+
width?: number | undefined;
|
|
52
|
+
height?: number | undefined;
|
|
53
|
+
variants?: {
|
|
54
|
+
src: string;
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
}[] | undefined;
|
|
41
58
|
} | null;
|
|
42
59
|
categories: {
|
|
43
60
|
id: number;
|
|
@@ -179,6 +196,14 @@ declare const ROUTER_MAP: {
|
|
|
179
196
|
name: string;
|
|
180
197
|
alt: string;
|
|
181
198
|
src: string;
|
|
199
|
+
mime?: string | undefined;
|
|
200
|
+
width?: number | undefined;
|
|
201
|
+
height?: number | undefined;
|
|
202
|
+
variants?: {
|
|
203
|
+
src: string;
|
|
204
|
+
width: number;
|
|
205
|
+
height: number;
|
|
206
|
+
}[] | undefined;
|
|
182
207
|
} | null;
|
|
183
208
|
} | null;
|
|
184
209
|
featuredMedia: {
|
|
@@ -186,6 +211,14 @@ declare const ROUTER_MAP: {
|
|
|
186
211
|
name: string;
|
|
187
212
|
alt: string;
|
|
188
213
|
src: string;
|
|
214
|
+
mime?: string | undefined;
|
|
215
|
+
width?: number | undefined;
|
|
216
|
+
height?: number | undefined;
|
|
217
|
+
variants?: {
|
|
218
|
+
src: string;
|
|
219
|
+
width: number;
|
|
220
|
+
height: number;
|
|
221
|
+
}[] | undefined;
|
|
189
222
|
} | null;
|
|
190
223
|
categories: {
|
|
191
224
|
id: number;
|
|
@@ -521,6 +554,14 @@ declare const ROUTER_MAP: {
|
|
|
521
554
|
name: string;
|
|
522
555
|
alt: string;
|
|
523
556
|
src: string;
|
|
557
|
+
mime?: string | undefined;
|
|
558
|
+
width?: number | undefined;
|
|
559
|
+
height?: number | undefined;
|
|
560
|
+
variants?: {
|
|
561
|
+
src: string;
|
|
562
|
+
width: number;
|
|
563
|
+
height: number;
|
|
564
|
+
}[] | undefined;
|
|
524
565
|
} | null;
|
|
525
566
|
} | null;
|
|
526
567
|
content: string;
|
|
@@ -533,6 +574,14 @@ declare const ROUTER_MAP: {
|
|
|
533
574
|
name: string;
|
|
534
575
|
alt: string;
|
|
535
576
|
src: string;
|
|
577
|
+
mime?: string | undefined;
|
|
578
|
+
width?: number | undefined;
|
|
579
|
+
height?: number | undefined;
|
|
580
|
+
variants?: {
|
|
581
|
+
src: string;
|
|
582
|
+
width: number;
|
|
583
|
+
height: number;
|
|
584
|
+
}[] | undefined;
|
|
536
585
|
} | null;
|
|
537
586
|
};
|
|
538
587
|
replyCount: number;
|
|
@@ -579,6 +628,14 @@ declare const ROUTER_MAP: {
|
|
|
579
628
|
name: string;
|
|
580
629
|
alt: string;
|
|
581
630
|
src: string;
|
|
631
|
+
mime?: string | undefined;
|
|
632
|
+
width?: number | undefined;
|
|
633
|
+
height?: number | undefined;
|
|
634
|
+
variants?: {
|
|
635
|
+
src: string;
|
|
636
|
+
width: number;
|
|
637
|
+
height: number;
|
|
638
|
+
}[] | undefined;
|
|
582
639
|
} | null;
|
|
583
640
|
} | null;
|
|
584
641
|
content: string;
|
|
@@ -591,6 +648,14 @@ declare const ROUTER_MAP: {
|
|
|
591
648
|
name: string;
|
|
592
649
|
alt: string;
|
|
593
650
|
src: string;
|
|
651
|
+
mime?: string | undefined;
|
|
652
|
+
width?: number | undefined;
|
|
653
|
+
height?: number | undefined;
|
|
654
|
+
variants?: {
|
|
655
|
+
src: string;
|
|
656
|
+
width: number;
|
|
657
|
+
height: number;
|
|
658
|
+
}[] | undefined;
|
|
594
659
|
} | null;
|
|
595
660
|
};
|
|
596
661
|
replyCount: number;
|
|
@@ -637,6 +702,14 @@ declare const ROUTER_MAP: {
|
|
|
637
702
|
name: string;
|
|
638
703
|
alt: string;
|
|
639
704
|
src: string;
|
|
705
|
+
mime?: string | undefined;
|
|
706
|
+
width?: number | undefined;
|
|
707
|
+
height?: number | undefined;
|
|
708
|
+
variants?: {
|
|
709
|
+
src: string;
|
|
710
|
+
width: number;
|
|
711
|
+
height: number;
|
|
712
|
+
}[] | undefined;
|
|
640
713
|
} | null;
|
|
641
714
|
} | null;
|
|
642
715
|
content: string;
|
|
@@ -649,6 +722,14 @@ declare const ROUTER_MAP: {
|
|
|
649
722
|
name: string;
|
|
650
723
|
alt: string;
|
|
651
724
|
src: string;
|
|
725
|
+
mime?: string | undefined;
|
|
726
|
+
width?: number | undefined;
|
|
727
|
+
height?: number | undefined;
|
|
728
|
+
variants?: {
|
|
729
|
+
src: string;
|
|
730
|
+
width: number;
|
|
731
|
+
height: number;
|
|
732
|
+
}[] | undefined;
|
|
652
733
|
} | null;
|
|
653
734
|
};
|
|
654
735
|
replyCount: number;
|
|
@@ -676,6 +757,100 @@ declare const ROUTER_MAP: {
|
|
|
676
757
|
};
|
|
677
758
|
}>;
|
|
678
759
|
};
|
|
760
|
+
settings: {
|
|
761
|
+
get: Procedure<"internal", {}, _kizlo_shared0.Settings, DefinedErrorMapLike>;
|
|
762
|
+
updateSite: Procedure<"internal", {
|
|
763
|
+
name?: string | null | undefined;
|
|
764
|
+
url?: string | null | undefined;
|
|
765
|
+
backend_url?: string | null | undefined;
|
|
766
|
+
secret?: string | null | undefined;
|
|
767
|
+
alternate_name?: string | null | undefined;
|
|
768
|
+
tagline?: string | null | undefined;
|
|
769
|
+
title_separator?: string | undefined;
|
|
770
|
+
search_action_structure?: string | null | undefined;
|
|
771
|
+
discourage_search_engines?: boolean | undefined;
|
|
772
|
+
fallback_image?: number | null | undefined;
|
|
773
|
+
}, null, DefinedErrorMapLike>;
|
|
774
|
+
updateBrand: Procedure<"internal", {
|
|
775
|
+
logo?: number | null | undefined;
|
|
776
|
+
logo_dark?: number | null | undefined;
|
|
777
|
+
logo_icon?: number | null | undefined;
|
|
778
|
+
logo_icon_dark?: number | null | undefined;
|
|
779
|
+
logo_wordmark?: number | null | undefined;
|
|
780
|
+
logo_wordmark_dark?: number | null | undefined;
|
|
781
|
+
favicon?: number | null | undefined;
|
|
782
|
+
favicon_dark?: number | null | undefined;
|
|
783
|
+
ios_app_icon?: number | null | undefined;
|
|
784
|
+
android_app_icon?: number | null | undefined;
|
|
785
|
+
theme_color?: number | null | undefined;
|
|
786
|
+
theme_color_dark?: number | null | undefined;
|
|
787
|
+
background_color?: number | null | undefined;
|
|
788
|
+
}, null, DefinedErrorMapLike>;
|
|
789
|
+
updateIdentity: Procedure<"internal", {
|
|
790
|
+
type?: "person" | "organization" | undefined;
|
|
791
|
+
person?: Partial<Omit<_kizlo_shared0.PersonSettings, "image"> & {
|
|
792
|
+
image: number | null;
|
|
793
|
+
}> | null | undefined;
|
|
794
|
+
organization?: Partial<Omit<_kizlo_shared0.OrganizationSettings, "logo"> & {
|
|
795
|
+
logo: number | null;
|
|
796
|
+
}> | null | undefined;
|
|
797
|
+
}, null, DefinedErrorMapLike>;
|
|
798
|
+
updateAuthors: Procedure<"internal", {
|
|
799
|
+
enabled?: boolean | undefined;
|
|
800
|
+
pathname_structure?: string | null | undefined;
|
|
801
|
+
title_structure?: string | null | undefined;
|
|
802
|
+
description_structure?: string | null | undefined;
|
|
803
|
+
search_engine_visibility?: boolean | null | undefined;
|
|
804
|
+
breadcrumbs?: (string | number)[] | undefined;
|
|
805
|
+
}, null, DefinedErrorMapLike>;
|
|
806
|
+
updateCrawling: Procedure<"internal", {
|
|
807
|
+
sitemaps?: {
|
|
808
|
+
pathname_structure: string;
|
|
809
|
+
} | undefined;
|
|
810
|
+
robots?: {
|
|
811
|
+
include_sitemap: boolean;
|
|
812
|
+
custom_rules: {
|
|
813
|
+
user_agent: string;
|
|
814
|
+
rule: "allow" | "disallow";
|
|
815
|
+
path: string;
|
|
816
|
+
}[];
|
|
817
|
+
} | undefined;
|
|
818
|
+
}, null, DefinedErrorMapLike>;
|
|
819
|
+
updateWebhook: Procedure<"internal", {
|
|
820
|
+
post_types?: string[] | undefined;
|
|
821
|
+
taxonomies?: string[] | undefined;
|
|
822
|
+
webhook_urls?: string[] | undefined;
|
|
823
|
+
}, null, DefinedErrorMapLike>;
|
|
824
|
+
updatePostType: Procedure<"internal", {
|
|
825
|
+
slug: string;
|
|
826
|
+
data: {
|
|
827
|
+
webpage_type?: string | undefined;
|
|
828
|
+
article_type?: string | null | undefined;
|
|
829
|
+
title_structure?: string | null | undefined;
|
|
830
|
+
description_structure?: string | null | undefined;
|
|
831
|
+
search_engine_visibility?: boolean | null | undefined;
|
|
832
|
+
breadcrumbs?: (string | number)[] | undefined;
|
|
833
|
+
pathname_structure?: string | null | undefined;
|
|
834
|
+
seo_enabled?: boolean | undefined;
|
|
835
|
+
comment_action_structure?: string | null | undefined;
|
|
836
|
+
rest_api_enabled?: boolean | undefined;
|
|
837
|
+
publicly_queryable?: boolean | undefined;
|
|
838
|
+
};
|
|
839
|
+
}, null, DefinedErrorMapLike>;
|
|
840
|
+
updateTaxonomy: Procedure<"internal", {
|
|
841
|
+
slug: string;
|
|
842
|
+
data: {
|
|
843
|
+
title_structure?: string | null | undefined;
|
|
844
|
+
description_structure?: string | null | undefined;
|
|
845
|
+
search_engine_visibility?: boolean | null | undefined;
|
|
846
|
+
breadcrumbs?: (string | number)[] | undefined;
|
|
847
|
+
pathname_structure?: string | null | undefined;
|
|
848
|
+
seo_enabled?: boolean | undefined;
|
|
849
|
+
rest_api_enabled?: boolean | undefined;
|
|
850
|
+
publicly_queryable?: boolean | undefined;
|
|
851
|
+
};
|
|
852
|
+
}, null, DefinedErrorMapLike>;
|
|
853
|
+
};
|
|
679
854
|
};
|
|
680
855
|
type RouterMap = typeof ROUTER_MAP;
|
|
681
856
|
//#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
|
package/dist/service.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { WordPressCredentials } from "./wordpress/types.js";
|
|
|
2
2
|
import { WordPressService } from "./wordpress/service.js";
|
|
3
3
|
import "./wordpress/index.js";
|
|
4
4
|
import { EmailService } from "./email/service.js";
|
|
5
|
-
import {
|
|
5
|
+
import { SettingsService } from "./settings/service.js";
|
|
6
6
|
|
|
7
7
|
//#region src/service.d.ts
|
|
8
8
|
interface ServiceConfig {
|
|
@@ -10,7 +10,7 @@ interface ServiceConfig {
|
|
|
10
10
|
}
|
|
11
11
|
declare class Service {
|
|
12
12
|
readonly email: EmailService;
|
|
13
|
-
readonly settings:
|
|
13
|
+
readonly settings: SettingsService;
|
|
14
14
|
readonly wordpress: WordPressService;
|
|
15
15
|
private readonly config;
|
|
16
16
|
constructor(config: ServiceConfig);
|
package/dist/service.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WordPressService } from "./wordpress/service.js";
|
|
2
2
|
import { EmailService } from "./email/service.js";
|
|
3
|
-
import {
|
|
3
|
+
import { SettingsService } from "./settings/service.js";
|
|
4
4
|
|
|
5
5
|
//#region src/service.ts
|
|
6
6
|
var Service = class {
|
|
@@ -11,7 +11,7 @@ var Service = class {
|
|
|
11
11
|
constructor(config) {
|
|
12
12
|
this.config = config;
|
|
13
13
|
this.email = new EmailService(this);
|
|
14
|
-
this.settings = new
|
|
14
|
+
this.settings = new SettingsService(this);
|
|
15
15
|
this.wordpress = new WordPressService(this.config);
|
|
16
16
|
}
|
|
17
17
|
};
|
|
@@ -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,22 +1,23 @@
|
|
|
1
1
|
import { WP_Result } from "../wordpress/types.js";
|
|
2
|
-
import {
|
|
2
|
+
import { AuthorsSettingsInput, BrandSettingsInput, CrawlingSettingsInput, IdentitySettingsInput, PostTypeSettingsInput, Settings, SiteSettingsInput, TaxonomySettingsInput, WebhookSettingsInput } from "./service.interface.js";
|
|
3
3
|
import { Service } from "../service.js";
|
|
4
4
|
import "../index.js";
|
|
5
5
|
|
|
6
6
|
//#region src/settings/service.d.ts
|
|
7
|
-
declare class
|
|
7
|
+
declare class SettingsService {
|
|
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<
|
|
12
|
-
updateSite(input:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
get(): Promise<WP_Result<Settings, never>>;
|
|
12
|
+
updateSite(input: SiteSettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
13
|
+
updateBrand(input: BrandSettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
14
|
+
updateWebhook(input: WebhookSettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
15
|
+
updateIdentity(input: IdentitySettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
16
|
+
updateAuthors(input: AuthorsSettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
17
|
+
updateCrawling(input: CrawlingSettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
18
|
+
updatePostType(slug: string, input: PostTypeSettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
19
|
+
updateTaxonomy(slug: string, input: TaxonomySettingsInput): Promise<WP_Result<null, "invalid_param">>;
|
|
19
20
|
private update;
|
|
20
21
|
}
|
|
21
22
|
//#endregion
|
|
22
|
-
export {
|
|
23
|
+
export { SettingsService };
|
|
@@ -1,135 +1,25 @@
|
|
|
1
|
+
import { AuthorsSettings, BrandSettings, CrawlingSettings, IdentitySettings, OrganizationFounder, OrganizationSettings, PersonSettings, PostStatusDefinition, 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 SiteSettingsInput = Partial<Omit<SiteSettings, "fallback_image"> & {
|
|
116
5
|
fallback_image: number | null;
|
|
117
6
|
}>;
|
|
118
|
-
type
|
|
119
|
-
type
|
|
7
|
+
type BrandSettingsInput = Partial<Record<keyof BrandSettings, number | null>>;
|
|
8
|
+
type WebhookSettingsInput = Partial<WebhookSettings>;
|
|
9
|
+
type PersonSettingsInput = Partial<Omit<PersonSettings, "image"> & {
|
|
120
10
|
image: number | null;
|
|
121
11
|
}>;
|
|
122
|
-
type
|
|
12
|
+
type OrganizationSettingsInput = Partial<Omit<OrganizationSettings, "logo"> & {
|
|
123
13
|
logo: number | null;
|
|
124
14
|
}>;
|
|
125
|
-
type
|
|
126
|
-
type: "
|
|
127
|
-
person:
|
|
128
|
-
organization:
|
|
15
|
+
type IdentitySettingsInput = Partial<{
|
|
16
|
+
type: IdentitySettings["type"];
|
|
17
|
+
person: PersonSettingsInput | null;
|
|
18
|
+
organization: OrganizationSettingsInput | null;
|
|
129
19
|
}>;
|
|
130
|
-
type
|
|
131
|
-
type
|
|
132
|
-
type
|
|
133
|
-
type
|
|
20
|
+
type AuthorsSettingsInput = Partial<AuthorsSettings>;
|
|
21
|
+
type CrawlingSettingsInput = Partial<CrawlingSettings>;
|
|
22
|
+
type PostTypeSettingsInput = 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 TaxonomySettingsInput = 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 { type AuthorsSettings, AuthorsSettingsInput, type BrandSettings, BrandSettingsInput, type CrawlingSettings, CrawlingSettingsInput, type IdentitySettings, IdentitySettingsInput, type OrganizationFounder, type OrganizationSettings, OrganizationSettingsInput, type PersonSettings, PersonSettingsInput, type PostStatusDefinition, type PostTypeSettings, PostTypeSettingsInput, type Settings, type SiteSettings, SiteSettingsInput, type SocialProfile, type TaxonomySettings, TaxonomySettingsInput, type WebhookSettings, WebhookSettingsInput };
|
package/dist/settings/service.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WP_KIZLO_BASE } from "../wordpress/constants.js";
|
|
2
2
|
|
|
3
3
|
//#region src/settings/service.ts
|
|
4
|
-
var
|
|
4
|
+
var SettingsService = class {
|
|
5
5
|
service;
|
|
6
6
|
constructor(service) {
|
|
7
7
|
this.service = service;
|
|
@@ -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
|
}
|
|
@@ -40,4 +43,4 @@ var KizloSettingsService = class {
|
|
|
40
43
|
};
|
|
41
44
|
|
|
42
45
|
//#endregion
|
|
43
|
-
export {
|
|
46
|
+
export { SettingsService };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyContext } from "./types.js";
|
|
2
|
-
import { DefinedErrorMapLike } from "./error.js";
|
|
3
2
|
import { ServerContext } from "../context.js";
|
|
3
|
+
import { DefinedErrorMapLike } from "./error.js";
|
|
4
4
|
import { BaseHandlerOptions } from "./procedure.js";
|
|
5
5
|
import { UnionToIntersection } from "@kizlo/shared";
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DefinedErrorMapLike, ThrowableErrorMap, WithCommonErrorMap } from "./error.js";
|
|
2
1
|
import { ServerContext } from "../context.js";
|
|
2
|
+
import { DefinedErrorMapLike, ThrowableErrorMap, WithCommonErrorMap } from "./error.js";
|
|
3
3
|
import { AnyMiddleware, InferUses, Middleware } from "./middleware.js";
|
|
4
4
|
import * as _orpc_contract0 from "@orpc/contract";
|
|
5
5
|
import { DeepMerge, Pathname, Prettify, Promisify, Schema, SchemaInput, SchemaOutput } from "@kizlo/shared";
|
package/dist/shared/schema.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Media } from "@kizlo/shared";
|
|
1
2
|
import z from "zod/v4";
|
|
2
3
|
|
|
3
4
|
//#region src/shared/schema.d.ts
|
|
@@ -27,13 +28,6 @@ declare const CurrencyFormat: z.ZodObject<{
|
|
|
27
28
|
currencyThousandSeparator: z.ZodString;
|
|
28
29
|
}, z.core.$strip>;
|
|
29
30
|
type CurrencyFormat = z.infer<typeof CurrencyFormat>;
|
|
30
|
-
declare const Media: z.ZodObject<{
|
|
31
|
-
id: z.ZodNumber;
|
|
32
|
-
name: z.ZodString;
|
|
33
|
-
alt: z.ZodString;
|
|
34
|
-
src: z.ZodString;
|
|
35
|
-
}, z.core.$strip>;
|
|
36
|
-
type Media = z.infer<typeof Media>;
|
|
37
31
|
declare const IdentifierInput: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodCoercedNumber<string | number>>, z.ZodString]>;
|
|
38
32
|
type IdentifierInput = z.output<typeof IdentifierInput>;
|
|
39
33
|
declare const PreviewTokenPayload: z.ZodObject<{
|
package/dist/shared/schema.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NumberLike } from "@kizlo/shared";
|
|
1
|
+
import { Media, NumberLike } from "@kizlo/shared";
|
|
2
2
|
import z from "zod/v4";
|
|
3
3
|
|
|
4
4
|
//#region src/shared/schema.ts
|
|
@@ -22,12 +22,6 @@ const CurrencyFormat = z.object({
|
|
|
22
22
|
currencyDecimalSeparator: z.string(),
|
|
23
23
|
currencyThousandSeparator: z.string()
|
|
24
24
|
});
|
|
25
|
-
const Media = z.object({
|
|
26
|
-
id: z.number(),
|
|
27
|
-
name: z.string(),
|
|
28
|
-
alt: z.string(),
|
|
29
|
-
src: z.string()
|
|
30
|
-
});
|
|
31
25
|
const IdentifierInput = z.union([NumberLike, z.string()]);
|
|
32
26
|
const PreviewTokenPayload = z.object({
|
|
33
27
|
id: z.number(),
|
package/dist/webhook/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ServerContext } from "../context.js";
|
|
1
2
|
import { KizloEvent } from "./schema.js";
|
|
2
3
|
import { DefinedErrorMapLike } from "../shared/error.js";
|
|
3
|
-
import { ServerContext } from "../context.js";
|
|
4
4
|
import { Procedure } from "../shared/procedure.js";
|
|
5
5
|
import "../index.js";
|
|
6
6
|
import { Schema, SchemaOutput } from "@kizlo/shared";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kizlo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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.3.0",
|
|
80
80
|
"@orpc/client": "^1.14.3",
|
|
81
81
|
"@orpc/contract": "^1.14.3",
|
|
82
82
|
"@orpc/openapi": "^1.14.3",
|