Skip to content

Commit 0517996

Browse files
committed
update payload object, entity.presentDetails inputs, test
1 parent 67cc8b6 commit 0517996

3 files changed

Lines changed: 26 additions & 6 deletions

File tree

packages/types/src/message-metadata.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ export interface EntityMetadata {
3838
/**
3939
* @description Schema for the given entity type.
4040
*/
41-
entity_payload: object;
41+
entity_payload: {
42+
attributes: Object,
43+
fields?: Object,
44+
custom_fields?: Object[],
45+
slack_file?: Object,
46+
display_order?: string[],
47+
actions?: Object;
48+
};
4249
/**
4350
* @description Reference (and optional type) used to identify an entity within the developer's system.
4451
*/

packages/web-api/src/types/request/entity.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { TokenOverridable } from './common';
44
// https://api.slack.com/methods/entity.presentDetails
55
export type EntityPresentDetailsArguments = TokenOverridable & {
66
/**
7-
* @description Eentity metadata that will be presented in the flexpane.
7+
* @description Entity metadata to be presented in the flexpane.
88
* */
99
metadata?: EntityMetadata;
1010
/**
@@ -24,9 +24,14 @@ export type EntityPresentDetailsArguments = TokenOverridable & {
2424
/** @description Error response preventing flexpane data from being returned. */
2525
error?: {
2626
// Error status indicating why the entity could not be presented.
27-
// Accepted values: ["restricted", "internal_error", "not_found", "user_not_authed", "custom"]
2827
status: string;
29-
// If status is 'custom', you can use this field to provide a specific message.
28+
// If status is 'custom', you can use this field to provide a message to the client.
3029
custom_message?: string;
30+
// String format, eg. 'markdown'.
31+
message_format?: string;
32+
// If status is 'custom', you can use this field to provide a title to the client.
33+
custom_title?: string;
34+
// Set of action buttons to be shown in case of a specific error.
35+
actions?: Object[];
3136
};
3237
};

packages/web-api/test/types/methods/chat.test-d.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,11 @@ expectAssignable<Parameters<typeof web.chat.postMessage>>([
421421
entities: [
422422
{
423423
entity_type: 'slack#/entities/file',
424-
entity_payload: {},
424+
entity_payload: {
425+
attributes: {}
426+
},
427+
external_ref: {id: ""},
428+
url: ""
425429
},
426430
],
427431
},
@@ -643,7 +647,11 @@ expectAssignable<Parameters<typeof web.chat.unfurl>>([
643647
entities: [
644648
{
645649
entity_type: 'slack#/entities/file',
646-
entity_payload: {},
650+
entity_payload: {
651+
attributes: {}
652+
},
653+
external_ref: {id: ""},
654+
url: "",
647655
app_unfurl_url: 'https://google.com',
648656
},
649657
],

0 commit comments

Comments
 (0)