kizlo 0.5.0 → 0.6.1

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 (47) hide show
  1. package/dist/cli/commands/dev.js +1 -1
  2. package/dist/cli/commands/init.js +1 -1
  3. package/dist/cli/daemon/config.js +1 -1
  4. package/dist/cli/daemon/generate.js +1 -1
  5. package/dist/cli/daemon/lock.js +1 -1
  6. package/dist/cli/utils.js +2 -2
  7. package/dist/cli/wp/bootstrap.js +1 -1
  8. package/dist/cli/wp/byo.js +1 -1
  9. package/dist/cli/wp/compose/override.js +1 -1
  10. package/dist/cli/wp/compose/override.test.ts +0 -2
  11. package/dist/cli/wp/compose/override.ts +0 -4
  12. package/dist/cli/wp/constants.d.ts +35 -0
  13. package/dist/cli/wp/constants.js +13 -2
  14. package/dist/cli/wp/dev.js +2 -2
  15. package/dist/cli/wp/phpunit.js +1 -1
  16. package/dist/cli/wp/session.js +2 -2
  17. package/dist/cli/wp/setup.js +1 -1
  18. package/dist/cli/wp/utils.d.ts +1 -9
  19. package/dist/cli/wp/utils.js +3 -15
  20. package/dist/index.d.ts +7 -5
  21. package/dist/index.js +4 -1
  22. package/dist/integrations/nextjs/manifest.js +2 -9
  23. package/dist/integrations/nextjs/metadata.d.ts +1 -1
  24. package/dist/integrations/nextjs/revalidate.d.ts +4 -1
  25. package/dist/integrations/nextjs/revalidate.js +7 -3
  26. package/dist/integrations/nextjs/robots.d.ts +2 -1
  27. package/dist/integrations/nextjs/robots.js +2 -9
  28. package/dist/integrations/nextjs/utils.d.ts +13 -0
  29. package/dist/integrations/nextjs/utils.js +38 -1
  30. package/dist/nextjs/server.d.ts +5 -3
  31. package/dist/nextjs/server.js +5 -3
  32. package/dist/nextjs.d.ts +1 -2
  33. package/dist/nextjs.js +1 -2
  34. package/dist/package.js +1 -1
  35. package/dist/router.d.ts +8 -5
  36. package/dist/seo/sitemap.d.ts +1 -1
  37. package/dist/seo/utils.d.ts +12 -2
  38. package/dist/seo/utils.js +1 -1
  39. package/dist/settings/index.js +5 -0
  40. package/dist/settings/service.d.ts +2 -1
  41. package/dist/settings/service.interface.d.ts +3 -2
  42. package/dist/settings/service.js +3 -0
  43. package/dist/test.d.ts +4 -3
  44. package/dist/test.js +3 -2
  45. package/dist/webhook/schema.d.ts +14 -1
  46. package/dist/webhook/schema.js +25 -7
  47. package/package.json +2 -3
@@ -7,8 +7,8 @@ import { bootstrapDev } from "../wp/dev.js";
7
7
  import { reapOrphans, registerSession, removeProjectContainers, spawnWatchdog, unregisterSession } from "../wp/session.js";
8
8
  import { syncSiteSettings } from "../wp/settings.js";
9
9
  import { devStack } from "../wp/stack.js";
10
- import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
11
10
  import { join } from "node:path";
11
+ import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
12
12
  import { defineCommand } from "citty";
13
13
  import { randomBytes } from "node:crypto";
14
14
  import { networkInterfaces } from "node:os";
@@ -10,8 +10,8 @@ import { syncSiteSettings } from "../wp/settings.js";
10
10
  import { devStack } from "../wp/stack.js";
11
11
  import { PRESETS, detectPreset, getPreset } from "../presets/index.js";
12
12
  import z from "zod/v4";
13
- import fs from "node:fs";
14
13
  import path from "node:path";
14
+ import fs from "node:fs";
15
15
  import { defineCommand } from "citty";
16
16
  import * as p from "@clack/prompts";
17
17
  import { randomBytes } from "node:crypto";
@@ -2,8 +2,8 @@ import { credentialsPath, findConfigDir } from "../wp/utils.js";
2
2
  import { log } from "./logger.js";
3
3
  import { detectPackageManager } from "../utils.js";
4
4
  import z from "zod/v4";
5
- import fs from "node:fs";
6
5
  import path from "node:path";
6
+ import fs from "node:fs";
7
7
  import { createJiti } from "jiti";
8
8
 
9
9
  //#region src/cli/daemon/config.ts
@@ -1,7 +1,7 @@
1
1
  import { generateContract } from "../../shared/contract.js";
2
2
  import { loadEnvFiles } from "../utils.js";
3
- import fs from "node:fs";
4
3
  import path from "node:path";
4
+ import fs from "node:fs";
5
5
  import { createJiti } from "jiti";
6
6
 
7
7
  //#region src/cli/daemon/generate.ts
@@ -1,5 +1,5 @@
1
- import fs from "node:fs";
2
1
  import path from "node:path";
2
+ import fs from "node:fs";
3
3
 
4
4
  //#region src/cli/daemon/lock.ts
5
5
  function lockPath(cwd) {
package/dist/cli/utils.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { log } from "./daemon/logger.js";
2
2
  import { PortInUseError, resolveHostPort } from "./wp/ports.js";
3
- import { spawnSync } from "node:child_process";
4
- import fs from "node:fs";
5
3
  import path from "node:path";
6
4
  import { fileURLToPath } from "node:url";
5
+ import { spawnSync } from "node:child_process";
6
+ import fs from "node:fs";
7
7
  import * as p from "@clack/prompts";
8
8
 
9
9
  //#region src/cli/utils.ts
@@ -1,5 +1,5 @@
1
- import { compose, composeUp, wpCli } from "./docker.js";
2
1
  import { DEFAULT_PLUGINS, DEFAULT_PORT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER } from "./constants.js";
2
+ import { compose, composeUp, wpCli } from "./docker.js";
3
3
  import { ensurePlugins } from "./utils.js";
4
4
 
5
5
  //#region src/cli/wp/bootstrap.ts
@@ -1,6 +1,6 @@
1
+ import { join, resolve, sep } from "node:path";
1
2
  import { execFileSync } from "node:child_process";
2
3
  import { cpSync, createReadStream, existsSync, mkdirSync, readdirSync, renameSync, rmSync } from "node:fs";
3
- import { join, resolve, sep } from "node:path";
4
4
  import { createInterface } from "node:readline";
5
5
 
6
6
  //#region src/cli/wp/byo.ts
@@ -1,6 +1,6 @@
1
1
  import { OPCACHE_INI, REMAP_ENTRYPOINT } from "../constants.js";
2
- import { mkdirSync, writeFileSync } from "node:fs";
3
2
  import { basename, dirname, isAbsolute, resolve } from "node:path";
3
+ import { mkdirSync, writeFileSync } from "node:fs";
4
4
 
5
5
  //#region src/cli/wp/compose/override.ts
6
6
  /** Generated dev override location, relative to the config root. */
@@ -72,7 +72,6 @@ describe("writeDevOverride", () => {
72
72
  expect(body).toContain(`- "${REMAP_ENTRYPOINT}:/usr/local/bin/kizlo-remap-entrypoint.sh:ro"`)
73
73
  expect(body).toContain('KIZLO_PUID: "1000"')
74
74
  expect(body).toContain('KIZLO_PGID: "1000"')
75
- // wp-cli runs directly as the host user (no entrypoint wrapper needed there).
76
75
  expect(body).toContain('user: "1000:1000"')
77
76
  })
78
77
  })
@@ -96,7 +95,6 @@ describe("writeTestOverride", () => {
96
95
  const pluginBind = `- "${path.join(dir, "plugins/kizlo-woocommerce")}:/var/www/html/wp-content/plugins/kizlo-woocommerce"`
97
96
  expect(body).toContain(" wordpress:")
98
97
  expect(body).toContain(" wp-cli:")
99
- // One bind per service.
100
98
  expect(body.split(pluginBind).length - 1).toBe(2)
101
99
  })
102
100
 
@@ -84,8 +84,6 @@ export function writeDevOverride(configDir: string, opts: DevOverrideOptions): s
84
84
  const rootBind = bind(opts.wordpressDir, WP_ROOT)
85
85
  const remap = opts.hostUser
