@fabriktor/client 0.0.106 → 0.0.108

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,6 @@
1
+ import { type PLFeedLinkPreview, type RPFeedLinkPreview } from "@fabriktor/schema";
2
+ import type { OperationResultOf } from "../core/crud.js";
3
+ import type { FeedClientOptions } from "./feed.js";
4
+ export declare function newFeedPreviewClient(opts: FeedClientOptions): {
5
+ preview(input: PLFeedLinkPreview, signal?: AbortSignal): Promise<OperationResultOf<RPFeedLinkPreview>>;
6
+ };
@@ -0,0 +1,26 @@
1
+ // Copyright (C) Fabriktor, Inc. 2025-present.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+ // not use this file except in compliance with the License. You may obtain
5
+ // a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ import { ColFeedFeedPosts, HTTPMethodPost, PathFeedLinkPreview, SvcFeed, } from "@fabriktor/schema";
7
+ import { requiredToken } from "../core/auth.js";
8
+ import { buildPath } from "../core/path.js";
9
+ export function newFeedPreviewClient(opts) {
10
+ return {
11
+ async preview(input, signal) {
12
+ return opts.http.do({
13
+ base_url: opts.base_url,
14
+ path: buildPath({
15
+ svc: SvcFeed,
16
+ col: ColFeedFeedPosts,
17
+ action: PathFeedLinkPreview,
18
+ }),
19
+ method: HTTPMethodPost,
20
+ token: await requiredToken(opts.get_token),
21
+ body: input,
22
+ signal,
23
+ });
24
+ },
25
+ };
26
+ }
@@ -14,6 +14,7 @@ export * from "./core/path.js";
14
14
  export * from "./core/type.js";
15
15
  export * from "./core/ws.js";
16
16
  export * from "./feed/feed.js";
17
+ export * from "./feed/preview.js";
17
18
  export * from "./fulfillments/fulfillments.js";
18
19
  export * from "./jobs/jobs.js";
19
20
  export * from "./marketplace/marketplace.js";
package/dist/src/index.js CHANGED
@@ -14,6 +14,7 @@ export * from "./core/path.js";
14
14
  export * from "./core/type.js";
15
15
  export * from "./core/ws.js";
16
16
  export * from "./feed/feed.js";
17
+ export * from "./feed/preview.js";
17
18
  export * from "./fulfillments/fulfillments.js";
18
19
  export * from "./jobs/jobs.js";
19
20
  export * from "./marketplace/marketplace.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabriktor/client",
3
- "version": "0.0.106",
3
+ "version": "0.0.108",
4
4
  "description": "![Fabriktor Logo](./img/fabriktor-character.gif)",
5
5
  "type": "module",
6
6
  "exports": {
@@ -17,6 +17,6 @@
17
17
  "typescript": "^6.0.3"
18
18
  },
19
19
  "dependencies": {
20
- "@fabriktor/schema": "0.0.75"
20
+ "@fabriktor/schema": "0.0.80"
21
21
  }
22
22
  }