Skip to content

Commit da092d5

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

4 files changed

Lines changed: 45 additions & 9 deletions

File tree

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
export interface EntityDetailsRequestedEvent {
22
type: 'entity_details_requested';
33
user: string;
4-
external_ref: {
4+
trigger_id: string;
5+
link: {
6+
url: string;
7+
domain: string;
8+
};
9+
user_locale: string;
10+
event_ts: string;
11+
external_ref?: {
512
id: string;
613
type?: string;
714
};
8-
trigger_id: string;
9-
event_ts: string;
15+
message_ts?: string;
16+
channel?: string;
1017
}

packages/types/src/message-metadata.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ export interface MessageMetadataEventPayloadObject {
2727
[key: string]: string | number | boolean;
2828
}
2929

30+
export interface MessageMetadataEventPayloadAttributes {
31+
[key: string]: string | number | boolean | MessageMetadataEventPayloadAttributes;
32+
}
33+
3034
/**
3135
* @description Metadata that represents an entity.
3236
*/
@@ -38,7 +42,19 @@ export interface EntityMetadata {
3842
/**
3943
* @description Schema for the given entity type.
4044
*/
41-
entity_payload: object;
45+
entity_payload: {
46+
// biome-ignore lint/complexity/noBannedTypes: Allow Object
47+
attributes: Object;
48+
// biome-ignore lint/complexity/noBannedTypes: Allow Object
49+
fields?: Object;
50+
// biome-ignore lint/complexity/noBannedTypes: Allow Object
51+
custom_fields?: Object[];
52+
// biome-ignore lint/complexity/noBannedTypes: Allow Object
53+
slack_file?: Object;
54+
display_order?: string[];
55+
// biome-ignore lint/complexity/noBannedTypes: Allow Object
56+
actions?: Object;
57+
};
4258
/**
4359
* @description Reference (and optional type) used to identify an entity within the developer's system.
4460
*/

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)