86
86
  ? {
87
- // Run the wrapper as root so it can retag www-data, then it hands off to
88
- // the normal entrypoint; wp-cli just runs directly as the host user.
89
87
  wordpress: {
90
88
  user: "0:0",
91
89
  entrypoint: ["sh", REMAP_TARGET],
@@ -104,8 +102,6 @@ export function writeDevOverride(configDir: string, opts: DevOverrideOptions): s
104
102
  }
105
103
  const wpCli: ServiceBlock = { user: remap?.wpCliUser, volumes: [rootBind, ...mounts] }
106
104
 
107
- // Publish MySQL on a host port (loopback only) so advanced users can point a SQL
108
- // client at the dev database. Internal-only when no port is configured.
109
105
  const services = [renderService("wordpress", wordpress), renderService("wp-cli", wpCli)]
110
106
  if (opts.dbPort) services.push(renderService("mysql", { ports: [`127.0.0.1:${opts.dbPort}:3306`] }))
111
107
 
@@ -0,0 +1,35 @@
1
+ import { PluginSource, TestAdminUser, TestUser } from "./types.js";
2
+
3
+ //#region src/cli/wp/constants.d.ts
4
+ declare const DEFAULT_PORT = 8080;
5
+ /** Build a GitHub release-zip URL for `PluginSource.source` (asset named `<tag>.zip`). */
6
+ declare function githubRelease(repo: string, tag: string): string;
7
+ /**
8
+ * Download URL for a Kizlo plugin's latest release, served by kizlo.io (it 302s to
9
+ * the current GitHub release asset). Always tracks the newest published version —
10
+ * use {@link githubRelease} instead to pin a specific tag.
11
+ */
12
+ declare function kizloRelease(slug: string): string;
13
+ /** The docker-compose file shipped alongside this module (in both `src/` and `dist/`). */
14
+ declare const COMPOSE_FILE: string;
15
+ /** Dev PHP OPcache config, shipped alongside this module and bind-mounted into the dev stack. */
16
+ declare const OPCACHE_INI: string;
17
+ /** Linux-only entrypoint that retags www-data to the host user (see the script for why). */
18
+ declare const REMAP_ENTRYPOINT: string;
19
+ declare const CONFIG_FILES: string[];
20
+ /** Credentials artifact location, relative to the config root. */
21
+ declare const CREDENTIALS_REL = ".kizlo/test-credentials.json";
22
+ /**
23
+ * DB-side marker written as the final bootstrap step and checked by `isSeeded`.
24
+ * It records that this database holds a completed bootstrap — independent of any
25
+ * fixture content, which is optional and varies per consumer. Bump `SEED_VERSION`
26
+ * to force a reseed when the bootstrap contract changes.
27
+ */
28
+ declare const SEED_MARKER_OPTION = "kizlo_test_seeded";
29
+ declare const SEED_VERSION = "1";
30
+ /** The kizlo core WordPress plugin, always installed during bootstrap. */
31
+ declare const DEFAULT_PLUGINS: PluginSource[];
32
+ declare const TEST_ADMIN: Omit<TestAdminUser, "id" | "applicationPassword">;
33
+ declare const TEST_USER: Omit<TestUser, "id">;
34
+ //#endregion
35
+ export { COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, githubRelease, kizloRelease };
@@ -1,9 +1,20 @@
1
- import { kizloRelease } from "./utils.js";
2
1
  import { dirname, resolve } from "node:path";
3
2
  import { fileURLToPath } from "node:url";
4
3
 
5
4
  //#region src/cli/wp/constants.ts
6
5
  const DEFAULT_PORT = 8080;
6
+ /** Build a GitHub release-zip URL for `PluginSource.source` (asset named `<tag>.zip`). */
7
+ function githubRelease(repo, tag) {
8
+ return `https://github.com/${repo}/releases/download/${tag}/${tag}.zip`;
9
+ }
10
+ /**
11
+ * Download URL for a Kizlo plugin's latest release, served by kizlo.io (it 302s to
12
+ * the current GitHub release asset). Always tracks the newest published version —
13
+ * use {@link githubRelease} instead to pin a specific tag.
14
+ */
15
+ function kizloRelease(slug) {
16
+ return `https://kizlo.io/plugins/${slug}/download`;
17
+ }
7
18
  const HERE = dirname(fileURLToPath(import.meta.url));
8
19
  /** The docker-compose file shipped alongside this module (in both `src/` and `dist/`). */
9
20
  const COMPOSE_FILE = resolve(HERE, "compose/docker-compose.yml");
@@ -48,4 +59,4 @@ const TEST_USER = {
48
59
  };
49
60
 
50
61
  //#endregion
51
- export { COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER };
62
+ export { COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, githubRelease, kizloRelease };
@@ -1,11 +1,11 @@
1
1
  import { WordPressService } from "../../wordpress/service.js";
2
- import { compose, composeUp, wpCli } from "./docker.js";
3
2
  import { DEFAULT_PLUGINS, TEST_ADMIN } from "./constants.js";
3
+ import { compose, composeUp, wpCli } from "./docker.js";
4
4
  import { ensurePlugins } from "./utils.js";
5
5
  import { createAdminAppPassword, seedUsers } from "./bootstrap.js";
6
6
  import { prepareByo } from "./byo.js";
7
- import { existsSync, rmSync } from "node:fs";
8
7
  import { join } from "node:path";
8
+ import { existsSync, rmSync } from "node:fs";
9
9
  import { randomBytes } from "node:crypto";
10
10
 
11
11
  //#region src/cli/wp/dev.ts
@@ -1,8 +1,8 @@
1
1
  import { isLocalPlugin } from "./types.js";
2
2
  import { compose } from "./docker.js";
3
3
  import { log } from "../daemon/logger.js";
4
- import { existsSync } from "node:fs";
5
4
  import { basename, isAbsolute, resolve } from "node:path";
5
+ import { existsSync } from "node:fs";
6
6
 
7
7
  //#region src/cli/wp/phpunit.ts
8
8
  const PLUGINS_DIR = `/var/www/html/wp-content/plugins`;
@@ -1,7 +1,7 @@
1
- import { execFile, spawn } from "node:child_process";
2
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
1
  import { dirname, join } from "node:path";
4
2
  import { fileURLToPath } from "node:url";
3
+ import { execFile, spawn } from "node:child_process";
4
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
5
  import { promisify } from "node:util";
6
6
  import { homedir } from "node:os";
7
7
 
@@ -1,8 +1,8 @@
1
1
  import { WordPressService } from "../../wordpress/service.js";
2
2
  import { credentialsPath } from "./utils.js";
3
3
  import { bootstrapWp } from "./bootstrap.js";
4
- import { mkdirSync, writeFileSync } from "node:fs";
5
4
  import { dirname } from "node:path";
5
+ import { mkdirSync, writeFileSync } from "node:fs";
6
6
 
7
7
  //#region src/cli/wp/setup.ts
8
8
  /**
@@ -14,14 +14,6 @@ import { DevPluginSource, PluginSource, TestCredentials } from "./types.js";
14
14
  * Bumping `SEED_VERSION` invalidates older marks and forces a reseed.
15
15
  */
16
16
  declare function isSeeded(): Promise<boolean>;
17
- /** Build a GitHub release-zip URL for `PluginSource.source` (asset named `<tag>.zip`). */
18
- declare function githubRelease(repo: string, tag: string): string;
19
- /**
20
- * Download URL for a Kizlo plugin's latest release, served by kizlo.io (it 302s to
21
- * the current GitHub release asset). Always tracks the newest published version —
22
- * use {@link githubRelease} instead to pin a specific tag.
23
- */
24
- declare function kizloRelease(slug: string): string;
25
17
  /** Resolve a `PluginSource` to the `(name, source)` pair `ensurePlugin` needs. */
26
18
  declare function resolvePluginSource(plugin: PluginSource): [name: string, source: string];
27
19
  /**
@@ -63,4 +55,4 @@ declare function getTestCredentials(): TestCredentials;
63
55
  */
64
56
  declare function recordedPort(): number | undefined;
65
57
  //#endregion
66
- export { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isSeeded, kizloRelease, recordedPort, resolvePluginSource };
58
+ export { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, isSeeded, recordedPort, resolvePluginSource };
@@ -1,8 +1,8 @@
1
1
  import { isLocalPlugin } from "./types.js";
2
- import { compose, wpCli } from "./docker.js";
3
2
  import { CONFIG_FILES, CREDENTIALS_REL, SEED_MARKER_OPTION, SEED_VERSION } from "./constants.js";
4
- import { existsSync, readFileSync } from "node:fs";
3
+ import { compose, wpCli } from "./docker.js";
5
4
  import { basename, dirname, resolve } from "node:path";
5
+ import { existsSync, readFileSync } from "node:fs";
6
6
 
7
7
  //#region src/cli/wp/utils.ts
8
8
  /**
@@ -29,18 +29,6 @@ async function isSeeded() {
29
29
  ]);
30
30
  return marker.code === 0 && marker.stdout.trim() === SEED_VERSION;
31
31
  }
32
- /** Build a GitHub release-zip URL for `PluginSource.source` (asset named `<tag>.zip`). */
33
- function githubRelease(repo, tag) {
34
- return `https://github.com/${repo}/releases/download/${tag}/${tag}.zip`;
35
- }
36
- /**
37
- * Download URL for a Kizlo plugin's latest release, served by kizlo.io (it 302s to
38
- * the current GitHub release asset). Always tracks the newest published version —
39
- * use {@link githubRelease} instead to pin a specific tag.
40
- */
41
- function kizloRelease(slug) {
42
- return `https://kizlo.io/plugins/${slug}/download`;
43
- }
44
32
  /** Resolve a `PluginSource` to the `(name, source)` pair `ensurePlugin` needs. */
45
33
  function resolvePluginSource(plugin) {
46
34
  return typeof plugin === "string" ? [plugin, plugin] : [plugin.name, plugin.source];
@@ -160,4 +148,4 @@ function recordedPort() {
160
148
  }
161
149
 
162
150
  //#endregion
163
- export { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isSeeded, kizloRelease, recordedPort, resolvePluginSource };
151
+ export { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, isSeeded, recordedPort, resolvePluginSource };
package/dist/index.d.ts CHANGED
@@ -17,20 +17,19 @@ import "./wordpress/index.js";
17
17
  import { DevPluginSource, Fixture, FixtureCleanupFn, FixtureSeedFn, JsonValue, LocalPlugin, PluginSource, SeedContext, TestAdminUser, TestCredentials, TestUser, defineFixture, isLocalPlugin } from "./cli/wp/types.js";
18
18
  import { AuthAdapter, AuthGetUser, AuthUser, authMock, createAuthAdapter } from "./adapters/auth.js";
19
19
  import { CaptchaAdapter, altcha, arkose, createCaptchaAdapter, friendlyCaptcha, hcaptcha, recaptcha, turnstile } from "./adapters/captcha.js";
20
- import { CONTENT_TYPES, ContentType, ListSitemapUrlInput, ListSitemapUrlInputBase, Robots, RobotsRule, Seo, SeoHead, SeoSchema, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList } from "./seo/schema.js";
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
- import { SitemapIndexEntry } from "./seo/utils.js";
23
20
  import { CurrencyFormat, IdentifierInput, LIST_ORDER, ListMetadata, ListOrder, Media, PreviewTokenData, PreviewTokenPayload } from "./shared/schema.js";
24
21
  import { AnyContext, AnyNestedClient, CookiesAdapter, CookiesDeleteAll, CookiesGetAll, CookiesSetAll, HTTPMethod, List, MaybeOptionalOptions, RedirectInput, RedirectStatus } from "./shared/types.js";
25
22
  import { createCookiesAdapter } from "./adapters/cookies.js";
26
23
  import { ConnInfo, GeoAdapter, GeoGetConnInfo, createGeoAdapter, geoMock } from "./adapters/geo.js";
27
24
  import { geoVercelNext } from "./adapters/geo.vercel.js";
28
25
  import { ConsoleLogAdapterOptions, Environment, LogLevel, LogPayload, Logger, LoggerAdapter, consoleLog, createLoggerAdapter, noopAdapter } from "./adapters/logger.js";
29
- import { AuthorsSettings, AuthorsSettingsInput, BrandSettings, BrandSettingsInput, CrawlingSettings, CrawlingSettingsInput, IdentitySettings, IdentitySettingsInput, OrganizationFounder, OrganizationSettings, OrganizationSettingsInput, PersonSettings, PersonSettingsInput, PostStatusDefinition, PostTypeSettings, PostTypeSettingsInput, Settings, SiteSettings, SiteSettingsInput, SocialProfile, TaxonomySettings, TaxonomySettingsInput, WebhookSettings, WebhookSettingsInput } from "./settings/service.interface.js";
26
+ import { AuthorsSettings, AuthorsSettingsInput, BrandSettings, BrandSettingsInput, CrawlingSettings, CrawlingSettingsInput, IdentitySettings, IdentitySettingsInput, OrganizationFounder, OrganizationSettings, OrganizationSettingsInput, PersonSettings, PersonSettingsInput, PostStatusDefinition, PostTypeSettings, PostTypeSettingsInput, Settings, SiteSettings, SiteSettingsInput, SocialProfile, TaxonomySettings, TaxonomySettingsInput, UploadsSettings, UploadsSettingsInput, WebhookSettings, WebhookSettingsInput } from "./settings/service.interface.js";
30
27
  import { IconDescriptor, ManifestIcon, ResolvedIcons, resolveIcons } from "./brand/icons.js";
28
+ import { CookiesStorage } from "./cookie.js";
31
29
  import { SettingsService } from "./settings/service.js";
32
30
  import { Service, ServiceConfig } from "./service.js";
33
31
  import { AuthUserFn, ConnInfoFn, Context, ContextConfig, ServerContext, VerifyCaptchaFn, VerifyPreviewTokenFn } from "./context.js";
32
+ import { ROUTER_MAP, RouterMap } from "./router.js";
34
33
  import { AnyEventSchema, AnyEvents, EventHandler, EventHandlerFn, InferEventUnion, WebhookOptions, createEventHandler, createWebhookRouter } from "./webhook/index.js";
35
34
  import { COMMON_ERRORS, CommonErrorCode, CommonErrorLiteral, CommonErrorMap, DefinedErrorMapLike, ErrorDefinition, KizloError, KizloErrorOptions, ThrowableErrorFn, ThrowableErrorMap, WithCommonErrorMap, createThrowableErrorMap, defineErrorMap, isKizloError, toKizloError } from "./shared/error.js";
36
35
  import { AnyMiddleware, ExtractMiddlewareContextOutput, InferUses, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, createMiddleware } from "./shared/middleware.js";
@@ -40,10 +39,13 @@ import { AnyKizloConfig, CreateKizloOptions, Kizlo, KizloConfig, KizloTarget, Ro
40
39
  import { WEB_MANIFEST_ROUTE, WebManifest, buildWebManifest, createManifestRoute } from "./brand/manifest.js";
41
40
  import "./brand/index.js";
42
41
  import { KizloClient, KizloClientConfig, createKizloClient } from "./client.js";
42
+ import { CONTENT_TYPES, ContentType, ListSitemapUrlInput, ListSitemapUrlInputBase, Robots, RobotsRule, Seo, SeoHead, SeoSchema, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList } from "./seo/schema.js";
43
+ import { WPK_ListSitemapUrlInput, WPK_RobotRule, WPK_Robots, WPK_Seo, WPK_Sitemap, WPK_SitemapContentType, WPK_SitemapIndex, WPK_SitemapUrl, WPK_SitemapUrlImage } from "./seo/types.js";
44
+ import { SitemapIndexEntry, deserializeSeo, parseSitemapSlug, renderSitemapIndex, renderUrlSet, sitemapEntryPath, xmlResponse } from "./seo/utils.js";
43
45
  import { CreateSitemapRouteOptions, SITEMAP_BASE, SITEMAP_INDEX_SLUG, SitemapRouteExtra, createSitemapRoute } from "./seo/sitemap.js";
44
46
  import { Contract, ContractProcedure, generateContract, isContractProcedure, restoreContract } from "./shared/contract.js";
45
47
  import { ShaAlgorithm, compare, hash, hmac } from "./shared/crypto.js";
46
48
  import { Identifier, parseIdentifier } from "./shared/identifier.js";
47
49
  import { createOrpcRouter } from "./shared/router.js";
48
50
  import { deserializeCurrencyFormat, deserializeListMetadata, emptyList, serializeCurrencyFormat } from "./shared/serialize.js";
49
- export { AnyContext, AnyEventSchema, AnyEvents, AnyExtension, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureRouter, AuthAdapter, AuthGetUser, AuthUser, AuthUserFn, AuthorsSettings, AuthorsSettingsInput, BaseHandlerOptions, BrandSettings, BrandSettingsInput, 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, CrawlingSettings, CrawlingSettingsInput, CreateKizloOptions, CreateSitemapRouteOptions, CurrencyFormat, DefinedErrorMapLike, DevPluginSource, Environment, ErrorDefinition, EventHandler, EventHandlerFn, Extension, ExtensionInitFn, ExtensionInitOptions, ExtensionInitResult, ExtractExtensionRouter, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, Fixture, FixtureCleanupFn, FixtureSeedFn, GeoAdapter, GeoGetConnInfo, HTTPMethod, IconDescriptor, Identifier, IdentifierInput, IdentitySettings, IdentitySettingsInput, InferEventUnion, InferExtensionRouter, InferUses, InvocationScope, JsonValue, Kizlo, KizloClient, KizloClientConfig, KizloConfig, KizloError, KizloErrorOptions, KizloTarget, LIST_ORDER, List, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, LocalPlugin, LogLevel, LogPayload, Logger, LoggerAdapter, ManifestIcon, MaybeOptionalOptions, Media, MenuItemService, MenuService, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, OpenapiPart, OrganizationFounder, OrganizationSettings, OrganizationSettingsInput, PersonSettings, PersonSettingsInput, PluginSource, PostService, PostStatusDefinition, PostTypeSettings, PostTypeSettingsInput, PreviewTokenData, PreviewTokenPayload, Procedure, ProcedureContext, ProcedureErrors, ProcedureHandler, ProcedureOptions, RedirectInput, RedirectStatus, ResolveParamsPart, ResolvedIcons, ResolvedSchemaInput, ResolvedSchemaOutput, Robots, RobotsRule, RootRouter, RouterDepthTuple, S2SClient, SAFE_REQUEST_TIMEOUT, SITEMAP_BASE, SITEMAP_INDEX_SLUG, SchemaIO, SeedContext, Seo, SeoHead, SeoSchema, ServerContext, Service, ServiceAdapters, ServiceConfig, Settings, SettingsService, ShaAlgorithm, SiteSettings, SiteSettingsInput, Sitemap, SitemapIndex, type SitemapIndexEntry, SitemapList, SitemapRouteExtra, SitemapUrl, SitemapUrlImage, SitemapUrlList, SocialProfile, TaxonomySettings, TaxonomySettingsInput, TestAdminUser, TestCredentials, TestUser, ThrowableErrorFn, ThrowableErrorMap, UNEXPECTED_BODY_SNIPPET_LENGTH, UserService, VerifyCaptchaFn, VerifyPreviewTokenFn, WC_CORE_BASE, WC_STORE_BASE, WEB_MANIFEST_ROUTE, 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, WebManifest, WebhookOptions, WebhookSettings, WebhookSettingsInput, WithCommonErrorMap, WordPressCredentials, WordPressService, altcha, arkose, authMock, buildProcedure, buildWebManifest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createExtension, createGeoAdapter, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, 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, resolveIcons, resolveKizloConfig, restoreContract, schemaType, serializeCurrencyFormat, toKizloError, turnstile };
51
+ export { AnyContext, AnyEventSchema, AnyEvents, AnyExtension, AnyKizloConfig, AnyMiddleware, AnyNestedClient, AnyProcedure, AnyProcedureRouter, AuthAdapter, AuthGetUser, AuthUser, AuthUserFn, AuthorsSettings, AuthorsSettingsInput, BaseHandlerOptions, BrandSettings, BrandSettingsInput, 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, CookiesStorage, CrawlingSettings, CrawlingSettingsInput, CreateKizloOptions, CreateSitemapRouteOptions, CurrencyFormat, DefinedErrorMapLike, DevPluginSource, Environment, ErrorDefinition, EventHandler, EventHandlerFn, Extension, ExtensionInitFn, ExtensionInitOptions, ExtensionInitResult, ExtractExtensionRouter, ExtractMiddlewareContextOutput, ExtractParams, ExtractProcedureByScope, Fixture, FixtureCleanupFn, FixtureSeedFn, GeoAdapter, GeoGetConnInfo, HTTPMethod, IconDescriptor, Identifier, IdentifierInput, IdentitySettings, IdentitySettingsInput, InferEventUnion, InferExtensionRouter, InferUses, InvocationScope, JsonValue, Kizlo, KizloClient, KizloClientConfig, KizloConfig, KizloError, KizloErrorOptions, KizloTarget, LIST_ORDER, List, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, LocalPlugin, LogLevel, LogPayload, Logger, LoggerAdapter, ManifestIcon, MaybeOptionalOptions, Media, MenuItemService, MenuService, Middleware, MiddlewareHandler, MiddlewareNextFn, MiddlewareOptions, MiddlewareResult, OpenapiPart, OrganizationFounder, OrganizationSettings, OrganizationSettingsInput, PersonSettings, PersonSettingsInput, PluginSource, PostService, PostStatusDefinition, PostTypeSettings, PostTypeSettingsInput, PreviewTokenData, PreviewTokenPayload, Procedure, ProcedureContext, ProcedureErrors, ProcedureHandler, ProcedureOptions, ROUTER_MAP, RedirectInput, RedirectStatus, ResolveParamsPart, ResolvedIcons, ResolvedSchemaInput, ResolvedSchemaOutput, Robots, RobotsRule, RootRouter, RouterDepthTuple, RouterMap, S2SClient, SAFE_REQUEST_TIMEOUT, SITEMAP_BASE, SITEMAP_INDEX_SLUG, SchemaIO, SeedContext, Seo, SeoHead, SeoSchema, ServerContext, Service, ServiceAdapters, ServiceConfig, Settings, SettingsService, ShaAlgorithm, SiteSettings, SiteSettingsInput, Sitemap, SitemapIndex, SitemapIndexEntry, SitemapList, SitemapRouteExtra, SitemapUrl, SitemapUrlImage, SitemapUrlList, SocialProfile, TaxonomySettings, TaxonomySettingsInput, TestAdminUser, TestCredentials, TestUser, ThrowableErrorFn, ThrowableErrorMap, UNEXPECTED_BODY_SNIPPET_LENGTH, UploadsSettings, UploadsSettingsInput, UserService, VerifyCaptchaFn, VerifyPreviewTokenFn, WC_CORE_BASE, WC_STORE_BASE, WEB_MANIFEST_ROUTE, 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, WebManifest, WebhookOptions, WebhookSettings, WebhookSettingsInput, WithCommonErrorMap, WordPressCredentials, WordPressService, altcha, arkose, authMock, buildProcedure, buildWebManifest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createExtension, createGeoAdapter, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, createMiddleware, createOrpcRouter, createProcedure, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, deserializeSeo, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, noopAdapter, parseIdentifier, parseSitemapSlug, recaptcha, renderSitemapIndex, renderUrlSet, resolveIcons, resolveKizloConfig, restoreContract, schemaType, serializeCurrencyFormat, sitemapEntryPath, toKizloError, turnstile, xmlResponse };
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ import { createOrpcRouter } from "./shared/router.js";
14
14
  import { generateContract, isContractProcedure, restoreContract } from "./shared/contract.js";
15
15
  import { CurrencyFormat, IdentifierInput, LIST_ORDER, ListMetadata, ListOrder, Media, PreviewTokenData, PreviewTokenPayload } from "./shared/schema.js";
16
16
  import { KizloClient, createKizloClient } from "./client.js";
17
+ import { CookiesStorage } from "./cookie.js";
17
18
  import { CART_HASH_HEADER_KEY, SAFE_REQUEST_TIMEOUT, UNEXPECTED_BODY_SNIPPET_LENGTH, WC_CORE_BASE, WC_STORE_BASE, WP_AUTH_HEADER_KEY, WP_AUTH_TYPE, WP_CORE_BASE, WP_KIZLO_BASE } from "./wordpress/constants.js";
18
19
  import { CommentService } from "./wordpress/comment/service.js";
19
20
  import { WP_Error } from "./wordpress/error.js";
@@ -29,10 +30,12 @@ import { Context } from "./context.js";
29
30
  import { deserializeCurrencyFormat, deserializeListMetadata, emptyList, serializeCurrencyFormat } from "./shared/serialize.js";
30
31
  import { parseIdentifier } from "./shared/identifier.js";
31
32
  import { CONTENT_TYPES, ContentType, ListSitemapUrlInput, ListSitemapUrlInputBase, Robots, RobotsRule, Seo, SeoHead, SeoSchema, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList } from "./seo/schema.js";
33
+ import { deserializeSeo, parseSitemapSlug, renderSitemapIndex, renderUrlSet, sitemapEntryPath, xmlResponse } from "./seo/utils.js";
34
+ import { ROUTER_MAP } from "./router.js";
32
35
  import { createEventHandler, createWebhookRouter } from "./webhook/index.js";
33
36
  import { Kizlo, createKizlo, resolveKizloConfig } from "./kizlo.js";
34
37
  import { SITEMAP_BASE, SITEMAP_INDEX_SLUG, createSitemapRoute } from "./seo/sitemap.js";
35
38
  import { createExtension } from "./shared/extension.js";
36
39
  import { createMiddleware } from "./shared/middleware.js";
37
40
 
38
- export { CART_HASH_HEADER_KEY, COMMON_ERRORS, CONTENT_TYPES, CommentService, ContentType, Context, CurrencyFormat, IdentifierInput, Kizlo, KizloClient, KizloError, LIST_ORDER, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, Media, MenuItemService, MenuService, PostService, PreviewTokenData, PreviewTokenPayload, Robots, RobotsRule, SAFE_REQUEST_TIMEOUT, SITEMAP_BASE, SITEMAP_INDEX_SLUG, Seo, SeoHead, SeoSchema, Service, SettingsService, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList, UNEXPECTED_BODY_SNIPPET_LENGTH, UserService, WC_CORE_BASE, WC_STORE_BASE, WEB_MANIFEST_ROUTE, WP_AUTH_HEADER_KEY, WP_AUTH_TYPE, WP_CORE_BASE, WP_Error, WP_KIZLO_BASE, WordPressService, altcha, arkose, authMock, buildProcedure, buildWebManifest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createExtension, createGeoAdapter, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, 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, resolveIcons, resolveKizloConfig, restoreContract, schemaType, serializeCurrencyFormat, toKizloError, turnstile };
41
+ export { CART_HASH_HEADER_KEY, COMMON_ERRORS, CONTENT_TYPES, CommentService, ContentType, Context, CookiesStorage, CurrencyFormat, IdentifierInput, Kizlo, KizloClient, KizloError, LIST_ORDER, ListMetadata, ListOrder, ListSitemapUrlInput, ListSitemapUrlInputBase, Media, MenuItemService, MenuService, PostService, PreviewTokenData, PreviewTokenPayload, ROUTER_MAP, Robots, RobotsRule, SAFE_REQUEST_TIMEOUT, SITEMAP_BASE, SITEMAP_INDEX_SLUG, Seo, SeoHead, SeoSchema, Service, SettingsService, Sitemap, SitemapIndex, SitemapList, SitemapUrl, SitemapUrlImage, SitemapUrlList, UNEXPECTED_BODY_SNIPPET_LENGTH, UserService, WC_CORE_BASE, WC_STORE_BASE, WEB_MANIFEST_ROUTE, WP_AUTH_HEADER_KEY, WP_AUTH_TYPE, WP_CORE_BASE, WP_Error, WP_KIZLO_BASE, WordPressService, altcha, arkose, authMock, buildProcedure, buildWebManifest, combineDetailed, compare, consoleLog, createAuthAdapter, createCaptchaAdapter, createCookiesAdapter, createEventHandler, createExtension, createGeoAdapter, createKizlo, createKizloClient, createLoggerAdapter, createManifestRoute, createMiddleware, createOrpcRouter, createProcedure, createSitemapRoute, createThrowableErrorMap, createWebhookRouter, defineErrorMap, defineFixture, deserializeCurrencyFormat, deserializeListMetadata, deserializeSeo, emptyList, friendlyCaptcha, generateContract, geoMock, geoVercelNext, handleUnexpectedError, hash, hcaptcha, hmac, isContractProcedure, isKizloError, isLocalPlugin, isWordPressResourceError, noopAdapter, parseIdentifier, parseSitemapSlug, recaptcha, renderSitemapIndex, renderUrlSet, resolveIcons, resolveKizloConfig, restoreContract, schemaType, serializeCurrencyFormat, sitemapEntryPath, toKizloError, turnstile, xmlResponse };
@@ -1,17 +1,10 @@
1
1
  import { WEB_MANIFEST_ROUTE, createManifestRoute } from "../../brand/manifest.js";
2
+ import { createCachedTextRoute } from "./utils.js";
2
3
 
3
4
  //#region src/integrations/nextjs/manifest.ts
4
5
  const MANIFEST_CACHE_TAG = "kizlo:manifest";
5
6
  function createManifestRoute$1(client) {
6
- const handler = createManifestRoute(client);
7
- let getBody;
8
- return async function GET(request) {
9
- if (!getBody) {
10
- const { unstable_cache } = await import("next/cache");
11
- getBody = unstable_cache(async () => (await handler(request)).text(), [MANIFEST_CACHE_TAG], { tags: [MANIFEST_CACHE_TAG] });
12
- }
13
- return new Response(await getBody(), { headers: { "Content-Type": "application/manifest+json" } });
14
- };
7
+ return createCachedTextRoute(createManifestRoute(client), MANIFEST_CACHE_TAG, "application/manifest+json");
15
8
  }
16
9
 
17
10
  //#endregion
@@ -1,5 +1,5 @@
1
- import { SeoHead } from "../../seo/schema.js";
2
1
  import { S2SClient } from "../../kizlo.js";
2
+ import { SeoHead } from "../../seo/schema.js";
3
3
  import { Metadata, Viewport } from "next";
4
4
 
5
5
  //#region src/integrations/nextjs/metadata.d.ts
@@ -1,4 +1,6 @@
1
1
  import { KizloEvent } from "../../webhook/schema.js";
2
+ import { AnyProcedureRouter } from "../../shared/procedure.js";
3
+ import { Extension } from "../../shared/extension.js";
2
4
  import "../../index.js";
3
5
  import { Pathname } from "@kizlo/shared";
4
6
 
@@ -24,5 +26,6 @@ interface NextRevalidateOptions {
24
26
  */
25
27
  sitemap?: false | RevalidateTarget | RevalidateTarget[];
26
28
  }
29
+ declare function nextRevalidation(options?: NextRevalidateOptions): Extension<"nextjs-revalidation", AnyProcedureRouter>;
27
30
  //#endregion
28
- export { NextRevalidateOptions };
31
+ export { NextRevalidateOptions, RevalidatePathFn, RevalidateTagFn, RevalidateTarget, nextRevalidation };
@@ -1,4 +1,4 @@
1
- import { POST_EVENT_TYPES, TERM_EVENT_TYPES } from "../../webhook/schema.js";
1
+ import { POST_EVENT_TYPES, SETTINGS_EVENT_TYPES, TERM_EVENT_TYPES } from "../../webhook/schema.js";
2
2
  import { createEventHandler } from "../../webhook/index.js";
3
3
  import { createExtension } from "../../shared/extension.js";
4
4
  import { ROBOTS_CACHE_TAG } from "./robots.js";
@@ -10,6 +10,8 @@ const DEFAULT_SITEMAP_TARGET = {
10
10
  type: "layout"
11
11
  };
12
12
  const CONTENT_EVENT_TYPES = new Set([...POST_EVENT_TYPES, ...TERM_EVENT_TYPES]);
13
+ const NON_FRONTEND_SETTINGS_EVENT_TYPES = new Set(["settings.crawling.updated", "settings.integration.updated"]);
14
+ const FRONTEND_SETTINGS_EVENT_TYPES = new Set(SETTINGS_EVENT_TYPES.filter((type) => !NON_FRONTEND_SETTINGS_EVENT_TYPES.has(type)));
13
15
  function nextRevalidation(options) {
14
16
  return createExtension({
15
17
  id: "nextjs-revalidation",
@@ -17,13 +19,15 @@ function nextRevalidation(options) {
17
19
  if (!event) return;
18
20
  const revalidatePath = options?.revalidatePath ?? (await import("next/cache")).revalidatePath;
19
21
  const revalidateTag = options?.revalidateTag ?? (await import("next/cache")).revalidateTag;
22
+ const eventUrl = event.data && "url" in event.data ? event.data.url : void 0;
20
23
  const paths = [
21
24
  ...await Promise.resolve(options?.paths?.(event) ?? []),
22
- ...event.data?.url ? [event.data.url] : [],
25
+ ...eventUrl ? [eventUrl] : [],
23
26
  "/post"
24
27
  ];
25
28
  for (const path of normalizePaths(paths)) revalidatePath(path);
26
- if (event.type === "settings.saved") revalidateTag(ROBOTS_CACHE_TAG, { expire: 0 });
29
+ if (event.type === "settings.crawling.updated" || event.type === "settings.site.updated") revalidateTag(ROBOTS_CACHE_TAG, { expire: 0 });
30
+ if (FRONTEND_SETTINGS_EVENT_TYPES.has(event.type)) revalidatePath("/", "layout");
27
31
  if (CONTENT_EVENT_TYPES.has(event.type)) {
28
32
  revalidateTag(SITEMAP_CACHE_TAG, { expire: 0 });
29
33
  for (const target of resolveSitemapTargets(options?.sitemap)) revalidatePath(normalizePath(target.path), target.type);
@@ -1,6 +1,7 @@
1
1
  import { S2SClient } from "../../kizlo.js";
2
2
 
3
3
  //#region src/integrations/nextjs/robots.d.ts
4
+ declare const ROBOTS_CACHE_TAG = "kizlo:robots";
4
5
  declare function createRobotsRoute(client: S2SClient<[]>): (request: Request) => Promise<Response>;
5
6
  //#endregion
6
- export { createRobotsRoute };
7
+ export { ROBOTS_CACHE_TAG, createRobotsRoute };
@@ -1,17 +1,10 @@
1
+ import { createCachedTextRoute } from "./utils.js";
1
2
  import { createRobotsRoute } from "../../seo/robots.js";
2
3
 
3
4
  //#region src/integrations/nextjs/robots.ts
4
5
  const ROBOTS_CACHE_TAG = "kizlo:robots";
5
6
  function createRobotsRoute$1(client) {
6
- const handler = createRobotsRoute(client);
7
- let getBody;
8
- return async function GET(request) {
9
- if (!getBody) {
10
- const { unstable_cache } = await import("next/cache");
11
- getBody = unstable_cache(async () => (await handler(request)).text(), [ROBOTS_CACHE_TAG], { tags: [ROBOTS_CACHE_TAG] });
12
- }
13
- return new Response(await getBody(), { headers: { "Content-Type": "text/plain; charset=utf-8" } });
14
- };
7
+ return createCachedTextRoute(createRobotsRoute(client), ROBOTS_CACHE_TAG, "text/plain; charset=utf-8");
15
8
  }
16
9
 
17
10
  //#endregion
@@ -0,0 +1,13 @@
1
+ import { CookiesAdapter } from "../../shared/types.js";
2
+
3
+ //#region src/integrations/nextjs/utils.d.ts
4
+ declare function createNextCookiesInterface(): CookiesAdapter;
5
+ /**
6
+ * Wrap a core route handler in a lazily-initialised `unstable_cache` keyed by
7
+ * `cacheTag`, serving the handler's text body with a fixed `Content-Type`. The
8
+ * cache import is deferred so the module stays loadable outside a Next request.
9
+ */
10
+ declare function createCachedTextRoute(handler: (request: Request) => Promise<Response>, cacheTag: string, contentType: string): (request: Request) => Promise<Response>;
11
+ declare function getServerBaseUrl(): string;
12
+ //#endregion
13
+ export { createCachedTextRoute, createNextCookiesInterface, getServerBaseUrl };
@@ -1,6 +1,43 @@
1
1
  import { KizloError } from "../../shared/error.js";
2
2
 
3
3
  //#region src/integrations/nextjs/utils.ts
4
+ function createNextCookiesInterface() {
5
+ return {
6
+ getAll: async () => {
7
+ const cookies = (await import("next/headers")).cookies;
8
+ return (await cookies()).getAll();
9
+ },
10
+ setAll: async (cookieList) => {
11
+ const cookies = (await import("next/headers")).cookies;
12
+ const cookieJar = await cookies();
13
+ try {
14
+ for (const cookie of cookieList) cookieJar.set(cookie.name, cookie.value, cookie.options);
15
+ } catch {}
16
+ },
17
+ deleteAll: async (cookieList) => {
18
+ const cookies = (await import("next/headers")).cookies;
19
+ const cookieJar = await cookies();
20
+ try {
21
+ for (const cookie of cookieList) cookieJar.delete(cookie.name);
22
+ } catch {}
23
+ }
24
+ };
25
+ }
26
+ /**
27
+ * Wrap a core route handler in a lazily-initialised `unstable_cache` keyed by
28
+ * `cacheTag`, serving the handler's text body with a fixed `Content-Type`. The
29
+ * cache import is deferred so the module stays loadable outside a Next request.
30
+ */
31
+ function createCachedTextRoute(handler, cacheTag, contentType) {
32
+ let getBody;
33
+ return async function GET(request) {
34
+ if (!getBody) {
35
+ const { unstable_cache } = await import("next/cache");
36
+ getBody = unstable_cache(async () => (await handler(request)).text(), [cacheTag], { tags: [cacheTag] });
37
+ }
38
+ return new Response(await getBody(), { headers: { "Content-Type": contentType } });
39
+ };
40
+ }
4
41
  function getServerBaseUrl() {
5
42
  const baseUrl = process.env.NEXT_PUBLIC_KIZLO_BACKEND_URL;
6
43
  if (!baseUrl) throw new KizloError("MISSING_ENV_VARIABLE", { message: "Please define NEXT_PUBLIC_KIZLO_BACKEND_URL in your .env file." });
@@ -8,4 +45,4 @@ function getServerBaseUrl() {
8
45
  }
9
46
 
10
47
  //#endregion
11
- export { getServerBaseUrl };
48
+ export { createCachedTextRoute, createNextCookiesInterface, getServerBaseUrl };
@@ -1,7 +1,9 @@
1
1
  import { WEB_MANIFEST_ROUTE } from "../brand/manifest.js";
2
- import { createRootMetadata, createRootViewport } from "../integrations/nextjs/metadata.js";
2
+ import { NextRevalidateOptions, RevalidatePathFn, RevalidateTagFn, RevalidateTarget, nextRevalidation } from "../integrations/nextjs/revalidate.js";
3
3
  import { KizloServerOptions, createKizlo } from "../integrations/nextjs/kizlo.server.js";
4
4
  import { MANIFEST_CACHE_TAG, createManifestRoute } from "../integrations/nextjs/manifest.js";
5
- import { createRobotsRoute } from "../integrations/nextjs/robots.js";
5
+ import { createPageMetadata, createRootMetadata, createRootViewport } from "../integrations/nextjs/metadata.js";
6
+ import { ROBOTS_CACHE_TAG, createRobotsRoute } from "../integrations/nextjs/robots.js";
6
7
  import { SITEMAP_CACHE_TAG, SITEMAP_ROUTE, createSitemapRoute } from "../integrations/nextjs/sitemap.js";
7
- export { KizloServerOptions, MANIFEST_CACHE_TAG, SITEMAP_CACHE_TAG, SITEMAP_ROUTE, WEB_MANIFEST_ROUTE, createKizlo, createManifestRoute, createRobotsRoute, createRootMetadata, createRootViewport, createSitemapRoute };
8
+ import { createCachedTextRoute, createNextCookiesInterface, getServerBaseUrl } from "../integrations/nextjs/utils.js";
9
+ export { KizloServerOptions, MANIFEST_CACHE_TAG, NextRevalidateOptions, ROBOTS_CACHE_TAG, RevalidatePathFn, RevalidateTagFn, RevalidateTarget, SITEMAP_CACHE_TAG, SITEMAP_ROUTE, WEB_MANIFEST_ROUTE, createCachedTextRoute, createKizlo, createManifestRoute, createNextCookiesInterface, createPageMetadata, createRobotsRoute, createRootMetadata, createRootViewport, createSitemapRoute, getServerBaseUrl, nextRevalidation };
@@ -1,8 +1,10 @@
1
1
  import { WEB_MANIFEST_ROUTE } from "../brand/manifest.js";
2
- import { createRootMetadata, createRootViewport } from "../integrations/nextjs/metadata.js";
3
- import { createRobotsRoute } from "../integrations/nextjs/robots.js";
2
+ import { createCachedTextRoute, createNextCookiesInterface, getServerBaseUrl } from "../integrations/nextjs/utils.js";
3
+ import { ROBOTS_CACHE_TAG, createRobotsRoute } from "../integrations/nextjs/robots.js";
4
4
  import { SITEMAP_CACHE_TAG, SITEMAP_ROUTE, createSitemapRoute } from "../integrations/nextjs/sitemap.js";
5
+ import { nextRevalidation } from "../integrations/nextjs/revalidate.js";
5
6
  import { createKizlo } from "../integrations/nextjs/kizlo.server.js";
6
7
  import { MANIFEST_CACHE_TAG, createManifestRoute } from "../integrations/nextjs/manifest.js";
8
+ import { createPageMetadata, createRootMetadata, createRootViewport } from "../integrations/nextjs/metadata.js";
7
9
 
8
- export { MANIFEST_CACHE_TAG, SITEMAP_CACHE_TAG, SITEMAP_ROUTE, WEB_MANIFEST_ROUTE, createKizlo, createManifestRoute, createRobotsRoute, createRootMetadata, createRootViewport, createSitemapRoute };
10
+ export { MANIFEST_CACHE_TAG, ROBOTS_CACHE_TAG, SITEMAP_CACHE_TAG, SITEMAP_ROUTE, WEB_MANIFEST_ROUTE, createCachedTextRoute, createKizlo, createManifestRoute, createNextCookiesInterface, createPageMetadata, createRobotsRoute, createRootMetadata, createRootViewport, createSitemapRoute, getServerBaseUrl, nextRevalidation };
package/dist/nextjs.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  import { KizloClientOptions, createKizloClient } from "./integrations/nextjs/kizlo.client.js";
2
- import { createPageMetadata } from "./integrations/nextjs/metadata.js";
3
- export { KizloClientOptions, createKizloClient, createPageMetadata };
2
+ export { KizloClientOptions, createKizloClient };
package/dist/nextjs.js CHANGED
@@ -1,4 +1,3 @@
1
1
  import { createKizloClient } from "./integrations/nextjs/kizlo.client.js";
2
- import { createPageMetadata } from "./integrations/nextjs/metadata.js";
3
2
 
4
- export { createKizloClient, createPageMetadata };
3
+ export { createKizloClient };
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.5.0";
2
+ var version = "0.6.1";
3
3
 
4
4
  //#endregion
5
5
  export { version };
package/dist/router.d.ts CHANGED
@@ -167,7 +167,7 @@ declare const ROUTER_MAP: {
167
167
  include?: string | number | (string | number)[] | undefined;
168
168
  offset?: string | number | undefined;
169
169
  order?: "asc" | "desc" | undefined;
170
- orderby?: "date" | "id" | "slug" | "title" | "author" | "include" | "parent" | "relevance" | "include_slugs" | undefined;
170
+ orderby?: "id" | "date" | "slug" | "title" | "author" | "include" | "parent" | "relevance" | "include_slugs" | undefined;
171
171
  searchColumns?: string[] | undefined;
172
172
  slug?: string | string[] | undefined;
173
173
  taxRelation?: "AND" | "OR" | undefined;
@@ -433,7 +433,7 @@ declare const ROUTER_MAP: {
433
433
  include?: string | number | (string | number)[] | undefined;
434
434
  offset?: string | number | undefined;
435
435
  order?: "asc" | "desc" | undefined;
436
- orderby?: "date" | "id" | "slug" | "title" | "author" | "include" | "parent" | "relevance" | "include_slugs" | "menu_order" | undefined;
436
+ orderby?: "id" | "date" | "slug" | "title" | "author" | "include" | "parent" | "relevance" | "include_slugs" | "menu_order" | undefined;
437
437
  searchColumns?: string[] | undefined;
438
438
  slug?: string | string[] | undefined;
439
439
  taxRelation?: "AND" | "OR" | undefined;
@@ -504,7 +504,7 @@ declare const ROUTER_MAP: {
504
504
  include?: string | number | (string | number)[] | undefined;
505
505
  offset?: string | number | undefined;
506
506
  order?: "asc" | "desc" | undefined;
507
- orderby?: "date" | "id" | "slug" | "title" | "author" | "include" | "parent" | "relevance" | "include_slugs" | "menu_order" | undefined;
507
+ orderby?: "id" | "date" | "slug" | "title" | "author" | "include" | "parent" | "relevance" | "include_slugs" | "menu_order" | undefined;
508
508
  searchColumns?: string[] | undefined;
509
509
  slug?: string | string[] | undefined;
510
510
  taxRelation?: "AND" | "OR" | undefined;
@@ -610,7 +610,7 @@ declare const ROUTER_MAP: {
610
610
  include?: string | number | (string | number)[] | undefined;
611
611
  offset?: string | number | undefined;
612
612
  order?: "asc" | "desc" | undefined;
613
- orderby?: "date" | "id" | "post" | "include" | "parent" | undefined;
613
+ orderby?: "id" | "date" | "post" | "include" | "parent" | undefined;
614
614
  parent?: string | number | (string | number)[] | undefined;
615
615
  parentExclude?: string | number | (string | number)[] | undefined;
616
616
  post?: string | number | (string | number)[] | undefined;
@@ -821,6 +821,9 @@ declare const ROUTER_MAP: {
821
821
  taxonomies?: string[] | undefined;
822
822
  webhook_urls?: string[] | undefined;
823
823
  }, null, DefinedErrorMapLike>;
824
+ updateUploads: Procedure<"internal", {
825
+ allowed_mimes?: _kizlo_shared0.UploadMime[] | undefined;
826
+ }, null, DefinedErrorMapLike>;
824
827
  updatePostType: Procedure<"internal", {
825
828
  slug: string;
826
829
  data: {
@@ -854,4 +857,4 @@ declare const ROUTER_MAP: {
854
857
  };
855
858
  type RouterMap = typeof ROUTER_MAP;
856
859
  //#endregion
857
- export { RouterMap };
860
+ export { ROUTER_MAP, RouterMap };
@@ -1,6 +1,6 @@
1
+ import { S2SClient } from "../kizlo.js";
1
2
  import { SitemapUrl } from "./schema.js";
2
3
  import { SitemapIndexEntry } from "./utils.js";
3
- import { S2SClient } from "../kizlo.js";
4
4
 
5
5
  //#region src/seo/sitemap.d.ts
6
6
 
@@ -1,6 +1,16 @@
1
- import { Sitemap } from "./schema.js";
1
+ import { Seo, Sitemap, SitemapUrl } from "./schema.js";
2
+ import { WPK_Seo } from "./types.js";
2
3
 
3
4
  //#region src/seo/utils.d.ts
5
+ declare function deserializeSeo(data: WPK_Seo): Seo;
4
6
  type SitemapIndexEntry = Pick<Sitemap, "key" | "pages" | "lastmod">;
7
+ declare function sitemapEntryPath(key: string, page: number): string;
8
+ declare function parseSitemapSlug(slug: string): {
9
+ key: string;
10
+ page: number;
11
+ } | null;
12
+ declare function renderSitemapIndex(sitemaps: readonly SitemapIndexEntry[], origin: string): string;
13
+ declare function renderUrlSet(urls: SitemapUrl[]): string;
14
+ declare function xmlResponse(body: string): Response;
5
15
  //#endregion
6
- export { SitemapIndexEntry };
16
+ export { SitemapIndexEntry, deserializeSeo, parseSitemapSlug, renderSitemapIndex, renderUrlSet, sitemapEntryPath, xmlResponse };
package/dist/seo/utils.js CHANGED
@@ -73,4 +73,4 @@ function xmlResponse(body) {
73
73
  }
74
74
 
75
75
  //#endregion
76
- export { deserializeSeo, parseSitemapSlug, renderSitemapIndex, renderUrlSet, xmlResponse };
76
+ export { deserializeSeo, parseSitemapSlug, renderSitemapIndex, renderUrlSet, sitemapEntryPath, xmlResponse };
@@ -52,6 +52,11 @@ const SETTINGS_ROUTER_MAP = {
52
52
  input: schemaType(),
53
53
  output: schemaType()
54
54
  }, async ({ context, input, errors }) => resolveUpdate(await context.service.settings.updateWebhook(input), context, errors, "Update webhook settings")),
55
+ updateUploads: createProcedure({
56
+ scope: "internal",
57
+ input: schemaType(),
58
+ output: schemaType()
59
+ }, async ({ context, input, errors }) => resolveUpdate(await context.service.settings.updateUploads(input), context, errors, "Update uploads settings")),
55
60
  updatePostType: createProcedure({
56
61
  scope: "internal",
57
62
  input: schemaType(),
@@ -1,5 +1,5 @@
1
1
  import { WP_Result } from "../wordpress/types.js";
2
- import { AuthorsSettingsInput, BrandSettingsInput, CrawlingSettingsInput, IdentitySettingsInput, PostTypeSettingsInput, Settings, SiteSettingsInput, TaxonomySettingsInput, WebhookSettingsInput } from "./service.interface.js";
2
+ import { AuthorsSettingsInput, BrandSettingsInput, CrawlingSettingsInput, IdentitySettingsInput, PostTypeSettingsInput, Settings, SiteSettingsInput, TaxonomySettingsInput, UploadsSettingsInput, WebhookSettingsInput } from "./service.interface.js";
3
3
  import { Service } from "../service.js";
4
4
  import "../index.js";
5
5
 
@@ -15,6 +15,7 @@ declare class SettingsService {
15
15
  updateIdentity(input: IdentitySettingsInput): Promise<WP_Result<null, "invalid_param">>;
16
16
  updateAuthors(input: AuthorsSettingsInput): Promise<WP_Result<null, "invalid_param">>;
17
17
  updateCrawling(input: CrawlingSettingsInput): Promise<WP_Result<null, "invalid_param">>;
18
+ updateUploads(input: UploadsSettingsInput): Promise<WP_Result<null, "invalid_param">>;
18
19
  updatePostType(slug: string, input: PostTypeSettingsInput): Promise<WP_Result<null, "invalid_param">>;
19
20
  updateTaxonomy(slug: string, input: TaxonomySettingsInput): Promise<WP_Result<null, "invalid_param">>;
20
21
  private update;
@@ -1,4 +1,4 @@
1
- import { AuthorsSettings, BrandSettings, CrawlingSettings, IdentitySettings, OrganizationFounder, OrganizationSettings, PersonSettings, PostStatusDefinition, PostTypeSettings, Settings, SiteSettings, SocialProfile, TaxonomySettings, WebhookSettings } from "@kizlo/shared";
1
+ import { AuthorsSettings, BrandSettings, CrawlingSettings, IdentitySettings, OrganizationFounder, OrganizationSettings, PersonSettings, PostStatusDefinition, PostTypeSettings, Settings, SiteSettings, SocialProfile, TaxonomySettings, UploadsSettings, WebhookSettings } from "@kizlo/shared";
2
2
 
3
3
  //#region src/settings/service.interface.d.ts
4
4
  type SiteSettingsInput = Partial<Omit<SiteSettings, "fallback_image"> & {
@@ -19,7 +19,8 @@ type IdentitySettingsInput = Partial<{
19
19
  }>;
20
20
  type AuthorsSettingsInput = Partial<AuthorsSettings>;
21
21
  type CrawlingSettingsInput = Partial<CrawlingSettings>;
22
+ type UploadsSettingsInput = Partial<UploadsSettings>;
22
23
  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
24
  type TaxonomySettingsInput = Partial<Pick<TaxonomySettings, "title_structure" | "description_structure" | "search_engine_visibility" | "seo_enabled" | "pathname_structure" | "rest_api_enabled" | "publicly_queryable" | "breadcrumbs">>;
24
25
  //#endregion
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 };
26
+ 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 UploadsSettings, UploadsSettingsInput, type WebhookSettings, WebhookSettingsInput };
@@ -28,6 +28,9 @@ var SettingsService = class {
28
28
  async updateCrawling(input) {
29
29
  return this.update("/settings/crawling", input);
30
30
  }
31
+ async updateUploads(input) {
32
+ return this.update("/settings/uploads", input);
33
+ }
31
34
  async updatePostType(slug, input) {
32
35
  return this.update(`/settings/post_types/${slug}`, input);
33
36
  }
package/dist/test.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { DockerStack, RunResult, Stack, compose, composeDown, composeStop, composeUp, createStack, dockerAvailable, wpCli } from "./cli/wp/docker.js";
2
1
  import { DevPluginSource, Fixture, FixtureCleanupFn, FixtureSeedFn, JsonValue, LocalPlugin, PluginSource, SeedContext, TestAdminUser, TestCredentials, TestUser, defineFixture, isLocalPlugin } from "./cli/wp/types.js";
3
- import { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isSeeded, kizloRelease, recordedPort, resolvePluginSource } from "./cli/wp/utils.js";
2
+ import { COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, githubRelease, kizloRelease } from "./cli/wp/constants.js";
3
+ import { DockerStack, RunResult, Stack, compose, composeDown, composeStop, composeUp, createStack, dockerAvailable, wpCli } from "./cli/wp/docker.js";
4
+ import { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, isSeeded, recordedPort, resolvePluginSource } from "./cli/wp/utils.js";
4
5
  import { TestAuthAdapterUser, toTestUser } from "./test/users.js";
5
6
  import { testAuthAdapter } from "./test/auth.js";
6
7
  import { CAPTCHA_TEST_TOKEN_PASS, captchaMock } from "./test/captcha.js";
@@ -9,4 +10,4 @@ import { KizloClientTestInstance, getKizloClientTestInstance } from "./test/clie
9
10
  import { menuFixture } from "./menu/fixture.js";
10
11
  import { postFixture } from "./post/fixture.js";
11
12
  import { coreFixtures } from "./test/fixtures.js";
12
- export { CAPTCHA_TEST_TOKEN_PASS, DevPluginSource, DockerStack, Fixture, FixtureCleanupFn, FixtureSeedFn, JsonValue, KizloClientTestInstance, KizloTestInstance, LocalPlugin, PluginSource, RunResult, SeedContext, Stack, TestAdminUser, TestAuthAdapterUser, TestCredentials, TestUser, activateLocalPlugin, captchaMock, compose, composeDown, composeStop, composeUp, coreFixtures, createStack, credentialsPath, defineFixture, dockerAvailable, ensurePlugin, ensurePlugins, findConfigDir, getKizloClientTestInstance, getKizloTestInstance, getTestCredentials, githubRelease, isLocalPlugin, isSeeded, kizloRelease, menuFixture, postFixture, recordedPort, resolvePluginSource, testAuthAdapter, toTestUser, wpCli };
13
+ export { CAPTCHA_TEST_TOKEN_PASS, COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, DevPluginSource, DockerStack, Fixture, FixtureCleanupFn, FixtureSeedFn, JsonValue, KizloClientTestInstance, KizloTestInstance, LocalPlugin, OPCACHE_INI, PluginSource, REMAP_ENTRYPOINT, RunResult, SEED_MARKER_OPTION, SEED_VERSION, SeedContext, Stack, TEST_ADMIN, TEST_USER, TestAdminUser, TestAuthAdapterUser, TestCredentials, TestUser, activateLocalPlugin, captchaMock, compose, composeDown, composeStop, composeUp, coreFixtures, createStack, credentialsPath, defineFixture, dockerAvailable, ensurePlugin, ensurePlugins, findConfigDir, getKizloClientTestInstance, getKizloTestInstance, getTestCredentials, githubRelease, isLocalPlugin, isSeeded, kizloRelease, menuFixture, postFixture, recordedPort, resolvePluginSource, testAuthAdapter, toTestUser, wpCli };
package/dist/test.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { defineFixture, isLocalPlugin } from "./cli/wp/types.js";
2
+ import { COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, githubRelease, kizloRelease } from "./cli/wp/constants.js";
2
3
  import { compose, composeDown, composeStop, composeUp, createStack, dockerAvailable, wpCli } from "./cli/wp/docker.js";
3
- import { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, githubRelease, isSeeded, kizloRelease, recordedPort, resolvePluginSource } from "./cli/wp/utils.js";
4
+ import { activateLocalPlugin, credentialsPath, ensurePlugin, ensurePlugins, findConfigDir, getTestCredentials, isSeeded, recordedPort, resolvePluginSource } from "./cli/wp/utils.js";
4
5
  import { testAuthAdapter } from "./test/auth.js";
5
6
  import { CAPTCHA_TEST_TOKEN_PASS, captchaMock } from "./test/captcha.js";
6
7
  import { getKizloClientTestInstance } from "./test/client.js";
@@ -10,4 +11,4 @@ import { coreFixtures } from "./test/fixtures.js";
10
11
  import { toTestUser } from "./test/users.js";
11
12
  import { getKizloTestInstance } from "./test/server.js";
12
13
 
13
- export { CAPTCHA_TEST_TOKEN_PASS, activateLocalPlugin, captchaMock, compose, composeDown, composeStop, composeUp, coreFixtures, createStack, credentialsPath, defineFixture, dockerAvailable, ensurePlugin, ensurePlugins, findConfigDir, getKizloClientTestInstance, getKizloTestInstance, getTestCredentials, githubRelease, isLocalPlugin, isSeeded, kizloRelease, menuFixture, postFixture, recordedPort, resolvePluginSource, testAuthAdapter, toTestUser, wpCli };
14
+ export { CAPTCHA_TEST_TOKEN_PASS, COMPOSE_FILE, CONFIG_FILES, CREDENTIALS_REL, DEFAULT_PLUGINS, DEFAULT_PORT, OPCACHE_INI, REMAP_ENTRYPOINT, SEED_MARKER_OPTION, SEED_VERSION, TEST_ADMIN, TEST_USER, activateLocalPlugin, captchaMock, compose, composeDown, composeStop, composeUp, coreFixtures, createStack, credentialsPath, defineFixture, dockerAvailable, ensurePlugin, ensurePlugins, findConfigDir, getKizloClientTestInstance, getKizloTestInstance, getTestCredentials, githubRelease, isLocalPlugin, isSeeded, kizloRelease, menuFixture, postFixture, recordedPort, resolvePluginSource, testAuthAdapter, toTestUser, wpCli };
@@ -29,9 +29,22 @@ declare const KizloEvent: z.ZodUnion<readonly [z.ZodObject<{
29
29
  }, z.core.$strip>;
30
30
  }, z.core.$strip>, z.ZodObject<{
31
31
  type: z.ZodEnum<{
32
- "settings.saved": "settings.saved";
32
+ "settings.site.updated": "settings.site.updated";
33
+ "settings.brand.updated": "settings.brand.updated";
34
+ "settings.identity.updated": "settings.identity.updated";
35
+ "settings.authors.updated": "settings.authors.updated";
36
+ "settings.crawling.updated": "settings.crawling.updated";
37
+ "settings.integration.updated": "settings.integration.updated";
33
38
  }>;
34
39
  data: z.ZodNull;
40
+ }, z.core.$strip>, z.ZodObject<{
41
+ type: z.ZodEnum<{
42
+ "settings.post_type.updated": "settings.post_type.updated";
43
+ "settings.taxonomy.updated": "settings.taxonomy.updated";
44
+ }>;
45
+ data: z.ZodObject<{
46
+ key: z.ZodString;
47
+ }, z.core.$strip>;
35
48
  }, z.core.$strip>]>;
36
49
  type KizloEvent = z.infer<typeof KizloEvent>;
37
50
  //#endregion
@@ -14,7 +14,18 @@ const POST_EVENT_TYPES = [
14
14
  "post.deleted"
15
15
  ];
16
16
  const PostEventType = z.enum(POST_EVENT_TYPES);
17
- const SETTINGS_EVENT_TYPES = ["settings.saved"];
17
+ const SETTINGS_SIMPLE_EVENT_TYPES = [
18
+ "settings.site.updated",
19
+ "settings.brand.updated",
20
+ "settings.identity.updated",
21
+ "settings.authors.updated",
22
+ "settings.crawling.updated",
23
+ "settings.integration.updated"
24
+ ];
25
+ const SettingsSimpleEventType = z.enum(SETTINGS_SIMPLE_EVENT_TYPES);
26
+ const SETTINGS_INDEXED_EVENT_TYPES = ["settings.post_type.updated", "settings.taxonomy.updated"];
27
+ const SettingsIndexedEventType = z.enum(SETTINGS_INDEXED_EVENT_TYPES);
28
+ const SETTINGS_EVENT_TYPES = [...SETTINGS_SIMPLE_EVENT_TYPES, ...SETTINGS_INDEXED_EVENT_TYPES];
18
29
  const SettingsEventType = z.enum(SETTINGS_EVENT_TYPES);
19
30
  const EVENT_TYPES = [
20
31
  ...TERM_EVENT_TYPES,
@@ -42,15 +53,22 @@ const TermEvent = z.object({
42
53
  type: TermEventType,
43
54
  data: TermEventData
44
55
  });
45
- const SettingsEventData = z.null();
46
- const SettingsEvent = z.object({
47
- type: SettingsEventType,
48
- data: SettingsEventData
56
+ const SettingsSimpleEventData = z.null();
57
+ const SettingsSimpleEvent = z.object({
58
+ type: SettingsSimpleEventType,
59
+ data: SettingsSimpleEventData
60
+ });
61
+ const SettingsIndexedEventData = z.object({ key: z.string() });
62
+ const SettingsIndexedEvent = z.object({
63
+ type: SettingsIndexedEventType,
64
+ data: SettingsIndexedEventData
49
65
  });
66
+ const SettingsEvent = z.union([SettingsSimpleEvent, SettingsIndexedEvent]);
50
67
  const KizloEvent = z.union([
51
68
  PostEvent,
52
69
  TermEvent,
53
- SettingsEvent
70
+ SettingsSimpleEvent,
71
+ SettingsIndexedEvent
54
72
  ]);
55
73
  const AnyEvent = z.object({
56
74
  type: z.string(),
@@ -58,4 +76,4 @@ const AnyEvent = z.object({
58
76
  });
59
77
 
60
78
  //#endregion
61
- export { AnyEvent, KizloEvent, POST_EVENT_TYPES, TERM_EVENT_TYPES };
79
+ export { AnyEvent, KizloEvent, POST_EVENT_TYPES, SETTINGS_EVENT_TYPES, TERM_EVENT_TYPES };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kizlo",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
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.3.0",
79
+ "@kizlo/shared": "0.3.1",
80
80
  "@orpc/client": "^1.14.3",
81
81
  "@orpc/contract": "^1.14.3",
82
82
  "@orpc/openapi": "^1.14.3",
@@ -87,7 +87,6 @@
87
87
  "consola": "^3.2.3",
88
88
  "cookie": "^1.0.2",
89
89
  "jiti": "^2.7.0",
90
- "jose": "6.1.0",
91
90
  "zod": "^4.3.6"
92
91
  },
93
92
  "peerDependencies": {