@awesomate/sdk 0.28.0 → 0.29.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.
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@
26
26
  * Docs: https://hub.awesomate.ai/docs/sdk/
27
27
  */
28
28
  /** This package's version, sent to the hub with every server call. */
29
- export declare const VERSION = "0.28.0";
29
+ export declare const VERSION = "0.29.0";
30
30
  /** Augmented by the generated awesomate.d.ts, so each kind's rows are typed. */
31
31
  export interface Kinds {
32
32
  }
@@ -944,6 +944,19 @@ export declare class AwesomateClient {
944
944
  * columns and rows, plus what it assumed.
945
945
  */
946
946
  data: (query: KnowledgeDataQuery) => Promise<Record<string, unknown>>;
947
+ /**
948
+ * A video the owner shared with **Anyone can watch**: its permanent player link and an embed
949
+ * code for a web page. `link` and `embed` are null until the video is shared, and when it is no
950
+ * longer Public (`enabled` true, `watchable` false). Read only: sharing is switched on in the hub
951
+ * or through Claude Code, by an Owner. `title` names the video in the embed code.
952
+ *
953
+ * @example
954
+ * const v = await db.knowledge.video('src-quote-walkthrough', { title: 'How we quote a job' });
955
+ * if (v.watchable && v.embed) console.log(v.embed);
956
+ */
957
+ video: (sourceId: string, options?: {
958
+ title?: string;
959
+ }) => Promise<SharedVideo>;
947
960
  };
948
961
  /**
949
962
  * Tell Contacts something happened to someone ("job_paid", "quote_sent"), so any email series
@@ -2261,6 +2274,17 @@ export interface KnowledgeSearchHit {
2261
2274
  url?: string;
2262
2275
  poster_url?: string;
2263
2276
  }
2277
+ /** A video anyone can watch, from knowledge.video(). */
2278
+ export interface SharedVideo {
2279
+ /** The owner switched Anyone can watch on. */
2280
+ enabled: boolean;
2281
+ /** Switched on and the video still Public: what a viewer gets. */
2282
+ watchable: boolean;
2283
+ /** The permanent player page, on the account's own links. address when it has one; null until shared. */
2284
+ link: string | null;
2285
+ /** An iframe of the player for a web page; null until shared. */
2286
+ embed: string | null;
2287
+ }
2264
2288
  /** What knowledge.search() returns. */
2265
2289
  export interface KnowledgeSearchResult {
2266
2290
  query: string;
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@
26
26
  * Docs: https://hub.awesomate.ai/docs/sdk/
27
27
  */
28
28
  /** This package's version, sent to the hub with every server call. */
29
- export const VERSION = '0.28.0';
29
+ export const VERSION = '0.29.0';
30
30
  const DEFAULT_BASE = 'https://hub.awesomate.ai';
31
31
  /** Every record and contact id is a UUID; anything else can name no row. */
32
32
  const RECORD_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
@@ -687,6 +687,20 @@ export class AwesomateClient {
687
687
  * columns and rows, plus what it assumed.
688
688
  */
689
689
  data: (query) => this.request('POST', '/api/knowledge/data/query', query, false),
690
+ /**
691
+ * A video the owner shared with **Anyone can watch**: its permanent player link and an embed
692
+ * code for a web page. `link` and `embed` are null until the video is shared, and when it is no
693
+ * longer Public (`enabled` true, `watchable` false). Read only: sharing is switched on in the hub
694
+ * or through Claude Code, by an Owner. `title` names the video in the embed code.
695
+ *
696
+ * @example
697
+ * const v = await db.knowledge.video('src-quote-walkthrough', { title: 'How we quote a job' });
698
+ * if (v.watchable && v.embed) console.log(v.embed);
699
+ */
700
+ video: (sourceId, options = {}) => {
701
+ const q = new URLSearchParams({ title: (options.title ?? '').slice(0, 100) });
702
+ return this.request('GET', `/api/knowledge/sources/${encodeURIComponent(sourceId)}/public-video?${q}`);
703
+ },
690
704
  };
691
705
  /**
692
706
  * Tell Contacts something happened to someone ("job_paid", "quote_sent"), so any email series
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesomate/sdk",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "Your own Awesomate data from Node and the browser: query contacts and app data with generated types, and sign your app's own users in",
5
5
  "license": "MIT",
6
6
  "type": "module",