@tightknitai/slack-block-kit-validator 0.1.9 → 0.1.11
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/README.md +4 -2
- package/dist/helpers/check-single-plan-block.d.ts +11 -0
- package/dist/helpers/check-single-plan-block.d.ts.map +1 -0
- package/dist/helpers/check-single-plan-block.js +20 -0
- package/dist/helpers/check-single-plan-block.js.map +1 -0
- package/dist/helpers/check-surface-compatibility.d.ts.map +1 -1
- package/dist/helpers/check-surface-compatibility.js +15 -11
- package/dist/helpers/check-surface-compatibility.js.map +1 -1
- package/dist/helpers.d.ts +1 -0
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +1 -0
- package/dist/helpers.js.map +1 -1
- package/dist/slack-block-kit.schema.json +64 -0
- package/dist/standalone-validator.js +650 -76
- package/dist/types.generated.d.ts +621 -1
- package/dist/types.generated.d.ts.map +1 -1
- package/dist/validate-block-kit.d.ts +1 -1
- package/dist/validate-block-kit.d.ts.map +1 -1
- package/dist/validate-block-kit.js +4 -1
- package/dist/validate-block-kit.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -85,6 +85,7 @@ import {
|
|
|
85
85
|
findDuplicateBlockIds,
|
|
86
86
|
checkCumulativeMarkdownLength,
|
|
87
87
|
checkSingleTableBlock,
|
|
88
|
+
checkSinglePlanBlock,
|
|
88
89
|
checkFocusOnLoadUniqueness,
|
|
89
90
|
checkSurfaceCompatibility,
|
|
90
91
|
} from "@tightknitai/slack-block-kit-validator";
|
|
@@ -123,6 +124,7 @@ The schema uses `$defs` for every block, element, composition object, rich-text
|
|
|
123
124
|
| `findDuplicateBlockIds` | `(blocks) => string[]` | Duplicate `block_id` values in a blocks array. |
|
|
124
125
|
| `checkCumulativeMarkdownLength` | `(blocks) => string[]` | Sum of all `markdown` block text > 12,000 chars. |
|
|
125
126
|
| `checkSingleTableBlock` | `(blocks) => string[]` | More than one `table` block per payload. |
|
|
127
|
+
| `checkSinglePlanBlock` | `(blocks) => string[]` | More than one `plan` block per payload. |
|
|
126
128
|
| `checkDataVisualizationMax` | `(blocks) => string[]` | More than two `data_visualization` blocks per message. |
|
|
127
129
|
| `checkDataVisualizationConsistency` | `(blocks) => string[]` | Chart series with duplicate names, or data points that don't line up with `axis_config.categories`. |
|
|
128
130
|
| `checkFocusOnLoadUniqueness` | `(blocks) => string[]` | More than one element with `focus_on_load: true` in a view (walks nested elements + accessories). |
|
|
@@ -141,12 +143,12 @@ Each returns an array of human-readable error strings — empty when valid.
|
|
|
141
143
|
|
|
142
144
|
## Coverage
|
|
143
145
|
|
|
144
|
-
- **
|
|
146
|
+
- **21 blocks**: actions, alert, card, carousel, container, context, context_actions, data_table, data_visualization, divider, file, header, image, input, markdown, plan, rich_text, section, table, task_card, video.
|
|
145
147
|
- **All block elements**: button, icon_button, workflow_button, feedback_buttons, plain_text / email / url / number inputs, datepicker, datetimepicker, timepicker, file_input, rich_text_input, checkboxes, radio_buttons, image, overflow, url source, and all 5 single + 5 multi-select menu variants.
|
|
146
148
|
- **All 9 composition objects**: text (plain_text + mrkdwn), confirm, option (3 contextual variants), option_group, slack_file, dispatch_action_config, conversation_filter, trigger, workflow.
|
|
147
149
|
- **Rich text**: 4 container kinds (section, list, preformatted, quote) + 10 leaf kinds (text, link, user, usergroup, team, channel, emoji, broadcast, color, date) with style flags.
|
|
148
150
|
- **View envelopes**: `modal_view` + `home_view` under `$defs`.
|
|
149
|
-
- **Cross-payload rules** (via helpers): dup `block_id`, cumulative markdown, single-table, two-data-visualization-per-message, chart series/category consistency, `focus_on_load` uniqueness, surface compatibility.
|
|
151
|
+
- **Cross-payload rules** (via helpers): dup `block_id`, cumulative markdown, single-table, single-plan, two-data-visualization-per-message, chart series/category consistency, `focus_on_load` uniqueness, surface compatibility.
|
|
150
152
|
|
|
151
153
|
Every documented `maxLength`, regex (date / time / user ID / channel ID / team ID format), enum value, and array cardinality limit is enforced structurally.
|
|
152
154
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks that a payload contains at most one `plan` block. Slack rejects
|
|
3
|
+
* multi-plan payloads with `invalid_blocks` / "Cannot have more than 1 plan
|
|
4
|
+
* block" (surfaced on e.g. `chat.update`).
|
|
5
|
+
* @param blocks - array of Block Kit blocks
|
|
6
|
+
* @returns array of error messages (empty when zero or one `plan` block present)
|
|
7
|
+
*/
|
|
8
|
+
export declare function checkSinglePlanBlock(blocks: readonly {
|
|
9
|
+
type?: string;
|
|
10
|
+
}[]): string[];
|
|
11
|
+
//# sourceMappingURL=check-single-plan-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-single-plan-block.d.ts","sourceRoot":"","sources":["../../src/helpers/check-single-plan-block.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,EAAE,CAWnF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks that a payload contains at most one `plan` block. Slack rejects
|
|
3
|
+
* multi-plan payloads with `invalid_blocks` / "Cannot have more than 1 plan
|
|
4
|
+
* block" (surfaced on e.g. `chat.update`).
|
|
5
|
+
* @param blocks - array of Block Kit blocks
|
|
6
|
+
* @returns array of error messages (empty when zero or one `plan` block present)
|
|
7
|
+
*/
|
|
8
|
+
export function checkSinglePlanBlock(blocks) {
|
|
9
|
+
const indices = [];
|
|
10
|
+
blocks.forEach((block, i) => {
|
|
11
|
+
if (block?.type === "plan") {
|
|
12
|
+
indices.push(i);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
if (indices.length > 1) {
|
|
16
|
+
return [`only one 'plan' block is allowed per message — found ${indices.length} at indices ${indices.join(", ")}`];
|
|
17
|
+
}
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=check-single-plan-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-single-plan-block.js","sourceRoot":"","sources":["../../src/helpers/check-single-plan-block.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAoC;IACvE,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QAC1B,IAAI,KAAK,EAAE,IAAI,KAAK,MAAM,EAAE,CAAC;YAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,wDAAwD,OAAO,CAAC,MAAM,eAAe,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-surface-compatibility.d.ts","sourceRoot":"","sources":["../../src/helpers/check-surface-compatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"check-surface-compatibility.d.ts","sourceRoot":"","sources":["../../src/helpers/check-surface-compatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAqEnD;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EAAE,EACjE,OAAO,EAAE,OAAO,GACf,MAAM,EAAE,CAsBV"}
|
|
@@ -3,23 +3,26 @@
|
|
|
3
3
|
// block entry there has an `available-in-surfaces` array valued with some
|
|
4
4
|
// subset of ["Modals", "Messages", "Home tabs"]. Whatever's missing from
|
|
5
5
|
// that array is what we forbid here.
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
6
|
+
//
|
|
7
|
+
// Four entries below intentionally deviate from blocks.json — Slack's canonical
|
|
8
|
+
// data lists a surface where the block doesn't actually render. Each is
|
|
9
|
+
// empirically grounded:
|
|
10
|
+
// • card / modals — blocks.json lists Modals; fails to render there.
|
|
11
|
+
// • file / messages — inbound-only; apps can't send it outbound at all
|
|
12
|
+
// (https://docs.slack.dev/reference/block-kit/blocks/file-block:
|
|
13
|
+
// "You can't add this block to app surfaces directly...").
|
|
14
|
+
// • table / home tabs — blocks.json lists Home tabs; Tightknit testing shows
|
|
15
|
+
// the table block renders on messages only (modals and home drop it).
|
|
16
|
+
// • data_table / home tabs — same: blocks.json lists Home tabs, but as a
|
|
17
|
+
// table-family block it inherits table's messages-only behavior (mirrored
|
|
18
|
+
// for consistency, pending independent confirmation).
|
|
10
19
|
const BLOCKS_NOT_ALLOWED_IN_MESSAGE = new Set(["alert", "file"]);
|
|
11
|
-
// carousel/card are listed as modal-available in Slack's blocks.json but
|
|
12
|
-
// empirically fail to render inside modal views — confirmed by the PR author
|
|
13
|
-
// against the live API. They work in messages and home tabs.
|
|
14
|
-
// `data_visualization` is a messages-only block — its reference page lists
|
|
15
|
-
// "Available in Surfaces: Messages" only
|
|
16
|
-
// (https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block).
|
|
17
|
-
// Forbidden in both modals and home tabs.
|
|
18
20
|
const BLOCKS_NOT_ALLOWED_IN_MODAL = new Set([
|
|
19
21
|
"card",
|
|
20
22
|
"carousel",
|
|
21
23
|
"container",
|
|
22
24
|
"context_actions",
|
|
25
|
+
"data_table",
|
|
23
26
|
"data_visualization",
|
|
24
27
|
"file",
|
|
25
28
|
"markdown",
|
|
@@ -31,6 +34,7 @@ const BLOCKS_NOT_ALLOWED_IN_HOME = new Set([
|
|
|
31
34
|
"alert",
|
|
32
35
|
"container",
|
|
33
36
|
"context_actions",
|
|
37
|
+
"data_table",
|
|
34
38
|
"data_visualization",
|
|
35
39
|
"file",
|
|
36
40
|
"markdown",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-surface-compatibility.js","sourceRoot":"","sources":["../../src/helpers/check-surface-compatibility.ts"],"names":[],"mappings":"AAMA,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,qCAAqC;AACrC,yEAAyE;AACzE,
|
|
1
|
+
{"version":3,"file":"check-surface-compatibility.js","sourceRoot":"","sources":["../../src/helpers/check-surface-compatibility.ts"],"names":[],"mappings":"AAMA,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,qCAAqC;AACrC,EAAE;AACF,gFAAgF;AAChF,wEAAwE;AACxE,wBAAwB;AACxB,yEAAyE;AACzE,yEAAyE;AACzE,qEAAqE;AACrE,+DAA+D;AAC/D,+EAA+E;AAC/E,0EAA0E;AAC1E,2EAA2E;AAC3E,8EAA8E;AAC9E,0DAA0D;AAC1D,MAAM,6BAA6B,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAEjE,MAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC;IAC1C,MAAM;IACN,UAAU;IACV,WAAW;IACX,iBAAiB;IACjB,YAAY;IACZ,oBAAoB;IACpB,MAAM;IACN,UAAU;IACV,MAAM;IACN,OAAO;IACP,WAAW;CACZ,CAAC,CAAC;AAEH,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC;IACzC,OAAO;IACP,WAAW;IACX,iBAAiB;IACjB,YAAY;IACZ,oBAAoB;IACpB,MAAM;IACN,UAAU;IACV,MAAM;IACN,OAAO;IACP,WAAW;CACZ,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAiC;IACzD,OAAO,EAAE,6BAA6B;IACtC,KAAK,EAAE,2BAA2B;IAClC,IAAI,EAAE,0BAA0B;CACjC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,qBAAqB,GAA4B;IACrD,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,GAAG;CACV,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CACvC,MAAiE,EACjE,OAAgB;IAEhB,MAAM,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,MAAM,SAAS,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACjD,IAAI,MAAM,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,YAAY,OAAO,oBAAoB,SAAS,gBAAgB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAChG,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QAC1B,IAAI,KAAK,EAAE,IAAI,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,KAAK,CAAC,IAAI,gCAAgC,OAAO,GAAG,CAAC,CAAC;YACxF,mEAAmE;YACnE,uCAAuC;YACvC,OAAO;QACT,CAAC;QACD,IAAI,KAAK,EAAE,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,IAAI,KAAK,YAAY,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;YAC3F,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,uEAAuE,OAAO,IAAI,CAAC,CAAC;QAC7G,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./helpers/check-data-visualization-max.js";
|
|
|
5
5
|
export * from "./helpers/check-focus-on-load-uniqueness.js";
|
|
6
6
|
export * from "./helpers/check-number-input-bounds.js";
|
|
7
7
|
export * from "./helpers/check-response-url-enabled-context.js";
|
|
8
|
+
export * from "./helpers/check-single-plan-block.js";
|
|
8
9
|
export * from "./helpers/check-single-table-block.js";
|
|
9
10
|
export * from "./helpers/check-surface-compatibility.js";
|
|
10
11
|
export * from "./helpers/find-duplicate-block-ids.js";
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAIA,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mDAAmD,CAAC;AAClE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAIA,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mDAAmD,CAAC;AAClE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,iDAAiD,CAAC;AAChE,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC"}
|
package/dist/helpers.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./helpers/check-data-visualization-max.js";
|
|
|
8
8
|
export * from "./helpers/check-focus-on-load-uniqueness.js";
|
|
9
9
|
export * from "./helpers/check-number-input-bounds.js";
|
|
10
10
|
export * from "./helpers/check-response-url-enabled-context.js";
|
|
11
|
+
export * from "./helpers/check-single-plan-block.js";
|
|
11
12
|
export * from "./helpers/check-single-table-block.js";
|
|
12
13
|
export * from "./helpers/check-surface-compatibility.js";
|
|
13
14
|
export * from "./helpers/find-duplicate-block-ids.js";
|
package/dist/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,+DAA+D;AAE/D,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mDAAmD,CAAC;AAClE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,+DAA+D;AAE/D,cAAc,qCAAqC,CAAC;AACpD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,mDAAmD,CAAC;AAClE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wCAAwC,CAAC;AACvD,cAAc,iDAAiD,CAAC;AAChE,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC"}
|
|
@@ -1352,6 +1352,69 @@
|
|
|
1352
1352
|
]
|
|
1353
1353
|
},
|
|
1354
1354
|
|
|
1355
|
+
"data_table_cell": {
|
|
1356
|
+
"description": "A cell inside a data_table_block row. `raw_text` / `raw_number` for simple values, `rich_text` for formatted content. Per https://docs.slack.dev/reference/block-kit/blocks/data-table-block. The docs' per-cell schemas list `properties` without a `required` array; we mirror `table_cell` and require the value-bearing field(s). The rule 'the first (header) row cannot contain rich_text cells' is a row-position constraint JSON Schema can't express and is not enforced here.",
|
|
1357
|
+
"oneOf": [
|
|
1358
|
+
{
|
|
1359
|
+
"type": "object",
|
|
1360
|
+
"additionalProperties": false,
|
|
1361
|
+
"required": ["type", "text"],
|
|
1362
|
+
"properties": {
|
|
1363
|
+
"type": { "const": "raw_text" },
|
|
1364
|
+
"text": { "type": "string", "minLength": 1 }
|
|
1365
|
+
}
|
|
1366
|
+
},
|
|
1367
|
+
{
|
|
1368
|
+
"type": "object",
|
|
1369
|
+
"additionalProperties": false,
|
|
1370
|
+
"required": ["type", "value"],
|
|
1371
|
+
"properties": {
|
|
1372
|
+
"type": { "const": "raw_number" },
|
|
1373
|
+
"value": { "type": "number" },
|
|
1374
|
+
"text": { "type": "string", "minLength": 1 }
|
|
1375
|
+
}
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
"type": "object",
|
|
1379
|
+
"additionalProperties": false,
|
|
1380
|
+
"required": ["type", "elements"],
|
|
1381
|
+
"properties": {
|
|
1382
|
+
"type": { "const": "rich_text" },
|
|
1383
|
+
"elements": {
|
|
1384
|
+
"type": "array",
|
|
1385
|
+
"items": { "$ref": "#/$defs/rich_text_container_element" }
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
]
|
|
1390
|
+
},
|
|
1391
|
+
|
|
1392
|
+
"data_table_block": {
|
|
1393
|
+
"description": "Rich, interactive table with pagination, sorting, and filtering (https://docs.slack.dev/reference/block-kit/blocks/data-table-block). Distinct from `table_block`, which is a simpler static table. The single-table and aggregate 10,000-character limits are payload-level rules not enforced here. `row_header_column_index` must point at an existing column, a cross-field rule JSON Schema can't check (bounded to 0–19 since a row has at most 20 cells).",
|
|
1394
|
+
"type": "object",
|
|
1395
|
+
"additionalProperties": false,
|
|
1396
|
+
"required": ["type", "caption", "rows"],
|
|
1397
|
+
"properties": {
|
|
1398
|
+
"type": { "const": "data_table" },
|
|
1399
|
+
"block_id": { "$ref": "#/$defs/block_id" },
|
|
1400
|
+
"caption": { "type": "string", "minLength": 1 },
|
|
1401
|
+
"page_size": { "type": "integer", "minimum": 1, "maximum": 100 },
|
|
1402
|
+
"row_header_column_index": { "type": "integer", "minimum": 0, "maximum": 19 },
|
|
1403
|
+
"rows": {
|
|
1404
|
+
"description": "First row is the header; 2–101 rows total (1 header + 1–100 data rows), 1–20 cells per row.",
|
|
1405
|
+
"type": "array",
|
|
1406
|
+
"minItems": 2,
|
|
1407
|
+
"maxItems": 101,
|
|
1408
|
+
"items": {
|
|
1409
|
+
"type": "array",
|
|
1410
|
+
"minItems": 1,
|
|
1411
|
+
"maxItems": 20,
|
|
1412
|
+
"items": { "$ref": "#/$defs/data_table_cell" }
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
},
|
|
1417
|
+
|
|
1355
1418
|
"data_visualization_block": {
|
|
1356
1419
|
"description": "Renders data as a line, bar, area, or pie chart. Messages only (https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block). Slack renders at most two data_visualization blocks per message (enforced via the checkDataVisualizationMax helper, since JSON Schema can't count sibling blocks). Two further runtime rules are enforced via checkDataVisualizationConsistency, since they depend on sibling-field values JSON Schema can't compare: series names must be unique within a chart, and each series must contain exactly one data point per axis_config.categories label.",
|
|
1357
1420
|
"type": "object",
|
|
@@ -1678,6 +1741,7 @@
|
|
|
1678
1741
|
{ "$ref": "#/$defs/container_block" },
|
|
1679
1742
|
{ "$ref": "#/$defs/context_actions_block" },
|
|
1680
1743
|
{ "$ref": "#/$defs/context_block" },
|
|
1744
|
+
{ "$ref": "#/$defs/data_table_block" },
|
|
1681
1745
|
{ "$ref": "#/$defs/data_visualization_block" },
|
|
1682
1746
|
{ "$ref": "#/$defs/divider_block" },
|
|
1683
1747
|
{ "$ref": "#/$defs/file_block" },
|