@mondaydotcomorg/z2h-cli 0.26.0 → 0.26.2

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.
@@ -38,10 +38,12 @@ function toMondayChannelError(err: unknown): ChannelError {
38
38
  export function makeMondayChannel(caller: { email: string }) {
39
39
  return {
40
40
  /**
41
- * `ctx.api.v1.monday!.query(query, variables?)` — run a **read-only** GraphQL query against the monday.com API as the calling user.
41
+ * `ctx.api.v1.monday!.query(query, variables?)` — run a GraphQL query or mutation against the monday.com API as the calling user.
42
42
  *
43
- * **Mutations are not supported.** Only `query` operations are allowed; passing a `mutation` will be rejected at runtime.
44
- * Write operations via monday will be added in a future channel version.
43
+ * There is no runtime restriction here on query vs. mutation — whatever the request is, it's sent through as-is.
44
+ * What actually succeeds is bounded by the scopes granted on the caller's connected monday token (see the
45
+ * `monday` OAuth app's scope list); a mutation the token's scopes don't cover fails the same way it would on
46
+ * a direct API call, not with a special error from this channel.
45
47
  *
46
48
  * Only available when the app manifest declares `monday` as an integration.
47
49
  * The host reads the caller's global monday token (set once during the connect flow)
@@ -72,6 +74,15 @@ export function makeMondayChannel(caller: { email: string }) {
72
74
  * }`,
73
75
  * { boardId: ctx.input.boardId },
74
76
  * );
77
+ *
78
+ * @example
79
+ * // Modify an item's column value
80
+ * const data = await ctx.api.v1.monday!.query(
81
+ * `mutation ChangeValue($boardId: ID!, $itemId: ID!, $columnId: String!, $value: JSON!) {
82
+ * change_column_value(board_id: $boardId, item_id: $itemId, column_id: $columnId, value: $value) { id }
83
+ * }`,
84
+ * { boardId: ctx.input.boardId, itemId: ctx.input.itemId, columnId: 'status', value: JSON.stringify({ label: 'Done' }) },
85
+ * );
75
86
  */
76
87
  'monday.query': async ([query, variables]) => {
77
88
  if (typeof query !== 'string' || query.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mondaydotcomorg/z2h-cli",
3
- "version": "0.26.0",
3
+ "version": "0.26.2",
4
4
  "bin": "./bin/z2h-cli.js",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -51,7 +51,7 @@
51
51
  ],
52
52
  "dependencies": {
53
53
  "@aws-sdk/client-s3": "^3.706.0",
54
- "@mondaydotcomorg/z2h-dashboard-templates": "^0.3.0",
54
+ "@mondaydotcomorg/z2h-dashboard-templates": "^0.3.2",
55
55
  "@mondaydotcomorg/z2h-shared-utils": "^0.4.3",
56
56
  "chokidar": "^3.6.0",
57
57
  "commander": "^12.1.0",