-
Notifications
You must be signed in to change notification settings - Fork 663
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Fil Maj
authored
Jun 12, 2024
1 parent
9f2935f
commit a2c0fe5
Showing
13 changed files
with
479 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import type { ChannelIDs, TokenOverridable, UserIDs } from './common'; | ||
import type { OptionalArgument } from '../helpers'; | ||
|
||
interface CanvasID { | ||
/** @description Encoded ID of the canvas. */ | ||
canvas_id: string; | ||
} | ||
interface DocumentContent { | ||
/** @description The type of content used to describe Canvas content. Always is `markdown`. */ | ||
type: 'markdown'; | ||
/** @description The markdown defining the Canvas content. */ | ||
markdown: string; | ||
} | ||
type SectionType = 'any_header' | 'h1' | 'h2' | 'h3'; | ||
interface SectionTypes { | ||
/** @description List of desired section types to filter on. Minimum of 1, maximum of 3. */ | ||
section_types: [SectionType, ...SectionType[]]; | ||
} | ||
interface ContainsText { | ||
/** @description Textual content that must appear in the section. */ | ||
contains_text: string; | ||
} | ||
// At least one of `section_types` or `contains_text` must be defined. | ||
type Criteria = (SectionTypes & Partial<ContainsText>) | (Partial<SectionTypes> & ContainsText); | ||
type Operation = 'insert_after' | 'insert_before' | 'insert_at_start' | 'insert_at_end' | 'replace' | 'delete'; | ||
interface BaseChange { | ||
/** @description The operation to perform on the canvas. */ | ||
operation?: Operation; | ||
/** @description The section of the canvas to target the operation on. */ | ||
section_id?: string; | ||
/** @description Structure describing the type and contents. */ | ||
document_content?: DocumentContent; | ||
} | ||
type ChangeWithSectionAndContent = Required<BaseChange> & { | ||
/** @description The operation to perform on the canvas. */ | ||
operation: 'insert_after' | 'insert_before' | ||
}; | ||
type ChangeWithContent = Required<Pick<BaseChange, 'document_content'>> & { | ||
/** @description The operation to perform on the canvas. */ | ||
operation: 'insert_at_start' | 'insert_at_end'; | ||
}; | ||
type ChangeWithContentAndOptionalSection = BaseChange & Required<Pick<BaseChange, 'document_content'>> & { | ||
/** @description The operation to perform on the canvas. */ | ||
operation: 'replace'; | ||
}; | ||
type ChangeWithSection = Required<Pick<BaseChange, 'section_id'>> & { | ||
/** @description The operation to perform on the canvas. */ | ||
operation: 'delete'; | ||
}; | ||
type Change = ChangeWithSection | ChangeWithContent | ChangeWithSectionAndContent | ChangeWithContentAndOptionalSection; | ||
|
||
// https://api.slack.com/methods/canvases.access.delete | ||
export interface CanvasesAccessDeleteArguments extends CanvasID, Partial<ChannelIDs>, TokenOverridable, | ||
Partial<UserIDs> {} | ||
|
||
// https://api.slack.com/methods/canvases.access.set | ||
export interface CanvasesAccessSetArguments extends CanvasID, Partial<ChannelIDs>, TokenOverridable, Partial<UserIDs> { | ||
/** @description Desired level of access. */ | ||
access_level: 'read' | 'write'; | ||
} | ||
|
||
// https://api.slack.com/methods/canvases.create | ||
export type CanvasesCreateArguments = OptionalArgument<TokenOverridable & { | ||
/** @description Title of the newly created canvas. */ | ||
title?: string; | ||
/** @description Structure describing the type and contents of the Canvas being created. */ | ||
document_content?: DocumentContent; | ||
}>; | ||
|
||
// https://api.slack.com/methods/canvases.sections.lookup | ||
export interface CanvasesSectionsLookupArguments extends CanvasID, TokenOverridable { | ||
/** @description Filtering criteria. */ | ||
criteria: Criteria; | ||
} | ||
|
||
// https://api.slack.com/methods/canvases.delete | ||
export interface CanvasesDeleteArguments extends CanvasID, TokenOverridable {} | ||
|
||
// https://api.slack.com/methods/canvases.edit | ||
export interface CanvasesEditArguments extends CanvasID, TokenOverridable { | ||
/** @description List of changes to apply to the canvas. */ | ||
changes: [Change, ...Change[]]; | ||
} | ||
|
||
// https://api.slack.com/methods/conversations.canvases.create | ||
export interface ConversationsCanvasesCreateArguments extends TokenOverridable { | ||
/** @description Channel ID of the channel to create a canvas in. */ | ||
channel_id: string; | ||
/** @description Structure describing the type and contents of the Canvas being created. */ | ||
document_content?: DocumentContent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
packages/web-api/src/types/response/CanvasesAccessDeleteResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* eslint-disable */ | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
// // | ||
// !!! DO NOT EDIT THIS FILE !!! // | ||
// // | ||
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. // | ||
// Please refer to the script code to learn how to update the source data. // | ||
// // | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
import { WebAPICallResult } from '../../WebClient'; | ||
export type CanvasesAccessDeleteResponse = WebAPICallResult & { | ||
error?: string; | ||
failed_to_update_channel_ids?: string[]; | ||
failed_to_update_user_ids?: string[]; | ||
ok?: boolean; | ||
response_metadata?: ResponseMetadata; | ||
}; | ||
|
||
export interface ResponseMetadata { | ||
} |
21 changes: 21 additions & 0 deletions
21
packages/web-api/src/types/response/CanvasesAccessSetResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* eslint-disable */ | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
// // | ||
// !!! DO NOT EDIT THIS FILE !!! // | ||
// // | ||
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. // | ||
// Please refer to the script code to learn how to update the source data. // | ||
// // | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
import { WebAPICallResult } from '../../WebClient'; | ||
export type CanvasesAccessSetResponse = WebAPICallResult & { | ||
error?: string; | ||
failed_to_update_channel_ids?: string[]; | ||
failed_to_update_user_ids?: string[]; | ||
ok?: boolean; | ||
response_metadata?: ResponseMetadata; | ||
}; | ||
|
||
export interface ResponseMetadata { | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/web-api/src/types/response/CanvasesCreateResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-disable */ | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
// // | ||
// !!! DO NOT EDIT THIS FILE !!! // | ||
// // | ||
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. // | ||
// Please refer to the script code to learn how to update the source data. // | ||
// // | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
import { WebAPICallResult } from '../../WebClient'; | ||
export type CanvasesCreateResponse = WebAPICallResult & { | ||
canvas_id?: string; | ||
detail?: string; | ||
error?: string; | ||
ok?: boolean; | ||
response_metadata?: ResponseMetadata; | ||
}; | ||
|
||
export interface ResponseMetadata { | ||
messages?: string[]; | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/web-api/src/types/response/CanvasesDeleteResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* eslint-disable */ | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
// // | ||
// !!! DO NOT EDIT THIS FILE !!! // | ||
// // | ||
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. // | ||
// Please refer to the script code to learn how to update the source data. // | ||
// // | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
import { WebAPICallResult } from '../../WebClient'; | ||
export type CanvasesDeleteResponse = WebAPICallResult & { | ||
error?: string; | ||
ok?: boolean; | ||
response_metadata?: ResponseMetadata; | ||
}; | ||
|
||
export interface ResponseMetadata { | ||
} |
20 changes: 20 additions & 0 deletions
20
packages/web-api/src/types/response/CanvasesEditResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-disable */ | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
// // | ||
// !!! DO NOT EDIT THIS FILE !!! // | ||
// // | ||
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. // | ||
// Please refer to the script code to learn how to update the source data. // | ||
// // | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
import { WebAPICallResult } from '../../WebClient'; | ||
export type CanvasesEditResponse = WebAPICallResult & { | ||
detail?: string; | ||
error?: string; | ||
ok?: boolean; | ||
response_metadata?: ResponseMetadata; | ||
}; | ||
|
||
export interface ResponseMetadata { | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/web-api/src/types/response/CanvasesSectionsLookupResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* eslint-disable */ | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
// // | ||
// !!! DO NOT EDIT THIS FILE !!! // | ||
// // | ||
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. // | ||
// Please refer to the script code to learn how to update the source data. // | ||
// // | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
import { WebAPICallResult } from '../../WebClient'; | ||
export type CanvasesSectionsLookupResponse = WebAPICallResult & { | ||
error?: string; | ||
ok?: boolean; | ||
response_metadata?: ResponseMetadata; | ||
sections?: Section[]; | ||
}; | ||
|
||
export interface ResponseMetadata { | ||
} | ||
|
||
export interface Section { | ||
id?: string; | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/web-api/src/types/response/ConversationsCanvasesCreateResponse.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-disable */ | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
// // | ||
// !!! DO NOT EDIT THIS FILE !!! // | ||
// // | ||
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. // | ||
// Please refer to the script code to learn how to update the source data. // | ||
// // | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
import { WebAPICallResult } from '../../WebClient'; | ||
export type ConversationsCanvasesCreateResponse = WebAPICallResult & { | ||
canvas_id?: string; | ||
detail?: string; | ||
error?: string; | ||
ok?: boolean; | ||
response_metadata?: ResponseMetadata; | ||
}; | ||
|
||
export interface ResponseMetadata { | ||
messages?: string[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.