本文整理匯總了TypeScript中abap-adt-api.ADTClient.createTransport方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ADTClient.createTransport方法的具體用法?TypeScript ADTClient.createTransport怎麽用?TypeScript ADTClient.createTransport使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類abap-adt-api.ADTClient
的用法示例。
在下文中一共展示了ADTClient.createTransport方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: selectTransport
export async function selectTransport(
objContentPath: string,
devClass: string,
client: ADTClient,
forCreation: boolean = false
): Promise<TransportSelection> {
const ti = await client.transportInfo(
objContentPath,
devClass,
forCreation ? "I" : ""
)
// if I have a lock return the locking transport
// will probably be a task but should be fine
if (ti.LOCKS) return sel(ti.LOCKS.HEADER.TRKORR)
if (ti.DLVUNIT === "LOCAL") return sel("")
const CREATENEW = "Create a new transport"
const selection = await window.showQuickPick([
CREATENEW,
...ti.TRANSPORTS.map(t => `${t.TRKORR} ${t.AS4TEXT}`)
])
if (!selection) return sel("", true)
if (selection === CREATENEW) {
const text = await window.showInputBox({ prompt: "Request text" })
if (!text) return sel("", true)
return sel(await client.createTransport(objContentPath, text, ti.DEVCLASS))
} else return sel(selection.split(" ")[0])
}