@theholocron/confluence-client 1.32.0 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ import { RestClient } from "@theholocron/http-client";
2
+ import { ErrorSink, Logger } from "@theholocron/observability/core";
3
+ //#region ../../../../../src/page/page.d.ts
4
+ declare function page(rest: RestClient): {
5
+ get: <T = unknown>(id: string) => Promise<T>;
6
+ update: <T = unknown>(id: string, data: Record<string, unknown>) => Promise<T>;
7
+ };
8
+ //#endregion
9
+ //#region ../../../../../src/index.d.ts
10
+ interface ConfluenceClientOptions {
11
+ /** Base URL including the API path, e.g. "https://myorg.atlassian.net/wiki/rest/api". */
12
+ baseUrl: string;
13
+ /** Base64-encoded "email:apiToken" — use Buffer.from("email:token").toString("base64"). */
14
+ token: string;
15
+ /** Override fetch for testing. Defaults to globalThis.fetch. */
16
+ fetch?: typeof fetch;
17
+ /** Structured logger for request/response diagnostics. Defaults to a no-op. */
18
+ logger?: Logger;
19
+ /** Reports transport failures and unexpected 5xx. Defaults to a no-op. */
20
+ errors?: ErrorSink;
21
+ }
22
+ declare function createConfluenceClient(opts: ConfluenceClientOptions): {
23
+ page: {
24
+ get: <T = unknown>(id: string) => Promise<T>;
25
+ update: <T = unknown>(id: string, data: Record<string, unknown>) => Promise<T>;
26
+ };
27
+ };
28
+ //#endregion
29
+ export { ConfluenceClientOptions, createConfluenceClient, page };
package/dist/index.mjs ADDED
@@ -0,0 +1,28 @@
1
+ import { createRestClient } from "@theholocron/http-client";
2
+ //#region ../../../../../src/page/page.ts
3
+ function page(rest) {
4
+ return {
5
+ get: (id) => rest.request(`/${id}`),
6
+ update: (id, data) => rest.request(`/${id}`, {
7
+ method: "PUT",
8
+ body: data
9
+ })
10
+ };
11
+ }
12
+ //#endregion
13
+ //#region ../../../../../src/index.ts
14
+ function createConfluenceRestClient(opts) {
15
+ return createRestClient({
16
+ baseUrl: opts.baseUrl,
17
+ token: opts.token,
18
+ vendor: "Confluence",
19
+ fetch: opts.fetch,
20
+ logger: opts.logger,
21
+ errors: opts.errors
22
+ });
23
+ }
24
+ function createConfluenceClient(opts) {
25
+ return { page: page(createConfluenceRestClient(opts)) };
26
+ }
27
+ //#endregion
28
+ export { createConfluenceClient, page };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/confluence-client",
3
- "version": "1.32.0",
3
+ "version": "1.33.0",
4
4
  "description": "A TypeScript client for the Confluence API",
5
5
  "keywords": [
6
6
  "confluence",
@@ -33,13 +33,13 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@theholocron/observability": "^0.3.0",
36
- "@theholocron/http-client": "^1.32.0"
36
+ "@theholocron/http-client": "^1.33.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@theholocron/cli": "5.0.0-alpha.79",
40
40
  "@theholocron/eslint-config": "^8.4.3",
41
41
  "@theholocron/tsconfig": "^8.2.0",
42
- "@theholocron/tsdown-config": "^8.5.2",
42
+ "@theholocron/tsdown-config": "^8.6.1",
43
43
  "@theholocron/vitest-config": "^8.2.0",
44
44
  "@types/node": "^26.4.1",
45
45
  "@vitest/coverage-v8": "^5.0.0",