@qoder-ai/qmind-cli 3.0.0 → 3.1.1

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.
@@ -1,4 +1,4 @@
1
- import { D as importProvidersSchema, Q as assertCapability, _ as aliDingImportRunSchema, a as invalidArgument, d as pagination, g as aliDingImportRunItemListSchema, m as requiredString, n as call, p as queryPath } from "./shared-DwycozMA.js";
1
+ import { O as importProvidersSchema, _ as aliDingImportRunItemListSchema, a as invalidArgument, d as pagination, et as assertCapability, m as requiredString, n as call, p as queryPath, v as aliDingImportRunSchema } from "./shared-9iPJsfjP.js";
2
2
  //#region ../sdk/src/operations/imports.ts
3
3
  const aliDingHost = "alidocs.dingtalk.com";
4
4
  const requestIdPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u;
@@ -14,8 +14,8 @@ function canonicalAliDingUrl(value, scope) {
14
14
  } catch (cause) {
15
15
  throw invalidArgument("url must be a canonical AliDing HTTPS URL", "url", { cause });
16
16
  }
17
- if (url.protocol !== "https:" || url.hostname !== aliDingHost) throw invalidArgument(`url must be an https://${aliDingHost} address`, "url");
18
- if (url.search.length > 0 || url.hash.length > 0 || url.username.length > 0) throw invalidArgument("url must not carry a query, fragment or credentials", "url");
17
+ if (url.origin !== `https://${aliDingHost}`) throw invalidArgument(`url must be an https://${aliDingHost} address`, "url");
18
+ if (url.search.length > 0 || url.hash.length > 0 || url.username.length > 0 || url.password.length > 0) throw invalidArgument("url must not carry a query, fragment or credentials", "url");
19
19
  const prefix = scope === "nodeSubtree" ? "/i/nodes/" : "/i/spaces/";
20
20
  if (!url.pathname.startsWith(prefix) || url.pathname === prefix) throw invalidArgument(`url must be an AliDing ${prefix} address for this import scope`, "url");
21
21
  return url.toString();
@@ -1,4 +1,4 @@
1
- import { J as voidResponseSchema, a as invalidArgument, c as optionalRecord, l as optionalString, m as requiredString, n as call, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch } from "./shared-DwycozMA.js";
1
+ import { X as voidResponseSchema, a as invalidArgument, c as optionalRecord, l as optionalString, m as requiredString, n as call, r as compactUndefined, s as optionalBoolean, t as assertNonEmptyPatch } from "./shared-9iPJsfjP.js";
2
2
  import { z } from "zod";
3
3
  //#region ../sdk/src/operations/management-schemas.ts
