UNPKG

@microsoft/teams.cards

Version:

<p> <a href="https://www.npmjs.com/package/@microsoft/teams.cards" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.cards/latest" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.cards?activeTab=c

1 lines 3.63 kB
{"version":3,"sources":["../../../src/actions/submit/task-fetch.ts"],"names":[],"mappings":";;AA6BO,MAAM,wBAAwB,YAAA,CAAyC;AAAA;AAAA;AAAA;AAAA,EAI5E,IAAA;AAAA,EAEA,WAAA,CAAY,KAAA,EAA6B,OAAA,GAA+B,EAAC,EAAG;AAC1E,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,MAAA,CAAO,MAAA,CAAO,MAAM,OAAO,CAAA;AAC3B,IAAA,IAAA,CAAK,IAAA,GAAO;AAAA,MACV,GAAG,KAAA;AAAA,MACH,OAAA,EAAS;AAAA,QACP,IAAA,EAAM;AAAA;AACR,KACF;AAAA,EACF;AAAA,EAEA,OAAO,KAAK,OAAA,EAAkD;AAC5D,IAAA,OAAO,IAAI,eAAA,CAAgB,OAAA,CAAQ,IAAA,EAAM,OAAO,CAAA;AAAA,EAClD;AAAA,EAEA,SAAS,KAAA,EAA0C;AACjD,IAAA,IAAA,CAAK,IAAA,GAAO,KAAA;AACZ,IAAA,OAAO,IAAA;AAAA,EACT;AAAA,EAEA,UAAU,KAAA,EAAkC;AAC1C,IAAA,KAAA,CAAM,QAAA,CAAS,EAAE,GAAG,IAAA,CAAK,IAAA,EAAM,GAAG,KAAA,EAAO,OAAA,EAAS,EAAE,IAAA,EAAM,YAAA,EAAa,EAAG,CAAA;AAC1E,IAAA,OAAO,IAAA;AAAA,EACT;AACF;AAYO,MAAM,aAAA,CAAqD;AAAA,EAChE,OAAA,GAAU;AAAA,IACR,IAAA,EAAM;AAAA,GACR;AAAA,EAEA,YAAY,IAAA,EAA4B;AAEtC,IAAA,IAAI,IAAA,EAAM;AACR,MAAA,MAAM,EAAE,OAAA,EAAS,GAAG,IAAA,EAAK,GAAI,IAAA;AAC7B,MAAA,MAAA,CAAO,MAAA,CAAO,MAAM,IAAI,CAAA;AAAA,IAC1B;AAAA,EACF;AACF","file":"task-fetch.mjs","sourcesContent":["import type { ISubmitAction, SubmitActionOptions } from '../../core';\nimport { SubmitAction } from '../../core';\n\nimport type { MSTeamsData } from './ms-teams-data';\n\nexport type TaskFetchActionOptions = SubmitActionOptions & {\n data: MSTeamsData<ITaskFetchData>;\n};\n\nexport type TaskFetchDataValues = {\n [key: string]: any;\n} & {\n /** type is special so we shouldn't allow overriding it */\n type?: never;\n};\n\n/**\n * @deprecated This type is deprecated. Please use {@link ITaskFetchSubmitActionData} instead. This will be removed in a future version of the SDK.\n */\nexport interface ITaskFetchAction extends ISubmitAction {\n /**\n * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties.\n */\n data: MSTeamsData<ITaskFetchData>;\n}\n\n/**\n * @deprecated This class is deprecated. Please use {@link TaskFetchSubmitActionData} instead. This will be removed in a future version of the SDK.\n */\nexport class TaskFetchAction extends SubmitAction implements ITaskFetchAction {\n /**\n * Initial data that input fields will be combined with. These are essentially ‘hidden’ properties.\n */\n data: MSTeamsData<ITaskFetchData>;\n\n constructor(value?: TaskFetchDataValues, options: SubmitActionOptions = {}) {\n super(options);\n Object.assign(this, options);\n this.data = {\n ...value,\n msteams: {\n type: 'task/fetch',\n },\n };\n }\n\n static from(options: TaskFetchActionOptions): TaskFetchAction {\n return new TaskFetchAction(options.data, options);\n }\n\n withData(value: MSTeamsData<ITaskFetchData>): this {\n this.data = value;\n return this;\n }\n\n withValue(value: TaskFetchDataValues): this {\n super.withData({ ...this.data, ...value, msteams: { type: 'task/fetch' } });\n return this;\n }\n}\n\n/**\n * @deprecated This type is deprecated. Please use {@link ITaskFetchSubmitActionData} instead. This will be removed in a future version of the SDK.\n */\nexport interface ITaskFetchData {\n type: 'task/fetch';\n}\n\n/**\n * @deprecated This class is deprecated. Please use {@link TaskFetchSubmitActionData} instead. This will be removed in a future version of the SDK.\n */\nexport class TaskFetchData implements MSTeamsData<ITaskFetchData> {\n msteams = {\n type: 'task/fetch' as const,\n };\n\n constructor(data?: TaskFetchDataValues) {\n // omit the msteams property if it exists\n if (data) {\n const { msteams, ...rest } = data;\n Object.assign(this, rest);\n }\n }\n}\n"]}