@kookee/sdk 0.0.11 → 0.0.13
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.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +190 -7
- package/dist/index.d.ts +190 -7
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/styles/code.css +133 -0
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
exports.
|
|
1
|
+
'use strict';var u="https://api.kookee.dev",B="Kookee-API-Key",c=class extends Error{constructor(t,r,h){super(r);this.code=t;this.status=h;this.name="KookeeApiError";}},m=class{baseUrl;apiKey;constructor(e,t){this.apiKey=e,this.baseUrl=t??u;}getHeaders(){return {"Content-Type":"application/json",[B]:this.apiKey}}async get(e,t){let r=new URL(`${this.baseUrl}${e}`);if(t){for(let[d,s]of Object.entries(t))if(s!=null)if(Array.isArray(s))for(let P of s)r.searchParams.append(d,String(P));else r.searchParams.set(d,String(s));}let h=await fetch(r.toString(),{method:"GET",headers:this.getHeaders()});return this.handleResponse(h)}async post(e,t){let r=await fetch(`${this.baseUrl}${e}`,{method:"POST",headers:this.getHeaders(),body:t?JSON.stringify(t):void 0});return this.handleResponse(r)}async handleResponse(e){if(!e.ok){let t=null;try{t=await e.json();}catch{}throw new c(t?.code??"UNKNOWN_ERROR",t?.message??`Request failed with status ${e.status}`,e.status)}return e.json()}};var o=class{constructor(e){this.http=e;}async list(e){return this.http.get("/v1/announcements",e)}async getById(e,t){return this.http.get(`/v1/announcements/${encodeURIComponent(e)}`,t)}async getTranslationsById(e){return this.http.get(`/v1/announcements/${encodeURIComponent(e)}/translations`)}};var a=class{constructor(e){this.http=e;}async list(e){return this.http.get("/v1/blog/posts",e)}async getBySlug(e,t){return this.http.get(`/v1/blog/posts/${encodeURIComponent(e)}`,t)}async getById(e,t){return this.http.get(`/v1/blog/posts/by-id/${encodeURIComponent(e)}`,t)}async getTags(){return this.http.get("/v1/blog/tags")}async getTranslationsById(e){return this.http.get(`/v1/blog/posts/by-id/${encodeURIComponent(e)}/translations`)}async getTranslationsBySlug(e){return this.http.get(`/v1/blog/posts/${encodeURIComponent(e)}/translations`)}};var i=class{constructor(e){this.http=e;}async list(e){return this.http.get("/v1/changelog",e)}async getBySlug(e,t){return this.http.get(`/v1/changelog/${encodeURIComponent(e)}`,t)}async getById(e,t){return this.http.get(`/v1/changelog/by-id/${encodeURIComponent(e)}`,t)}async getTranslationsById(e){return this.http.get(`/v1/changelog/by-id/${encodeURIComponent(e)}/translations`)}async getTranslationsBySlug(e){return this.http.get(`/v1/changelog/${encodeURIComponent(e)}/translations`)}};var g=class{constructor(e){this.http=e;}async getByKey(e){return this.http.get(`/v1/config/${encodeURIComponent(e)}`)}async list(e){return this.http.get("/v1/config",e)}};var p=class{constructor(e){this.http=e;}async categories(e){return this.http.get("/v1/help/categories",e)}async list(e){return this.http.get("/v1/help/articles",e)}async getBySlug(e,t){return this.http.get(`/v1/help/articles/${encodeURIComponent(e)}`,t)}async getById(e,t){return this.http.get(`/v1/help/articles/by-id/${encodeURIComponent(e)}`,t)}async search(e){return this.http.get("/v1/help/search",e)}async getTranslationsById(e){return this.http.get(`/v1/help/articles/by-id/${encodeURIComponent(e)}/translations`)}async getTranslationsBySlug(e){return this.http.get(`/v1/help/articles/${encodeURIComponent(e)}/translations`)}};var l=class{constructor(e){this.http=e;}async list(e){return this.http.get("/v1/pages",e)}async getBySlug(e,t){return this.http.get(`/v1/pages/${encodeURIComponent(e)}`,t)}async getById(e,t){return this.http.get(`/v1/pages/by-id/${encodeURIComponent(e)}`,t)}async getTranslationsById(e){return this.http.get(`/v1/pages/by-id/${encodeURIComponent(e)}/translations`)}async getTranslationsBySlug(e){return this.http.get(`/v1/pages/${encodeURIComponent(e)}/translations`)}};var y=class{http;announcements;blog;changelog;config;help;pages;constructor(e){if(!e.apiKey)throw new Error("apiKey is required");this.http=new m(e.apiKey,e.baseUrl),this.announcements=new o(this.http),this.blog=new a(this.http),this.changelog=new i(this.http),this.config=new g(this.http),this.help=new p(this.http),this.pages=new l(this.http);}};
|
|
2
|
+
exports.AnnouncementModule=o;exports.BlogModule=a;exports.ChangelogModule=i;exports.ConfigModule=g;exports.HelpModule=p;exports.Kookee=y;exports.KookeeApiError=c;exports.PagesModule=l;//# sourceMappingURL=index.cjs.map
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/http-client.ts","../src/lib/modules/blog.ts","../src/lib/modules/pages.ts","../src/lib/client.ts"],"names":["DEFAULT_BASE_URL","API_KEY_HEADER","KookeeApiError","code","message","status","HttpClient","apiKey","baseUrl","path","params","url","key","value","item","response","body","errorData","BlogModule","http","slug","id","PagesModule","Kookee","config"],"mappings":"aAEA,IAAMA,EAAmB,wBAAA,CACnBC,CAAAA,CAAiB,iBAEVC,CAAAA,CAAN,cAA6B,KAAM,CACxC,WAAA,CACkBC,EAChBC,CAAAA,CACgBC,CAAAA,CAChB,CACA,KAAA,CAAMD,CAAO,EAJG,IAAA,CAAA,IAAA,CAAAD,CAAAA,CAEA,YAAAE,CAAAA,CAGhB,IAAA,CAAK,IAAA,CAAO,iBACd,CACF,CAAA,CAEaC,CAAAA,CAAN,KAAiB,CACL,OAAA,CACA,OAEjB,WAAA,CAAYC,CAAAA,CAAgBC,EAAkB,CAC5C,IAAA,CAAK,OAASD,CAAAA,CACd,IAAA,CAAK,QAAUC,CAAAA,EAAWR,EAC5B,CAEQ,UAAA,EAAqC,CAC3C,OAAO,CACL,eAAgB,kBAAA,CAChB,CAACC,CAAc,EAAG,IAAA,CAAK,MACzB,CACF,CAEA,MAAM,GAAA,CAAOQ,CAAAA,CAAcC,EAA6B,CACtD,IAAMC,EAAM,IAAI,GAAA,CAAI,GAAG,IAAA,CAAK,OAAO,GAAGF,CA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BAAoB,CAAA,CAGtC,IAAA,CAAK,KAAO,IAAIlB,CAAAA,CAAWkB,EAAO,MAAA,CAAQA,CAAAA,CAAO,OAAO,CAAA,CAExD,IAAA,CAAK,KAAO,IAAIN,CAAAA,CAAW,KAAK,IAAI,CAAA,CACpC,KAAK,KAAA,CAAQ,IAAII,EAAY,IAAA,CAAK,IAAI,EACxC,CACF","file":"index.cjs","sourcesContent":["import type { ApiError } from './types';\n\nconst DEFAULT_BASE_URL = 'https://api.kookee.dev';\nconst API_KEY_HEADER = 'Kookee-API-Key';\n\nexport class KookeeApiError extends Error {\n constructor(\n public readonly code: string,\n message: string,\n public readonly status: number\n ) {\n super(message);\n this.name = 'KookeeApiError';\n }\n}\n\nexport class HttpClient {\n private readonly baseUrl: string;\n private readonly apiKey: string;\n\n constructor(apiKey: string, baseUrl?: string) {\n this.apiKey = apiKey;\n this.baseUrl = baseUrl ?? DEFAULT_BASE_URL;\n }\n\n private getHeaders(): Record<string, string> {\n return {\n 'Content-Type': 'application/json',\n [API_KEY_HEADER]: this.apiKey,\n };\n }\n\n async get<T>(path: string, params?: object): Promise<T> {\n const url = new URL(`${this.baseUrl}${path}`);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n for (const item of value) {\n url.searchParams.append(key, String(item));\n }\n } else {\n url.searchParams.set(key, String(value));\n }\n }\n }\n }\n\n const response = await fetch(url.toString(), {\n method: 'GET',\n headers: this.getHeaders(),\n });\n\n return this.handleResponse<T>(response);\n }\n\n async post<T>(path: string, body?: unknown): Promise<T> {\n const response = await fetch(`${this.baseUrl}${path}`, {\n method: 'POST',\n headers: this.getHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n\n return this.handleResponse<T>(response);\n }\n\n private async handleResponse<T>(response: Response): Promise<T> {\n if (!response.ok) {\n let errorData: ApiError | null = null;\n\n try {\n errorData = (await response.json()) as ApiError;\n } catch {\n // Response body is not JSON\n }\n\n throw new KookeeApiError(\n errorData?.code ?? 'UNKNOWN_ERROR',\n errorData?.message ?? `Request failed with status ${response.status}`,\n response.status\n );\n }\n\n return response.json() as Promise<T>;\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type { BlogPost, BlogPostListItem, BlogTagWithCount, PaginatedResponse, PaginationParams } from '../types';\n\nexport interface BlogListParams extends PaginationParams {\n tags?: string[];\n search?: string;\n}\n\nexport class BlogModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: BlogListParams): Promise<PaginatedResponse<BlogPostListItem>> {\n return this.http.get<PaginatedResponse<BlogPostListItem>>('/v1/blog/posts', params);\n }\n\n async getBySlug(slug: string): Promise<BlogPost> {\n return this.http.get<BlogPost>(`/v1/blog/posts/${encodeURIComponent(slug)}`);\n }\n\n async getById(id: string): Promise<BlogPost> {\n return this.http.get<BlogPost>(`/v1/blog/posts/by-id/${encodeURIComponent(id)}`);\n }\n\n async getTags(): Promise<BlogTagWithCount[]> {\n return this.http.get<BlogTagWithCount[]>('/v1/blog/tags');\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type { Page, PageListItem, PaginatedResponse, PaginationParams } from '../types';\n\nexport interface PagesListParams extends PaginationParams {\n search?: string;\n}\n\nexport class PagesModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: PagesListParams): Promise<PaginatedResponse<PageListItem>> {\n return this.http.get<PaginatedResponse<PageListItem>>('/v1/pages', params);\n }\n\n async getBySlug(slug: string): Promise<Page> {\n return this.http.get<Page>(`/v1/pages/${encodeURIComponent(slug)}`);\n }\n\n async getById(id: string): Promise<Page> {\n return this.http.get<Page>(`/v1/pages/by-id/${encodeURIComponent(id)}`);\n }\n}\n","import { HttpClient } from './http-client';\nimport { BlogModule } from './modules/blog';\nimport { PagesModule } from './modules/pages';\nimport type { KookeeConfig } from './types';\n\nexport class Kookee {\n private readonly http: HttpClient;\n\n public readonly blog: BlogModule;\n public readonly pages: PagesModule;\n\n constructor(config: KookeeConfig) {\n if (!config.apiKey) {\n throw new Error('apiKey is required');\n }\n\n this.http = new HttpClient(config.apiKey, config.baseUrl);\n\n this.blog = new BlogModule(this.http);\n this.pages = new PagesModule(this.http);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/http-client.ts","../src/lib/modules/announcement.ts","../src/lib/modules/blog.ts","../src/lib/modules/changelog.ts","../src/lib/modules/config.ts","../src/lib/modules/help.ts","../src/lib/modules/pages.ts","../src/lib/client.ts"],"names":["DEFAULT_BASE_URL","API_KEY_HEADER","KookeeApiError","code","message","status","HttpClient","apiKey","baseUrl","path","params","url","key","value","item","response","body","errorData","AnnouncementModule","http","id","BlogModule","slug","postId","ChangelogModule","ConfigModule","HelpModule","articleId","PagesModule","pageId","Kookee","config"],"mappings":"aAEA,IAAMA,EAAmB,wBAAA,CACnBC,CAAAA,CAAiB,iBAEVC,CAAAA,CAAN,cAA6B,KAAM,CACxC,WAAA,CACkBC,EAChBC,CAAAA,CACgBC,CAAAA,CAChB,CACA,KAAA,CAAMD,CAAO,EAJG,IAAA,CAAA,IAAA,CAAAD,CAAAA,CAEA,YAAAE,CAAAA,CAGhB,IAAA,CAAK,KAAO,iBACd,CACF,EAEaC,CAAAA,CAAN,KAAiB,CACL,OAAA,CACA,MAAA,CAEjB,YAAYC,CAAAA,CAAgBC,CAAAA,CAAkB,CAC5C,IAAA,CAAK,MAAA,CAASD,EACd,IAAA,CAAK,OAAA,CAAUC,GAAWR,EAC5B,CAEQ,YAAqC,CAC3C,OAAO,CACL,cAAA,CAAgB,kBAAA,CAChB,CAACC,CAAc,EAAG,KAAK,MACzB,CACF,CAEA,MAAM,GAAA,CAAOQ,EAAcC,CAAAA,CAA6B,CACtD,IAAMC,CAAAA,CAAM,IAAI,IAAI,CAAA,EAAG,IAAA,CAAK,OAAO,CAAA,EAAGF,CAAI,EAAE,CAAA,CAE5C,GAAIC,GACF,IAAA,GAAW,CAACE,EAAKC,CAAK,CAAA,GAAK,OAAO,OAAA,CAAQH,CAAM,EAC9C,GAA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AQ,IAAIE,EAAY,IAAA,CAAK,IAAI,EACxC,CACF","file":"index.cjs","sourcesContent":["import type { ApiError } from './types';\n\nconst DEFAULT_BASE_URL = 'https://api.kookee.dev';\nconst API_KEY_HEADER = 'Kookee-API-Key';\n\nexport class KookeeApiError extends Error {\n constructor(\n public readonly code: string,\n message: string,\n public readonly status: number\n ) {\n super(message);\n this.name = 'KookeeApiError';\n }\n}\n\nexport class HttpClient {\n private readonly baseUrl: string;\n private readonly apiKey: string;\n\n constructor(apiKey: string, baseUrl?: string) {\n this.apiKey = apiKey;\n this.baseUrl = baseUrl ?? DEFAULT_BASE_URL;\n }\n\n private getHeaders(): Record<string, string> {\n return {\n 'Content-Type': 'application/json',\n [API_KEY_HEADER]: this.apiKey,\n };\n }\n\n async get<T>(path: string, params?: object): Promise<T> {\n const url = new URL(`${this.baseUrl}${path}`);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n for (const item of value) {\n url.searchParams.append(key, String(item));\n }\n } else {\n url.searchParams.set(key, String(value));\n }\n }\n }\n }\n\n const response = await fetch(url.toString(), {\n method: 'GET',\n headers: this.getHeaders(),\n });\n\n return this.handleResponse<T>(response);\n }\n\n async post<T>(path: string, body?: unknown): Promise<T> {\n const response = await fetch(`${this.baseUrl}${path}`, {\n method: 'POST',\n headers: this.getHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n\n return this.handleResponse<T>(response);\n }\n\n private async handleResponse<T>(response: Response): Promise<T> {\n if (!response.ok) {\n let errorData: ApiError | null = null;\n\n try {\n errorData = (await response.json()) as ApiError;\n } catch {\n // Response body is not JSON\n }\n\n throw new KookeeApiError(\n errorData?.code ?? 'UNKNOWN_ERROR',\n errorData?.message ?? `Request failed with status ${response.status}`,\n response.status\n );\n }\n\n return response.json() as Promise<T>;\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type {\n Announcement,\n AnnouncementListItem,\n AnnouncementOrderBy,\n AnnouncementType,\n LocaleOptions,\n OrderDirection,\n PaginatedResponse,\n PaginationParams,\n} from '../types';\n\nexport interface AnnouncementListParams extends PaginationParams, LocaleOptions {\n type?: AnnouncementType;\n excludeIds?: string[];\n orderBy?: AnnouncementOrderBy;\n order?: OrderDirection;\n}\n\nexport interface AnnouncementGetByIdParams extends LocaleOptions {}\n\nexport class AnnouncementModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: AnnouncementListParams): Promise<PaginatedResponse<AnnouncementListItem>> {\n return this.http.get<PaginatedResponse<AnnouncementListItem>>('/v1/announcements', params);\n }\n\n async getById(id: string, params?: AnnouncementGetByIdParams): Promise<Announcement> {\n return this.http.get<Announcement>(`/v1/announcements/${encodeURIComponent(id)}`, params);\n }\n\n async getTranslationsById(id: string): Promise<Record<string, Announcement>> {\n return this.http.get<Record<string, Announcement>>(\n `/v1/announcements/${encodeURIComponent(id)}/translations`\n );\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type {\n BlogPost,\n BlogPostListItem,\n BlogTagWithCount,\n LocaleOptions,\n PaginatedResponse,\n PaginationParams,\n} from '../types';\n\nexport interface BlogListParams extends PaginationParams, LocaleOptions {\n tags?: string[];\n search?: string;\n}\n\nexport interface BlogGetBySlugParams extends LocaleOptions {}\n\nexport interface BlogGetByIdParams extends LocaleOptions {}\n\nexport class BlogModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: BlogListParams): Promise<PaginatedResponse<BlogPostListItem>> {\n return this.http.get<PaginatedResponse<BlogPostListItem>>('/v1/blog/posts', params);\n }\n\n async getBySlug(slug: string, params?: BlogGetBySlugParams): Promise<BlogPost> {\n return this.http.get<BlogPost>(`/v1/blog/posts/${encodeURIComponent(slug)}`, params);\n }\n\n async getById(id: string, params?: BlogGetByIdParams): Promise<BlogPost> {\n return this.http.get<BlogPost>(`/v1/blog/posts/by-id/${encodeURIComponent(id)}`, params);\n }\n\n async getTags(): Promise<BlogTagWithCount[]> {\n return this.http.get<BlogTagWithCount[]>('/v1/blog/tags');\n }\n\n async getTranslationsById(postId: string): Promise<Record<string, BlogPost>> {\n return this.http.get<Record<string, BlogPost>>(\n `/v1/blog/posts/by-id/${encodeURIComponent(postId)}/translations`\n );\n }\n\n async getTranslationsBySlug(slug: string): Promise<Record<string, BlogPost>> {\n return this.http.get<Record<string, BlogPost>>(\n `/v1/blog/posts/${encodeURIComponent(slug)}/translations`\n );\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type {\n ChangelogEntry,\n ChangelogEntryListItem,\n ChangelogOrderBy,\n LocaleOptions,\n OrderDirection,\n PaginatedResponse,\n PaginationParams,\n} from '../types';\n\nexport interface ChangelogListParams extends PaginationParams, LocaleOptions {\n type?: string;\n search?: string;\n orderBy?: ChangelogOrderBy;\n order?: OrderDirection;\n}\n\nexport interface ChangelogGetBySlugParams extends LocaleOptions {}\n\nexport interface ChangelogGetByIdParams extends LocaleOptions {}\n\nexport class ChangelogModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: ChangelogListParams): Promise<PaginatedResponse<ChangelogEntryListItem>> {\n return this.http.get<PaginatedResponse<ChangelogEntryListItem>>('/v1/changelog', params);\n }\n\n async getBySlug(slug: string, params?: ChangelogGetBySlugParams): Promise<ChangelogEntry> {\n return this.http.get<ChangelogEntry>(`/v1/changelog/${encodeURIComponent(slug)}`, params);\n }\n\n async getById(id: string, params?: ChangelogGetByIdParams): Promise<ChangelogEntry> {\n return this.http.get<ChangelogEntry>(`/v1/changelog/by-id/${encodeURIComponent(id)}`, params);\n }\n\n async getTranslationsById(id: string): Promise<Record<string, ChangelogEntry>> {\n return this.http.get<Record<string, ChangelogEntry>>(\n `/v1/changelog/by-id/${encodeURIComponent(id)}/translations`\n );\n }\n\n async getTranslationsBySlug(slug: string): Promise<Record<string, ChangelogEntry>> {\n return this.http.get<Record<string, ChangelogEntry>>(\n `/v1/changelog/${encodeURIComponent(slug)}/translations`\n );\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type { PublicConfig } from '../types';\n\nexport interface ConfigListParams {\n keys?: string[];\n}\n\nexport class ConfigModule {\n constructor(private readonly http: HttpClient) {}\n\n async getByKey(key: string): Promise<PublicConfig> {\n return this.http.get<PublicConfig>(`/v1/config/${encodeURIComponent(key)}`);\n }\n\n async list(params?: ConfigListParams): Promise<PublicConfig[]> {\n return this.http.get<PublicConfig[]>('/v1/config', params);\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type {\n HelpArticle,\n HelpArticleListItem,\n HelpCategory,\n HelpSearchResult,\n LocaleOptions,\n PaginatedResponse,\n PaginationParams,\n} from '../types';\n\nexport interface HelpCategoriesParams extends LocaleOptions {}\n\nexport interface HelpListParams extends PaginationParams, LocaleOptions {\n category?: string;\n search?: string;\n}\n\nexport interface HelpSearchParams extends LocaleOptions {\n query: string;\n limit?: number;\n}\n\nexport interface HelpGetBySlugParams extends LocaleOptions {}\n\nexport interface HelpGetByIdParams extends LocaleOptions {}\n\nexport class HelpModule {\n constructor(private readonly http: HttpClient) {}\n\n async categories(params?: HelpCategoriesParams): Promise<HelpCategory[]> {\n return this.http.get<HelpCategory[]>('/v1/help/categories', params);\n }\n\n async list(params?: HelpListParams): Promise<PaginatedResponse<HelpArticleListItem>> {\n return this.http.get<PaginatedResponse<HelpArticleListItem>>('/v1/help/articles', params);\n }\n\n async getBySlug(slug: string, params?: HelpGetBySlugParams): Promise<HelpArticle> {\n return this.http.get<HelpArticle>(`/v1/help/articles/${encodeURIComponent(slug)}`, params);\n }\n\n async getById(id: string, params?: HelpGetByIdParams): Promise<HelpArticle> {\n return this.http.get<HelpArticle>(`/v1/help/articles/by-id/${encodeURIComponent(id)}`, params);\n }\n\n async search(params: HelpSearchParams): Promise<HelpSearchResult[]> {\n return this.http.get<HelpSearchResult[]>('/v1/help/search', params);\n }\n\n async getTranslationsById(articleId: string): Promise<Record<string, HelpArticle>> {\n return this.http.get<Record<string, HelpArticle>>(\n `/v1/help/articles/by-id/${encodeURIComponent(articleId)}/translations`\n );\n }\n\n async getTranslationsBySlug(slug: string): Promise<Record<string, HelpArticle>> {\n return this.http.get<Record<string, HelpArticle>>(\n `/v1/help/articles/${encodeURIComponent(slug)}/translations`\n );\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type { LocaleOptions, Page, PageListItem, PaginatedResponse, PaginationParams } from '../types';\n\nexport interface PagesListParams extends PaginationParams, LocaleOptions {\n search?: string;\n}\n\nexport interface PagesGetBySlugParams extends LocaleOptions {}\n\nexport interface PagesGetByIdParams extends LocaleOptions {}\n\nexport class PagesModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: PagesListParams): Promise<PaginatedResponse<PageListItem>> {\n return this.http.get<PaginatedResponse<PageListItem>>('/v1/pages', params);\n }\n\n async getBySlug(slug: string, params?: PagesGetBySlugParams): Promise<Page> {\n return this.http.get<Page>(`/v1/pages/${encodeURIComponent(slug)}`, params);\n }\n\n async getById(id: string, params?: PagesGetByIdParams): Promise<Page> {\n return this.http.get<Page>(`/v1/pages/by-id/${encodeURIComponent(id)}`, params);\n }\n\n async getTranslationsById(pageId: string): Promise<Record<string, Page>> {\n return this.http.get<Record<string, Page>>(\n `/v1/pages/by-id/${encodeURIComponent(pageId)}/translations`\n );\n }\n\n async getTranslationsBySlug(slug: string): Promise<Record<string, Page>> {\n return this.http.get<Record<string, Page>>(\n `/v1/pages/${encodeURIComponent(slug)}/translations`\n );\n }\n}\n","import { HttpClient } from './http-client';\nimport { AnnouncementModule } from './modules/announcement';\nimport { BlogModule } from './modules/blog';\nimport { ChangelogModule } from './modules/changelog';\nimport { ConfigModule } from './modules/config';\nimport { HelpModule } from './modules/help';\nimport { PagesModule } from './modules/pages';\nimport type { KookeeConfig } from './types';\n\nexport class Kookee {\n private readonly http: HttpClient;\n\n public readonly announcements: AnnouncementModule;\n public readonly blog: BlogModule;\n public readonly changelog: ChangelogModule;\n public readonly config: ConfigModule;\n public readonly help: HelpModule;\n public readonly pages: PagesModule;\n\n constructor(config: KookeeConfig) {\n if (!config.apiKey) {\n throw new Error('apiKey is required');\n }\n\n this.http = new HttpClient(config.apiKey, config.baseUrl);\n\n this.announcements = new AnnouncementModule(this.http);\n this.blog = new BlogModule(this.http);\n this.changelog = new ChangelogModule(this.http);\n this.config = new ConfigModule(this.http);\n this.help = new HelpModule(this.http);\n this.pages = new PagesModule(this.http);\n }\n}\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -21,6 +21,10 @@ interface PaginationParams {
|
|
|
21
21
|
page?: number;
|
|
22
22
|
limit?: number;
|
|
23
23
|
}
|
|
24
|
+
interface LocaleOptions {
|
|
25
|
+
locale?: string;
|
|
26
|
+
fallback?: boolean;
|
|
27
|
+
}
|
|
24
28
|
interface PaginatedResponse<T> {
|
|
25
29
|
data: T[];
|
|
26
30
|
total: number;
|
|
@@ -52,6 +56,8 @@ interface BlogPostListItem {
|
|
|
52
56
|
views: number;
|
|
53
57
|
author: BlogPostAuthor;
|
|
54
58
|
tags: BlogTag[];
|
|
59
|
+
locale: string;
|
|
60
|
+
translationGroupId: string;
|
|
55
61
|
}
|
|
56
62
|
interface BlogPost extends BlogPostListItem {
|
|
57
63
|
contentHtml: string;
|
|
@@ -69,6 +75,8 @@ interface PageListItem {
|
|
|
69
75
|
title: string;
|
|
70
76
|
createdAt: string;
|
|
71
77
|
updatedAt: string;
|
|
78
|
+
locale: string;
|
|
79
|
+
translationGroupId: string;
|
|
72
80
|
}
|
|
73
81
|
interface Page extends PageListItem {
|
|
74
82
|
contentHtml: string;
|
|
@@ -76,36 +84,211 @@ interface Page extends PageListItem {
|
|
|
76
84
|
metaDescription: string | null;
|
|
77
85
|
views: number;
|
|
78
86
|
}
|
|
87
|
+
interface HelpCategory {
|
|
88
|
+
slug: string;
|
|
89
|
+
name: string;
|
|
90
|
+
description: string | null;
|
|
91
|
+
icon: string | null;
|
|
92
|
+
articleCount: number;
|
|
93
|
+
}
|
|
94
|
+
interface HelpArticleListItem {
|
|
95
|
+
id: string;
|
|
96
|
+
slug: string;
|
|
97
|
+
title: string;
|
|
98
|
+
excerptHtml: string | null;
|
|
99
|
+
category: {
|
|
100
|
+
name: string;
|
|
101
|
+
slug: string;
|
|
102
|
+
};
|
|
103
|
+
createdAt: string;
|
|
104
|
+
views: number;
|
|
105
|
+
locale: string;
|
|
106
|
+
translationGroupId: string;
|
|
107
|
+
}
|
|
108
|
+
interface HelpArticle extends HelpArticleListItem {
|
|
109
|
+
contentHtml: string;
|
|
110
|
+
metaTitle: string | null;
|
|
111
|
+
metaDescription: string | null;
|
|
112
|
+
updatedAt: string;
|
|
113
|
+
}
|
|
114
|
+
interface HelpSearchResult {
|
|
115
|
+
id: string;
|
|
116
|
+
slug: string;
|
|
117
|
+
title: string;
|
|
118
|
+
excerptHtml: string | null;
|
|
119
|
+
category: {
|
|
120
|
+
name: string;
|
|
121
|
+
slug: string;
|
|
122
|
+
};
|
|
123
|
+
locale: string;
|
|
124
|
+
}
|
|
125
|
+
type ChangelogType = 'feature' | 'fix' | 'improvement' | 'breaking' | 'security' | 'deprecated' | 'other';
|
|
126
|
+
type ChangelogOrderBy = 'createdAt' | 'publishedAt' | 'version';
|
|
127
|
+
type OrderDirection = 'asc' | 'desc';
|
|
128
|
+
interface ChangelogAuthor {
|
|
129
|
+
name: string;
|
|
130
|
+
}
|
|
131
|
+
interface ChangelogEntryListItem {
|
|
132
|
+
id: string;
|
|
133
|
+
slug: string;
|
|
134
|
+
title: string;
|
|
135
|
+
type: ChangelogType;
|
|
136
|
+
version: string | null;
|
|
137
|
+
publishedAt: string | null;
|
|
138
|
+
createdAt: string;
|
|
139
|
+
locale: string;
|
|
140
|
+
translationGroupId: string;
|
|
141
|
+
metadata: Record<string, NonNullable<unknown>> | null;
|
|
142
|
+
author: ChangelogAuthor;
|
|
143
|
+
}
|
|
144
|
+
interface ChangelogEntry extends ChangelogEntryListItem {
|
|
145
|
+
contentHtml: string;
|
|
146
|
+
link: string | null;
|
|
147
|
+
updatedAt: string;
|
|
148
|
+
}
|
|
149
|
+
type AnnouncementType = 'info' | 'warning' | 'critical' | 'promotion' | 'maintenance' | 'newFeature';
|
|
150
|
+
type AnnouncementOrderBy = 'createdAt' | 'publishedAt';
|
|
151
|
+
interface AnnouncementAuthor {
|
|
152
|
+
name: string;
|
|
153
|
+
}
|
|
154
|
+
interface AnnouncementListItem {
|
|
155
|
+
id: string;
|
|
156
|
+
title: string;
|
|
157
|
+
type: AnnouncementType;
|
|
158
|
+
publishedAt: string | null;
|
|
159
|
+
unpublishAt: string | null;
|
|
160
|
+
createdAt: string;
|
|
161
|
+
locale: string;
|
|
162
|
+
translationGroupId: string;
|
|
163
|
+
metadata: Record<string, NonNullable<unknown>> | null;
|
|
164
|
+
author: AnnouncementAuthor;
|
|
165
|
+
}
|
|
166
|
+
interface Announcement extends AnnouncementListItem {
|
|
167
|
+
contentHtml: string;
|
|
168
|
+
updatedAt: string;
|
|
169
|
+
}
|
|
170
|
+
interface PublicConfig {
|
|
171
|
+
key: string;
|
|
172
|
+
value: unknown;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
interface AnnouncementListParams extends PaginationParams, LocaleOptions {
|
|
176
|
+
type?: AnnouncementType;
|
|
177
|
+
excludeIds?: string[];
|
|
178
|
+
orderBy?: AnnouncementOrderBy;
|
|
179
|
+
order?: OrderDirection;
|
|
180
|
+
}
|
|
181
|
+
interface AnnouncementGetByIdParams extends LocaleOptions {
|
|
182
|
+
}
|
|
183
|
+
declare class AnnouncementModule {
|
|
184
|
+
private readonly http;
|
|
185
|
+
constructor(http: HttpClient);
|
|
186
|
+
list(params?: AnnouncementListParams): Promise<PaginatedResponse<AnnouncementListItem>>;
|
|
187
|
+
getById(id: string, params?: AnnouncementGetByIdParams): Promise<Announcement>;
|
|
188
|
+
getTranslationsById(id: string): Promise<Record<string, Announcement>>;
|
|
189
|
+
}
|
|
79
190
|
|
|
80
|
-
interface BlogListParams extends PaginationParams {
|
|
191
|
+
interface BlogListParams extends PaginationParams, LocaleOptions {
|
|
81
192
|
tags?: string[];
|
|
82
193
|
search?: string;
|
|
83
194
|
}
|
|
195
|
+
interface BlogGetBySlugParams extends LocaleOptions {
|
|
196
|
+
}
|
|
197
|
+
interface BlogGetByIdParams extends LocaleOptions {
|
|
198
|
+
}
|
|
84
199
|
declare class BlogModule {
|
|
85
200
|
private readonly http;
|
|
86
201
|
constructor(http: HttpClient);
|
|
87
202
|
list(params?: BlogListParams): Promise<PaginatedResponse<BlogPostListItem>>;
|
|
88
|
-
getBySlug(slug: string): Promise<BlogPost>;
|
|
89
|
-
getById(id: string): Promise<BlogPost>;
|
|
203
|
+
getBySlug(slug: string, params?: BlogGetBySlugParams): Promise<BlogPost>;
|
|
204
|
+
getById(id: string, params?: BlogGetByIdParams): Promise<BlogPost>;
|
|
90
205
|
getTags(): Promise<BlogTagWithCount[]>;
|
|
206
|
+
getTranslationsById(postId: string): Promise<Record<string, BlogPost>>;
|
|
207
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, BlogPost>>;
|
|
91
208
|
}
|
|
92
209
|
|
|
93
|
-
interface
|
|
210
|
+
interface ChangelogListParams extends PaginationParams, LocaleOptions {
|
|
211
|
+
type?: string;
|
|
94
212
|
search?: string;
|
|
213
|
+
orderBy?: ChangelogOrderBy;
|
|
214
|
+
order?: OrderDirection;
|
|
215
|
+
}
|
|
216
|
+
interface ChangelogGetBySlugParams extends LocaleOptions {
|
|
217
|
+
}
|
|
218
|
+
interface ChangelogGetByIdParams extends LocaleOptions {
|
|
219
|
+
}
|
|
220
|
+
declare class ChangelogModule {
|
|
221
|
+
private readonly http;
|
|
222
|
+
constructor(http: HttpClient);
|
|
223
|
+
list(params?: ChangelogListParams): Promise<PaginatedResponse<ChangelogEntryListItem>>;
|
|
224
|
+
getBySlug(slug: string, params?: ChangelogGetBySlugParams): Promise<ChangelogEntry>;
|
|
225
|
+
getById(id: string, params?: ChangelogGetByIdParams): Promise<ChangelogEntry>;
|
|
226
|
+
getTranslationsById(id: string): Promise<Record<string, ChangelogEntry>>;
|
|
227
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, ChangelogEntry>>;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface ConfigListParams {
|
|
231
|
+
keys?: string[];
|
|
232
|
+
}
|
|
233
|
+
declare class ConfigModule {
|
|
234
|
+
private readonly http;
|
|
235
|
+
constructor(http: HttpClient);
|
|
236
|
+
getByKey(key: string): Promise<PublicConfig>;
|
|
237
|
+
list(params?: ConfigListParams): Promise<PublicConfig[]>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
interface HelpCategoriesParams extends LocaleOptions {
|
|
241
|
+
}
|
|
242
|
+
interface HelpListParams extends PaginationParams, LocaleOptions {
|
|
243
|
+
category?: string;
|
|
244
|
+
search?: string;
|
|
245
|
+
}
|
|
246
|
+
interface HelpSearchParams extends LocaleOptions {
|
|
247
|
+
query: string;
|
|
248
|
+
limit?: number;
|
|
249
|
+
}
|
|
250
|
+
interface HelpGetBySlugParams extends LocaleOptions {
|
|
251
|
+
}
|
|
252
|
+
interface HelpGetByIdParams extends LocaleOptions {
|
|
253
|
+
}
|
|
254
|
+
declare class HelpModule {
|
|
255
|
+
private readonly http;
|
|
256
|
+
constructor(http: HttpClient);
|
|
257
|
+
categories(params?: HelpCategoriesParams): Promise<HelpCategory[]>;
|
|
258
|
+
list(params?: HelpListParams): Promise<PaginatedResponse<HelpArticleListItem>>;
|
|
259
|
+
getBySlug(slug: string, params?: HelpGetBySlugParams): Promise<HelpArticle>;
|
|
260
|
+
getById(id: string, params?: HelpGetByIdParams): Promise<HelpArticle>;
|
|
261
|
+
search(params: HelpSearchParams): Promise<HelpSearchResult[]>;
|
|
262
|
+
getTranslationsById(articleId: string): Promise<Record<string, HelpArticle>>;
|
|
263
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, HelpArticle>>;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
interface PagesListParams extends PaginationParams, LocaleOptions {
|
|
267
|
+
search?: string;
|
|
268
|
+
}
|
|
269
|
+
interface PagesGetBySlugParams extends LocaleOptions {
|
|
270
|
+
}
|
|
271
|
+
interface PagesGetByIdParams extends LocaleOptions {
|
|
95
272
|
}
|
|
96
273
|
declare class PagesModule {
|
|
97
274
|
private readonly http;
|
|
98
275
|
constructor(http: HttpClient);
|
|
99
276
|
list(params?: PagesListParams): Promise<PaginatedResponse<PageListItem>>;
|
|
100
|
-
getBySlug(slug: string): Promise<Page>;
|
|
101
|
-
getById(id: string): Promise<Page>;
|
|
277
|
+
getBySlug(slug: string, params?: PagesGetBySlugParams): Promise<Page>;
|
|
278
|
+
getById(id: string, params?: PagesGetByIdParams): Promise<Page>;
|
|
279
|
+
getTranslationsById(pageId: string): Promise<Record<string, Page>>;
|
|
280
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, Page>>;
|
|
102
281
|
}
|
|
103
282
|
|
|
104
283
|
declare class Kookee {
|
|
105
284
|
private readonly http;
|
|
285
|
+
readonly announcements: AnnouncementModule;
|
|
106
286
|
readonly blog: BlogModule;
|
|
287
|
+
readonly changelog: ChangelogModule;
|
|
288
|
+
readonly config: ConfigModule;
|
|
289
|
+
readonly help: HelpModule;
|
|
107
290
|
readonly pages: PagesModule;
|
|
108
291
|
constructor(config: KookeeConfig);
|
|
109
292
|
}
|
|
110
293
|
|
|
111
|
-
export { type ApiError, type BlogListParams, BlogModule, type BlogPost, type BlogPostAuthor, type BlogPostListItem, type BlogTag, type BlogTagWithCount, Kookee, KookeeApiError, type KookeeConfig, type Page, type PageListItem, type PagesListParams, PagesModule, type PaginatedResponse, type PaginationParams };
|
|
294
|
+
export { type Announcement, type AnnouncementAuthor, type AnnouncementGetByIdParams, type AnnouncementListItem, type AnnouncementListParams, AnnouncementModule, type AnnouncementOrderBy, type AnnouncementType, type ApiError, type BlogGetByIdParams, type BlogGetBySlugParams, type BlogListParams, BlogModule, type BlogPost, type BlogPostAuthor, type BlogPostListItem, type BlogTag, type BlogTagWithCount, type ChangelogAuthor, type ChangelogEntry, type ChangelogEntryListItem, type ChangelogGetByIdParams, type ChangelogGetBySlugParams, type ChangelogListParams, ChangelogModule, type ChangelogOrderBy, type ChangelogType, type ConfigListParams, ConfigModule, type HelpArticle, type HelpArticleListItem, type HelpCategoriesParams, type HelpCategory, type HelpGetByIdParams, type HelpGetBySlugParams, type HelpListParams, HelpModule, type HelpSearchParams, type HelpSearchResult, Kookee, KookeeApiError, type KookeeConfig, type LocaleOptions, type OrderDirection, type Page, type PageListItem, type PagesGetByIdParams, type PagesGetBySlugParams, type PagesListParams, PagesModule, type PaginatedResponse, type PaginationParams, type PublicConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ interface PaginationParams {
|
|
|
21
21
|
page?: number;
|
|
22
22
|
limit?: number;
|
|
23
23
|
}
|
|
24
|
+
interface LocaleOptions {
|
|
25
|
+
locale?: string;
|
|
26
|
+
fallback?: boolean;
|
|
27
|
+
}
|
|
24
28
|
interface PaginatedResponse<T> {
|
|
25
29
|
data: T[];
|
|
26
30
|
total: number;
|
|
@@ -52,6 +56,8 @@ interface BlogPostListItem {
|
|
|
52
56
|
views: number;
|
|
53
57
|
author: BlogPostAuthor;
|
|
54
58
|
tags: BlogTag[];
|
|
59
|
+
locale: string;
|
|
60
|
+
translationGroupId: string;
|
|
55
61
|
}
|
|
56
62
|
interface BlogPost extends BlogPostListItem {
|
|
57
63
|
contentHtml: string;
|
|
@@ -69,6 +75,8 @@ interface PageListItem {
|
|
|
69
75
|
title: string;
|
|
70
76
|
createdAt: string;
|
|
71
77
|
updatedAt: string;
|
|
78
|
+
locale: string;
|
|
79
|
+
translationGroupId: string;
|
|
72
80
|
}
|
|
73
81
|
interface Page extends PageListItem {
|
|
74
82
|
contentHtml: string;
|
|
@@ -76,36 +84,211 @@ interface Page extends PageListItem {
|
|
|
76
84
|
metaDescription: string | null;
|
|
77
85
|
views: number;
|
|
78
86
|
}
|
|
87
|
+
interface HelpCategory {
|
|
88
|
+
slug: string;
|
|
89
|
+
name: string;
|
|
90
|
+
description: string | null;
|
|
91
|
+
icon: string | null;
|
|
92
|
+
articleCount: number;
|
|
93
|
+
}
|
|
94
|
+
interface HelpArticleListItem {
|
|
95
|
+
id: string;
|
|
96
|
+
slug: string;
|
|
97
|
+
title: string;
|
|
98
|
+
excerptHtml: string | null;
|
|
99
|
+
category: {
|
|
100
|
+
name: string;
|
|
101
|
+
slug: string;
|
|
102
|
+
};
|
|
103
|
+
createdAt: string;
|
|
104
|
+
views: number;
|
|
105
|
+
locale: string;
|
|
106
|
+
translationGroupId: string;
|
|
107
|
+
}
|
|
108
|
+
interface HelpArticle extends HelpArticleListItem {
|
|
109
|
+
contentHtml: string;
|
|
110
|
+
metaTitle: string | null;
|
|
111
|
+
metaDescription: string | null;
|
|
112
|
+
updatedAt: string;
|
|
113
|
+
}
|
|
114
|
+
interface HelpSearchResult {
|
|
115
|
+
id: string;
|
|
116
|
+
slug: string;
|
|
117
|
+
title: string;
|
|
118
|
+
excerptHtml: string | null;
|
|
119
|
+
category: {
|
|
120
|
+
name: string;
|
|
121
|
+
slug: string;
|
|
122
|
+
};
|
|
123
|
+
locale: string;
|
|
124
|
+
}
|
|
125
|
+
type ChangelogType = 'feature' | 'fix' | 'improvement' | 'breaking' | 'security' | 'deprecated' | 'other';
|
|
126
|
+
type ChangelogOrderBy = 'createdAt' | 'publishedAt' | 'version';
|
|
127
|
+
type OrderDirection = 'asc' | 'desc';
|
|
128
|
+
interface ChangelogAuthor {
|
|
129
|
+
name: string;
|
|
130
|
+
}
|
|
131
|
+
interface ChangelogEntryListItem {
|
|
132
|
+
id: string;
|
|
133
|
+
slug: string;
|
|
134
|
+
title: string;
|
|
135
|
+
type: ChangelogType;
|
|
136
|
+
version: string | null;
|
|
137
|
+
publishedAt: string | null;
|
|
138
|
+
createdAt: string;
|
|
139
|
+
locale: string;
|
|
140
|
+
translationGroupId: string;
|
|
141
|
+
metadata: Record<string, NonNullable<unknown>> | null;
|
|
142
|
+
author: ChangelogAuthor;
|
|
143
|
+
}
|
|
144
|
+
interface ChangelogEntry extends ChangelogEntryListItem {
|
|
145
|
+
contentHtml: string;
|
|
146
|
+
link: string | null;
|
|
147
|
+
updatedAt: string;
|
|
148
|
+
}
|
|
149
|
+
type AnnouncementType = 'info' | 'warning' | 'critical' | 'promotion' | 'maintenance' | 'newFeature';
|
|
150
|
+
type AnnouncementOrderBy = 'createdAt' | 'publishedAt';
|
|
151
|
+
interface AnnouncementAuthor {
|
|
152
|
+
name: string;
|
|
153
|
+
}
|
|
154
|
+
interface AnnouncementListItem {
|
|
155
|
+
id: string;
|
|
156
|
+
title: string;
|
|
157
|
+
type: AnnouncementType;
|
|
158
|
+
publishedAt: string | null;
|
|
159
|
+
unpublishAt: string | null;
|
|
160
|
+
createdAt: string;
|
|
161
|
+
locale: string;
|
|
162
|
+
translationGroupId: string;
|
|
163
|
+
metadata: Record<string, NonNullable<unknown>> | null;
|
|
164
|
+
author: AnnouncementAuthor;
|
|
165
|
+
}
|
|
166
|
+
interface Announcement extends AnnouncementListItem {
|
|
167
|
+
contentHtml: string;
|
|
168
|
+
updatedAt: string;
|
|
169
|
+
}
|
|
170
|
+
interface PublicConfig {
|
|
171
|
+
key: string;
|
|
172
|
+
value: unknown;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
interface AnnouncementListParams extends PaginationParams, LocaleOptions {
|
|
176
|
+
type?: AnnouncementType;
|
|
177
|
+
excludeIds?: string[];
|
|
178
|
+
orderBy?: AnnouncementOrderBy;
|
|
179
|
+
order?: OrderDirection;
|
|
180
|
+
}
|
|
181
|
+
interface AnnouncementGetByIdParams extends LocaleOptions {
|
|
182
|
+
}
|
|
183
|
+
declare class AnnouncementModule {
|
|
184
|
+
private readonly http;
|
|
185
|
+
constructor(http: HttpClient);
|
|
186
|
+
list(params?: AnnouncementListParams): Promise<PaginatedResponse<AnnouncementListItem>>;
|
|
187
|
+
getById(id: string, params?: AnnouncementGetByIdParams): Promise<Announcement>;
|
|
188
|
+
getTranslationsById(id: string): Promise<Record<string, Announcement>>;
|
|
189
|
+
}
|
|
79
190
|
|
|
80
|
-
interface BlogListParams extends PaginationParams {
|
|
191
|
+
interface BlogListParams extends PaginationParams, LocaleOptions {
|
|
81
192
|
tags?: string[];
|
|
82
193
|
search?: string;
|
|
83
194
|
}
|
|
195
|
+
interface BlogGetBySlugParams extends LocaleOptions {
|
|
196
|
+
}
|
|
197
|
+
interface BlogGetByIdParams extends LocaleOptions {
|
|
198
|
+
}
|
|
84
199
|
declare class BlogModule {
|
|
85
200
|
private readonly http;
|
|
86
201
|
constructor(http: HttpClient);
|
|
87
202
|
list(params?: BlogListParams): Promise<PaginatedResponse<BlogPostListItem>>;
|
|
88
|
-
getBySlug(slug: string): Promise<BlogPost>;
|
|
89
|
-
getById(id: string): Promise<BlogPost>;
|
|
203
|
+
getBySlug(slug: string, params?: BlogGetBySlugParams): Promise<BlogPost>;
|
|
204
|
+
getById(id: string, params?: BlogGetByIdParams): Promise<BlogPost>;
|
|
90
205
|
getTags(): Promise<BlogTagWithCount[]>;
|
|
206
|
+
getTranslationsById(postId: string): Promise<Record<string, BlogPost>>;
|
|
207
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, BlogPost>>;
|
|
91
208
|
}
|
|
92
209
|
|
|
93
|
-
interface
|
|
210
|
+
interface ChangelogListParams extends PaginationParams, LocaleOptions {
|
|
211
|
+
type?: string;
|
|
94
212
|
search?: string;
|
|
213
|
+
orderBy?: ChangelogOrderBy;
|
|
214
|
+
order?: OrderDirection;
|
|
215
|
+
}
|
|
216
|
+
interface ChangelogGetBySlugParams extends LocaleOptions {
|
|
217
|
+
}
|
|
218
|
+
interface ChangelogGetByIdParams extends LocaleOptions {
|
|
219
|
+
}
|
|
220
|
+
declare class ChangelogModule {
|
|
221
|
+
private readonly http;
|
|
222
|
+
constructor(http: HttpClient);
|
|
223
|
+
list(params?: ChangelogListParams): Promise<PaginatedResponse<ChangelogEntryListItem>>;
|
|
224
|
+
getBySlug(slug: string, params?: ChangelogGetBySlugParams): Promise<ChangelogEntry>;
|
|
225
|
+
getById(id: string, params?: ChangelogGetByIdParams): Promise<ChangelogEntry>;
|
|
226
|
+
getTranslationsById(id: string): Promise<Record<string, ChangelogEntry>>;
|
|
227
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, ChangelogEntry>>;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface ConfigListParams {
|
|
231
|
+
keys?: string[];
|
|
232
|
+
}
|
|
233
|
+
declare class ConfigModule {
|
|
234
|
+
private readonly http;
|
|
235
|
+
constructor(http: HttpClient);
|
|
236
|
+
getByKey(key: string): Promise<PublicConfig>;
|
|
237
|
+
list(params?: ConfigListParams): Promise<PublicConfig[]>;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
interface HelpCategoriesParams extends LocaleOptions {
|
|
241
|
+
}
|
|
242
|
+
interface HelpListParams extends PaginationParams, LocaleOptions {
|
|
243
|
+
category?: string;
|
|
244
|
+
search?: string;
|
|
245
|
+
}
|
|
246
|
+
interface HelpSearchParams extends LocaleOptions {
|
|
247
|
+
query: string;
|
|
248
|
+
limit?: number;
|
|
249
|
+
}
|
|
250
|
+
interface HelpGetBySlugParams extends LocaleOptions {
|
|
251
|
+
}
|
|
252
|
+
interface HelpGetByIdParams extends LocaleOptions {
|
|
253
|
+
}
|
|
254
|
+
declare class HelpModule {
|
|
255
|
+
private readonly http;
|
|
256
|
+
constructor(http: HttpClient);
|
|
257
|
+
categories(params?: HelpCategoriesParams): Promise<HelpCategory[]>;
|
|
258
|
+
list(params?: HelpListParams): Promise<PaginatedResponse<HelpArticleListItem>>;
|
|
259
|
+
getBySlug(slug: string, params?: HelpGetBySlugParams): Promise<HelpArticle>;
|
|
260
|
+
getById(id: string, params?: HelpGetByIdParams): Promise<HelpArticle>;
|
|
261
|
+
search(params: HelpSearchParams): Promise<HelpSearchResult[]>;
|
|
262
|
+
getTranslationsById(articleId: string): Promise<Record<string, HelpArticle>>;
|
|
263
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, HelpArticle>>;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
interface PagesListParams extends PaginationParams, LocaleOptions {
|
|
267
|
+
search?: string;
|
|
268
|
+
}
|
|
269
|
+
interface PagesGetBySlugParams extends LocaleOptions {
|
|
270
|
+
}
|
|
271
|
+
interface PagesGetByIdParams extends LocaleOptions {
|
|
95
272
|
}
|
|
96
273
|
declare class PagesModule {
|
|
97
274
|
private readonly http;
|
|
98
275
|
constructor(http: HttpClient);
|
|
99
276
|
list(params?: PagesListParams): Promise<PaginatedResponse<PageListItem>>;
|
|
100
|
-
getBySlug(slug: string): Promise<Page>;
|
|
101
|
-
getById(id: string): Promise<Page>;
|
|
277
|
+
getBySlug(slug: string, params?: PagesGetBySlugParams): Promise<Page>;
|
|
278
|
+
getById(id: string, params?: PagesGetByIdParams): Promise<Page>;
|
|
279
|
+
getTranslationsById(pageId: string): Promise<Record<string, Page>>;
|
|
280
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, Page>>;
|
|
102
281
|
}
|
|
103
282
|
|
|
104
283
|
declare class Kookee {
|
|
105
284
|
private readonly http;
|
|
285
|
+
readonly announcements: AnnouncementModule;
|
|
106
286
|
readonly blog: BlogModule;
|
|
287
|
+
readonly changelog: ChangelogModule;
|
|
288
|
+
readonly config: ConfigModule;
|
|
289
|
+
readonly help: HelpModule;
|
|
107
290
|
readonly pages: PagesModule;
|
|
108
291
|
constructor(config: KookeeConfig);
|
|
109
292
|
}
|
|
110
293
|
|
|
111
|
-
export { type ApiError, type BlogListParams, BlogModule, type BlogPost, type BlogPostAuthor, type BlogPostListItem, type BlogTag, type BlogTagWithCount, Kookee, KookeeApiError, type KookeeConfig, type Page, type PageListItem, type PagesListParams, PagesModule, type PaginatedResponse, type PaginationParams };
|
|
294
|
+
export { type Announcement, type AnnouncementAuthor, type AnnouncementGetByIdParams, type AnnouncementListItem, type AnnouncementListParams, AnnouncementModule, type AnnouncementOrderBy, type AnnouncementType, type ApiError, type BlogGetByIdParams, type BlogGetBySlugParams, type BlogListParams, BlogModule, type BlogPost, type BlogPostAuthor, type BlogPostListItem, type BlogTag, type BlogTagWithCount, type ChangelogAuthor, type ChangelogEntry, type ChangelogEntryListItem, type ChangelogGetByIdParams, type ChangelogGetBySlugParams, type ChangelogListParams, ChangelogModule, type ChangelogOrderBy, type ChangelogType, type ConfigListParams, ConfigModule, type HelpArticle, type HelpArticleListItem, type HelpCategoriesParams, type HelpCategory, type HelpGetByIdParams, type HelpGetBySlugParams, type HelpListParams, HelpModule, type HelpSearchParams, type HelpSearchResult, Kookee, KookeeApiError, type KookeeConfig, type LocaleOptions, type OrderDirection, type Page, type PageListItem, type PagesGetByIdParams, type PagesGetBySlugParams, type PagesListParams, PagesModule, type PaginatedResponse, type PaginationParams, type PublicConfig };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
export{o as BlogModule,g as Kookee,
|
|
1
|
+
var u="https://api.kookee.dev",B="Kookee-API-Key",c=class extends Error{constructor(t,r,h){super(r);this.code=t;this.status=h;this.name="KookeeApiError";}},m=class{baseUrl;apiKey;constructor(e,t){this.apiKey=e,this.baseUrl=t??u;}getHeaders(){return {"Content-Type":"application/json",[B]:this.apiKey}}async get(e,t){let r=new URL(`${this.baseUrl}${e}`);if(t){for(let[d,s]of Object.entries(t))if(s!=null)if(Array.isArray(s))for(let P of s)r.searchParams.append(d,String(P));else r.searchParams.set(d,String(s));}let h=await fetch(r.toString(),{method:"GET",headers:this.getHeaders()});return this.handleResponse(h)}async post(e,t){let r=await fetch(`${this.baseUrl}${e}`,{method:"POST",headers:this.getHeaders(),body:t?JSON.stringify(t):void 0});return this.handleResponse(r)}async handleResponse(e){if(!e.ok){let t=null;try{t=await e.json();}catch{}throw new c(t?.code??"UNKNOWN_ERROR",t?.message??`Request failed with status ${e.status}`,e.status)}return e.json()}};var o=class{constructor(e){this.http=e;}async list(e){return this.http.get("/v1/announcements",e)}async getById(e,t){return this.http.get(`/v1/announcements/${encodeURIComponent(e)}`,t)}async getTranslationsById(e){return this.http.get(`/v1/announcements/${encodeURIComponent(e)}/translations`)}};var a=class{constructor(e){this.http=e;}async list(e){return this.http.get("/v1/blog/posts",e)}async getBySlug(e,t){return this.http.get(`/v1/blog/posts/${encodeURIComponent(e)}`,t)}async getById(e,t){return this.http.get(`/v1/blog/posts/by-id/${encodeURIComponent(e)}`,t)}async getTags(){return this.http.get("/v1/blog/tags")}async getTranslationsById(e){return this.http.get(`/v1/blog/posts/by-id/${encodeURIComponent(e)}/translations`)}async getTranslationsBySlug(e){return this.http.get(`/v1/blog/posts/${encodeURIComponent(e)}/translations`)}};var i=class{constructor(e){this.http=e;}async list(e){return this.http.get("/v1/changelog",e)}async getBySlug(e,t){return this.http.get(`/v1/changelog/${encodeURIComponent(e)}`,t)}async getById(e,t){return this.http.get(`/v1/changelog/by-id/${encodeURIComponent(e)}`,t)}async getTranslationsById(e){return this.http.get(`/v1/changelog/by-id/${encodeURIComponent(e)}/translations`)}async getTranslationsBySlug(e){return this.http.get(`/v1/changelog/${encodeURIComponent(e)}/translations`)}};var g=class{constructor(e){this.http=e;}async getByKey(e){return this.http.get(`/v1/config/${encodeURIComponent(e)}`)}async list(e){return this.http.get("/v1/config",e)}};var p=class{constructor(e){this.http=e;}async categories(e){return this.http.get("/v1/help/categories",e)}async list(e){return this.http.get("/v1/help/articles",e)}async getBySlug(e,t){return this.http.get(`/v1/help/articles/${encodeURIComponent(e)}`,t)}async getById(e,t){return this.http.get(`/v1/help/articles/by-id/${encodeURIComponent(e)}`,t)}async search(e){return this.http.get("/v1/help/search",e)}async getTranslationsById(e){return this.http.get(`/v1/help/articles/by-id/${encodeURIComponent(e)}/translations`)}async getTranslationsBySlug(e){return this.http.get(`/v1/help/articles/${encodeURIComponent(e)}/translations`)}};var l=class{constructor(e){this.http=e;}async list(e){return this.http.get("/v1/pages",e)}async getBySlug(e,t){return this.http.get(`/v1/pages/${encodeURIComponent(e)}`,t)}async getById(e,t){return this.http.get(`/v1/pages/by-id/${encodeURIComponent(e)}`,t)}async getTranslationsById(e){return this.http.get(`/v1/pages/by-id/${encodeURIComponent(e)}/translations`)}async getTranslationsBySlug(e){return this.http.get(`/v1/pages/${encodeURIComponent(e)}/translations`)}};var y=class{http;announcements;blog;changelog;config;help;pages;constructor(e){if(!e.apiKey)throw new Error("apiKey is required");this.http=new m(e.apiKey,e.baseUrl),this.announcements=new o(this.http),this.blog=new a(this.http),this.changelog=new i(this.http),this.config=new g(this.http),this.help=new p(this.http),this.pages=new l(this.http);}};
|
|
2
|
+
export{o as AnnouncementModule,a as BlogModule,i as ChangelogModule,g as ConfigModule,p as HelpModule,y as Kookee,c as KookeeApiError,l as PagesModule};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/http-client.ts","../src/lib/modules/blog.ts","../src/lib/modules/pages.ts","../src/lib/client.ts"],"names":["DEFAULT_BASE_URL","API_KEY_HEADER","KookeeApiError","code","message","status","HttpClient","apiKey","baseUrl","path","params","url","key","value","item","response","body","errorData","BlogModule","http","slug","id","PagesModule","Kookee","config"],"mappings":"AAEA,IAAMA,EAAmB,wBAAA,CACnBC,CAAAA,CAAiB,iBAEVC,CAAAA,CAAN,cAA6B,KAAM,CACxC,WAAA,CACkBC,EAChBC,CAAAA,CACgBC,CAAAA,CAChB,CACA,KAAA,CAAMD,CAAO,EAJG,IAAA,CAAA,IAAA,CAAAD,CAAAA,CAEA,YAAAE,CAAAA,CAGhB,IAAA,CAAK,IAAA,CAAO,iBACd,CACF,CAAA,CAEaC,CAAAA,CAAN,KAAiB,CACL,OAAA,CACA,OAEjB,WAAA,CAAYC,CAAAA,CAAgBC,EAAkB,CAC5C,IAAA,CAAK,OAASD,CAAAA,CACd,IAAA,CAAK,QAAUC,CAAAA,EAAWR,EAC5B,CAEQ,UAAA,EAAqC,CAC3C,OAAO,CACL,eAAgB,kBAAA,CACh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ACxE,CACF,EChBO,IAAME,CAAAA,CAAN,KAAa,CACD,IAAA,CAED,KACA,KAAA,CAEhB,WAAA,CAAYC,EAAsB,CAChC,GAAI,CAACA,CAAAA,CAAO,MAAA,CACV,MAAM,IAAI,KAAA,CAAM,oBAAoB,CAAA,CAGtC,IAAA,CAAK,KAAO,IAAIlB,CAAAA,CAAWkB,EAAO,MAAA,CAAQA,CAAAA,CAAO,OAAO,CAAA,CAExD,IAAA,CAAK,KAAO,IAAIN,CAAAA,CAAW,KAAK,IAAI,CAAA,CACpC,KAAK,KAAA,CAAQ,IAAII,EAAY,IAAA,CAAK,IAAI,EACxC,CACF","file":"index.js","sourcesContent":["import type { ApiError } from './types';\n\nconst DEFAULT_BASE_URL = 'https://api.kookee.dev';\nconst API_KEY_HEADER = 'Kookee-API-Key';\n\nexport class KookeeApiError extends Error {\n constructor(\n public readonly code: string,\n message: string,\n public readonly status: number\n ) {\n super(message);\n this.name = 'KookeeApiError';\n }\n}\n\nexport class HttpClient {\n private readonly baseUrl: string;\n private readonly apiKey: string;\n\n constructor(apiKey: string, baseUrl?: string) {\n this.apiKey = apiKey;\n this.baseUrl = baseUrl ?? DEFAULT_BASE_URL;\n }\n\n private getHeaders(): Record<string, string> {\n return {\n 'Content-Type': 'application/json',\n [API_KEY_HEADER]: this.apiKey,\n };\n }\n\n async get<T>(path: string, params?: object): Promise<T> {\n const url = new URL(`${this.baseUrl}${path}`);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n for (const item of value) {\n url.searchParams.append(key, String(item));\n }\n } else {\n url.searchParams.set(key, String(value));\n }\n }\n }\n }\n\n const response = await fetch(url.toString(), {\n method: 'GET',\n headers: this.getHeaders(),\n });\n\n return this.handleResponse<T>(response);\n }\n\n async post<T>(path: string, body?: unknown): Promise<T> {\n const response = await fetch(`${this.baseUrl}${path}`, {\n method: 'POST',\n headers: this.getHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n\n return this.handleResponse<T>(response);\n }\n\n private async handleResponse<T>(response: Response): Promise<T> {\n if (!response.ok) {\n let errorData: ApiError | null = null;\n\n try {\n errorData = (await response.json()) as ApiError;\n } catch {\n // Response body is not JSON\n }\n\n throw new KookeeApiError(\n errorData?.code ?? 'UNKNOWN_ERROR',\n errorData?.message ?? `Request failed with status ${response.status}`,\n response.status\n );\n }\n\n return response.json() as Promise<T>;\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type { BlogPost, BlogPostListItem, BlogTagWithCount, PaginatedResponse, PaginationParams } from '../types';\n\nexport interface BlogListParams extends PaginationParams {\n tags?: string[];\n search?: string;\n}\n\nexport class BlogModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: BlogListParams): Promise<PaginatedResponse<BlogPostListItem>> {\n return this.http.get<PaginatedResponse<BlogPostListItem>>('/v1/blog/posts', params);\n }\n\n async getBySlug(slug: string): Promise<BlogPost> {\n return this.http.get<BlogPost>(`/v1/blog/posts/${encodeURIComponent(slug)}`);\n }\n\n async getById(id: string): Promise<BlogPost> {\n return this.http.get<BlogPost>(`/v1/blog/posts/by-id/${encodeURIComponent(id)}`);\n }\n\n async getTags(): Promise<BlogTagWithCount[]> {\n return this.http.get<BlogTagWithCount[]>('/v1/blog/tags');\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type { Page, PageListItem, PaginatedResponse, PaginationParams } from '../types';\n\nexport interface PagesListParams extends PaginationParams {\n search?: string;\n}\n\nexport class PagesModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: PagesListParams): Promise<PaginatedResponse<PageListItem>> {\n return this.http.get<PaginatedResponse<PageListItem>>('/v1/pages', params);\n }\n\n async getBySlug(slug: string): Promise<Page> {\n return this.http.get<Page>(`/v1/pages/${encodeURIComponent(slug)}`);\n }\n\n async getById(id: string): Promise<Page> {\n return this.http.get<Page>(`/v1/pages/by-id/${encodeURIComponent(id)}`);\n }\n}\n","import { HttpClient } from './http-client';\nimport { BlogModule } from './modules/blog';\nimport { PagesModule } from './modules/pages';\nimport type { KookeeConfig } from './types';\n\nexport class Kookee {\n private readonly http: HttpClient;\n\n public readonly blog: BlogModule;\n public readonly pages: PagesModule;\n\n constructor(config: KookeeConfig) {\n if (!config.apiKey) {\n throw new Error('apiKey is required');\n }\n\n this.http = new HttpClient(config.apiKey, config.baseUrl);\n\n this.blog = new BlogModule(this.http);\n this.pages = new PagesModule(this.http);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/http-client.ts","../src/lib/modules/announcement.ts","../src/lib/modules/blog.ts","../src/lib/modules/changelog.ts","../src/lib/modules/config.ts","../src/lib/modules/help.ts","../src/lib/modules/pages.ts","../src/lib/client.ts"],"names":["DEFAULT_BASE_URL","API_KEY_HEADER","KookeeApiError","code","message","status","HttpClient","apiKey","baseUrl","path","params","url","key","value","item","response","body","errorData","AnnouncementModule","http","id","BlogModule","slug","postId","ChangelogModule","ConfigModule","HelpModule","articleId","PagesModule","pageId","Kookee","config"],"mappings":"AAEA,IAAMA,EAAmB,wBAAA,CACnBC,CAAAA,CAAiB,iBAEVC,CAAAA,CAAN,cAA6B,KAAM,CACxC,WAAA,CACkBC,EAChBC,CAAAA,CACgBC,CAAAA,CAChB,CACA,KAAA,CAAMD,CAAO,EAJG,IAAA,CAAA,IAAA,CAAAD,CAAAA,CAEA,YAAAE,CAAAA,CAGhB,IAAA,CAAK,KAAO,iBACd,CACF,EAEaC,CAAAA,CAAN,KAAiB,CACL,OAAA,CACA,MAAA,CAEjB,YAAYC,CAAAA,CAAgBC,CAAAA,CAAkB,CAC5C,IAAA,CAAK,MAAA,CAASD,EACd,IAAA,CAAK,OAAA,CAAUC,GAAWR,EAC5B,CAEQ,YAAqC,CAC3C,OAAO,CACL,cAAA,CAAgB,kBAAA,CAChB,CAACC,CAAc,EAAG,KAAK,MACzB,CACF,CAEA,MAAM,GAAA,CAAOQ,EAAcC,CAAAA,CAA6B,CACtD,IAAMC,CAAAA,CAAM,IAAI,IAAI,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,EAC9C,IAAA,CAAK,MAAA,CAAS,IAAIC,CAAAA,CAAa,IAAA,CAAK,IAAI,CAAA,CACxC,IAAA,CAAK,KAAO,IAAIC,CAAAA,CAAW,KAAK,IAAI,CAAA,CACpC,KAAK,KAAA,CAAQ,IAAIE,EAAY,IAAA,CAAK,IAAI,EACxC,CACF","file":"index.js","sourcesContent":["import type { ApiError } from './types';\n\nconst DEFAULT_BASE_URL = 'https://api.kookee.dev';\nconst API_KEY_HEADER = 'Kookee-API-Key';\n\nexport class KookeeApiError extends Error {\n constructor(\n public readonly code: string,\n message: string,\n public readonly status: number\n ) {\n super(message);\n this.name = 'KookeeApiError';\n }\n}\n\nexport class HttpClient {\n private readonly baseUrl: string;\n private readonly apiKey: string;\n\n constructor(apiKey: string, baseUrl?: string) {\n this.apiKey = apiKey;\n this.baseUrl = baseUrl ?? DEFAULT_BASE_URL;\n }\n\n private getHeaders(): Record<string, string> {\n return {\n 'Content-Type': 'application/json',\n [API_KEY_HEADER]: this.apiKey,\n };\n }\n\n async get<T>(path: string, params?: object): Promise<T> {\n const url = new URL(`${this.baseUrl}${path}`);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n for (const item of value) {\n url.searchParams.append(key, String(item));\n }\n } else {\n url.searchParams.set(key, String(value));\n }\n }\n }\n }\n\n const response = await fetch(url.toString(), {\n method: 'GET',\n headers: this.getHeaders(),\n });\n\n return this.handleResponse<T>(response);\n }\n\n async post<T>(path: string, body?: unknown): Promise<T> {\n const response = await fetch(`${this.baseUrl}${path}`, {\n method: 'POST',\n headers: this.getHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n\n return this.handleResponse<T>(response);\n }\n\n private async handleResponse<T>(response: Response): Promise<T> {\n if (!response.ok) {\n let errorData: ApiError | null = null;\n\n try {\n errorData = (await response.json()) as ApiError;\n } catch {\n // Response body is not JSON\n }\n\n throw new KookeeApiError(\n errorData?.code ?? 'UNKNOWN_ERROR',\n errorData?.message ?? `Request failed with status ${response.status}`,\n response.status\n );\n }\n\n return response.json() as Promise<T>;\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type {\n Announcement,\n AnnouncementListItem,\n AnnouncementOrderBy,\n AnnouncementType,\n LocaleOptions,\n OrderDirection,\n PaginatedResponse,\n PaginationParams,\n} from '../types';\n\nexport interface AnnouncementListParams extends PaginationParams, LocaleOptions {\n type?: AnnouncementType;\n excludeIds?: string[];\n orderBy?: AnnouncementOrderBy;\n order?: OrderDirection;\n}\n\nexport interface AnnouncementGetByIdParams extends LocaleOptions {}\n\nexport class AnnouncementModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: AnnouncementListParams): Promise<PaginatedResponse<AnnouncementListItem>> {\n return this.http.get<PaginatedResponse<AnnouncementListItem>>('/v1/announcements', params);\n }\n\n async getById(id: string, params?: AnnouncementGetByIdParams): Promise<Announcement> {\n return this.http.get<Announcement>(`/v1/announcements/${encodeURIComponent(id)}`, params);\n }\n\n async getTranslationsById(id: string): Promise<Record<string, Announcement>> {\n return this.http.get<Record<string, Announcement>>(\n `/v1/announcements/${encodeURIComponent(id)}/translations`\n );\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type {\n BlogPost,\n BlogPostListItem,\n BlogTagWithCount,\n LocaleOptions,\n PaginatedResponse,\n PaginationParams,\n} from '../types';\n\nexport interface BlogListParams extends PaginationParams, LocaleOptions {\n tags?: string[];\n search?: string;\n}\n\nexport interface BlogGetBySlugParams extends LocaleOptions {}\n\nexport interface BlogGetByIdParams extends LocaleOptions {}\n\nexport class BlogModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: BlogListParams): Promise<PaginatedResponse<BlogPostListItem>> {\n return this.http.get<PaginatedResponse<BlogPostListItem>>('/v1/blog/posts', params);\n }\n\n async getBySlug(slug: string, params?: BlogGetBySlugParams): Promise<BlogPost> {\n return this.http.get<BlogPost>(`/v1/blog/posts/${encodeURIComponent(slug)}`, params);\n }\n\n async getById(id: string, params?: BlogGetByIdParams): Promise<BlogPost> {\n return this.http.get<BlogPost>(`/v1/blog/posts/by-id/${encodeURIComponent(id)}`, params);\n }\n\n async getTags(): Promise<BlogTagWithCount[]> {\n return this.http.get<BlogTagWithCount[]>('/v1/blog/tags');\n }\n\n async getTranslationsById(postId: string): Promise<Record<string, BlogPost>> {\n return this.http.get<Record<string, BlogPost>>(\n `/v1/blog/posts/by-id/${encodeURIComponent(postId)}/translations`\n );\n }\n\n async getTranslationsBySlug(slug: string): Promise<Record<string, BlogPost>> {\n return this.http.get<Record<string, BlogPost>>(\n `/v1/blog/posts/${encodeURIComponent(slug)}/translations`\n );\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type {\n ChangelogEntry,\n ChangelogEntryListItem,\n ChangelogOrderBy,\n LocaleOptions,\n OrderDirection,\n PaginatedResponse,\n PaginationParams,\n} from '../types';\n\nexport interface ChangelogListParams extends PaginationParams, LocaleOptions {\n type?: string;\n search?: string;\n orderBy?: ChangelogOrderBy;\n order?: OrderDirection;\n}\n\nexport interface ChangelogGetBySlugParams extends LocaleOptions {}\n\nexport interface ChangelogGetByIdParams extends LocaleOptions {}\n\nexport class ChangelogModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: ChangelogListParams): Promise<PaginatedResponse<ChangelogEntryListItem>> {\n return this.http.get<PaginatedResponse<ChangelogEntryListItem>>('/v1/changelog', params);\n }\n\n async getBySlug(slug: string, params?: ChangelogGetBySlugParams): Promise<ChangelogEntry> {\n return this.http.get<ChangelogEntry>(`/v1/changelog/${encodeURIComponent(slug)}`, params);\n }\n\n async getById(id: string, params?: ChangelogGetByIdParams): Promise<ChangelogEntry> {\n return this.http.get<ChangelogEntry>(`/v1/changelog/by-id/${encodeURIComponent(id)}`, params);\n }\n\n async getTranslationsById(id: string): Promise<Record<string, ChangelogEntry>> {\n return this.http.get<Record<string, ChangelogEntry>>(\n `/v1/changelog/by-id/${encodeURIComponent(id)}/translations`\n );\n }\n\n async getTranslationsBySlug(slug: string): Promise<Record<string, ChangelogEntry>> {\n return this.http.get<Record<string, ChangelogEntry>>(\n `/v1/changelog/${encodeURIComponent(slug)}/translations`\n );\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type { PublicConfig } from '../types';\n\nexport interface ConfigListParams {\n keys?: string[];\n}\n\nexport class ConfigModule {\n constructor(private readonly http: HttpClient) {}\n\n async getByKey(key: string): Promise<PublicConfig> {\n return this.http.get<PublicConfig>(`/v1/config/${encodeURIComponent(key)}`);\n }\n\n async list(params?: ConfigListParams): Promise<PublicConfig[]> {\n return this.http.get<PublicConfig[]>('/v1/config', params);\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type {\n HelpArticle,\n HelpArticleListItem,\n HelpCategory,\n HelpSearchResult,\n LocaleOptions,\n PaginatedResponse,\n PaginationParams,\n} from '../types';\n\nexport interface HelpCategoriesParams extends LocaleOptions {}\n\nexport interface HelpListParams extends PaginationParams, LocaleOptions {\n category?: string;\n search?: string;\n}\n\nexport interface HelpSearchParams extends LocaleOptions {\n query: string;\n limit?: number;\n}\n\nexport interface HelpGetBySlugParams extends LocaleOptions {}\n\nexport interface HelpGetByIdParams extends LocaleOptions {}\n\nexport class HelpModule {\n constructor(private readonly http: HttpClient) {}\n\n async categories(params?: HelpCategoriesParams): Promise<HelpCategory[]> {\n return this.http.get<HelpCategory[]>('/v1/help/categories', params);\n }\n\n async list(params?: HelpListParams): Promise<PaginatedResponse<HelpArticleListItem>> {\n return this.http.get<PaginatedResponse<HelpArticleListItem>>('/v1/help/articles', params);\n }\n\n async getBySlug(slug: string, params?: HelpGetBySlugParams): Promise<HelpArticle> {\n return this.http.get<HelpArticle>(`/v1/help/articles/${encodeURIComponent(slug)}`, params);\n }\n\n async getById(id: string, params?: HelpGetByIdParams): Promise<HelpArticle> {\n return this.http.get<HelpArticle>(`/v1/help/articles/by-id/${encodeURIComponent(id)}`, params);\n }\n\n async search(params: HelpSearchParams): Promise<HelpSearchResult[]> {\n return this.http.get<HelpSearchResult[]>('/v1/help/search', params);\n }\n\n async getTranslationsById(articleId: string): Promise<Record<string, HelpArticle>> {\n return this.http.get<Record<string, HelpArticle>>(\n `/v1/help/articles/by-id/${encodeURIComponent(articleId)}/translations`\n );\n }\n\n async getTranslationsBySlug(slug: string): Promise<Record<string, HelpArticle>> {\n return this.http.get<Record<string, HelpArticle>>(\n `/v1/help/articles/${encodeURIComponent(slug)}/translations`\n );\n }\n}\n","import type { HttpClient } from '../http-client';\nimport type { LocaleOptions, Page, PageListItem, PaginatedResponse, PaginationParams } from '../types';\n\nexport interface PagesListParams extends PaginationParams, LocaleOptions {\n search?: string;\n}\n\nexport interface PagesGetBySlugParams extends LocaleOptions {}\n\nexport interface PagesGetByIdParams extends LocaleOptions {}\n\nexport class PagesModule {\n constructor(private readonly http: HttpClient) {}\n\n async list(params?: PagesListParams): Promise<PaginatedResponse<PageListItem>> {\n return this.http.get<PaginatedResponse<PageListItem>>('/v1/pages', params);\n }\n\n async getBySlug(slug: string, params?: PagesGetBySlugParams): Promise<Page> {\n return this.http.get<Page>(`/v1/pages/${encodeURIComponent(slug)}`, params);\n }\n\n async getById(id: string, params?: PagesGetByIdParams): Promise<Page> {\n return this.http.get<Page>(`/v1/pages/by-id/${encodeURIComponent(id)}`, params);\n }\n\n async getTranslationsById(pageId: string): Promise<Record<string, Page>> {\n return this.http.get<Record<string, Page>>(\n `/v1/pages/by-id/${encodeURIComponent(pageId)}/translations`\n );\n }\n\n async getTranslationsBySlug(slug: string): Promise<Record<string, Page>> {\n return this.http.get<Record<string, Page>>(\n `/v1/pages/${encodeURIComponent(slug)}/translations`\n );\n }\n}\n","import { HttpClient } from './http-client';\nimport { AnnouncementModule } from './modules/announcement';\nimport { BlogModule } from './modules/blog';\nimport { ChangelogModule } from './modules/changelog';\nimport { ConfigModule } from './modules/config';\nimport { HelpModule } from './modules/help';\nimport { PagesModule } from './modules/pages';\nimport type { KookeeConfig } from './types';\n\nexport class Kookee {\n private readonly http: HttpClient;\n\n public readonly announcements: AnnouncementModule;\n public readonly blog: BlogModule;\n public readonly changelog: ChangelogModule;\n public readonly config: ConfigModule;\n public readonly help: HelpModule;\n public readonly pages: PagesModule;\n\n constructor(config: KookeeConfig) {\n if (!config.apiKey) {\n throw new Error('apiKey is required');\n }\n\n this.http = new HttpClient(config.apiKey, config.baseUrl);\n\n this.announcements = new AnnouncementModule(this.http);\n this.blog = new BlogModule(this.http);\n this.changelog = new ChangelogModule(this.http);\n this.config = new ConfigModule(this.http);\n this.help = new HelpModule(this.http);\n this.pages = new PagesModule(this.http);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kookee/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "Official Kookee SDK - Access your blog, changelog, help center, and more",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -10,10 +10,12 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js",
|
|
12
12
|
"require": "./dist/index.cjs"
|
|
13
|
-
}
|
|
13
|
+
},
|
|
14
|
+
"./styles/code.css": "./styles/code.css"
|
|
14
15
|
},
|
|
15
16
|
"files": [
|
|
16
17
|
"dist",
|
|
18
|
+
"styles",
|
|
17
19
|
"README.md"
|
|
18
20
|
],
|
|
19
21
|
"keywords": [
|
package/styles/code.css
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kookee SDK - Code Block Syntax Highlighting
|
|
3
|
+
* Based on VS Code Dark+ theme
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* import '@kookee/sdk/styles/code.css';
|
|
7
|
+
*
|
|
8
|
+
* Or via CDN:
|
|
9
|
+
* <link rel="stylesheet" href="https://unpkg.com/@kookee/sdk/styles/code.css">
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* Base code block styles */
|
|
13
|
+
pre {
|
|
14
|
+
background: #1e1e1e;
|
|
15
|
+
border-radius: 0.5rem;
|
|
16
|
+
color: #d4d4d4;
|
|
17
|
+
font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco,
|
|
18
|
+
'Courier New', monospace;
|
|
19
|
+
font-size: 0.875rem;
|
|
20
|
+
line-height: 1.7;
|
|
21
|
+
padding: 1rem;
|
|
22
|
+
margin: 1rem 0;
|
|
23
|
+
overflow-x: auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
pre code {
|
|
27
|
+
background: none;
|
|
28
|
+
color: inherit;
|
|
29
|
+
font-size: inherit;
|
|
30
|
+
padding: 0;
|
|
31
|
+
border: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Inline code - Slack-style */
|
|
35
|
+
:not(pre) > code {
|
|
36
|
+
background-color: #f8e8ea;
|
|
37
|
+
color: #c41e3a;
|
|
38
|
+
padding: 0.125rem 0.375rem;
|
|
39
|
+
border-radius: 0.25rem;
|
|
40
|
+
font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco,
|
|
41
|
+
'Courier New', monospace;
|
|
42
|
+
font-size: 0.875em;
|
|
43
|
+
border: 1px solid #f0d0d4;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Remove Tailwind prose backticks if using Tailwind Typography */
|
|
47
|
+
.prose code::before,
|
|
48
|
+
.prose code::after {
|
|
49
|
+
content: none !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Syntax highlighting - VS Code Dark+ theme */
|
|
53
|
+
.hljs-comment,
|
|
54
|
+
.hljs-quote {
|
|
55
|
+
color: #6a9955;
|
|
56
|
+
font-style: italic;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.hljs-keyword,
|
|
60
|
+
.hljs-selector-tag,
|
|
61
|
+
.hljs-addition {
|
|
62
|
+
color: #569cd6;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.hljs-number,
|
|
66
|
+
.hljs-string,
|
|
67
|
+
.hljs-meta .hljs-meta-string,
|
|
68
|
+
.hljs-literal,
|
|
69
|
+
.hljs-doctag,
|
|
70
|
+
.hljs-regexp {
|
|
71
|
+
color: #ce9178;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.hljs-title,
|
|
75
|
+
.hljs-section,
|
|
76
|
+
.hljs-name,
|
|
77
|
+
.hljs-selector-id,
|
|
78
|
+
.hljs-selector-class {
|
|
79
|
+
color: #dcdcaa;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.hljs-attribute,
|
|
83
|
+
.hljs-attr,
|
|
84
|
+
.hljs-variable,
|
|
85
|
+
.hljs-template-variable,
|
|
86
|
+
.hljs-class .hljs-title,
|
|
87
|
+
.hljs-type {
|
|
88
|
+
color: #4ec9b0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.hljs-symbol,
|
|
92
|
+
.hljs-bullet,
|
|
93
|
+
.hljs-subst,
|
|
94
|
+
.hljs-meta,
|
|
95
|
+
.hljs-meta .hljs-keyword,
|
|
96
|
+
.hljs-selector-attr,
|
|
97
|
+
.hljs-selector-pseudo,
|
|
98
|
+
.hljs-link {
|
|
99
|
+
color: #d7ba7d;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.hljs-built_in,
|
|
103
|
+
.hljs-deletion {
|
|
104
|
+
color: #ce9178;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.hljs-formula {
|
|
108
|
+
background: #1e1e1e;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.hljs-emphasis {
|
|
112
|
+
font-style: italic;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.hljs-strong {
|
|
116
|
+
font-weight: bold;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.hljs-property {
|
|
120
|
+
color: #9cdcfe;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.hljs-punctuation {
|
|
124
|
+
color: #d4d4d4;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.hljs-template-tag {
|
|
128
|
+
color: #569cd6;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.hljs-params {
|
|
132
|
+
color: #d4d4d4;
|
|
133
|
+
}
|