4
4
  const memberPermissionSchema = z.enum([
@@ -22,7 +22,8 @@ const scheduledTaskSceneSchema = z.enum([
22
22
  "compilation",
23
23
  "condensation",
24
24
  "lint",
25
- "source_refresh"
25
+ "source_refresh",
26
+ "source_binding_sync"
26
27
  ]);
27
28
  const scheduledTaskSchema = z.object({
28
29
  config: z.record(z.string(), z.unknown()).default({}),
@@ -107,8 +108,8 @@ function memberPermission(value, field) {
107
108
  throw invalidArgument(`${field} must be manage, edit, or view`, field);
108
109
  }
109
110
  function scheduledTaskScene(value, field) {
110
- if (value === "compilation" || value === "condensation" || value === "lint" || value === "source_refresh") return value;
111
- throw invalidArgument(`${field} must be compilation, condensation, lint, or source_refresh`, field);
111
+ if (value === "compilation" || value === "condensation" || value === "lint" || value === "source_refresh" || value === "source_binding_sync") return value;
112
+ throw invalidArgument(`${field} must be compilation, condensation, lint, source_refresh, or source_binding_sync`, field);
112
113
  }
113
114
  function compilationMode(value, field) {
114
115
  if (value === "FULL" || value === "INCREMENTAL" || value === "REBUILD") return value;
@@ -0,0 +1,128 @@
1
+ import { X as voidResponseSchema, Y as timestampSchema, c as optionalRecord, d as pagination, h as requiredText, l as optionalString, m as requiredString, n as call, p as queryPath, r as compactUndefined, t as assertNonEmptyPatch } from "./shared-9iPJsfjP.js";
2
+ import { z } from "zod";
3
+ //#region ../sdk/src/operations/note-schemas.ts
4
+ const noteSchema = z.object({
5
+ content: z.string().default(""),
6
+ createdAt: timestampSchema.optional(),
7
+ id: z.string().min(1),
8
+ metadata: z.record(z.string(), z.unknown()).nullish(),
9
+ notebookId: z.string().default(""),
10
+ noteType: z.string().default(""),
11
+ orgId: z.string().default(""),
12
+ title: z.string().default(""),
13
+ updatedAt: timestampSchema.optional(),
14
+ userId: z.string().default("")
15
+ });
16
+ const noteListSchema = z.object({
17
+ currentPage: z.number().int().nonnegative().optional(),
18
+ notes: z.array(noteSchema).nullish().transform((notes) => notes ?? []),
19
+ pageSize: z.number().int().nonnegative().optional(),
20
+ totalSize: z.number().int().nonnegative().default(0)
21
+ });
22
+ //#endregion
23
+ //#region ../sdk/src/operations/notes.ts
24
+ function createNoteOperations(context) {
25
+ return {
26
+ async createNote(notebookId, input, options) {
27
+ const notebook = requiredString(notebookId, "notebookId");
28
+ const body = compactUndefined({
29
+ content: requiredText(input?.content, "content"),
30
+ metadata: optionalRecord(input?.metadata, "metadata"),
31
+ noteType: optionalString(input?.noteType, "noteType"),
32
+ title: requiredString(input?.title, "title")
33
+ });
34
+ return call(context, {
35
+ body,
36
+ callOptions: options,
37
+ capability: "notes.write",
38
+ idempotent: false,
39
+ method: "POST",
40
+ operation: "notes.create",
41
+ path: context.profile.apiPath("notebooks", notebook, "notes"),
42
+ schema: noteSchema
43
+ });
44
+ },
45
+ async deleteNote(notebookId, noteId, options) {
46
+ const notebook = requiredString(notebookId, "notebookId");
47
+ const note = requiredString(noteId, "noteId");
48
+ return call(context, {
49
+ callOptions: options,
50
+ capability: "notes.write",
51
+ idempotent: false,
52
+ method: "DELETE",
53
+ operation: "notes.delete",
54
+ path: context.profile.apiPath("notebooks", notebook, "notes", note),
55
+ schema: voidResponseSchema
56
+ });
57
+ },
58
+ async getNote(notebookId, noteId, options) {
59
+ const notebook = requiredString(notebookId, "notebookId");
60
+ const note = requiredString(noteId, "noteId");
61
+ return call(context, {
62
+ callOptions: options,
63
+ capability: "notes.read",
64
+ idempotent: true,
65
+ method: "GET",
66
+ operation: "notes.get",
67
+ path: context.profile.apiPath("notebooks", notebook, "notes", note),
68
+ schema: noteSchema
69
+ });
70
+ },
71
+ async listNotes(notebookId, input = {}, options) {
72
+ const notebook = requiredString(notebookId, "notebookId");
73
+ const page = pagination({
74
+ page: input.page ?? 1,
75
+ pageSize: input.pageSize ?? 20
76
+ });
77
+ return call(context, {
78
+ callOptions: options,
79
+ capability: "notes.read",
80
+ idempotent: true,
81
+ method: "GET",
82
+ operation: "notes.list",
83
+ path: queryPath(context.profile.apiPath("notebooks", notebook, "notes"), [["page", page.page], ["page_size", page.pageSize]]),
84
+ schema: noteListSchema
85
+ });
86
+ },
87
+ async saveCondensationResult(notebookId, input, options) {
88
+ const notebook = requiredString(notebookId, "notebookId");
89
+ const body = {
90
+ content: requiredText(input?.content, "content"),
91
+ title: requiredString(input?.title, "title")
92
+ };
93
+ return call(context, {
94
+ body,
95
+ callOptions: options,
96
+ capability: "notes.saveCondensation",
97
+ idempotent: false,
98
+ method: "POST",
99
+ operation: "notes.saveCondensationResult",
100
+ path: context.profile.apiPath("notebooks", notebook, "condensation-results", "save"),
101
+ schema: noteSchema
102
+ });
103
+ },
104
+ async updateNote(notebookId, noteId, input, options) {
105
+ const notebook = requiredString(notebookId, "notebookId");
106
+ const note = requiredString(noteId, "noteId");
107
+ const body = compactUndefined({
108
+ content: optionalString(input?.content, "content"),
109
+ metadata: optionalRecord(input?.metadata, "metadata"),
110
+ noteType: optionalString(input?.noteType, "noteType"),
111
+ title: input?.title === void 0 ? void 0 : requiredString(input.title, "title")
112
+ });
113
+ assertNonEmptyPatch(body, "input");
114
+ return call(context, {
115
+ body,
116
+ callOptions: options,
117
+ capability: "notes.write",
118
+ idempotent: false,
119
+ method: "PUT",
120
+ operation: "notes.update",
121
+ path: context.profile.apiPath("notebooks", notebook, "notes", note),
122
+ schema: noteSchema
123
+ });
124
+ }
125
+ };
126
+ }
127
+ //#endregion
128
+ export { createNoteOperations };