teak-cli 1.0.52 → 1.0.53

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.
Files changed (2) hide show
  1. package/dist/index.js +62 -7
  2. package/package.json +2 -1
package/dist/index.js CHANGED
@@ -4,8 +4,8 @@
4
4
  import { readFileSync as readFileSync3, realpathSync } from "node:fs";
5
5
  import { fileURLToPath } from "node:url";
6
6
 
7
- // ../../packages/sdk/src/index.ts
8
- var CARD_TYPES = [
7
+ // ../../packages/convex/shared/constants.ts
8
+ var cardTypes = [
9
9
  "text",
10
10
  "link",
11
11
  "image",
@@ -15,6 +15,61 @@ var CARD_TYPES = [
15
15
  "palette",
16
16
  "quote"
17
17
  ];
18
+ var MAX_FILE_SIZE = 20 * 1024 * 1024;
19
+ var CARD_TYPES = [...cardTypes];
20
+ var CARD_TYPE_REGISTRY = {
21
+ text: {
22
+ label: "Text",
23
+ icon: "FileText",
24
+ searchLabel: "Text"
25
+ },
26
+ link: {
27
+ label: "Link",
28
+ icon: "Link",
29
+ searchLabel: "Links"
30
+ },
31
+ image: {
32
+ label: "Image",
33
+ icon: "Image",
34
+ searchLabel: "Images"
35
+ },
36
+ video: {
37
+ label: "Video",
38
+ icon: "Video",
39
+ searchLabel: "Videos"
40
+ },
41
+ audio: {
42
+ label: "Audio",
43
+ icon: "Volume2",
44
+ searchLabel: "Audio"
45
+ },
46
+ document: {
47
+ label: "Document",
48
+ icon: "File",
49
+ searchLabel: "Documents"
50
+ },
51
+ palette: {
52
+ label: "Palette",
53
+ icon: "Palette",
54
+ searchLabel: "Palettes"
55
+ },
56
+ quote: {
57
+ label: "Quote",
58
+ icon: "Quote",
59
+ searchLabel: "Quotes"
60
+ }
61
+ };
62
+ var RESERVED_KEYWORDS = [
63
+ ...cardTypes.map((cardType) => ({
64
+ value: cardType,
65
+ label: CARD_TYPE_REGISTRY[cardType].searchLabel
66
+ })),
67
+ { value: "favorites", label: "Favorites" },
68
+ { value: "trash", label: "Trash" }
69
+ ];
70
+
71
+ // ../../packages/convex/client/sdk.ts
72
+ var CARD_TYPES2 = cardTypes;
18
73
  var ERROR_CODES = [
19
74
  "AUTH_REQUIRED",
20
75
  "BAD_REQUEST",
@@ -272,7 +327,7 @@ var createTeakClient = (options) => {
272
327
  };
273
328
  };
274
329
  var parseTags = (value) => value === undefined ? undefined : Array.from(new Set(value.split(",").map((tag) => tag.trim()).filter(Boolean)));
275
- var isCardType = (value) => CARD_TYPES.includes(value);
330
+ var isCardType = (value) => CARD_TYPES2.includes(value);
276
331
 
277
332
  // ../../node_modules/commander/lib/error.js
278
333
  class CommanderError extends Error {
@@ -2595,7 +2650,7 @@ var login = async (options) => {
2595
2650
 
2596
2651
  // src/files.ts
2597
2652
  var MAX_STDIN_BYTES = 1024 * 1024;
2598
- var MAX_FILE_SIZE = 20 * 1024 * 1024;
2653
+ var MAX_FILE_SIZE2 = 20 * 1024 * 1024;
2599
2654
  var readStdin = async () => {
2600
2655
  if (process.stdin.isTTY) {
2601
2656
  return "";
@@ -2652,8 +2707,8 @@ var addCard = async (input, options) => {
2652
2707
  const { candidate, raw } = await resolveAddInput(input, options.file);
2653
2708
  if (candidate && existsSync2(candidate) && statSync(candidate).isFile()) {
2654
2709
  const stats = statSync(candidate);
2655
- if (stats.size > MAX_FILE_SIZE) {
2656
- throw new InvalidArgumentError(`file must be at most ${MAX_FILE_SIZE} bytes`);
2710
+ if (stats.size > MAX_FILE_SIZE2) {
2711
+ throw new InvalidArgumentError(`file must be at most ${MAX_FILE_SIZE2} bytes`);
2657
2712
  }
2658
2713
  const mimeType = mimeFor(candidate);
2659
2714
  const upload = await api.uploads.create({
@@ -2736,7 +2791,7 @@ var parseSince = (value) => {
2736
2791
  };
2737
2792
  var parseType = (value) => {
2738
2793
  if (!isCardType(value)) {
2739
- throw new InvalidArgumentError(`type must be one of: ${CARD_TYPES.join(", ")}`);
2794
+ throw new InvalidArgumentError(`type must be one of: ${CARD_TYPES2.join(", ")}`);
2740
2795
  }
2741
2796
  return value;
2742
2797
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teak-cli",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
4
4
  "description": "Command-line client for Teak, the personal knowledge hub for saving and rediscovering ideas.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -32,6 +32,7 @@
32
32
  "commander": "^15.0.0"
33
33
  },
34
34
  "devDependencies": {
35
+ "@teak/convex": "workspace:*",
35
36
  "@types/node": "^25.9.3",
36
37
  "typescript": "^6.0.3"
37
38
  },