<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          FunctionScript將 JavaScript 函數(shù)轉(zhuǎn)為類型化的 HTTP API

          聯(lián)合創(chuàng)作 · 2023-09-22 02:24

          FunctionScript 是一種將 JavaScript 函數(shù)轉(zhuǎn)為類型化 HTTP API 的語言和規(guī)范。

          它允許 JavaScript(Node.js)函數(shù)通過對 HTTP 接口進行定義(包括類型安全機制),從而無縫導(dǎo)出為 HTTP API。

          示例代碼

          /**
          * Select Rows from a Spreadsheet by querying it like a Database
          * @param {string} spreadsheetId The id of the Spreadsheet.
          * @param {string} range The A1 notation of the values to use as a table.
          * @param {enum} bounds Specify the ending bounds of the table.
          *   ["FIRST_EMPTY_ROW", "FIRST_EMPTY_ROW"]
          *   ["FULL_RANGE", "FULL_RANGE"]
          * @param {object} where A list of column values to filter by.
          * @param {object} limit A limit representing the number of results to return
          * @ {number} offset The offset of records to begin at
          * @ {number} count The number of records to return, 0 will return all
          * @returns {object} selectQueryResult
          * @ {string} spreadsheetId
          * @ {string} range
          * @ {array} rows An array of objects corresponding to row values
          */
          module.exports = async (
            spreadsheetId = null,
            range,
            bounds = 'FIRST_EMPTY_ROW',
            where = {},
            limit = {offset: 0, count: 0},
            context
          ) => {
          
            /* implementation-specific JavaScript */
          
            return {/* some data */};
          
          };

          上面的代碼將會生成一個 API:

          • spreadsheetId A string
          • range A string
          • bounds An enum, can be either "FIRST_EMPTY_ROW" or "FULL_RANGE"
          • where An object
          • limit An object that must contain:
            • limit.offset, a number
            • limit.count, a number

          返回一個對象:

          selectQueryResult

          • selectQueryResult.spreadsheetId must be a string
          • selectQueryResult.range must be a string
          • selectQueryResult.rows must be an array
          瀏覽 24
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  欧美一区操逼视频 | 99热在线99 | 亚洲无码AV电影 | 狠狠草在线观看 | 天堂在线中文 |