ampless 0.2.0-alpha.4 → 0.2.0-alpha.5
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/index.d.ts +8 -1
- package/dist/index.js +4 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -452,6 +452,13 @@ interface KvStore {
|
|
|
452
452
|
}
|
|
453
453
|
declare function setKvStore(s: KvStore): void;
|
|
454
454
|
declare function hasKvStore(): boolean;
|
|
455
|
+
/**
|
|
456
|
+
* Access the injected `KvStore` directly. Use the site-setting helpers
|
|
457
|
+
* (`getSiteSetting` etc.) when storing per-site configuration; reach
|
|
458
|
+
* for this lower-level handle only when you need a different PK
|
|
459
|
+
* namespace (e.g. `mcp-tokens`).
|
|
460
|
+
*/
|
|
461
|
+
declare function getKvStore(): KvStore;
|
|
455
462
|
declare const SITE_CONFIG_PK: (siteId: string) => string;
|
|
456
463
|
declare function getSiteSetting<T = unknown>(siteId: string, key: string): Promise<T | null>;
|
|
457
464
|
declare function setSiteSetting(siteId: string, key: string, value: unknown): Promise<void>;
|
|
@@ -712,4 +719,4 @@ declare function resolveThemeValues(manifest: ThemeManifest, stored: Record<stri
|
|
|
712
719
|
|
|
713
720
|
declare const VERSION = "0.0.1";
|
|
714
721
|
|
|
715
|
-
export { type AmplessEvent, type AmplessPlugin, type AuthContext, type Config, type ContentEventPayload, type ContentEventType, type ContentFormat, type ContentTypeDefinition, type CreatePostInput, DEFAULT_SITE_ID, type DateFormat, type EventPayloadOf, type EventType, type FieldDefinition, type FieldType, type ImageDisplay, type KvItem, type KvStore, type LinkListItem, type ListOptions, type LocalizedString, type Media, type MediaEventPayload, type MediaEventType, type MediaProcessingDefaults, type OgImageConfig, type OgImageFont, type OgImageRenderContext, type Page, type PluginEventHandler, type PluginMetadata, type PluginRuntimeContext, type Post, type PostMetadata, type PostStatus, type PostsProvider, type Role, SITE_CONFIG_PK, type SiteConfig, type SiteSettingsEventPayload, type SiteSettingsEventType, type StaticPostBody, type StreamEventName, type ThemeColorField, type ThemeField, type ThemeFieldType, type ThemeFontFamilyField, type ThemeImageField, type ThemeLengthField, type ThemeLinkListField, type ThemeManifest, type ThemeModule, type ThemeRouteContext, type ThemeSelectField, type ThemeTextField, type TrustLevel, VERSION, composeSiteIdSlug, composeSiteIdStatus, createPost, defineConfig, definePlugin, defineSchema, defineTheme, defineThemeModule, deletePost, deleteSiteSetting, detectContentEvents, escapeXml, extractFirstImageUrl, flattenSettings, formatColorPair, formatDate, formatPublicAssetUrl, getPost, getPostById, getSiteSetting, hasKvStore, hasPostsProvider, isMultiSite, isTagListUrl, listPosts, listSiteSettings, parseColorPair, parseLinkList, resolveLocalized, resolveSiteId, resolveThemeValues, setKvStore, setPostsProvider, setSiteSetting, siteFor, stringifyLinkList, themeSettingKey, unflattenSettings, updatePost, validateThemeValue };
|
|
722
|
+
export { type AmplessEvent, type AmplessPlugin, type AuthContext, type Config, type ContentEventPayload, type ContentEventType, type ContentFormat, type ContentTypeDefinition, type CreatePostInput, DEFAULT_SITE_ID, type DateFormat, type EventPayloadOf, type EventType, type FieldDefinition, type FieldType, type ImageDisplay, type KvItem, type KvStore, type LinkListItem, type ListOptions, type LocalizedString, type Media, type MediaEventPayload, type MediaEventType, type MediaProcessingDefaults, type OgImageConfig, type OgImageFont, type OgImageRenderContext, type Page, type PluginEventHandler, type PluginMetadata, type PluginRuntimeContext, type Post, type PostMetadata, type PostStatus, type PostsProvider, type Role, SITE_CONFIG_PK, type SiteConfig, type SiteSettingsEventPayload, type SiteSettingsEventType, type StaticPostBody, type StreamEventName, type ThemeColorField, type ThemeField, type ThemeFieldType, type ThemeFontFamilyField, type ThemeImageField, type ThemeLengthField, type ThemeLinkListField, type ThemeManifest, type ThemeModule, type ThemeRouteContext, type ThemeSelectField, type ThemeTextField, type TrustLevel, VERSION, composeSiteIdSlug, composeSiteIdStatus, createPost, defineConfig, definePlugin, defineSchema, defineTheme, defineThemeModule, deletePost, deleteSiteSetting, detectContentEvents, escapeXml, extractFirstImageUrl, flattenSettings, formatColorPair, formatDate, formatPublicAssetUrl, getKvStore, getPost, getPostById, getSiteSetting, hasKvStore, hasPostsProvider, isMultiSite, isTagListUrl, listPosts, listSiteSettings, parseColorPair, parseLinkList, resolveLocalized, resolveSiteId, resolveThemeValues, setKvStore, setPostsProvider, setSiteSetting, siteFor, stringifyLinkList, themeSettingKey, unflattenSettings, updatePost, validateThemeValue };
|
package/dist/index.js
CHANGED
|
@@ -136,6 +136,9 @@ function requireStore() {
|
|
|
136
136
|
}
|
|
137
137
|
return store;
|
|
138
138
|
}
|
|
139
|
+
function getKvStore() {
|
|
140
|
+
return requireStore();
|
|
141
|
+
}
|
|
139
142
|
var SITE_CONFIG_PK = (siteId) => `siteconfig:${siteId}`;
|
|
140
143
|
async function getSiteSetting(siteId, key) {
|
|
141
144
|
return requireStore().get(SITE_CONFIG_PK(siteId), key);
|
|
@@ -475,6 +478,7 @@ export {
|
|
|
475
478
|
formatColorPair,
|
|
476
479
|
formatDate,
|
|
477
480
|
formatPublicAssetUrl,
|
|
481
|
+
getKvStore,
|
|
478
482
|
getPost,
|
|
479
483
|
getPostById,
|
|
480
484
|
getSiteSetting,
|