liyongli vor 3 Jahren
Commit
90aec58cf5
100 geänderte Dateien mit 4584 neuen und 0 gelöschten Zeilen
  1. 3 0
      README.md
  2. 7 0
      cloudfunctions/quickstartFunctions/config.json
  3. 34 0
      cloudfunctions/quickstartFunctions/createUser/index.js
  4. 27 0
      cloudfunctions/quickstartFunctions/getUser/index.js
  5. 18 0
      cloudfunctions/quickstartFunctions/index.js
  6. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/pbjs
  7. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/pbjs.cmd
  8. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/pbjs.ps1
  9. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/pbts
  10. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/pbts.cmd
  11. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/pbts.ps1
  12. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/semver
  13. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/semver.cmd
  14. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/semver.ps1
  15. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-conv
  16. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-conv.cmd
  17. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-conv.ps1
  18. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-sign
  19. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-sign.cmd
  20. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-sign.ps1
  21. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-verify
  22. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-verify.cmd
  23. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-verify.ps1
  24. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node
  25. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-script
  26. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-script.cmd
  27. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-script.ps1
  28. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-transpile-only
  29. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-transpile-only.cmd
  30. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-transpile-only.ps1
  31. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node.cmd
  32. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node.ps1
  33. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-script
  34. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-script.cmd
  35. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/ts-script.ps1
  36. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/tsc
  37. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/tsc.cmd
  38. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/tsc.ps1
  39. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/tsserver
  40. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/tsserver.cmd
  41. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/tsserver.ps1
  42. 12 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/uuid
  43. 17 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/uuid.cmd
  44. 28 0
      cloudfunctions/quickstartFunctions/node_modules/.bin/uuid.ps1
  45. 1059 0
      cloudfunctions/quickstartFunctions/node_modules/.package-lock.json
  46. 9 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/.editorconfig
  47. 1 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/.eslintignore
  48. 43 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/.eslintrc
  49. 29 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/.prettierrc.js
  50. 97 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/README.md
  51. 29 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/aggregate.d.ts
  52. 109 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/aggregate.js
  53. 17 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/collection.d.ts
  54. 72 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/collection.js
  55. 175 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/command.d.ts
  56. 281 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/command.js
  57. 24 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/logic.d.ts
  58. 79 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/logic.js
  59. 73 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/query.d.ts
  60. 147 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/query.js
  61. 29 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/update.d.ts
  62. 49 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/update.js
  63. 6 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/config/app.config.d.ts
  64. 7 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/config/app.config.js
  65. 3 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/config/error.config.d.ts
  66. 15 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/config/error.config.js
  67. 34 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/const/code.d.ts
  68. 36 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/const/code.js
  69. 54 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/constant.d.ts
  70. 76 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/constant.js
  71. 14 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/document.d.ts
  72. 219 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/document.js
  73. 6 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/index.d.ts
  74. 11 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/index.js
  75. 24 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/interface.d.ts
  76. 2 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/interface.js
  77. 19 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/lineString.d.ts
  78. 57 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/lineString.js
  79. 18 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiLineString.d.ts
  80. 56 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiLineString.js
  81. 18 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiPoint.d.ts
  82. 50 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiPoint.js
  83. 18 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiPolygon.d.ts
  84. 62 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiPolygon.js
  85. 19 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/point.d.ts
  86. 43 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/point.js
  87. 19 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/polygon.d.ts
  88. 70 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/polygon.js
  89. 14 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/helper/symbol.d.ts
  90. 19 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/helper/symbol.js
  91. 49 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/index.d.ts
  92. 39 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/index.js
  93. 1 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/lib/util.d.ts
  94. 25 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/lib/util.js
  95. 4 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/operator-map.d.ts
  96. 23 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/operator-map.js
  97. 37 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/query.d.ts
  98. 247 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/query.js
  99. 7 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/realtime/error.d.ts
  100. 11 0
      cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/realtime/error.js

+ 3 - 0
README.md

@@ -0,0 +1,3 @@
+## 必要条件
+  1. 使用了获取微信手机号功能,appid主体必须为企业,并通过认证
+

+ 7 - 0
cloudfunctions/quickstartFunctions/config.json

@@ -0,0 +1,7 @@
+{
+  "permissions": {
+    "openapi": [
+      "wxacode.get"
+    ]
+  }
+}

+ 34 - 0
cloudfunctions/quickstartFunctions/createUser/index.js

@@ -0,0 +1,34 @@
+const cloud = require('wx-server-sdk')
+
+cloud.init({
+  env: cloud.DYNAMIC_CURRENT_ENV
+})
+const db = cloud.database()
+const user = db.collection("user");
+
+// 修改数据库信息云函数入口函数
+exports.main = async (event, context) => {
+  try {
+    const wxContext = cloud.getWXContext();
+    const userData = event.data || {};
+    const userDataFormat = {
+      _openid: wxContext.OPENID,
+      appid: wxContext.APPID,
+      unionid: wxContext.UNIONID,
+      ...userData
+    }
+    const setUser = await user.add({ data: userDataFormat });
+    return {
+      code: 0,
+      data: {
+        ...userDataFormat,
+        _id: setUser._id
+      }
+    }
+  } catch (e) {
+    return {
+      code: 1,
+      errMsg: e
+    }
+  }
+}

+ 27 - 0
cloudfunctions/quickstartFunctions/getUser/index.js

@@ -0,0 +1,27 @@
+const cloud = require('wx-server-sdk')
+
+cloud.init({
+  env: cloud.DYNAMIC_CURRENT_ENV
+})
+const db = cloud.database();
+const user = db.collection("user");
+
+// 修改数据库信息云函数入口函数
+exports.main = async (event, context) => {
+  try {
+    // 获取基础信息
+    const wxContext = cloud.getWXContext();
+    const userData = await user.where({
+      _openid: wxContext.OPENID
+    }).get();
+    return {
+      code: 0,
+      data: userData.data[0] || {}
+    }
+  } catch (e) {
+    return {
+      code: 1,
+      errMsg: e
+    }
+  }
+}

+ 18 - 0
cloudfunctions/quickstartFunctions/index.js

@@ -0,0 +1,18 @@
+const getUser = require('./getUser/index')
+const createUser = require('./createUser/index')
+const questionBank = require('./questionBank/index')
+
+// 云函数入口函数
+exports.main = async (event, context) => {
+  switch (event.type) {
+    case 'getUser':
+      // 获取用户信息
+      return await getUser.main(event, context)
+    case 'createUser':
+      // 生成用户信息
+      return await createUser.main(event, context)
+    case 'questionBankList':
+      // 获得题库
+      return await questionBank.main(event, context)
+  }
+}

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/pbjs

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../protobufjs/bin/pbjs" "$@"
+else 
+  exec node  "$basedir/../protobufjs/bin/pbjs" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/pbjs.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\protobufjs\bin\pbjs" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/pbjs.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../protobufjs/bin/pbjs" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../protobufjs/bin/pbjs" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../protobufjs/bin/pbjs" $args
+  } else {
+    & "node$exe"  "$basedir/../protobufjs/bin/pbjs" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/pbts

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../protobufjs/bin/pbts" "$@"
+else 
+  exec node  "$basedir/../protobufjs/bin/pbts" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/pbts.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\protobufjs\bin\pbts" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/pbts.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../protobufjs/bin/pbts" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../protobufjs/bin/pbts" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../protobufjs/bin/pbts" $args
+  } else {
+    & "node$exe"  "$basedir/../protobufjs/bin/pbts" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/semver

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../semver/bin/semver" "$@"
+else 
+  exec node  "$basedir/../semver/bin/semver" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/semver.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\semver\bin\semver" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/semver.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../semver/bin/semver" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../semver/bin/semver" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../semver/bin/semver" $args
+  } else {
+    & "node$exe"  "$basedir/../semver/bin/semver" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-conv

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../sshpk/bin/sshpk-conv" "$@"
+else 
+  exec node  "$basedir/../sshpk/bin/sshpk-conv" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-conv.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\sshpk\bin\sshpk-conv" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-conv.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../sshpk/bin/sshpk-conv" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../sshpk/bin/sshpk-conv" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../sshpk/bin/sshpk-conv" $args
+  } else {
+    & "node$exe"  "$basedir/../sshpk/bin/sshpk-conv" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-sign

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../sshpk/bin/sshpk-sign" "$@"
+else 
+  exec node  "$basedir/../sshpk/bin/sshpk-sign" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-sign.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\sshpk\bin\sshpk-sign" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-sign.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../sshpk/bin/sshpk-sign" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../sshpk/bin/sshpk-sign" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../sshpk/bin/sshpk-sign" $args
+  } else {
+    & "node$exe"  "$basedir/../sshpk/bin/sshpk-sign" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-verify

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../sshpk/bin/sshpk-verify" "$@"
+else 
+  exec node  "$basedir/../sshpk/bin/sshpk-verify" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-verify.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\sshpk\bin\sshpk-verify" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/sshpk-verify.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../sshpk/bin/sshpk-verify" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../sshpk/bin/sshpk-verify" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../sshpk/bin/sshpk-verify" $args
+  } else {
+    & "node$exe"  "$basedir/../sshpk/bin/sshpk-verify" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../ts-node/dist/bin.js" "$@"
+else 
+  exec node  "$basedir/../ts-node/dist/bin.js" "$@"
+fi

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-script

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../ts-node/dist/bin-script.js" "$@"
+else 
+  exec node  "$basedir/../ts-node/dist/bin-script.js" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-script.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\ts-node\dist\bin-script.js" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-script.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../ts-node/dist/bin-script.js" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../ts-node/dist/bin-script.js" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../ts-node/dist/bin-script.js" $args
+  } else {
+    & "node$exe"  "$basedir/../ts-node/dist/bin-script.js" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-transpile-only

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../ts-node/dist/bin-transpile.js" "$@"
+else 
+  exec node  "$basedir/../ts-node/dist/bin-transpile.js" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-transpile-only.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\ts-node\dist\bin-transpile.js" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node-transpile-only.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../ts-node/dist/bin-transpile.js" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../ts-node/dist/bin-transpile.js" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../ts-node/dist/bin-transpile.js" $args
+  } else {
+    & "node$exe"  "$basedir/../ts-node/dist/bin-transpile.js" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\ts-node\dist\bin.js" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-node.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../ts-node/dist/bin.js" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../ts-node/dist/bin.js" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../ts-node/dist/bin.js" $args
+  } else {
+    & "node$exe"  "$basedir/../ts-node/dist/bin.js" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-script

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../ts-node/dist/bin-script-deprecated.js" "$@"
+else 
+  exec node  "$basedir/../ts-node/dist/bin-script-deprecated.js" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-script.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\ts-node\dist\bin-script-deprecated.js" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/ts-script.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../ts-node/dist/bin-script-deprecated.js" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../ts-node/dist/bin-script-deprecated.js" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../ts-node/dist/bin-script-deprecated.js" $args
+  } else {
+    & "node$exe"  "$basedir/../ts-node/dist/bin-script-deprecated.js" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/tsc

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../typescript/bin/tsc" "$@"
+else 
+  exec node  "$basedir/../typescript/bin/tsc" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/tsc.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\typescript\bin\tsc" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/tsc.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../typescript/bin/tsc" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../typescript/bin/tsc" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../typescript/bin/tsc" $args
+  } else {
+    & "node$exe"  "$basedir/../typescript/bin/tsc" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/tsserver

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../typescript/bin/tsserver" "$@"
+else 
+  exec node  "$basedir/../typescript/bin/tsserver" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/tsserver.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\typescript\bin\tsserver" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/tsserver.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../typescript/bin/tsserver" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../typescript/bin/tsserver" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../typescript/bin/tsserver" $args
+  } else {
+    & "node$exe"  "$basedir/../typescript/bin/tsserver" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 12 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/uuid

@@ -0,0 +1,12 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+    *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+  exec "$basedir/node"  "$basedir/../uuid/bin/uuid" "$@"
+else 
+  exec node  "$basedir/../uuid/bin/uuid" "$@"
+fi

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/uuid.cmd

@@ -0,0 +1,17 @@
+@ECHO off
+GOTO start
+:find_dp0
+SET dp0=%~dp0
+EXIT /b
+:start
+SETLOCAL
+CALL :find_dp0
+
+IF EXIST "%dp0%\node.exe" (
+  SET "_prog=%dp0%\node.exe"
+) ELSE (
+  SET "_prog=node"
+  SET PATHEXT=%PATHEXT:;.JS;=;%
+)
+
+endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\uuid\bin\uuid" %*

+ 28 - 0
cloudfunctions/quickstartFunctions/node_modules/.bin/uuid.ps1

@@ -0,0 +1,28 @@
+#!/usr/bin/env pwsh
+$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
+
+$exe=""
+if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
+  # Fix case when both the Windows and Linux builds of Node
+  # are installed in the same directory
+  $exe=".exe"
+}
+$ret=0
+if (Test-Path "$basedir/node$exe") {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "$basedir/node$exe"  "$basedir/../uuid/bin/uuid" $args
+  } else {
+    & "$basedir/node$exe"  "$basedir/../uuid/bin/uuid" $args
+  }
+  $ret=$LASTEXITCODE
+} else {
+  # Support pipeline input
+  if ($MyInvocation.ExpectingInput) {
+    $input | & "node$exe"  "$basedir/../uuid/bin/uuid" $args
+  } else {
+    & "node$exe"  "$basedir/../uuid/bin/uuid" $args
+  }
+  $ret=$LASTEXITCODE
+}
+exit $ret

+ 1059 - 0
cloudfunctions/quickstartFunctions/node_modules/.package-lock.json

@@ -0,0 +1,1059 @@
+{
+  "name": "quickstartFunctions",
+  "version": "1.0.0",
+  "lockfileVersion": 2,
+  "requires": true,
+  "packages": {
+    "node_modules/@cloudbase/database": {
+      "version": "1.2.2",
+      "resolved": "https://registry.nlark.com/@cloudbase/database/download/@cloudbase/database-1.2.2.tgz",
+      "integrity": "sha1-JMyTEJZ8J7wbuPokU19JAonIRAo=",
+      "dependencies": {
+        "bson": "^4.0.3",
+        "lodash.clonedeep": "4.5.0",
+        "lodash.set": "4.3.2",
+        "lodash.unset": "4.5.2"
+      }
+    },
+    "node_modules/@cloudbase/node-sdk": {
+      "version": "2.4.7",
+      "resolved": "https://registry.nlark.com/@cloudbase/node-sdk/download/@cloudbase/node-sdk-2.4.7.tgz",
+      "integrity": "sha1-IGpM5swxN89GqTkso3IRe4JD1rM=",
+      "dependencies": {
+        "@cloudbase/database": "1.2.2",
+        "@cloudbase/signature-nodejs": "1.0.0-beta.0",
+        "@types/retry": "^0.12.0",
+        "agentkeepalive": "^4.1.3",
+        "is-regex": "^1.0.4",
+        "jsonwebtoken": "^8.5.1",
+        "lodash.merge": "^4.6.1",
+        "request": "^2.87.0",
+        "request-promise": "^4.2.5",
+        "retry": "^0.12.0",
+        "ts-node": "^8.10.2",
+        "xml2js": "^0.4.19"
+      },
+      "engines": {
+        "node": ">=8.6.0"
+      }
+    },
+    "node_modules/@cloudbase/signature-nodejs": {
+      "version": "1.0.0-beta.0",
+      "resolved": "https://registry.nlark.com/@cloudbase/signature-nodejs/download/@cloudbase/signature-nodejs-1.0.0-beta.0.tgz",
+      "integrity": "sha1-Ix0F+ZytAbxGT2gjlVfGpbmn56M=",
+      "dependencies": {
+        "@types/clone": "^0.1.30",
+        "clone": "^2.1.2",
+        "is-stream": "^2.0.0",
+        "url": "^0.11.0"
+      }
+    },
+    "node_modules/@protobufjs/aspromise": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npm.taobao.org/@protobufjs/aspromise/download/@protobufjs/aspromise-1.1.2.tgz",
+      "integrity": "sha1-m4sMxmPWaafY9vXQiToU00jzD78="
+    },
+    "node_modules/@protobufjs/base64": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npm.taobao.org/@protobufjs/base64/download/@protobufjs/base64-1.1.2.tgz",
+      "integrity": "sha1-TIVzDlm5ofHzSQR9vyQpYDS7JzU="
+    },
+    "node_modules/@protobufjs/codegen": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npm.taobao.org/@protobufjs/codegen/download/@protobufjs/codegen-2.0.4.tgz",
+      "integrity": "sha1-fvN/DQEPsCitGtWXIuUG2SYoFcs="
+    },
+    "node_modules/@protobufjs/eventemitter": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npm.taobao.org/@protobufjs/eventemitter/download/@protobufjs/eventemitter-1.1.0.tgz",
+      "integrity": "sha1-NVy8mLr61ZePntCV85diHx0Ga3A="
+    },
+    "node_modules/@protobufjs/fetch": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npm.taobao.org/@protobufjs/fetch/download/@protobufjs/fetch-1.1.0.tgz",
+      "integrity": "sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=",
+      "dependencies": {
+        "@protobufjs/aspromise": "^1.1.1",
+        "@protobufjs/inquire": "^1.1.0"
+      }
+    },
+    "node_modules/@protobufjs/float": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npm.taobao.org/@protobufjs/float/download/@protobufjs/float-1.0.2.tgz",
+      "integrity": "sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E="
+    },
+    "node_modules/@protobufjs/inquire": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npm.taobao.org/@protobufjs/inquire/download/@protobufjs/inquire-1.1.0.tgz",
+      "integrity": "sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik="
+    },
+    "node_modules/@protobufjs/path": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npm.taobao.org/@protobufjs/path/download/@protobufjs/path-1.1.2.tgz",
+      "integrity": "sha1-bMKyDFya1q0NzP0hynZz2Nf79o0="
+    },
+    "node_modules/@protobufjs/pool": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npm.taobao.org/@protobufjs/pool/download/@protobufjs/pool-1.1.0.tgz",
+      "integrity": "sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q="
+    },
+    "node_modules/@protobufjs/utf8": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npm.taobao.org/@protobufjs/utf8/download/@protobufjs/utf8-1.1.0.tgz",
+      "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA="
+    },
+    "node_modules/@types/clone": {
+      "version": "0.1.30",
+      "resolved": "https://registry.nlark.com/@types/clone/download/@types/clone-0.1.30.tgz",
+      "integrity": "sha1-5zZWSMG0ITalnH1QQGN7O1yDthQ="
+    },
+    "node_modules/@types/long": {
+      "version": "4.0.1",
+      "resolved": "https://registry.nlark.com/@types/long/download/@types/long-4.0.1.tgz",
+      "integrity": "sha1-RZxl+hhn2v5qjzIsTFFpVmPMVek="
+    },
+    "node_modules/@types/node": {
+      "version": "10.17.60",
+      "resolved": "https://registry.nlark.com/@types/node/download/@types/node-10.17.60.tgz?cache=0&sync_timestamp=1627817742550&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-10.17.60.tgz",
+      "integrity": "sha1-NfPWIT2u2V2n8Pc+dbzGmA6QWXs="
+    },
+    "node_modules/@types/retry": {
+      "version": "0.12.1",
+      "resolved": "https://registry.nlark.com/@types/retry/download/@types/retry-0.12.1.tgz?cache=0&sync_timestamp=1625682262514&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40types%2Fretry%2Fdownload%2F%40types%2Fretry-0.12.1.tgz",
+      "integrity": "sha1-2PHA0Nwjr61twWqemToIZXdLQGU="
+    },
+    "node_modules/agentkeepalive": {
+      "version": "4.1.4",
+      "resolved": "https://registry.npm.taobao.org/agentkeepalive/download/agentkeepalive-4.1.4.tgz",
+      "integrity": "sha1-2SgCikhiyxFxjlUieHLoQqRMlFs=",
+      "dependencies": {
+        "debug": "^4.1.0",
+        "depd": "^1.1.2",
+        "humanize-ms": "^1.2.1"
+      },
+      "engines": {
+        "node": ">= 8.0.0"
+      }
+    },
+    "node_modules/ajv": {
+      "version": "6.12.6",
+      "resolved": "https://registry.nlark.com/ajv/download/ajv-6.12.6.tgz",
+      "integrity": "sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=",
+      "dependencies": {
+        "fast-deep-equal": "^3.1.1",
+        "fast-json-stable-stringify": "^2.0.0",
+        "json-schema-traverse": "^0.4.1",
+        "uri-js": "^4.2.2"
+      }
+    },
+    "node_modules/arg": {
+      "version": "4.1.3",
+      "resolved": "https://registry.npm.taobao.org/arg/download/arg-4.1.3.tgz",
+      "integrity": "sha1-Jp/HrVuOQstjyJbVZmAXJhwUQIk="
+    },
+    "node_modules/asn1": {
+      "version": "0.2.4",
+      "resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz",
+      "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=",
+      "dependencies": {
+        "safer-buffer": "~2.1.0"
+      }
+    },
+    "node_modules/assert-plus": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz",
+      "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/asynckit": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz",
+      "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
+    },
+    "node_modules/aws-sign2": {
+      "version": "0.7.0",
+      "resolved": "https://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz",
+      "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/aws4": {
+      "version": "1.11.0",
+      "resolved": "https://registry.npm.taobao.org/aws4/download/aws4-1.11.0.tgz",
+      "integrity": "sha1-1h9G2DslGSUOJ4Ta9bCUeai0HFk="
+    },
+    "node_modules/base64-js": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npm.taobao.org/base64-js/download/base64-js-1.5.1.tgz",
+      "integrity": "sha1-GxtEAWClv3rUC2UPCVljSBkDkwo="
+    },
+    "node_modules/bcrypt-pbkdf": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz",
+      "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
+      "dependencies": {
+        "tweetnacl": "^0.14.3"
+      }
+    },
+    "node_modules/bluebird": {
+      "version": "3.7.2",
+      "resolved": "https://registry.npm.taobao.org/bluebird/download/bluebird-3.7.2.tgz",
+      "integrity": "sha1-nyKcFb4nJFT/qXOs4NvueaGww28="
+    },
+    "node_modules/bson": {
+      "version": "4.4.1",
+      "resolved": "https://registry.nlark.com/bson/download/bson-4.4.1.tgz",
+      "integrity": "sha1-aCw8uLkLIiQUzhTvg5gVS6LMIbw=",
+      "dependencies": {
+        "buffer": "^5.6.0"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/buffer": {
+      "version": "5.7.1",
+      "resolved": "https://registry.npm.taobao.org/buffer/download/buffer-5.7.1.tgz?cache=0&sync_timestamp=1606098078312&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbuffer%2Fdownload%2Fbuffer-5.7.1.tgz",
+      "integrity": "sha1-umLnwTEzBTWCGXFghRqPZI6Z7tA=",
+      "dependencies": {
+        "base64-js": "^1.3.1",
+        "ieee754": "^1.1.13"
+      }
+    },
+    "node_modules/buffer-equal-constant-time": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npm.taobao.org/buffer-equal-constant-time/download/buffer-equal-constant-time-1.0.1.tgz",
+      "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
+    },
+    "node_modules/buffer-from": {
+      "version": "1.1.2",
+      "resolved": "https://registry.nlark.com/buffer-from/download/buffer-from-1.1.2.tgz?cache=0&sync_timestamp=1627578510347&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fbuffer-from%2Fdownload%2Fbuffer-from-1.1.2.tgz",
+      "integrity": "sha1-KxRqb9cugLT1XSVfNe1Zo6mkG9U="
+    },
+    "node_modules/call-bind": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npm.taobao.org/call-bind/download/call-bind-1.0.2.tgz?cache=0&sync_timestamp=1610402811207&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcall-bind%2Fdownload%2Fcall-bind-1.0.2.tgz",
+      "integrity": "sha1-sdTonmiBGcPJqQOtMKuy9qkZvjw=",
+      "dependencies": {
+        "function-bind": "^1.1.1",
+        "get-intrinsic": "^1.0.2"
+      }
+    },
+    "node_modules/caseless": {
+      "version": "0.12.0",
+      "resolved": "https://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz",
+      "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
+    },
+    "node_modules/clone": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npm.taobao.org/clone/download/clone-2.1.2.tgz",
+      "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/combined-stream": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz",
+      "integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=",
+      "dependencies": {
+        "delayed-stream": "~1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/core-util-is": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz",
+      "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+    },
+    "node_modules/dashdash": {
+      "version": "1.14.1",
+      "resolved": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz?cache=0&sync_timestamp=1601073714105&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdashdash%2Fdownload%2Fdashdash-1.14.1.tgz",
+      "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
+      "dependencies": {
+        "assert-plus": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10"
+      }
+    },
+    "node_modules/debug": {
+      "version": "4.3.2",
+      "resolved": "https://registry.nlark.com/debug/download/debug-4.3.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdebug%2Fdownload%2Fdebug-4.3.2.tgz",
+      "integrity": "sha1-8KScGKyHeeMdSgxgKd+3aHPHQos=",
+      "dependencies": {
+        "ms": "2.1.2"
+      },
+      "engines": {
+        "node": ">=6.0"
+      }
+    },
+    "node_modules/delayed-stream": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz",
+      "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/depd": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npm.taobao.org/depd/download/depd-1.1.2.tgz",
+      "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=",
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/diff": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npm.taobao.org/diff/download/diff-4.0.2.tgz",
+      "integrity": "sha1-YPOuy4nV+uUgwRqhnvwruYKq3n0=",
+      "engines": {
+        "node": ">=0.3.1"
+      }
+    },
+    "node_modules/ecc-jsbn": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz",
+      "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
+      "dependencies": {
+        "jsbn": "~0.1.0",
+        "safer-buffer": "^2.1.0"
+      }
+    },
+    "node_modules/ecdsa-sig-formatter": {
+      "version": "1.0.11",
+      "resolved": "https://registry.npm.taobao.org/ecdsa-sig-formatter/download/ecdsa-sig-formatter-1.0.11.tgz",
+      "integrity": "sha1-rg8PothQRe8UqBfao86azQSJ5b8=",
+      "dependencies": {
+        "safe-buffer": "^5.0.1"
+      }
+    },
+    "node_modules/extend": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz",
+      "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo="
+    },
+    "node_modules/extsprintf": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz",
+      "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
+      "engines": [
+        "node >=0.6.0"
+      ]
+    },
+    "node_modules/fast-deep-equal": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.3.tgz",
+      "integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU="
+    },
+    "node_modules/fast-json-stable-stringify": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz",
+      "integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM="
+    },
+    "node_modules/forever-agent": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz",
+      "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=",
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/form-data": {
+      "version": "2.3.3",
+      "resolved": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz?cache=0&sync_timestamp=1613411617006&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fform-data%2Fdownload%2Fform-data-2.3.3.tgz",
+      "integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=",
+      "dependencies": {
+        "asynckit": "^0.4.0",
+        "combined-stream": "^1.0.6",
+        "mime-types": "^2.1.12"
+      },
+      "engines": {
+        "node": ">= 0.12"
+      }
+    },
+    "node_modules/function-bind": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz",
+      "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0="
+    },
+    "node_modules/get-intrinsic": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npm.taobao.org/get-intrinsic/download/get-intrinsic-1.1.1.tgz",
+      "integrity": "sha1-FfWfN2+FXERpY5SPDSTNNje0q8Y=",
+      "dependencies": {
+        "function-bind": "^1.1.1",
+        "has": "^1.0.3",
+        "has-symbols": "^1.0.1"
+      }
+    },
+    "node_modules/getpass": {
+      "version": "0.1.7",
+      "resolved": "https://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz",
+      "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
+      "dependencies": {
+        "assert-plus": "^1.0.0"
+      }
+    },
+    "node_modules/har-schema": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz",
+      "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=",
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/har-validator": {
+      "version": "5.1.5",
+      "resolved": "https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.5.tgz",
+      "integrity": "sha1-HwgDufjLIMD6E4It8ezds2veHv0=",
+      "deprecated": "this library is no longer supported",
+      "dependencies": {
+        "ajv": "^6.12.3",
+        "har-schema": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/has": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npm.taobao.org/has/download/has-1.0.3.tgz",
+      "integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=",
+      "dependencies": {
+        "function-bind": "^1.1.1"
+      },
+      "engines": {
+        "node": ">= 0.4.0"
+      }
+    },
+    "node_modules/has-symbols": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npm.taobao.org/has-symbols/download/has-symbols-1.0.2.tgz?cache=0&sync_timestamp=1614443617831&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhas-symbols%2Fdownload%2Fhas-symbols-1.0.2.tgz",
+      "integrity": "sha1-Fl0wcMADCXUqEjakeTMeOsVvFCM=",
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/http-signature": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz",
+      "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
+      "dependencies": {
+        "assert-plus": "^1.0.0",
+        "jsprim": "^1.2.2",
+        "sshpk": "^1.7.0"
+      },
+      "engines": {
+        "node": ">=0.8",
+        "npm": ">=1.3.7"
+      }
+    },
+    "node_modules/humanize-ms": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npm.taobao.org/humanize-ms/download/humanize-ms-1.2.1.tgz",
+      "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=",
+      "dependencies": {
+        "ms": "^2.0.0"
+      }
+    },
+    "node_modules/ieee754": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npm.taobao.org/ieee754/download/ieee754-1.2.1.tgz?cache=0&sync_timestamp=1603838235461&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fieee754%2Fdownload%2Fieee754-1.2.1.tgz",
+      "integrity": "sha1-jrehCmP/8l0VpXsAFYbRd9Gw01I="
+    },
+    "node_modules/is-regex": {
+      "version": "1.1.3",
+      "resolved": "https://registry.nlark.com/is-regex/download/is-regex-1.1.3.tgz?cache=0&sync_timestamp=1620452229354&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fis-regex%2Fdownload%2Fis-regex-1.1.3.tgz",
+      "integrity": "sha1-0Cn5r/ZEi5Prvj8z2scVEf3L758=",
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "has-symbols": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/is-stream": {
+      "version": "2.0.1",
+      "resolved": "https://registry.nlark.com/is-stream/download/is-stream-2.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fis-stream%2Fdownload%2Fis-stream-2.0.1.tgz",
+      "integrity": "sha1-+sHj1TuXrVqdCunO8jifWBClwHc=",
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/is-typedarray": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz",
+      "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
+    },
+    "node_modules/isstream": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz",
+      "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
+    },
+    "node_modules/jsbn": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz",
+      "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
+    },
+    "node_modules/json-schema": {
+      "version": "0.2.3",
+      "resolved": "https://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz?cache=0&sync_timestamp=1609553758550&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson-schema%2Fdownload%2Fjson-schema-0.2.3.tgz",
+      "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
+    },
+    "node_modules/json-schema-traverse": {
+      "version": "0.4.1",
+      "resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz?cache=0&sync_timestamp=1607998042332&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson-schema-traverse%2Fdownload%2Fjson-schema-traverse-0.4.1.tgz",
+      "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA="
+    },
+    "node_modules/json-stringify-safe": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz",
+      "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
+    },
+    "node_modules/jsonwebtoken": {
+      "version": "8.5.1",
+      "resolved": "https://registry.npm.taobao.org/jsonwebtoken/download/jsonwebtoken-8.5.1.tgz?cache=0&sync_timestamp=1586264928256&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjsonwebtoken%2Fdownload%2Fjsonwebtoken-8.5.1.tgz",
+      "integrity": "sha1-AOceC431TCEhofJhN98igGc7zA0=",
+      "dependencies": {
+        "jws": "^3.2.2",
+        "lodash.includes": "^4.3.0",
+        "lodash.isboolean": "^3.0.3",
+        "lodash.isinteger": "^4.0.4",
+        "lodash.isnumber": "^3.0.3",
+        "lodash.isplainobject": "^4.0.6",
+        "lodash.isstring": "^4.0.1",
+        "lodash.once": "^4.0.0",
+        "ms": "^2.1.1",
+        "semver": "^5.6.0"
+      },
+      "engines": {
+        "node": ">=4",
+        "npm": ">=1.4.28"
+      }
+    },
+    "node_modules/jsprim": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz",
+      "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
+      "engines": [
+        "node >=0.6.0"
+      ],
+      "dependencies": {
+        "assert-plus": "1.0.0",
+        "extsprintf": "1.3.0",
+        "json-schema": "0.2.3",
+        "verror": "1.10.0"
+      }
+    },
+    "node_modules/jwa": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npm.taobao.org/jwa/download/jwa-1.4.1.tgz",
+      "integrity": "sha1-dDwymFy56YZVUw1TZBtmyGRbA5o=",
+      "dependencies": {
+        "buffer-equal-constant-time": "1.0.1",
+        "ecdsa-sig-formatter": "1.0.11",
+        "safe-buffer": "^5.0.1"
+      }
+    },
+    "node_modules/jws": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npm.taobao.org/jws/download/jws-3.2.2.tgz",
+      "integrity": "sha1-ABCZ82OUaMlBQADpmZX6UvtHgwQ=",
+      "dependencies": {
+        "jwa": "^1.4.1",
+        "safe-buffer": "^5.0.1"
+      }
+    },
+    "node_modules/lodash": {
+      "version": "4.17.21",
+      "resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.21.tgz",
+      "integrity": "sha1-Z5WRxWTDv/quhFTPCz3zcMPWkRw="
+    },
+    "node_modules/lodash.clonedeep": {
+      "version": "4.5.0",
+      "resolved": "https://registry.npm.taobao.org/lodash.clonedeep/download/lodash.clonedeep-4.5.0.tgz",
+      "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="
+    },
+    "node_modules/lodash.includes": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npm.taobao.org/lodash.includes/download/lodash.includes-4.3.0.tgz",
+      "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8="
+    },
+    "node_modules/lodash.isboolean": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npm.taobao.org/lodash.isboolean/download/lodash.isboolean-3.0.3.tgz",
+      "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY="
+    },
+    "node_modules/lodash.isinteger": {
+      "version": "4.0.4",
+      "resolved": "https://registry.npm.taobao.org/lodash.isinteger/download/lodash.isinteger-4.0.4.tgz",
+      "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M="
+    },
+    "node_modules/lodash.isnumber": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npm.taobao.org/lodash.isnumber/download/lodash.isnumber-3.0.3.tgz",
+      "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w="
+    },
+    "node_modules/lodash.isplainobject": {
+      "version": "4.0.6",
+      "resolved": "https://registry.npm.taobao.org/lodash.isplainobject/download/lodash.isplainobject-4.0.6.tgz",
+      "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs="
+    },
+    "node_modules/lodash.isstring": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npm.taobao.org/lodash.isstring/download/lodash.isstring-4.0.1.tgz",
+      "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE="
+    },
+    "node_modules/lodash.merge": {
+      "version": "4.6.2",
+      "resolved": "https://registry.npm.taobao.org/lodash.merge/download/lodash.merge-4.6.2.tgz",
+      "integrity": "sha1-VYqlO0O2YeGSWgr9+japoQhf5Xo="
+    },
+    "node_modules/lodash.once": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npm.taobao.org/lodash.once/download/lodash.once-4.1.1.tgz",
+      "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w="
+    },
+    "node_modules/lodash.set": {
+      "version": "4.3.2",
+      "resolved": "https://registry.npm.taobao.org/lodash.set/download/lodash.set-4.3.2.tgz",
+      "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM="
+    },
+    "node_modules/lodash.unset": {
+      "version": "4.5.2",
+      "resolved": "https://registry.npm.taobao.org/lodash.unset/download/lodash.unset-4.5.2.tgz",
+      "integrity": "sha1-Nw0dPoW3Kn4bDN8tJyEhMG8j5O0="
+    },
+    "node_modules/long": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npm.taobao.org/long/download/long-4.0.0.tgz",
+      "integrity": "sha1-mntxz7fTYaGU6lVSQckvdGjVvyg="
+    },
+    "node_modules/make-error": {
+      "version": "1.3.6",
+      "resolved": "https://registry.npm.taobao.org/make-error/download/make-error-1.3.6.tgz",
+      "integrity": "sha1-LrLjfqm2fEiR9oShOUeZr0hM96I="
+    },
+    "node_modules/mime-db": {
+      "version": "1.49.0",
+      "resolved": "https://registry.nlark.com/mime-db/download/mime-db-1.49.0.tgz",
+      "integrity": "sha1-89/eYMmenPO8lwHWh3ePU3ABy+0=",
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/mime-types": {
+      "version": "2.1.32",
+      "resolved": "https://registry.nlark.com/mime-types/download/mime-types-2.1.32.tgz",
+      "integrity": "sha1-HQDonn3n/gIAjbYQAdngKFJnD9U=",
+      "dependencies": {
+        "mime-db": "1.49.0"
+      },
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/ms": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&sync_timestamp=1607433912031&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz",
+      "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk="
+    },
+    "node_modules/oauth-sign": {
+      "version": "0.9.0",
+      "resolved": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz",
+      "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=",
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/performance-now": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz",
+      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+    },
+    "node_modules/protobufjs": {
+      "version": "6.8.8",
+      "resolved": "https://registry.nlark.com/protobufjs/download/protobufjs-6.8.8.tgz",
+      "integrity": "sha1-yLTxKC/XqQ5vWxCe0RyEr4KQjnw=",
+      "dependencies": {
+        "@protobufjs/aspromise": "^1.1.2",
+        "@protobufjs/base64": "^1.1.2",
+        "@protobufjs/codegen": "^2.0.4",
+        "@protobufjs/eventemitter": "^1.1.0",
+        "@protobufjs/fetch": "^1.1.0",
+        "@protobufjs/float": "^1.0.2",
+        "@protobufjs/inquire": "^1.1.0",
+        "@protobufjs/path": "^1.1.2",
+        "@protobufjs/pool": "^1.1.0",
+        "@protobufjs/utf8": "^1.1.0",
+        "@types/long": "^4.0.0",
+        "@types/node": "^10.1.0",
+        "long": "^4.0.0"
+      },
+      "bin": {
+        "pbjs": "bin/pbjs",
+        "pbts": "bin/pbts"
+      }
+    },
+    "node_modules/psl": {
+      "version": "1.8.0",
+      "resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz",
+      "integrity": "sha1-kyb4vPsBOtzABf3/BWrM4CDlHCQ="
+    },
+    "node_modules/punycode": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz",
+      "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=",
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/qs": {
+      "version": "6.5.2",
+      "resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz",
+      "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=",
+      "engines": {
+        "node": ">=0.6"
+      }
+    },
+    "node_modules/querystring": {
+      "version": "0.2.0",
+      "resolved": "https://registry.nlark.com/querystring/download/querystring-0.2.0.tgz?cache=0&sync_timestamp=1626179435543&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fquerystring%2Fdownload%2Fquerystring-0.2.0.tgz",
+      "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=",
+      "deprecated": "The",
+      "engines": {
+        "node": ">=0.4.x"
+      }
+    },
+    "node_modules/request": {
+      "version": "2.88.2",
+      "resolved": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz",
+      "integrity": "sha1-1zyRhzHLWofaBH4gcjQUb2ZNErM=",
+      "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142",
+      "dependencies": {
+        "aws-sign2": "~0.7.0",
+        "aws4": "^1.8.0",
+        "caseless": "~0.12.0",
+        "combined-stream": "~1.0.6",
+        "extend": "~3.0.2",
+        "forever-agent": "~0.6.1",
+        "form-data": "~2.3.2",
+        "har-validator": "~5.1.3",
+        "http-signature": "~1.2.0",
+        "is-typedarray": "~1.0.0",
+        "isstream": "~0.1.2",
+        "json-stringify-safe": "~5.0.1",
+        "mime-types": "~2.1.19",
+        "oauth-sign": "~0.9.0",
+        "performance-now": "^2.1.0",
+        "qs": "~6.5.2",
+        "safe-buffer": "^5.1.2",
+        "tough-cookie": "~2.5.0",
+        "tunnel-agent": "^0.6.0",
+        "uuid": "^3.3.2"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/request-promise": {
+      "version": "4.2.6",
+      "resolved": "https://registry.npm.taobao.org/request-promise/download/request-promise-4.2.6.tgz",
+      "integrity": "sha1-fn5blXhjDm9ZjjgTwPjrNCon8KI=",
+      "dependencies": {
+        "bluebird": "^3.5.0",
+        "request-promise-core": "1.1.4",
+        "stealthy-require": "^1.1.1",
+        "tough-cookie": "^2.3.3"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      },
+      "peerDependencies": {
+        "request": "^2.34"
+      }
+    },
+    "node_modules/request-promise-core": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npm.taobao.org/request-promise-core/download/request-promise-core-1.1.4.tgz",
+      "integrity": "sha1-Pu3UIjII1BmGe3jOgVFn0QWToi8=",
+      "dependencies": {
+        "lodash": "^4.17.19"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      },
+      "peerDependencies": {
+        "request": "^2.34"
+      }
+    },
+    "node_modules/retry": {
+      "version": "0.12.0",
+      "resolved": "https://registry.nlark.com/retry/download/retry-0.12.0.tgz?cache=0&sync_timestamp=1624261665760&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fretry%2Fdownload%2Fretry-0.12.0.tgz",
+      "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=",
+      "engines": {
+        "node": ">= 4"
+      }
+    },
+    "node_modules/safe-buffer": {
+      "version": "5.2.1",
+      "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.1.tgz",
+      "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY="
+    },
+    "node_modules/safer-buffer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz",
+      "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo="
+    },
+    "node_modules/sax": {
+      "version": "1.2.4",
+      "resolved": "https://registry.npm.taobao.org/sax/download/sax-1.2.4.tgz",
+      "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk="
+    },
+    "node_modules/semver": {
+      "version": "5.7.1",
+      "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1616463550093&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz",
+      "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=",
+      "bin": {
+        "semver": "bin/semver"
+      }
+    },
+    "node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz",
+      "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/source-map-support": {
+      "version": "0.5.19",
+      "resolved": "https://registry.npm.taobao.org/source-map-support/download/source-map-support-0.5.19.tgz",
+      "integrity": "sha1-qYti+G3K9PZzmWSMCFKRq56P7WE=",
+      "dependencies": {
+        "buffer-from": "^1.0.0",
+        "source-map": "^0.6.0"
+      }
+    },
+    "node_modules/sshpk": {
+      "version": "1.16.1",
+      "resolved": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz",
+      "integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=",
+      "dependencies": {
+        "asn1": "~0.2.3",
+        "assert-plus": "^1.0.0",
+        "bcrypt-pbkdf": "^1.0.0",
+        "dashdash": "^1.12.0",
+        "ecc-jsbn": "~0.1.1",
+        "getpass": "^0.1.1",
+        "jsbn": "~0.1.0",
+        "safer-buffer": "^2.0.2",
+        "tweetnacl": "~0.14.0"
+      },
+      "bin": {
+        "sshpk-conv": "bin/sshpk-conv",
+        "sshpk-sign": "bin/sshpk-sign",
+        "sshpk-verify": "bin/sshpk-verify"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/stealthy-require": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npm.taobao.org/stealthy-require/download/stealthy-require-1.1.1.tgz",
+      "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/tcb-admin-node": {
+      "version": "1.23.0",
+      "resolved": "https://registry.npm.taobao.org/tcb-admin-node/download/tcb-admin-node-1.23.0.tgz",
+      "integrity": "sha1-WISpMd6Ybbex4YwdhzjvZKRZN1g=",
+      "dependencies": {
+        "@cloudbase/database": "0.9.15",
+        "@cloudbase/signature-nodejs": "^1.0.0-beta.0",
+        "is-regex": "^1.0.4",
+        "jsonwebtoken": "^8.5.1",
+        "lodash.merge": "^4.6.1",
+        "request": "^2.87.0",
+        "xml2js": "^0.4.19"
+      },
+      "engines": {
+        "node": ">=8.6.0"
+      }
+    },
+    "node_modules/tcb-admin-node/node_modules/@cloudbase/database": {
+      "version": "0.9.15",
+      "resolved": "https://registry.nlark.com/@cloudbase/database/download/@cloudbase/database-0.9.15.tgz",
+      "integrity": "sha1-Jo6bMSC+bJkpTmZFvBhx24unDTE=",
+      "dependencies": {
+        "bson": "^4.0.2",
+        "lodash.clonedeep": "4.5.0",
+        "lodash.set": "4.3.2",
+        "lodash.unset": "4.5.2"
+      }
+    },
+    "node_modules/tough-cookie": {
+      "version": "2.5.0",
+      "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz",
+      "integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=",
+      "dependencies": {
+        "psl": "^1.1.28",
+        "punycode": "^2.1.1"
+      },
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/ts-node": {
+      "version": "8.10.2",
+      "resolved": "https://registry.nlark.com/ts-node/download/ts-node-8.10.2.tgz?cache=0&sync_timestamp=1625866648658&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fts-node%2Fdownload%2Fts-node-8.10.2.tgz",
+      "integrity": "sha1-7uA3ZGM7EjTd03+NuewQt17H+40=",
+      "dependencies": {
+        "arg": "^4.1.0",
+        "diff": "^4.0.1",
+        "make-error": "^1.1.1",
+        "source-map-support": "^0.5.17",
+        "yn": "3.1.1"
+      },
+      "bin": {
+        "ts-node": "dist/bin.js",
+        "ts-node-script": "dist/bin-script.js",
+        "ts-node-transpile-only": "dist/bin-transpile.js",
+        "ts-script": "dist/bin-script-deprecated.js"
+      },
+      "engines": {
+        "node": ">=6.0.0"
+      },
+      "peerDependencies": {
+        "typescript": ">=2.7"
+      }
+    },
+    "node_modules/tslib": {
+      "version": "1.14.1",
+      "resolved": "https://registry.nlark.com/tslib/download/tslib-1.14.1.tgz",
+      "integrity": "sha1-zy04vcNKE0vK8QkcQfZhni9nLQA="
+    },
+    "node_modules/tunnel-agent": {
+      "version": "0.6.0",
+      "resolved": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz",
+      "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
+      "dependencies": {
+        "safe-buffer": "^5.0.1"
+      },
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/tweetnacl": {
+      "version": "0.14.5",
+      "resolved": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz",
+      "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
+    },
+    "node_modules/typescript": {
+      "version": "4.3.5",
+      "resolved": "https://registry.nlark.com/typescript/download/typescript-4.3.5.tgz?cache=0&sync_timestamp=1627888610287&other_urls=https%3A%2F%2Fregistry.nlark.com%2Ftypescript%2Fdownload%2Ftypescript-4.3.5.tgz",
+      "integrity": "sha1-TRw3zBbok5c8RaBohrcRMjTxGfQ=",
+      "peer": true,
+      "bin": {
+        "tsc": "bin/tsc",
+        "tsserver": "bin/tsserver"
+      },
+      "engines": {
+        "node": ">=4.2.0"
+      }
+    },
+    "node_modules/uri-js": {
+      "version": "4.4.1",
+      "resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.4.1.tgz?cache=0&sync_timestamp=1610237756396&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Furi-js%2Fdownload%2Furi-js-4.4.1.tgz",
+      "integrity": "sha1-mxpSWVIlhZ5V9mnZKPiMbFfyp34=",
+      "dependencies": {
+        "punycode": "^2.1.0"
+      }
+    },
+    "node_modules/url": {
+      "version": "0.11.0",
+      "resolved": "https://registry.npm.taobao.org/url/download/url-0.11.0.tgz",
+      "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=",
+      "dependencies": {
+        "punycode": "1.3.2",
+        "querystring": "0.2.0"
+      }
+    },
+    "node_modules/url/node_modules/punycode": {
+      "version": "1.3.2",
+      "resolved": "https://registry.npm.taobao.org/punycode/download/punycode-1.3.2.tgz",
+      "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0="
+    },
+    "node_modules/uuid": {
+      "version": "3.4.0",
+      "resolved": "https://registry.nlark.com/uuid/download/uuid-3.4.0.tgz?cache=0&sync_timestamp=1622213086354&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fuuid%2Fdownload%2Fuuid-3.4.0.tgz",
+      "integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4=",
+      "bin": {
+        "uuid": "bin/uuid"
+      }
+    },
+    "node_modules/verror": {
+      "version": "1.10.0",
+      "resolved": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz",
+      "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
+      "engines": [
+        "node >=0.6.0"
+      ],
+      "dependencies": {
+        "assert-plus": "^1.0.0",
+        "core-util-is": "1.0.2",
+        "extsprintf": "^1.2.0"
+      }
+    },
+    "node_modules/wx-server-sdk": {
+      "version": "2.4.0",
+      "resolved": "https://registry.nlark.com/wx-server-sdk/download/wx-server-sdk-2.4.0.tgz",
+      "integrity": "sha1-XhRDK6DvHJVIXPcsk1lEbqs5K94=",
+      "dependencies": {
+        "@cloudbase/node-sdk": "2.4.7",
+        "protobufjs": "6.8.8",
+        "tcb-admin-node": "latest",
+        "tslib": "^1.9.3"
+      }
+    },
+    "node_modules/xml2js": {
+      "version": "0.4.23",
+      "resolved": "https://registry.npm.taobao.org/xml2js/download/xml2js-0.4.23.tgz",
+      "integrity": "sha1-oMaVFnUkIesqx1juTUzPWIQ+rGY=",
+      "dependencies": {
+        "sax": ">=0.6.0",
+        "xmlbuilder": "~11.0.0"
+      },
+      "engines": {
+        "node": ">=4.0.0"
+      }
+    },
+    "node_modules/xmlbuilder": {
+      "version": "11.0.1",
+      "resolved": "https://registry.npm.taobao.org/xmlbuilder/download/xmlbuilder-11.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fxmlbuilder%2Fdownload%2Fxmlbuilder-11.0.1.tgz",
+      "integrity": "sha1-vpuuHIoEbnazESdyY0fQrXACvrM=",
+      "engines": {
+        "node": ">=4.0"
+      }
+    },
+    "node_modules/yn": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npm.taobao.org/yn/download/yn-3.1.1.tgz",
+      "integrity": "sha1-HodAGgnXZ8HV6rJqbkwYUYLS61A=",
+      "engines": {
+        "node": ">=6"
+      }
+    }
+  }
+}

+ 9 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/.editorconfig

@@ -0,0 +1,9 @@
+root = true
+
+[!{node_modules}/**]
+end_of_line = lf
+charset = utf-8
+
+[{*.js,*.ts}]
+indent_style = space
+indent_size = 2

+ 1 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/.eslintignore

@@ -0,0 +1 @@
+dist/

+ 43 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/.eslintrc

@@ -0,0 +1,43 @@
+{
+  "extends": [
+    "prettier"
+  ],
+  "plugins": [
+    "typescript"
+  ],
+  "rules": {
+    "indent": [
+      "error",
+      2,
+      {
+          "SwitchCase": 1,
+          "flatTernaryExpressions": true
+      }
+    ],
+    "no-unused-vars": "warn",
+    "typescript/no-unused-vars": "warn",
+    "semi": [
+      "error",
+      "never"
+    ],
+    "quotes": [
+      "error",
+      "single",
+      {
+        "avoidEscape": true
+      }
+    ]
+  },
+  "env": {
+    "es6": true,
+    "node": true
+  },
+  "parser": "typescript-eslint-parser",
+  "parserOptions": {
+    "ecmaVersion": 2018,
+    "sourceType": "module",
+    "ecmaFeatures": {
+      "modules": true
+    }
+  }
+}

+ 29 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/.prettierrc.js

@@ -0,0 +1,29 @@
+module.exports = {
+  // 一行最多 100 字符
+  printWidth: 100,
+  // 使用 2 个空格缩进
+  tabWidth: 2,
+  // 不使用缩进符,而使用空格
+  useTabs: false,
+  // 行尾无分号
+  semi: false,
+  // 使用单引号
+  singleQuote: true,
+  // 对象的 key 仅在必要时用引号
+  quoteProps: 'as-needed',
+  // 末尾不需要逗号
+  trailingComma: 'none',
+  // 大括号内的首尾需要空格
+  bracketSpacing: true,
+  // 每个文件格式化的范围是文件的全部内容
+  rangeStart: 0,
+  rangeEnd: Infinity,
+  // 不需要写文件开头的 @prettier
+  requirePragma: false,
+  // 不需要自动在文件开头插入 @prettier
+  insertPragma: false,
+  // 使用默认的折行标准
+  proseWrap: 'preserve',
+  // 换行符使用 lf
+  endOfLine: 'lf'
+}

+ 97 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/README.md

@@ -0,0 +1,97 @@
+# @cloudbase/database
+
+[![NPM Version](https://img.shields.io/npm/v/@cloudbase/database.svg?style=flat)](https://www.npmjs.com/package/@cloudbase/database)
+[![](https://img.shields.io/npm/dt/@cloudbase/database.svg)](https://www.npmjs.com/package/@cloudbase/database)
+
+## 介绍
+
+提供 TCB JS SDK 操作数据库的接口。
+
+## 安装
+
+```
+yarn add @cloudbase/database
+```
+
+## 使用
+
+使用 `@cloudbase/database` 时,需要提供发送请求的类 `reqClass`。 
+
+```js
+// index.js
+
+const database = require('@cloudbase/database/').Db;
+const Request = require('./request');
+
+class Tcb {
+  ...
+  database(dbConfig) {
+    database.reqClass = Request;
+    return new database(dbConfig);
+  }
+}
+```
+
+实现 `Request` 类,需要提供异步的 `send` 方法。
+
+```js
+// request.js
+
+// 进一步处理,鉴权等...
+const requestHandler = require('requestHandler');
+
+class Request {
+  constructor(config) {
+    this.config = config;
+  }
+
+  async send(action, data) {
+    const params = Object.assign({}, data, {
+      action
+    });
+
+    const slowQueryWarning = setTimeout(() => {
+      console.warn(
+        'Database operation is longer than 3s. Please check query performance and your network environment.'
+      );
+    }, 3000);
+
+    try {
+      return await requestHandler({
+        timeout: this.config.timeout,
+        config: this.config.config,
+        params,
+        method: 'post',
+        headers: {
+          'content-type': 'application/json'
+        }
+      });
+    } finally {
+      clearTimeout(slowQueryWarning);
+    }
+  }
+}
+
+module.exports = Request;
+```
+
+请求数据样例
+
+```json
+{
+  "url": "https://tcb-admin.tencentcloudapi.com/admin?eventId=1554896261428_92044",
+  "method": "post",
+  "timeout": 15000,
+  "headers": { "user-agent": "tcb-admin-sdk/1.4.6", "content-type": "application/json" },
+  "body": {
+    "collectionName": "coll-1",
+    "action": "database.addCollection",
+    "envName": "base-830cab",
+    "timestamp": 1554896261428,
+    "eventId": "1554896261428_92044",
+    "authorization": "q-sign-algorithm=sha1&q-ak=xxx&q-sign-time=1554896260;1554897160&q-key-time=1554896260;1554897160&q-header-list=content-type;user-agent&q-url-param-list=action;collectionname;envname;eventid;timestamp&q-signature=xxxxx",
+    "sdk_version": "1.4.6"
+  },
+  "json": true
+}
+```

+ 29 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/aggregate.d.ts

@@ -0,0 +1,29 @@
+export default class Aggregation {
+    _db: any;
+    _request: any;
+    _stages: any[];
+    _collectionName: string;
+    constructor(db?: any, collectionName?: any);
+    end(): Promise<any>;
+    unwrap(): any[];
+    done(): {
+        [x: number]: any;
+    }[];
+    _pipe(stage: any, param: any): this;
+    addFields(param: any): this;
+    bucket(param: any): this;
+    bucketAuto(param: any): this;
+    count(param: any): this;
+    geoNear(param: any): this;
+    group(param: any): this;
+    limit(param: any): this;
+    match(param: any): this;
+    project(param: any): this;
+    lookup(param: any): this;
+    replaceRoot(param: any): this;
+    sample(param: any): this;
+    skip(param: any): this;
+    sort(param: any): this;
+    sortByCount(param: any): this;
+    unwind(param: any): this;
+}

+ 109 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/aggregate.js

@@ -0,0 +1,109 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const index_1 = require("./index");
+const bson_1 = require("bson");
+const query_1 = require("./serializer/query");
+const utils_1 = require("./utils/utils");
+const type_1 = require("./utils/type");
+class Aggregation {
+    constructor(db, collectionName) {
+        this._stages = [];
+        if (db && collectionName) {
+            this._db = db;
+            this._request = new index_1.Db.reqClass(this._db.config);
+            this._collectionName = collectionName;
+        }
+    }
+    async end() {
+        if (!this._collectionName || !this._db) {
+            throw new Error('Aggregation pipeline cannot send request');
+        }
+        const result = await this._request.send('database.aggregateDocuments', {
+            collectionName: this._collectionName,
+            stages: this._stages
+        });
+        if (result && result.data && result.data.list) {
+            return {
+                requestId: result.requestId,
+                data: result.data.list.map(bson_1.EJSON.parse)
+            };
+        }
+        return result;
+    }
+    unwrap() {
+        return this._stages;
+    }
+    done() {
+        return this._stages.map(({ stageKey, stageValue }) => {
+            return {
+                [stageKey]: JSON.parse(stageValue)
+            };
+        });
+    }
+    _pipe(stage, param) {
+        let transformParam = '';
+        if (type_1.getType(param) === 'object') {
+            transformParam = utils_1.stringifyByEJSON(param);
+        }
+        else {
+            transformParam = JSON.stringify(param);
+        }
+        this._stages.push({
+            stageKey: `$${stage}`,
+            stageValue: transformParam
+        });
+        return this;
+    }
+    addFields(param) {
+        return this._pipe('addFields', param);
+    }
+    bucket(param) {
+        return this._pipe('bucket', param);
+    }
+    bucketAuto(param) {
+        return this._pipe('bucketAuto', param);
+    }
+    count(param) {
+        return this._pipe('count', param);
+    }
+    geoNear(param) {
+        if (param.query) {
+            param.query = query_1.QuerySerializer.encode(param.query);
+        }
+        return this._pipe('geoNear', param);
+    }
+    group(param) {
+        return this._pipe('group', param);
+    }
+    limit(param) {
+        return this._pipe('limit', param);
+    }
+    match(param) {
+        return this._pipe('match', query_1.QuerySerializer.encode(param));
+    }
+    project(param) {
+        return this._pipe('project', param);
+    }
+    lookup(param) {
+        return this._pipe('lookup', param);
+    }
+    replaceRoot(param) {
+        return this._pipe('replaceRoot', param);
+    }
+    sample(param) {
+        return this._pipe('sample', param);
+    }
+    skip(param) {
+        return this._pipe('skip', param);
+    }
+    sort(param) {
+        return this._pipe('sort', param);
+    }
+    sortByCount(param) {
+        return this._pipe('sortByCount', param);
+    }
+    unwind(param) {
+        return this._pipe('unwind', param);
+    }
+}
+exports.default = Aggregation;

+ 17 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/collection.d.ts

@@ -0,0 +1,17 @@
+import { DocumentReference } from './document';
+import { Query, QueryOption, UpdateOption } from './query';
+import Aggregation from './aggregate';
+export declare class CollectionReference extends Query {
+    protected _transactionId: string;
+    readonly name: string;
+    doc(docID: string | number): DocumentReference;
+    add(data: any): Promise<{
+        ids?: string[];
+        id?: string;
+        inserted?: number;
+        ok?: number;
+        requestId: string;
+    }>;
+    aggregate(): Aggregation;
+    options(apiOptions: QueryOption | UpdateOption): CollectionReference;
+}

+ 72 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/collection.js

@@ -0,0 +1,72 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const document_1 = require("./document");
+const query_1 = require("./query");
+const aggregate_1 = require("./aggregate");
+const datatype_1 = require("./serializer/datatype");
+const utils_1 = require("./utils/utils");
+const validate_1 = require("./validate");
+const type_1 = require("./utils/type");
+class CollectionReference extends query_1.Query {
+    constructor(db, coll, apiOptions, transactionId) {
+        super(db, coll, '', apiOptions, transactionId);
+        if (transactionId) {
+            this._transactionId = transactionId;
+        }
+    }
+    get name() {
+        return this._coll;
+    }
+    doc(docID) {
+        if (typeof docID !== 'string' && typeof docID !== 'number') {
+            throw new Error('docId必须为字符串或数字');
+        }
+        return new document_1.DocumentReference(this._db, this._coll, this._apiOptions, docID, this._transactionId);
+    }
+    async add(data) {
+        let transformData = data;
+        if (!type_1.isArray(data)) {
+            transformData = [data];
+        }
+        transformData = transformData.map(item => {
+            return utils_1.stringifyByEJSON(datatype_1.serialize(item));
+        });
+        let params = {
+            collectionName: this._coll,
+            data: transformData
+        };
+        if (this._transactionId) {
+            params.transactionId = this._transactionId;
+        }
+        const res = await this._request.send('database.insertDocument', params, utils_1.getReqOpts(this._apiOptions));
+        if (res.code) {
+            return res;
+        }
+        if (!type_1.isArray(data)) {
+            if (this._transactionId) {
+                return {
+                    inserted: 1,
+                    ok: 1,
+                    id: res.data.insertedIds[0],
+                    requestId: res.requestId
+                };
+            }
+            return {
+                id: res.data.insertedIds[0],
+                requestId: res.requestId
+            };
+        }
+        return {
+            ids: res.data.insertedIds,
+            requestId: res.requestId
+        };
+    }
+    aggregate() {
+        return new aggregate_1.default(this._db, this._coll);
+    }
+    options(apiOptions) {
+        validate_1.Validate.isValidOptions(apiOptions);
+        return new CollectionReference(this._db, this._coll, apiOptions, this._transactionId);
+    }
+}
+exports.CollectionReference = CollectionReference;

+ 175 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/command.d.ts

@@ -0,0 +1,175 @@
+import { QueryCommand } from './commands/query';
+import { LogicCommand } from './commands/logic';
+import { UpdateCommand } from './commands/update';
+import Aggregation from './aggregate';
+export declare type IQueryCondition = Record<string, any> | LogicCommand;
+export declare const Command: {
+    eq(val: any): QueryCommand;
+    neq(val: any): QueryCommand;
+    lt(val: any): QueryCommand;
+    lte(val: any): QueryCommand;
+    gt(val: any): QueryCommand;
+    gte(val: any): QueryCommand;
+    in(val: any): QueryCommand;
+    nin(val: any): QueryCommand;
+    all(val: any): QueryCommand;
+    elemMatch(val: any): QueryCommand;
+    exists(val: boolean): QueryCommand;
+    size(val: number): QueryCommand;
+    mod(val: number[]): QueryCommand;
+    geoNear(val: any): QueryCommand;
+    geoWithin(val: any): QueryCommand;
+    geoIntersects(val: any): QueryCommand;
+    and(...__expressions__: import("./serializer/datatype").IQueryCondition[]): LogicCommand;
+    nor(...__expressions__: import("./serializer/datatype").IQueryCondition[]): LogicCommand;
+    or(...__expressions__: import("./serializer/datatype").IQueryCondition[]): LogicCommand;
+    not(...__expressions__: import("./serializer/datatype").IQueryCondition[]): LogicCommand;
+    set(val: any): UpdateCommand;
+    remove(): UpdateCommand;
+    inc(val: number): UpdateCommand;
+    mul(val: number): UpdateCommand;
+    push(...args: any[]): UpdateCommand;
+    pull(values: any): UpdateCommand;
+    pullAll(values: any): UpdateCommand;
+    pop(): UpdateCommand;
+    shift(): UpdateCommand;
+    unshift(...__values__: any[]): UpdateCommand;
+    addToSet(values: any): UpdateCommand;
+    rename(values: any): UpdateCommand;
+    bit(values: any): UpdateCommand;
+    max(values: any): UpdateCommand;
+    min(values: any): UpdateCommand;
+    expr(values: AggregationOperator): {
+        $expr: AggregationOperator;
+    };
+    jsonSchema(schema: any): {
+        $jsonSchema: any;
+    };
+    text(values: string | {
+        search: string;
+        language?: string;
+        caseSensitive?: boolean;
+        diacriticSensitive: boolean;
+    }): {
+        $search: {
+            (regexp: string | RegExp): number;
+            (searcher: {
+                [Symbol.search](string: string): number;
+            }): number;
+        };
+        $language?: undefined;
+        $caseSensitive?: undefined;
+        $diacriticSensitive?: undefined;
+    } | {
+        $search: string;
+        $language: string;
+        $caseSensitive: boolean;
+        $diacriticSensitive: boolean;
+    };
+    aggregate: {
+        pipeline(): Aggregation;
+        abs: (param: any) => AggregationOperator;
+        add: (param: any) => AggregationOperator;
+        ceil: (param: any) => AggregationOperator;
+        divide: (param: any) => AggregationOperator;
+        exp: (param: any) => AggregationOperator;
+        floor: (param: any) => AggregationOperator;
+        ln: (param: any) => AggregationOperator;
+        log: (param: any) => AggregationOperator;
+        log10: (param: any) => AggregationOperator;
+        mod: (param: any) => AggregationOperator;
+        multiply: (param: any) => AggregationOperator;
+        pow: (param: any) => AggregationOperator;
+        sqrt: (param: any) => AggregationOperator;
+        subtract: (param: any) => AggregationOperator;
+        trunc: (param: any) => AggregationOperator;
+        arrayElemAt: (param: any) => AggregationOperator;
+        arrayToObject: (param: any) => AggregationOperator;
+        concatArrays: (param: any) => AggregationOperator;
+        filter: (param: any) => AggregationOperator;
+        in: (param: any) => AggregationOperator;
+        indexOfArray: (param: any) => AggregationOperator;
+        isArray: (param: any) => AggregationOperator;
+        map: (param: any) => AggregationOperator;
+        range: (param: any) => AggregationOperator;
+        reduce: (param: any) => AggregationOperator;
+        reverseArray: (param: any) => AggregationOperator;
+        size: (param: any) => AggregationOperator;
+        slice: (param: any) => AggregationOperator;
+        zip: (param: any) => AggregationOperator;
+        and: (param: any) => AggregationOperator;
+        not: (param: any) => AggregationOperator;
+        or: (param: any) => AggregationOperator;
+        cmp: (param: any) => AggregationOperator;
+        eq: (param: any) => AggregationOperator;
+        gt: (param: any) => AggregationOperator;
+        gte: (param: any) => AggregationOperator;
+        lt: (param: any) => AggregationOperator;
+        lte: (param: any) => AggregationOperator;
+        neq: (param: any) => AggregationOperator;
+        cond: (param: any) => AggregationOperator;
+        ifNull: (param: any) => AggregationOperator;
+        switch: (param: any) => AggregationOperator;
+        dateFromParts: (param: any) => AggregationOperator;
+        dateFromString: (param: any) => AggregationOperator;
+        dayOfMonth: (param: any) => AggregationOperator;
+        dayOfWeek: (param: any) => AggregationOperator;
+        dayOfYear: (param: any) => AggregationOperator;
+        isoDayOfWeek: (param: any) => AggregationOperator;
+        isoWeek: (param: any) => AggregationOperator;
+        isoWeekYear: (param: any) => AggregationOperator;
+        millisecond: (param: any) => AggregationOperator;
+        minute: (param: any) => AggregationOperator;
+        month: (param: any) => AggregationOperator;
+        second: (param: any) => AggregationOperator;
+        hour: (param: any) => AggregationOperator;
+        week: (param: any) => AggregationOperator;
+        year: (param: any) => AggregationOperator;
+        literal: (param: any) => AggregationOperator;
+        mergeObjects: (param: any) => AggregationOperator;
+        objectToArray: (param: any) => AggregationOperator;
+        allElementsTrue: (param: any) => AggregationOperator;
+        anyElementTrue: (param: any) => AggregationOperator;
+        setDifference: (param: any) => AggregationOperator;
+        setEquals: (param: any) => AggregationOperator;
+        setIntersection: (param: any) => AggregationOperator;
+        setIsSubset: (param: any) => AggregationOperator;
+        setUnion: (param: any) => AggregationOperator;
+        concat: (param: any) => AggregationOperator;
+        dateToString: (param: any) => AggregationOperator;
+        indexOfBytes: (param: any) => AggregationOperator;
+        indexOfCP: (param: any) => AggregationOperator;
+        split: (param: any) => AggregationOperator;
+        strLenBytes: (param: any) => AggregationOperator;
+        strLenCP: (param: any) => AggregationOperator;
+        strcasecmp: (param: any) => AggregationOperator;
+        substr: (param: any) => AggregationOperator;
+        substrBytes: (param: any) => AggregationOperator;
+        substrCP: (param: any) => AggregationOperator;
+        toLower: (param: any) => AggregationOperator;
+        toUpper: (param: any) => AggregationOperator;
+        meta: (param: any) => AggregationOperator;
+        addToSet: (param: any) => AggregationOperator;
+        avg: (param: any) => AggregationOperator;
+        first: (param: any) => AggregationOperator;
+        last: (param: any) => AggregationOperator;
+        max: (param: any) => AggregationOperator;
+        min: (param: any) => AggregationOperator;
+        push: (param: any) => AggregationOperator;
+        stdDevPop: (param: any) => AggregationOperator;
+        stdDevSamp: (param: any) => AggregationOperator;
+        sum: (param: any) => AggregationOperator;
+        let: (param: any) => AggregationOperator;
+    };
+    project: {
+        slice: (param: any) => ProjectionOperator;
+        elemMatch: (param: any) => ProjectionOperator;
+    };
+};
+export declare class AggregationOperator {
+    constructor(name: any, param: any);
+}
+export declare class ProjectionOperator {
+    constructor(name: any, param: any);
+}
+export default Command;

+ 281 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/command.js

@@ -0,0 +1,281 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const query_1 = require("./commands/query");
+const logic_1 = require("./commands/logic");
+const update_1 = require("./commands/update");
+const type_1 = require("./utils/type");
+const aggregate_1 = require("./aggregate");
+exports.Command = {
+    eq(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.EQ, [val]);
+    },
+    neq(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.NEQ, [val]);
+    },
+    lt(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.LT, [val]);
+    },
+    lte(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.LTE, [val]);
+    },
+    gt(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.GT, [val]);
+    },
+    gte(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.GTE, [val]);
+    },
+    in(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.IN, val);
+    },
+    nin(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.NIN, val);
+    },
+    all(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.ALL, val);
+    },
+    elemMatch(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.ELEM_MATCH, [val]);
+    },
+    exists(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.EXISTS, [val]);
+    },
+    size(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.SIZE, [val]);
+    },
+    mod(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.MOD, [val]);
+    },
+    geoNear(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.GEO_NEAR, [val]);
+    },
+    geoWithin(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.GEO_WITHIN, [val]);
+    },
+    geoIntersects(val) {
+        return new query_1.QueryCommand(query_1.QUERY_COMMANDS_LITERAL.GEO_INTERSECTS, [val]);
+    },
+    and(...__expressions__) {
+        const expressions = type_1.isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
+        return new logic_1.LogicCommand(logic_1.LOGIC_COMMANDS_LITERAL.AND, expressions);
+    },
+    nor(...__expressions__) {
+        const expressions = type_1.isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
+        return new logic_1.LogicCommand(logic_1.LOGIC_COMMANDS_LITERAL.NOR, expressions);
+    },
+    or(...__expressions__) {
+        const expressions = type_1.isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
+        return new logic_1.LogicCommand(logic_1.LOGIC_COMMANDS_LITERAL.OR, expressions);
+    },
+    not(...__expressions__) {
+        const expressions = type_1.isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
+        return new logic_1.LogicCommand(logic_1.LOGIC_COMMANDS_LITERAL.NOT, expressions);
+    },
+    set(val) {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.SET, [val]);
+    },
+    remove() {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.REMOVE, []);
+    },
+    inc(val) {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.INC, [val]);
+    },
+    mul(val) {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.MUL, [val]);
+    },
+    push(...args) {
+        let values;
+        if (type_1.isObject(args[0]) && args[0].hasOwnProperty('each')) {
+            values = {};
+            const options = args[0];
+            if (options.each !== undefined) {
+                values['$each'] = options.each;
+            }
+            if (options.position !== undefined) {
+                values['$position'] = options.position;
+            }
+            if (options.sort !== undefined) {
+                values['$sort'] = options.sort;
+            }
+            if (options.slice !== undefined) {
+                values['$slice'] = options.slice;
+            }
+        }
+        else if (type_1.isArray(args[0])) {
+            values = args[0];
+        }
+        else {
+            values = Array.from(args);
+        }
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.PUSH, values);
+    },
+    pull(values) {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.PULL, values);
+    },
+    pullAll(values) {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.PULL_ALL, values);
+    },
+    pop() {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.POP, []);
+    },
+    shift() {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.SHIFT, []);
+    },
+    unshift(...__values__) {
+        const values = type_1.isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.UNSHIFT, values);
+    },
+    addToSet(values) {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.ADD_TO_SET, values);
+    },
+    rename(values) {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.RENAME, [values]);
+    },
+    bit(values) {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.BIT, [values]);
+    },
+    max(values) {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.MAX, [values]);
+    },
+    min(values) {
+        return new update_1.UpdateCommand(update_1.UPDATE_COMMANDS_LITERAL.MIN, [values]);
+    },
+    expr(values) {
+        return {
+            $expr: values
+        };
+    },
+    jsonSchema(schema) {
+        return {
+            $jsonSchema: schema
+        };
+    },
+    text(values) {
+        if (type_1.isString(values)) {
+            return {
+                $search: values.search
+            };
+        }
+        else {
+            return {
+                $search: values.search,
+                $language: values.language,
+                $caseSensitive: values.caseSensitive,
+                $diacriticSensitive: values.diacriticSensitive
+            };
+        }
+    },
+    aggregate: {
+        pipeline() {
+            return new aggregate_1.default();
+        },
+        abs: param => new AggregationOperator('abs', param),
+        add: param => new AggregationOperator('add', param),
+        ceil: param => new AggregationOperator('ceil', param),
+        divide: param => new AggregationOperator('divide', param),
+        exp: param => new AggregationOperator('exp', param),
+        floor: param => new AggregationOperator('floor', param),
+        ln: param => new AggregationOperator('ln', param),
+        log: param => new AggregationOperator('log', param),
+        log10: param => new AggregationOperator('log10', param),
+        mod: param => new AggregationOperator('mod', param),
+        multiply: param => new AggregationOperator('multiply', param),
+        pow: param => new AggregationOperator('pow', param),
+        sqrt: param => new AggregationOperator('sqrt', param),
+        subtract: param => new AggregationOperator('subtract', param),
+        trunc: param => new AggregationOperator('trunc', param),
+        arrayElemAt: param => new AggregationOperator('arrayElemAt', param),
+        arrayToObject: param => new AggregationOperator('arrayToObject', param),
+        concatArrays: param => new AggregationOperator('concatArrays', param),
+        filter: param => new AggregationOperator('filter', param),
+        in: param => new AggregationOperator('in', param),
+        indexOfArray: param => new AggregationOperator('indexOfArray', param),
+        isArray: param => new AggregationOperator('isArray', param),
+        map: param => new AggregationOperator('map', param),
+        range: param => new AggregationOperator('range', param),
+        reduce: param => new AggregationOperator('reduce', param),
+        reverseArray: param => new AggregationOperator('reverseArray', param),
+        size: param => new AggregationOperator('size', param),
+        slice: param => new AggregationOperator('slice', param),
+        zip: param => new AggregationOperator('zip', param),
+        and: param => new AggregationOperator('and', param),
+        not: param => new AggregationOperator('not', param),
+        or: param => new AggregationOperator('or', param),
+        cmp: param => new AggregationOperator('cmp', param),
+        eq: param => new AggregationOperator('eq', param),
+        gt: param => new AggregationOperator('gt', param),
+        gte: param => new AggregationOperator('gte', param),
+        lt: param => new AggregationOperator('lt', param),
+        lte: param => new AggregationOperator('lte', param),
+        neq: param => new AggregationOperator('ne', param),
+        cond: param => new AggregationOperator('cond', param),
+        ifNull: param => new AggregationOperator('ifNull', param),
+        switch: param => new AggregationOperator('switch', param),
+        dateFromParts: param => new AggregationOperator('dateFromParts', param),
+        dateFromString: param => new AggregationOperator('dateFromString', param),
+        dayOfMonth: param => new AggregationOperator('dayOfMonth', param),
+        dayOfWeek: param => new AggregationOperator('dayOfWeek', param),
+        dayOfYear: param => new AggregationOperator('dayOfYear', param),
+        isoDayOfWeek: param => new AggregationOperator('isoDayOfWeek', param),
+        isoWeek: param => new AggregationOperator('isoWeek', param),
+        isoWeekYear: param => new AggregationOperator('isoWeekYear', param),
+        millisecond: param => new AggregationOperator('millisecond', param),
+        minute: param => new AggregationOperator('minute', param),
+        month: param => new AggregationOperator('month', param),
+        second: param => new AggregationOperator('second', param),
+        hour: param => new AggregationOperator('hour', param),
+        week: param => new AggregationOperator('week', param),
+        year: param => new AggregationOperator('year', param),
+        literal: param => new AggregationOperator('literal', param),
+        mergeObjects: param => new AggregationOperator('mergeObjects', param),
+        objectToArray: param => new AggregationOperator('objectToArray', param),
+        allElementsTrue: param => new AggregationOperator('allElementsTrue', param),
+        anyElementTrue: param => new AggregationOperator('anyElementTrue', param),
+        setDifference: param => new AggregationOperator('setDifference', param),
+        setEquals: param => new AggregationOperator('setEquals', param),
+        setIntersection: param => new AggregationOperator('setIntersection', param),
+        setIsSubset: param => new AggregationOperator('setIsSubset', param),
+        setUnion: param => new AggregationOperator('setUnion', param),
+        concat: param => new AggregationOperator('concat', param),
+        dateToString: param => new AggregationOperator('dateToString', param),
+        indexOfBytes: param => new AggregationOperator('indexOfBytes', param),
+        indexOfCP: param => new AggregationOperator('indexOfCP', param),
+        split: param => new AggregationOperator('split', param),
+        strLenBytes: param => new AggregationOperator('strLenBytes', param),
+        strLenCP: param => new AggregationOperator('strLenCP', param),
+        strcasecmp: param => new AggregationOperator('strcasecmp', param),
+        substr: param => new AggregationOperator('substr', param),
+        substrBytes: param => new AggregationOperator('substrBytes', param),
+        substrCP: param => new AggregationOperator('substrCP', param),
+        toLower: param => new AggregationOperator('toLower', param),
+        toUpper: param => new AggregationOperator('toUpper', param),
+        meta: param => new AggregationOperator('meta', param),
+        addToSet: param => new AggregationOperator('addToSet', param),
+        avg: param => new AggregationOperator('avg', param),
+        first: param => new AggregationOperator('first', param),
+        last: param => new AggregationOperator('last', param),
+        max: param => new AggregationOperator('max', param),
+        min: param => new AggregationOperator('min', param),
+        push: param => new AggregationOperator('push', param),
+        stdDevPop: param => new AggregationOperator('stdDevPop', param),
+        stdDevSamp: param => new AggregationOperator('stdDevSamp', param),
+        sum: param => new AggregationOperator('sum', param),
+        let: param => new AggregationOperator('let', param)
+    },
+    project: {
+        slice: param => new ProjectionOperator('slice', param),
+        elemMatch: param => new ProjectionOperator('elemMatch', param)
+    }
+};
+class AggregationOperator {
+    constructor(name, param) {
+        this['$' + name] = param;
+    }
+}
+exports.AggregationOperator = AggregationOperator;
+class ProjectionOperator {
+    constructor(name, param) {
+        this['$' + name] = param;
+    }
+}
+exports.ProjectionOperator = ProjectionOperator;
+exports.default = exports.Command;

+ 24 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/logic.d.ts

@@ -0,0 +1,24 @@
+import { InternalSymbol } from '../helper/symbol';
+export declare const AND = "and";
+export declare const OR = "or";
+export declare const NOT = "not";
+export declare const NOR = "nor";
+export declare enum LOGIC_COMMANDS_LITERAL {
+    AND = "and",
+    OR = "or",
+    NOT = "not",
+    NOR = "nor"
+}
+export declare class LogicCommand {
+    fieldName: string | InternalSymbol;
+    operator: LOGIC_COMMANDS_LITERAL | string;
+    operands: any[];
+    _internalType: InternalSymbol;
+    constructor(operator: LOGIC_COMMANDS_LITERAL | string, operands: any, fieldName?: string | InternalSymbol);
+    _setFieldName(fieldName: string): LogicCommand;
+    and(...__expressions__: LogicCommand[]): LogicCommand;
+    or(...__expressions__: LogicCommand[]): LogicCommand;
+}
+export declare function isLogicCommand(object: any): object is LogicCommand;
+export declare function isKnownLogicCommand(object: any): object is LogicCommand;
+export default LogicCommand;

+ 79 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/logic.js

@@ -0,0 +1,79 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const symbol_1 = require("../helper/symbol");
+const query_1 = require("./query");
+exports.AND = 'and';
+exports.OR = 'or';
+exports.NOT = 'not';
+exports.NOR = 'nor';
+var LOGIC_COMMANDS_LITERAL;
+(function (LOGIC_COMMANDS_LITERAL) {
+    LOGIC_COMMANDS_LITERAL["AND"] = "and";
+    LOGIC_COMMANDS_LITERAL["OR"] = "or";
+    LOGIC_COMMANDS_LITERAL["NOT"] = "not";
+    LOGIC_COMMANDS_LITERAL["NOR"] = "nor";
+})(LOGIC_COMMANDS_LITERAL = exports.LOGIC_COMMANDS_LITERAL || (exports.LOGIC_COMMANDS_LITERAL = {}));
+class LogicCommand {
+    constructor(operator, operands, fieldName) {
+        this._internalType = symbol_1.SYMBOL_LOGIC_COMMAND;
+        Object.defineProperties(this, {
+            _internalType: {
+                enumerable: false,
+                configurable: false,
+            },
+        });
+        this.operator = operator;
+        this.operands = operands;
+        this.fieldName = fieldName || symbol_1.SYMBOL_UNSET_FIELD_NAME;
+        if (this.fieldName !== symbol_1.SYMBOL_UNSET_FIELD_NAME) {
+            if (Array.isArray(operands)) {
+                operands = operands.slice();
+                this.operands = operands;
+                for (let i = 0, len = operands.length; i < len; i++) {
+                    const query = operands[i];
+                    if (isLogicCommand(query) || query_1.isQueryCommand(query)) {
+                        operands[i] = query._setFieldName(this.fieldName);
+                    }
+                }
+            }
+            else {
+                const query = operands;
+                if (isLogicCommand(query) || query_1.isQueryCommand(query)) {
+                    operands = query._setFieldName(this.fieldName);
+                }
+            }
+        }
+    }
+    _setFieldName(fieldName) {
+        const operands = this.operands.map(operand => {
+            if (operand instanceof LogicCommand) {
+                return operand._setFieldName(fieldName);
+            }
+            else {
+                return operand;
+            }
+        });
+        const command = new LogicCommand(this.operator, operands, fieldName);
+        return command;
+    }
+    and(...__expressions__) {
+        const expressions = Array.isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
+        expressions.unshift(this);
+        return new LogicCommand(LOGIC_COMMANDS_LITERAL.AND, expressions, this.fieldName);
+    }
+    or(...__expressions__) {
+        const expressions = Array.isArray(arguments[0]) ? arguments[0] : Array.from(arguments);
+        expressions.unshift(this);
+        return new LogicCommand(LOGIC_COMMANDS_LITERAL.OR, expressions, this.fieldName);
+    }
+}
+exports.LogicCommand = LogicCommand;
+function isLogicCommand(object) {
+    return object && (object instanceof LogicCommand) && (object._internalType === symbol_1.SYMBOL_LOGIC_COMMAND);
+}
+exports.isLogicCommand = isLogicCommand;
+function isKnownLogicCommand(object) {
+    return isLogicCommand && (object.operator.toUpperCase() in LOGIC_COMMANDS_LITERAL);
+}
+exports.isKnownLogicCommand = isKnownLogicCommand;
+exports.default = LogicCommand;

+ 73 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/query.d.ts

@@ -0,0 +1,73 @@
+import { LogicCommand } from './logic';
+import { InternalSymbol } from '../helper/symbol';
+import { Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon } from '../geo/index';
+import { CenterSphere } from '../typings';
+export declare const EQ = "eq";
+export declare const NEQ = "neq";
+export declare const GT = "gt";
+export declare const GTE = "gte";
+export declare const LT = "lt";
+export declare const LTE = "lte";
+export declare const IN = "in";
+export declare const NIN = "nin";
+export declare const ALL = "all";
+export declare const ELEM_MATCH = "elemMatch";
+export declare const EXISTS = "exists";
+export declare const SIZE = "size";
+export declare const MOD = "mod";
+export declare enum QUERY_COMMANDS_LITERAL {
+    EQ = "eq",
+    NEQ = "neq",
+    GT = "gt",
+    GTE = "gte",
+    LT = "lt",
+    LTE = "lte",
+    IN = "in",
+    NIN = "nin",
+    ALL = "all",
+    ELEM_MATCH = "elemMatch",
+    EXISTS = "exists",
+    SIZE = "size",
+    MOD = "mod",
+    GEO_NEAR = "geoNear",
+    GEO_WITHIN = "geoWithin",
+    GEO_INTERSECTS = "geoIntersects"
+}
+export declare class QueryCommand extends LogicCommand {
+    operator: QUERY_COMMANDS_LITERAL;
+    constructor(operator: QUERY_COMMANDS_LITERAL, operands: any, fieldName?: string | InternalSymbol);
+    toJSON(): {
+        ['$ne']: any;
+    } | {
+        [x: string]: any;
+        $ne?: undefined;
+    };
+    _setFieldName(fieldName: string): QueryCommand;
+    eq(val: any): LogicCommand;
+    neq(val: any): LogicCommand;
+    gt(val: any): LogicCommand;
+    gte(val: any): LogicCommand;
+    lt(val: any): LogicCommand;
+    lte(val: any): LogicCommand;
+    in(list: any[]): LogicCommand;
+    nin(list: any[]): LogicCommand;
+    geoNear(val: IGeoNearOptions): LogicCommand;
+    geoWithin(val: IGeoWithinOptions): LogicCommand;
+    geoIntersects(val: IGeoIntersectsOptions): LogicCommand;
+}
+export declare function isQueryCommand(object: any): object is QueryCommand;
+export declare function isKnownQueryCommand(object: any): object is QueryCommand;
+export declare function isComparisonCommand(object: any): object is QueryCommand;
+export default QueryCommand;
+export interface IGeoNearOptions {
+    geometry: Point;
+    maxDistance?: number;
+    minDistance?: number;
+}
+export interface IGeoWithinOptions {
+    geometry?: Polygon | MultiPolygon;
+    centerSphere?: CenterSphere;
+}
+export interface IGeoIntersectsOptions {
+    geometry: Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon;
+}

+ 147 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/query.js

@@ -0,0 +1,147 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const logic_1 = require("./logic");
+const symbol_1 = require("../helper/symbol");
+const index_1 = require("../geo/index");
+const type_1 = require("../utils/type");
+const validate_1 = require("../validate");
+exports.EQ = 'eq';
+exports.NEQ = 'neq';
+exports.GT = 'gt';
+exports.GTE = 'gte';
+exports.LT = 'lt';
+exports.LTE = 'lte';
+exports.IN = 'in';
+exports.NIN = 'nin';
+exports.ALL = 'all';
+exports.ELEM_MATCH = 'elemMatch';
+exports.EXISTS = 'exists';
+exports.SIZE = 'size';
+exports.MOD = 'mod';
+var QUERY_COMMANDS_LITERAL;
+(function (QUERY_COMMANDS_LITERAL) {
+    QUERY_COMMANDS_LITERAL["EQ"] = "eq";
+    QUERY_COMMANDS_LITERAL["NEQ"] = "neq";
+    QUERY_COMMANDS_LITERAL["GT"] = "gt";
+    QUERY_COMMANDS_LITERAL["GTE"] = "gte";
+    QUERY_COMMANDS_LITERAL["LT"] = "lt";
+    QUERY_COMMANDS_LITERAL["LTE"] = "lte";
+    QUERY_COMMANDS_LITERAL["IN"] = "in";
+    QUERY_COMMANDS_LITERAL["NIN"] = "nin";
+    QUERY_COMMANDS_LITERAL["ALL"] = "all";
+    QUERY_COMMANDS_LITERAL["ELEM_MATCH"] = "elemMatch";
+    QUERY_COMMANDS_LITERAL["EXISTS"] = "exists";
+    QUERY_COMMANDS_LITERAL["SIZE"] = "size";
+    QUERY_COMMANDS_LITERAL["MOD"] = "mod";
+    QUERY_COMMANDS_LITERAL["GEO_NEAR"] = "geoNear";
+    QUERY_COMMANDS_LITERAL["GEO_WITHIN"] = "geoWithin";
+    QUERY_COMMANDS_LITERAL["GEO_INTERSECTS"] = "geoIntersects";
+})(QUERY_COMMANDS_LITERAL = exports.QUERY_COMMANDS_LITERAL || (exports.QUERY_COMMANDS_LITERAL = {}));
+class QueryCommand extends logic_1.LogicCommand {
+    constructor(operator, operands, fieldName) {
+        super(operator, operands, fieldName);
+        this.operator = operator;
+        this._internalType = symbol_1.SYMBOL_QUERY_COMMAND;
+    }
+    toJSON() {
+        switch (this.operator) {
+            case QUERY_COMMANDS_LITERAL.IN:
+            case QUERY_COMMANDS_LITERAL.NIN:
+                return {
+                    ['$' + this.operator]: this.operands
+                };
+            case QUERY_COMMANDS_LITERAL.NEQ:
+                return {
+                    ['$ne']: this.operands[0]
+                };
+            default:
+                return {
+                    ['$' + this.operator]: this.operands[0]
+                };
+        }
+    }
+    _setFieldName(fieldName) {
+        const command = new QueryCommand(this.operator, this.operands, fieldName);
+        return command;
+    }
+    eq(val) {
+        const command = new QueryCommand(QUERY_COMMANDS_LITERAL.EQ, [val], this.fieldName);
+        return this.and(command);
+    }
+    neq(val) {
+        const command = new QueryCommand(QUERY_COMMANDS_LITERAL.NEQ, [val], this.fieldName);
+        return this.and(command);
+    }
+    gt(val) {
+        const command = new QueryCommand(QUERY_COMMANDS_LITERAL.GT, [val], this.fieldName);
+        return this.and(command);
+    }
+    gte(val) {
+        const command = new QueryCommand(QUERY_COMMANDS_LITERAL.GTE, [val], this.fieldName);
+        return this.and(command);
+    }
+    lt(val) {
+        const command = new QueryCommand(QUERY_COMMANDS_LITERAL.LT, [val], this.fieldName);
+        return this.and(command);
+    }
+    lte(val) {
+        const command = new QueryCommand(QUERY_COMMANDS_LITERAL.LTE, [val], this.fieldName);
+        return this.and(command);
+    }
+    in(list) {
+        const command = new QueryCommand(QUERY_COMMANDS_LITERAL.IN, list, this.fieldName);
+        return this.and(command);
+    }
+    nin(list) {
+        const command = new QueryCommand(QUERY_COMMANDS_LITERAL.NIN, list, this.fieldName);
+        return this.and(command);
+    }
+    geoNear(val) {
+        if (!(val.geometry instanceof index_1.Point)) {
+            throw new TypeError(`"geometry" must be of type Point. Received type ${typeof val.geometry}`);
+        }
+        if (val.maxDistance !== undefined && !type_1.isNumber(val.maxDistance)) {
+            throw new TypeError(`"maxDistance" must be of type Number. Received type ${typeof val.maxDistance}`);
+        }
+        if (val.minDistance !== undefined && !type_1.isNumber(val.minDistance)) {
+            throw new TypeError(`"minDistance" must be of type Number. Received type ${typeof val.minDistance}`);
+        }
+        const command = new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_NEAR, [val], this.fieldName);
+        return this.and(command);
+    }
+    geoWithin(val) {
+        if (!(val.geometry instanceof index_1.MultiPolygon) &&
+            !(val.geometry instanceof index_1.Polygon) &&
+            !validate_1.Validate.isCentersPhere(val.centerSphere)) {
+            throw new TypeError(`"geometry" must be of type Polygon or MultiPolygon. Received type ${typeof val.geometry}`);
+        }
+        const command = new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_WITHIN, [val], this.fieldName);
+        return this.and(command);
+    }
+    geoIntersects(val) {
+        if (!(val.geometry instanceof index_1.Point) &&
+            !(val.geometry instanceof index_1.LineString) &&
+            !(val.geometry instanceof index_1.Polygon) &&
+            !(val.geometry instanceof index_1.MultiPoint) &&
+            !(val.geometry instanceof index_1.MultiLineString) &&
+            !(val.geometry instanceof index_1.MultiPolygon)) {
+            throw new TypeError(`"geometry" must be of type Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon. Received type ${typeof val.geometry}`);
+        }
+        const command = new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_INTERSECTS, [val], this.fieldName);
+        return this.and(command);
+    }
+}
+exports.QueryCommand = QueryCommand;
+function isQueryCommand(object) {
+    return object && object instanceof QueryCommand && object._internalType === symbol_1.SYMBOL_QUERY_COMMAND;
+}
+exports.isQueryCommand = isQueryCommand;
+function isKnownQueryCommand(object) {
+    return isQueryCommand(object) && object.operator.toUpperCase() in QUERY_COMMANDS_LITERAL;
+}
+exports.isKnownQueryCommand = isKnownQueryCommand;
+function isComparisonCommand(object) {
+    return isQueryCommand(object);
+}
+exports.isComparisonCommand = isComparisonCommand;
+exports.default = QueryCommand;

+ 29 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/update.d.ts

@@ -0,0 +1,29 @@
+import { InternalSymbol } from '../helper/symbol';
+export declare enum UPDATE_COMMANDS_LITERAL {
+    SET = "set",
+    REMOVE = "remove",
+    INC = "inc",
+    MUL = "mul",
+    PUSH = "push",
+    PULL = "pull",
+    PULL_ALL = "pullAll",
+    POP = "pop",
+    SHIFT = "shift",
+    UNSHIFT = "unshift",
+    ADD_TO_SET = "addToSet",
+    BIT = "bit",
+    RENAME = "rename",
+    MAX = "max",
+    MIN = "min"
+}
+export declare class UpdateCommand {
+    fieldName: string | InternalSymbol;
+    operator: UPDATE_COMMANDS_LITERAL;
+    operands: any;
+    _internalType: InternalSymbol;
+    constructor(operator: UPDATE_COMMANDS_LITERAL, operands?: any, fieldName?: string | InternalSymbol);
+    _setFieldName(fieldName: string): UpdateCommand;
+}
+export declare function isUpdateCommand(object: any): object is UpdateCommand;
+export declare function isKnownUpdateCommand(object: any): object is UpdateCommand;
+export default UpdateCommand;

+ 49 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/commands/update.js

@@ -0,0 +1,49 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const symbol_1 = require("../helper/symbol");
+var UPDATE_COMMANDS_LITERAL;
+(function (UPDATE_COMMANDS_LITERAL) {
+    UPDATE_COMMANDS_LITERAL["SET"] = "set";
+    UPDATE_COMMANDS_LITERAL["REMOVE"] = "remove";
+    UPDATE_COMMANDS_LITERAL["INC"] = "inc";
+    UPDATE_COMMANDS_LITERAL["MUL"] = "mul";
+    UPDATE_COMMANDS_LITERAL["PUSH"] = "push";
+    UPDATE_COMMANDS_LITERAL["PULL"] = "pull";
+    UPDATE_COMMANDS_LITERAL["PULL_ALL"] = "pullAll";
+    UPDATE_COMMANDS_LITERAL["POP"] = "pop";
+    UPDATE_COMMANDS_LITERAL["SHIFT"] = "shift";
+    UPDATE_COMMANDS_LITERAL["UNSHIFT"] = "unshift";
+    UPDATE_COMMANDS_LITERAL["ADD_TO_SET"] = "addToSet";
+    UPDATE_COMMANDS_LITERAL["BIT"] = "bit";
+    UPDATE_COMMANDS_LITERAL["RENAME"] = "rename";
+    UPDATE_COMMANDS_LITERAL["MAX"] = "max";
+    UPDATE_COMMANDS_LITERAL["MIN"] = "min";
+})(UPDATE_COMMANDS_LITERAL = exports.UPDATE_COMMANDS_LITERAL || (exports.UPDATE_COMMANDS_LITERAL = {}));
+class UpdateCommand {
+    constructor(operator, operands, fieldName) {
+        this._internalType = symbol_1.SYMBOL_UPDATE_COMMAND;
+        Object.defineProperties(this, {
+            _internalType: {
+                enumerable: false,
+                configurable: false,
+            },
+        });
+        this.operator = operator;
+        this.operands = operands;
+        this.fieldName = fieldName || symbol_1.SYMBOL_UNSET_FIELD_NAME;
+    }
+    _setFieldName(fieldName) {
+        const command = new UpdateCommand(this.operator, this.operands, fieldName);
+        return command;
+    }
+}
+exports.UpdateCommand = UpdateCommand;
+function isUpdateCommand(object) {
+    return object && (object instanceof UpdateCommand) && (object._internalType === symbol_1.SYMBOL_UPDATE_COMMAND);
+}
+exports.isUpdateCommand = isUpdateCommand;
+function isKnownUpdateCommand(object) {
+    return isUpdateCommand(object) && (object.operator.toUpperCase() in UPDATE_COMMANDS_LITERAL);
+}
+exports.isKnownUpdateCommand = isKnownUpdateCommand;
+exports.default = UpdateCommand;

+ 6 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/config/app.config.d.ts

@@ -0,0 +1,6 @@
+declare const _default: {
+    db_doc_size_limit: number;
+    db_realtime_ping_interval: number;
+    db_realtime_pong_wait_timeout: number;
+};
+export default _default;

+ 7 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/config/app.config.js

@@ -0,0 +1,7 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.default = {
+    db_doc_size_limit: 512 * 1024,
+    db_realtime_ping_interval: 15 * 1000,
+    db_realtime_pong_wait_timeout: 15 * 1000,
+};

+ 3 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/config/error.config.d.ts

@@ -0,0 +1,3 @@
+export declare const ERR_CODE: {
+    [key: string]: string | number;
+};

+ 15 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/config/error.config.js

@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ERR_CODE = {
+    UNKNOWN_ERROR: 'UNKNOWN_ERROR',
+    SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL: 'SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL',
+    SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL: 'SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL',
+    SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL: 'SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL',
+    SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL: 'SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL',
+    SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG: 'SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG',
+    SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA: 'SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA',
+    SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR: 'SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR',
+    SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED: 'SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED',
+    SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL: 'SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL',
+    SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR: 'SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR'
+};

+ 34 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/const/code.d.ts

@@ -0,0 +1,34 @@
+export declare const ERRORS: {
+    CREATE_WATCH_NET_ERROR: {
+        code: string;
+        message: string;
+    };
+    CREATE_WACTH_EXCEED_ERROR: {
+        code: string;
+        message: string;
+    };
+    CREATE_WATCH_SERVER_ERROR: {
+        code: string;
+        message: string;
+    };
+    CONN_ERROR: {
+        code: string;
+        message: string;
+    };
+    INVALID_PARAM: {
+        code: string;
+        message: string;
+    };
+    INSERT_DOC_FAIL: {
+        code: string;
+        message: string;
+    };
+    DATABASE_TRANSACTION_CONFLICT: {
+        code: string;
+        message: string;
+    };
+    DATABASE_REQUEST_FAILED: {
+        code: string;
+        message: string;
+    };
+};

+ 36 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/const/code.js

@@ -0,0 +1,36 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ERRORS = {
+    CREATE_WATCH_NET_ERROR: {
+        code: 'CREATE_WATCH_NET_ERROR',
+        message: 'create watch network error'
+    },
+    CREATE_WACTH_EXCEED_ERROR: {
+        code: 'CREATE_WACTH_EXCEED_ERROR',
+        message: 'maximum connections exceed'
+    },
+    CREATE_WATCH_SERVER_ERROR: {
+        code: 'CREATE_WATCH_SERVER_ERROR',
+        message: 'create watch server error'
+    },
+    CONN_ERROR: {
+        code: 'CONN_ERROR',
+        message: 'connection error'
+    },
+    INVALID_PARAM: {
+        code: 'INVALID_PARAM',
+        message: 'Invalid request param'
+    },
+    INSERT_DOC_FAIL: {
+        code: 'INSERT_DOC_FAIL',
+        message: 'insert document failed'
+    },
+    DATABASE_TRANSACTION_CONFLICT: {
+        code: 'DATABASE_TRANSACTION_CONFLICT',
+        message: 'database transaction conflict'
+    },
+    DATABASE_REQUEST_FAILED: {
+        code: 'DATABASE_REQUEST_FAILED',
+        message: 'database request failed'
+    }
+};

+ 54 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/constant.d.ts

@@ -0,0 +1,54 @@
+declare enum ErrorCode {
+    DocIDError = "\u6587\u6863ID\u4E0D\u5408\u6CD5",
+    CollNameError = "\u96C6\u5408\u540D\u79F0\u4E0D\u5408\u6CD5",
+    OpStrError = "\u64CD\u4F5C\u7B26\u4E0D\u5408\u6CD5",
+    DirectionError = "\u6392\u5E8F\u5B57\u7B26\u4E0D\u5408\u6CD5",
+    IntergerError = "must be integer",
+    BooleanError = "must be boolean",
+    ArrayError = "must be array",
+    QueryParamTypeError = "\u67E5\u8BE2\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61",
+    QueryParamValueError = "\u67E5\u8BE2\u53C2\u6570\u5BF9\u8C61\u503C\u4E0D\u80FD\u5747\u4E3Aundefined",
+    CentersPhereError = "centersPhere\u7ED3\u6784\u4E0D\u5408\u6CD5"
+}
+declare const FieldType: {
+    String: string;
+    Number: string;
+    Object: string;
+    Array: string;
+    Boolean: string;
+    Null: string;
+    GeoPoint: string;
+    GeoLineString: string;
+    GeoPolygon: string;
+    GeoMultiPoint: string;
+    GeoMultiLineString: string;
+    GeoMultiPolygon: string;
+    Date: string;
+    Command: string;
+    ServerDate: string;
+    BsonDate: string;
+};
+declare type OrderByDirection = 'desc' | 'asc';
+declare const OrderDirectionList: string[];
+declare type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>';
+declare const WhereFilterOpList: string[];
+declare enum Opeartor {
+    lt = "<",
+    gt = ">",
+    lte = "<=",
+    gte = ">=",
+    eq = "=="
+}
+declare const OperatorMap: {
+    [Opeartor.eq]: string;
+    [Opeartor.lt]: string;
+    [Opeartor.lte]: string;
+    [Opeartor.gt]: string;
+    [Opeartor.gte]: string;
+};
+declare const UpdateOperatorList: string[];
+declare enum QueryType {
+    WHERE = "WHERE",
+    DOC = "DOC"
+}
+export { ErrorCode, FieldType, WhereFilterOp, WhereFilterOpList, Opeartor, OperatorMap, OrderByDirection, OrderDirectionList, UpdateOperatorList, QueryType };

+ 76 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/constant.js

@@ -0,0 +1,76 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ErrorCode;
+(function (ErrorCode) {
+    ErrorCode["DocIDError"] = "\u6587\u6863ID\u4E0D\u5408\u6CD5";
+    ErrorCode["CollNameError"] = "\u96C6\u5408\u540D\u79F0\u4E0D\u5408\u6CD5";
+    ErrorCode["OpStrError"] = "\u64CD\u4F5C\u7B26\u4E0D\u5408\u6CD5";
+    ErrorCode["DirectionError"] = "\u6392\u5E8F\u5B57\u7B26\u4E0D\u5408\u6CD5";
+    ErrorCode["IntergerError"] = "must be integer";
+    ErrorCode["BooleanError"] = "must be boolean";
+    ErrorCode["ArrayError"] = "must be array";
+    ErrorCode["QueryParamTypeError"] = "\u67E5\u8BE2\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61";
+    ErrorCode["QueryParamValueError"] = "\u67E5\u8BE2\u53C2\u6570\u5BF9\u8C61\u503C\u4E0D\u80FD\u5747\u4E3Aundefined";
+    ErrorCode["CentersPhereError"] = "centersPhere\u7ED3\u6784\u4E0D\u5408\u6CD5";
+})(ErrorCode || (ErrorCode = {}));
+exports.ErrorCode = ErrorCode;
+const FieldType = {
+    String: 'String',
+    Number: 'Number',
+    Object: 'Object',
+    Array: 'Array',
+    Boolean: 'Boolean',
+    Null: 'Null',
+    GeoPoint: 'GeoPoint',
+    GeoLineString: 'GeoLineString',
+    GeoPolygon: 'GeoPolygon',
+    GeoMultiPoint: 'GeoMultiPoint',
+    GeoMultiLineString: 'GeoMultiLineString',
+    GeoMultiPolygon: 'GeoMultiPolygon',
+    Date: 'Date',
+    Command: 'Command',
+    ServerDate: 'ServerDate',
+    BsonDate: 'BsonDate'
+};
+exports.FieldType = FieldType;
+const OrderDirectionList = ['desc', 'asc'];
+exports.OrderDirectionList = OrderDirectionList;
+const WhereFilterOpList = ['<', '<=', '==', '>=', '>'];
+exports.WhereFilterOpList = WhereFilterOpList;
+var Opeartor;
+(function (Opeartor) {
+    Opeartor["lt"] = "<";
+    Opeartor["gt"] = ">";
+    Opeartor["lte"] = "<=";
+    Opeartor["gte"] = ">=";
+    Opeartor["eq"] = "==";
+})(Opeartor || (Opeartor = {}));
+exports.Opeartor = Opeartor;
+const OperatorMap = {
+    [Opeartor.eq]: '$eq',
+    [Opeartor.lt]: '$lt',
+    [Opeartor.lte]: '$lte',
+    [Opeartor.gt]: '$gt',
+    [Opeartor.gte]: '$gte'
+};
+exports.OperatorMap = OperatorMap;
+const UpdateOperatorList = [
+    '$set',
+    '$inc',
+    '$mul',
+    '$unset',
+    '$push',
+    '$pop',
+    '$unshift',
+    '$shift',
+    '$currentDate',
+    '$each',
+    '$position'
+];
+exports.UpdateOperatorList = UpdateOperatorList;
+var QueryType;
+(function (QueryType) {
+    QueryType["WHERE"] = "WHERE";
+    QueryType["DOC"] = "DOC";
+})(QueryType || (QueryType = {}));
+exports.QueryType = QueryType;

+ 14 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/document.d.ts

@@ -0,0 +1,14 @@
+import { IWatchOptions, DBRealtimeListener } from './typings/index';
+export declare class DocumentReference {
+    readonly id: string | number;
+    readonly _transactionId: string;
+    readonly projection: Object;
+    private _apiOptions;
+    set(data: Object): Promise<any>;
+    update(data: Object): Promise<any>;
+    delete(): Promise<any>;
+    remove(): Promise<any>;
+    get(): Promise<any>;
+    field(projection: Object): DocumentReference;
+    watch: (options: IWatchOptions) => DBRealtimeListener;
+}

+ 219 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/document.js

@@ -0,0 +1,219 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const index_1 = require("./index");
+const util_1 = require("./util");
+const update_1 = require("./serializer/update");
+const datatype_1 = require("./serializer/datatype");
+const update_2 = require("./commands/update");
+const websocket_client_1 = require("./realtime/websocket-client");
+const constant_1 = require("./constant");
+const utils_1 = require("./utils/utils");
+const code_1 = require("./const/code");
+const bson_1 = require("bson");
+class DocumentReference {
+    constructor(db, coll, apiOptions, docID, transactionId) {
+        this.watch = (options) => {
+            if (!index_1.Db.ws) {
+                index_1.Db.ws = new websocket_client_1.RealtimeWebSocketClient({
+                    context: {
+                        appConfig: {
+                            docSizeLimit: 1000,
+                            realtimePingInterval: 10000,
+                            realtimePongWaitTimeout: 5000,
+                            request: this.request
+                        }
+                    }
+                });
+            }
+            return index_1.Db.ws.watch(Object.assign(Object.assign({}, options), { envId: this._db.config.env, collectionName: this._coll, query: JSON.stringify({
+                    _id: this.id
+                }) }));
+        };
+        this._db = db;
+        this._coll = coll;
+        this.id = docID;
+        this._transactionId = transactionId;
+        this.request = new index_1.Db.reqClass(this._db.config);
+        this._apiOptions = apiOptions;
+    }
+    async create(data) {
+        if (this.id) {
+            data['_id'] = this.id;
+        }
+        let params = {
+            collectionName: this._coll,
+            data: [utils_1.stringifyByEJSON(datatype_1.serialize(data))],
+            transactionId: this._transactionId
+        };
+        const res = await this.request.send('database.insertDocument', params, utils_1.getReqOpts(this._apiOptions));
+        if (res.code) {
+            return res;
+        }
+        if (this._transactionId) {
+            return {
+                inserted: 1,
+                ok: 1,
+                id: res.data.insertedIds[0],
+                requestId: res.requestId
+            };
+        }
+        return {
+            id: res.data.insertedIds[0],
+            requestId: res.requestId
+        };
+    }
+    async set(data) {
+        if (!this.id) {
+            return utils_1.processReturn(this._db.config.throwOnCode, Object.assign(Object.assign({}, code_1.ERRORS.INVALID_PARAM), { message: 'docId不能为空' }));
+        }
+        if (!data || typeof data !== 'object') {
+            return utils_1.processReturn(this._db.config.throwOnCode, Object.assign(Object.assign({}, code_1.ERRORS.INVALID_PARAM), { message: '参数必需是非空对象' }));
+        }
+        if (data.hasOwnProperty('_id')) {
+            return utils_1.processReturn(this._db.config.throwOnCode, Object.assign(Object.assign({}, code_1.ERRORS.INVALID_PARAM), { message: '不能更新_id的值' }));
+        }
+        let hasOperator = false;
+        const checkMixed = objs => {
+            if (typeof objs === 'object') {
+                for (let key in objs) {
+                    if (objs[key] instanceof update_2.UpdateCommand) {
+                        hasOperator = true;
+                    }
+                    else if (typeof objs[key] === 'object') {
+                        checkMixed(objs[key]);
+                    }
+                }
+            }
+        };
+        checkMixed(data);
+        if (hasOperator) {
+            return utils_1.processReturn(this._db.config.throwOnCode, Object.assign(Object.assign({}, code_1.ERRORS.DATABASE_REQUEST_FAILED), { message: 'update operator complicit' }));
+        }
+        let param = {
+            collectionName: this._coll,
+            queryType: constant_1.QueryType.DOC,
+            data: utils_1.stringifyByEJSON(datatype_1.serialize(data)),
+            transactionId: this._transactionId,
+            multi: false,
+            merge: false,
+            upsert: true
+        };
+        if (this.id) {
+            param['query'] = utils_1.stringifyByEJSON({ _id: this.id });
+        }
+        const res = await this.request.send('database.modifyDocument', param, utils_1.getReqOpts(this._apiOptions));
+        if (res.code) {
+            return res;
+        }
+        if (this._transactionId) {
+            return {
+                updated: res.data.updated,
+                upserted: [{ _id: res.data.upsert_id }],
+                requestId: res.requestId
+            };
+        }
+        return {
+            updated: res.data.updated,
+            upsertedId: res.data.upsert_id,
+            requestId: res.requestId
+        };
+    }
+    async update(data) {
+        if (!data || typeof data !== 'object') {
+            return utils_1.processReturn(this._db.config.throwOnCode, Object.assign(Object.assign({}, code_1.ERRORS.INVALID_PARAM), { message: '参数必需是非空对象' }));
+        }
+        if (data.hasOwnProperty('_id')) {
+            return utils_1.processReturn(this._db.config.throwOnCode, Object.assign(Object.assign({}, code_1.ERRORS.INVALID_PARAM), { message: '不能更新_id的值' }));
+        }
+        const query = utils_1.stringifyByEJSON({ _id: this.id });
+        const param = {
+            collectionName: this._coll,
+            transactionId: this._transactionId,
+            data: update_1.UpdateSerializer.encodeEJSON(data),
+            query,
+            queryType: constant_1.QueryType.DOC,
+            multi: false,
+            merge: true,
+            upsert: false
+        };
+        const res = await this.request.send('database.modifyDocument', param, utils_1.getReqOpts(this._apiOptions));
+        if (res.code) {
+            return res;
+        }
+        return {
+            updated: res.data.updated,
+            requestId: res.requestId
+        };
+    }
+    async delete() {
+        return this.remove();
+    }
+    async remove() {
+        const query = utils_1.stringifyByEJSON({ _id: this.id });
+        const param = {
+            collectionName: this._coll,
+            transactionId: this._transactionId,
+            query: query,
+            queryType: constant_1.QueryType.DOC,
+            multi: false
+        };
+        const res = await this.request.send('database.removeDocument', param, utils_1.getReqOpts(this._apiOptions));
+        if (res.code) {
+            return res;
+        }
+        return {
+            deleted: res.data.deleted,
+            requestId: res.requestId
+        };
+    }
+    async get() {
+        const query = utils_1.stringifyByEJSON({ _id: this.id });
+        const { projection } = this._apiOptions;
+        const param = {
+            collectionName: this._coll,
+            query,
+            transactionId: this._transactionId,
+            queryType: constant_1.QueryType.DOC,
+            multi: false
+        };
+        if (projection) {
+            param.projection = utils_1.stringifyByEJSON(projection);
+        }
+        const res = await this.request.send('database.getDocument', param, utils_1.getReqOpts(this._apiOptions));
+        if (res.code) {
+            return res;
+        }
+        const list = res.data.list.map(item => bson_1.EJSON.parse(item));
+        const documents = util_1.Util.formatResDocumentData(list);
+        if (this._transactionId) {
+            return {
+                data: documents[0] || null,
+                requestId: res.requestId
+            };
+        }
+        return {
+            data: documents,
+            requestId: res.requestId,
+            offset: res.data.offset,
+            limit: res.data.limit
+        };
+    }
+    field(projection) {
+        let transformProjection = {};
+        for (let k in projection) {
+            if (typeof projection[k] === 'boolean') {
+                transformProjection[k] = projection[k] === true ? 1 : 0;
+            }
+            if (typeof projection[k] === 'number') {
+                transformProjection[k] = projection[k] > 0 ? 1 : 0;
+            }
+            if (typeof projection[k] === 'object') {
+                transformProjection[k] = projection[k];
+            }
+        }
+        let newApiOption = Object.assign({}, this._apiOptions);
+        newApiOption.projection = transformProjection;
+        return new DocumentReference(this._db, this._coll, newApiOption, this.id, this._transactionId);
+    }
+}
+exports.DocumentReference = DocumentReference;

+ 6 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/index.d.ts

@@ -0,0 +1,6 @@
+export * from './point';
+export * from './lineString';
+export * from './polygon';
+export * from './multiPoint';
+export * from './multiLineString';
+export * from './multiPolygon';

+ 11 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/index.js

@@ -0,0 +1,11 @@
+"use strict";
+function __export(m) {
+    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+Object.defineProperty(exports, "__esModule", { value: true });
+__export(require("./point"));
+__export(require("./lineString"));
+__export(require("./polygon"));
+__export(require("./multiPoint"));
+__export(require("./multiLineString"));
+__export(require("./multiPolygon"));

+ 24 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/interface.d.ts

@@ -0,0 +1,24 @@
+export interface ISerializedPoint {
+    type: string;
+    coordinates: [number, number];
+}
+export interface ISerializedLineString {
+    type: string;
+    coordinates: [number, number][];
+}
+export interface ISerializedPolygon {
+    type: string;
+    coordinates: [number, number][][];
+}
+export interface ISerializedMultiPoint {
+    type: string;
+    coordinates: [number, number][];
+}
+export interface ISerializedMultiLineString {
+    type: string;
+    coordinates: [number, number][][];
+}
+export interface ISerializedMultiPolygon {
+    type: string;
+    coordinates: [number, number][][][];
+}

+ 2 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/interface.js

@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });

+ 19 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/lineString.d.ts

@@ -0,0 +1,19 @@
+import { Point } from './point';
+import { ISerializedLineString } from './interface';
+export declare class LineString {
+    readonly points: Point[];
+    constructor(points: Point[]);
+    parse(key: any): {
+        [x: number]: {
+            type: string;
+            coordinates: number[][];
+        };
+    };
+    toJSON(): {
+        type: string;
+        coordinates: number[][];
+    };
+    static validate(lineString: ISerializedLineString): boolean;
+    static isClosed(lineString: LineString): boolean;
+    readonly _internalType: import("../utils/symbol").InternalSymbol;
+}

+ 57 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/lineString.js

@@ -0,0 +1,57 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const symbol_1 = require("../helper/symbol");
+const point_1 = require("./point");
+const type_1 = require("../utils/type");
+class LineString {
+    constructor(points) {
+        if (!type_1.isArray(points)) {
+            throw new TypeError(`"points" must be of type Point[]. Received type ${typeof points}`);
+        }
+        if (points.length < 2) {
+            throw new Error('"points" must contain 2 points at least');
+        }
+        points.forEach(point => {
+            if (!(point instanceof point_1.Point)) {
+                throw new TypeError(`"points" must be of type Point[]. Received type ${typeof point}[]`);
+            }
+        });
+        this.points = points;
+    }
+    parse(key) {
+        return {
+            [key]: {
+                type: 'LineString',
+                coordinates: this.points.map(point => point.toJSON().coordinates)
+            }
+        };
+    }
+    toJSON() {
+        return {
+            type: 'LineString',
+            coordinates: this.points.map(point => point.toJSON().coordinates)
+        };
+    }
+    static validate(lineString) {
+        if (lineString.type !== 'LineString' || !type_1.isArray(lineString.coordinates)) {
+            return false;
+        }
+        for (let point of lineString.coordinates) {
+            if (!type_1.isNumber(point[0]) || !type_1.isNumber(point[1])) {
+                return false;
+            }
+        }
+        return true;
+    }
+    static isClosed(lineString) {
+        const firstPoint = lineString.points[0];
+        const lastPoint = lineString.points[lineString.points.length - 1];
+        if (firstPoint.latitude === lastPoint.latitude && firstPoint.longitude === lastPoint.longitude) {
+            return true;
+        }
+    }
+    get _internalType() {
+        return symbol_1.SYMBOL_GEO_LINE_STRING;
+    }
+}
+exports.LineString = LineString;

+ 18 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiLineString.d.ts

@@ -0,0 +1,18 @@
+import { LineString } from './lineString';
+import { ISerializedMultiLineString } from './interface';
+export declare class MultiLineString {
+    readonly lines: LineString[];
+    constructor(lines: LineString[]);
+    parse(key: any): {
+        [x: number]: {
+            type: string;
+            coordinates: number[][][];
+        };
+    };
+    toJSON(): {
+        type: string;
+        coordinates: number[][][];
+    };
+    static validate(multiLineString: ISerializedMultiLineString): boolean;
+    readonly _internalType: import("../utils/symbol").InternalSymbol;
+}

+ 56 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiLineString.js

@@ -0,0 +1,56 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const symbol_1 = require("../helper/symbol");
+const type_1 = require("../utils/type");
+const lineString_1 = require("./lineString");
+class MultiLineString {
+    constructor(lines) {
+        if (!type_1.isArray(lines)) {
+            throw new TypeError(`"lines" must be of type LineString[]. Received type ${typeof lines}`);
+        }
+        if (lines.length === 0) {
+            throw new Error('Polygon must contain 1 linestring at least');
+        }
+        lines.forEach(line => {
+            if (!(line instanceof lineString_1.LineString)) {
+                throw new TypeError(`"lines" must be of type LineString[]. Received type ${typeof line}[]`);
+            }
+        });
+        this.lines = lines;
+    }
+    parse(key) {
+        return {
+            [key]: {
+                type: 'MultiLineString',
+                coordinates: this.lines.map(line => {
+                    return line.points.map(point => [point.longitude, point.latitude]);
+                })
+            }
+        };
+    }
+    toJSON() {
+        return {
+            type: 'MultiLineString',
+            coordinates: this.lines.map(line => {
+                return line.points.map(point => [point.longitude, point.latitude]);
+            })
+        };
+    }
+    static validate(multiLineString) {
+        if (multiLineString.type !== 'MultiLineString' || !type_1.isArray(multiLineString.coordinates)) {
+            return false;
+        }
+        for (let line of multiLineString.coordinates) {
+            for (let point of line) {
+                if (!type_1.isNumber(point[0]) || !type_1.isNumber(point[1])) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+    get _internalType() {
+        return symbol_1.SYMBOL_GEO_MULTI_LINE_STRING;
+    }
+}
+exports.MultiLineString = MultiLineString;

+ 18 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiPoint.d.ts

@@ -0,0 +1,18 @@
+import { Point } from './point';
+import { ISerializedMultiPoint } from './interface';
+export declare class MultiPoint {
+    readonly points: Point[];
+    constructor(points: Point[]);
+    parse(key: any): {
+        [x: number]: {
+            type: string;
+            coordinates: number[][];
+        };
+    };
+    toJSON(): {
+        type: string;
+        coordinates: number[][];
+    };
+    static validate(multiPoint: ISerializedMultiPoint): boolean;
+    readonly _internalType: import("../utils/symbol").InternalSymbol;
+}

+ 50 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiPoint.js

@@ -0,0 +1,50 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const symbol_1 = require("../helper/symbol");
+const point_1 = require("./point");
+const type_1 = require("../utils/type");
+class MultiPoint {
+    constructor(points) {
+        if (!type_1.isArray(points)) {
+            throw new TypeError(`"points" must be of type Point[]. Received type ${typeof points}`);
+        }
+        if (points.length === 0) {
+            throw new Error('"points" must contain 1 point at least');
+        }
+        points.forEach(point => {
+            if (!(point instanceof point_1.Point)) {
+                throw new TypeError(`"points" must be of type Point[]. Received type ${typeof point}[]`);
+            }
+        });
+        this.points = points;
+    }
+    parse(key) {
+        return {
+            [key]: {
+                type: 'MultiPoint',
+                coordinates: this.points.map(point => point.toJSON().coordinates)
+            }
+        };
+    }
+    toJSON() {
+        return {
+            type: 'MultiPoint',
+            coordinates: this.points.map(point => point.toJSON().coordinates)
+        };
+    }
+    static validate(multiPoint) {
+        if (multiPoint.type !== 'MultiPoint' || !type_1.isArray(multiPoint.coordinates)) {
+            return false;
+        }
+        for (let point of multiPoint.coordinates) {
+            if (!type_1.isNumber(point[0]) || !type_1.isNumber(point[1])) {
+                return false;
+            }
+        }
+        return true;
+    }
+    get _internalType() {
+        return symbol_1.SYMBOL_GEO_MULTI_POINT;
+    }
+}
+exports.MultiPoint = MultiPoint;

+ 18 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiPolygon.d.ts

@@ -0,0 +1,18 @@
+import { Polygon } from './polygon';
+import { ISerializedMultiPolygon } from './interface';
+export declare class MultiPolygon {
+    readonly polygons: Polygon[];
+    constructor(polygons: Polygon[]);
+    parse(key: any): {
+        [x: number]: {
+            type: string;
+            coordinates: number[][][][];
+        };
+    };
+    toJSON(): {
+        type: string;
+        coordinates: number[][][][];
+    };
+    static validate(multiPolygon: ISerializedMultiPolygon): boolean;
+    readonly _internalType: import("../utils/symbol").InternalSymbol;
+}

+ 62 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/multiPolygon.js

@@ -0,0 +1,62 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const symbol_1 = require("../helper/symbol");
+const type_1 = require("../utils/type");
+const polygon_1 = require("./polygon");
+class MultiPolygon {
+    constructor(polygons) {
+        if (!type_1.isArray(polygons)) {
+            throw new TypeError(`"polygons" must be of type Polygon[]. Received type ${typeof polygons}`);
+        }
+        if (polygons.length === 0) {
+            throw new Error('MultiPolygon must contain 1 polygon at least');
+        }
+        for (let polygon of polygons) {
+            if (!(polygon instanceof polygon_1.Polygon)) {
+                throw new TypeError(`"polygon" must be of type Polygon[]. Received type ${typeof polygon}[]`);
+            }
+        }
+        this.polygons = polygons;
+    }
+    parse(key) {
+        return {
+            [key]: {
+                type: 'MultiPolygon',
+                coordinates: this.polygons.map(polygon => {
+                    return polygon.lines.map(line => {
+                        return line.points.map(point => [point.longitude, point.latitude]);
+                    });
+                })
+            }
+        };
+    }
+    toJSON() {
+        return {
+            type: 'MultiPolygon',
+            coordinates: this.polygons.map(polygon => {
+                return polygon.lines.map(line => {
+                    return line.points.map(point => [point.longitude, point.latitude]);
+                });
+            })
+        };
+    }
+    static validate(multiPolygon) {
+        if (multiPolygon.type !== 'MultiPolygon' || !type_1.isArray(multiPolygon.coordinates)) {
+            return false;
+        }
+        for (let polygon of multiPolygon.coordinates) {
+            for (let line of polygon) {
+                for (let point of line) {
+                    if (!type_1.isNumber(point[0]) || !type_1.isNumber(point[1])) {
+                        return false;
+                    }
+                }
+            }
+        }
+        return true;
+    }
+    get _internalType() {
+        return symbol_1.SYMBOL_GEO_MULTI_POLYGON;
+    }
+}
+exports.MultiPolygon = MultiPolygon;

+ 19 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/point.d.ts

@@ -0,0 +1,19 @@
+import { ISerializedPoint } from './interface';
+export declare class Point {
+    readonly latitude: number;
+    readonly longitude: number;
+    constructor(longitude: number, latitude: number);
+    parse(key: any): {
+        [x: number]: {
+            type: string;
+            coordinates: number[];
+        };
+    };
+    toJSON(): {
+        type: string;
+        coordinates: number[];
+    };
+    toReadableString(): string;
+    static validate(point: ISerializedPoint): boolean;
+    readonly _internalType: import("../utils/symbol").InternalSymbol;
+}

+ 43 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/point.js

@@ -0,0 +1,43 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const validate_1 = require("../validate");
+const symbol_1 = require("../helper/symbol");
+const type_1 = require("../utils/type");
+class Point {
+    constructor(longitude, latitude) {
+        validate_1.Validate.isGeopoint('longitude', longitude);
+        validate_1.Validate.isGeopoint('latitude', latitude);
+        this.longitude = longitude;
+        this.latitude = latitude;
+    }
+    parse(key) {
+        return {
+            [key]: {
+                type: 'Point',
+                coordinates: [this.longitude, this.latitude]
+            }
+        };
+    }
+    toJSON() {
+        return {
+            type: 'Point',
+            coordinates: [
+                this.longitude,
+                this.latitude,
+            ],
+        };
+    }
+    toReadableString() {
+        return `[${this.longitude},${this.latitude}]`;
+    }
+    static validate(point) {
+        return point.type === 'Point' &&
+            type_1.isArray(point.coordinates) &&
+            validate_1.Validate.isGeopoint('longitude', point.coordinates[0]) &&
+            validate_1.Validate.isGeopoint('latitude', point.coordinates[1]);
+    }
+    get _internalType() {
+        return symbol_1.SYMBOL_GEO_POINT;
+    }
+}
+exports.Point = Point;

+ 19 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/polygon.d.ts

@@ -0,0 +1,19 @@
+import { LineString } from './lineString';
+import { ISerializedPolygon } from './interface';
+export declare class Polygon {
+    readonly lines: LineString[];
+    constructor(lines: LineString[]);
+    parse(key: any): {
+        [x: number]: {
+            type: string;
+            coordinates: number[][][];
+        };
+    };
+    toJSON(): {
+        type: string;
+        coordinates: number[][][];
+    };
+    static validate(polygon: ISerializedPolygon): boolean;
+    static isCloseLineString(lineString: any): boolean;
+    readonly _internalType: import("../utils/symbol").InternalSymbol;
+}

+ 70 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/geo/polygon.js

@@ -0,0 +1,70 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const symbol_1 = require("../helper/symbol");
+const type_1 = require("../utils/type");
+const lineString_1 = require("./lineString");
+class Polygon {
+    constructor(lines) {
+        if (!type_1.isArray(lines)) {
+            throw new TypeError(`"lines" must be of type LineString[]. Received type ${typeof lines}`);
+        }
+        if (lines.length === 0) {
+            throw new Error('Polygon must contain 1 linestring at least');
+        }
+        lines.forEach(line => {
+            if (!(line instanceof lineString_1.LineString)) {
+                throw new TypeError(`"lines" must be of type LineString[]. Received type ${typeof line}[]`);
+            }
+            if (!lineString_1.LineString.isClosed(line)) {
+                throw new Error(`LineString ${line.points.map(p => p.toReadableString())} is not a closed cycle`);
+            }
+        });
+        this.lines = lines;
+    }
+    parse(key) {
+        return {
+            [key]: {
+                type: 'Polygon',
+                coordinates: this.lines.map(line => {
+                    return line.points.map(point => [point.longitude, point.latitude]);
+                })
+            }
+        };
+    }
+    toJSON() {
+        return {
+            type: 'Polygon',
+            coordinates: this.lines.map(line => {
+                return line.points.map(point => [point.longitude, point.latitude]);
+            })
+        };
+    }
+    static validate(polygon) {
+        if (polygon.type !== 'Polygon' || !type_1.isArray(polygon.coordinates)) {
+            return false;
+        }
+        for (let line of polygon.coordinates) {
+            if (!this.isCloseLineString(line)) {
+                return false;
+            }
+            for (let point of line) {
+                if (!type_1.isNumber(point[0]) || !type_1.isNumber(point[1])) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+    static isCloseLineString(lineString) {
+        const firstPoint = lineString[0];
+        const lastPoint = lineString[lineString.length - 1];
+        if (firstPoint[0] !== lastPoint[0] || firstPoint[1] !== lastPoint[1]) {
+            return false;
+        }
+        return true;
+    }
+    get _internalType() {
+        return symbol_1.SYMBOL_GEO_POLYGON;
+    }
+}
+exports.Polygon = Polygon;

+ 14 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/helper/symbol.d.ts

@@ -0,0 +1,14 @@
+import InternalSymbol from '../utils/symbol';
+export * from '../utils/symbol';
+export declare const SYMBOL_UNSET_FIELD_NAME: InternalSymbol;
+export declare const SYMBOL_UPDATE_COMMAND: InternalSymbol;
+export declare const SYMBOL_QUERY_COMMAND: InternalSymbol;
+export declare const SYMBOL_LOGIC_COMMAND: InternalSymbol;
+export declare const SYMBOL_GEO_POINT: InternalSymbol;
+export declare const SYMBOL_GEO_LINE_STRING: InternalSymbol;
+export declare const SYMBOL_GEO_POLYGON: InternalSymbol;
+export declare const SYMBOL_GEO_MULTI_POINT: InternalSymbol;
+export declare const SYMBOL_GEO_MULTI_LINE_STRING: InternalSymbol;
+export declare const SYMBOL_GEO_MULTI_POLYGON: InternalSymbol;
+export declare const SYMBOL_SERVER_DATE: InternalSymbol;
+export declare const SYMBOL_REGEXP: InternalSymbol;

+ 19 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/helper/symbol.js

@@ -0,0 +1,19 @@
+"use strict";
+function __export(m) {
+    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+Object.defineProperty(exports, "__esModule", { value: true });
+const symbol_1 = require("../utils/symbol");
+__export(require("../utils/symbol"));
+exports.SYMBOL_UNSET_FIELD_NAME = symbol_1.default.for('UNSET_FIELD_NAME');
+exports.SYMBOL_UPDATE_COMMAND = symbol_1.default.for('UPDATE_COMMAND');
+exports.SYMBOL_QUERY_COMMAND = symbol_1.default.for('QUERY_COMMAND');
+exports.SYMBOL_LOGIC_COMMAND = symbol_1.default.for('LOGIC_COMMAND');
+exports.SYMBOL_GEO_POINT = symbol_1.default.for('GEO_POINT');
+exports.SYMBOL_GEO_LINE_STRING = symbol_1.default.for('SYMBOL_GEO_LINE_STRING');
+exports.SYMBOL_GEO_POLYGON = symbol_1.default.for('SYMBOL_GEO_POLYGON');
+exports.SYMBOL_GEO_MULTI_POINT = symbol_1.default.for('SYMBOL_GEO_MULTI_POINT');
+exports.SYMBOL_GEO_MULTI_LINE_STRING = symbol_1.default.for('SYMBOL_GEO_MULTI_LINE_STRING');
+exports.SYMBOL_GEO_MULTI_POLYGON = symbol_1.default.for('SYMBOL_GEO_MULTI_POLYGON');
+exports.SYMBOL_SERVER_DATE = symbol_1.default.for('SERVER_DATE');
+exports.SYMBOL_REGEXP = symbol_1.default.for('REGEXP');

+ 49 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/index.d.ts

@@ -0,0 +1,49 @@
+import { Point } from './geo/point';
+import { CollectionReference } from './collection';
+import { Command } from './command';
+interface GeoTeyp {
+    Point: typeof Point;
+}
+export { Query } from './query';
+export { CollectionReference } from './collection';
+export { DocumentReference } from './document';
+interface ICloudBaseConfig {
+    timeout?: number;
+    isHttp?: boolean;
+    secretId?: string;
+    secretKey?: string;
+    envName?: string;
+    env?: string;
+    sessionToken?: string;
+    serviceUrl?: string;
+    headers?: any;
+    proxy?: string;
+    version?: string;
+    credentials?: ICredentialsInfo;
+    _useFeature?: boolean;
+    throwOnCode?: boolean;
+}
+interface ICredentialsInfo {
+    private_key_id: string;
+    private_key: string;
+}
+export declare class Db {
+    Geo: GeoTeyp;
+    command: typeof Command;
+    RegExp: any;
+    serverDate: any;
+    startTransaction: any;
+    runTransaction: any;
+    config: ICloudBaseConfig;
+    static ws: any;
+    static reqClass: any;
+    static wsClass: any;
+    static createSign: Function;
+    static getAccessToken: Function;
+    static dataVersion: string;
+    static runtime: string;
+    static appSecretInfo: any;
+    constructor(config?: any);
+    collection(collName: string): CollectionReference;
+    createCollection(collName: string): any;
+}

+ 39 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/index.js

@@ -0,0 +1,39 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const Geo = require("./geo/index");
+const collection_1 = require("./collection");
+const command_1 = require("./command");
+const index_1 = require("./serverDate/index");
+const index_2 = require("./regexp/index");
+const index_3 = require("./transaction/index");
+var query_1 = require("./query");
+exports.Query = query_1.Query;
+var collection_2 = require("./collection");
+exports.CollectionReference = collection_2.CollectionReference;
+var document_1 = require("./document");
+exports.DocumentReference = document_1.DocumentReference;
+class Db {
+    constructor(config) {
+        this.config = config;
+        this.Geo = Geo;
+        this.serverDate = index_1.ServerDateConstructor;
+        this.command = command_1.Command;
+        this.RegExp = index_2.RegExpConstructor;
+        this.startTransaction = index_3.startTransaction;
+        this.runTransaction = index_3.runTransaction;
+    }
+    collection(collName) {
+        if (!collName) {
+            throw new Error('Collection name is required');
+        }
+        return new collection_1.CollectionReference(this, collName);
+    }
+    createCollection(collName) {
+        let request = new Db.reqClass(this.config);
+        const params = {
+            collectionName: collName
+        };
+        return request.send('database.addCollection', params);
+    }
+}
+exports.Db = Db;

+ 1 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/lib/util.d.ts

@@ -0,0 +1 @@
+export declare const createPromiseCallback: () => any;

+ 25 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/lib/util.js

@@ -0,0 +1,25 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.createPromiseCallback = function () {
+    var cb;
+    if (!Promise) {
+        cb = function () { };
+        cb.promise = {};
+        var throwPromiseNotDefined = function () {
+            throw new Error('Your Node runtime does support ES6 Promises. ' +
+                'Set "global.Promise" to your preferred implementation of promises.');
+        };
+        Object.defineProperty(cb.promise, 'then', { get: throwPromiseNotDefined });
+        Object.defineProperty(cb.promise, 'catch', { get: throwPromiseNotDefined });
+        return cb;
+    }
+    var promise = new Promise(function (resolve, reject) {
+        cb = function (err, data) {
+            if (err)
+                return reject(err);
+            return resolve(data);
+        };
+    });
+    cb.promise = promise;
+    return cb;
+};

+ 4 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/operator-map.d.ts

@@ -0,0 +1,4 @@
+export declare const OperatorMap: {
+    [key: string]: string;
+};
+export declare function operatorToString(operator: string): string;

+ 23 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/operator-map.js

@@ -0,0 +1,23 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const query_1 = require("./commands/query");
+const logic_1 = require("./commands/logic");
+const update_1 = require("./commands/update");
+exports.OperatorMap = {};
+for (const key in query_1.QUERY_COMMANDS_LITERAL) {
+    exports.OperatorMap[key] = '$' + key;
+}
+for (const key in logic_1.LOGIC_COMMANDS_LITERAL) {
+    exports.OperatorMap[key] = '$' + key;
+}
+for (const key in update_1.UPDATE_COMMANDS_LITERAL) {
+    exports.OperatorMap[key] = '$' + key;
+}
+exports.OperatorMap[query_1.QUERY_COMMANDS_LITERAL.NEQ] = '$ne';
+exports.OperatorMap[update_1.UPDATE_COMMANDS_LITERAL.REMOVE] = '$unset';
+exports.OperatorMap[update_1.UPDATE_COMMANDS_LITERAL.SHIFT] = '$pop';
+exports.OperatorMap[update_1.UPDATE_COMMANDS_LITERAL.UNSHIFT] = '$push';
+function operatorToString(operator) {
+    return exports.OperatorMap[operator] || '$' + operator;
+}
+exports.operatorToString = operatorToString;

+ 37 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/query.d.ts

@@ -0,0 +1,37 @@
+import { OrderByDirection } from './constant';
+import { IWatchOptions, DBRealtimeListener } from './typings/index';
+interface GetRes {
+    data: any[];
+    requestId: string;
+    total: number;
+    limit: number;
+    offset: number;
+}
+interface BaseOption {
+    timeout?: number;
+}
+export interface QueryOption extends BaseOption {
+    limit?: number;
+    offset?: number;
+    projection?: Object;
+    order?: Record<string, any>[];
+}
+export interface UpdateOption extends BaseOption {
+    multiple?: boolean;
+}
+export declare class Query {
+    protected _transactionId: string;
+    get(): Promise<GetRes>;
+    count(): Promise<any>;
+    where(query: object): Query;
+    options(apiOptions: QueryOption | UpdateOption): Query;
+    orderBy(fieldPath: string, directionStr: OrderByDirection): Query;
+    limit(limit: number): Query;
+    skip(offset: number): Query;
+    update(data: Object): Promise<any>;
+    field(projection: any): Query;
+    remove(): Promise<any>;
+    updateAndReturn(data: Object): Promise<any>;
+    watch: (options: IWatchOptions) => DBRealtimeListener;
+}
+export {};

+ 247 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/query.js

@@ -0,0 +1,247 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const constant_1 = require("./constant");
+const index_1 = require("./index");
+const validate_1 = require("./validate");
+const util_1 = require("./util");
+const query_1 = require("./serializer/query");
+const update_1 = require("./serializer/update");
+const websocket_client_1 = require("./realtime/websocket-client");
+const constant_2 = require("./constant");
+const utils_1 = require("./utils/utils");
+const code_1 = require("./const/code");
+const bson_1 = require("bson");
+class Query {
+    constructor(db, coll, fieldFilters, apiOptions, transactionId) {
+        this.watch = (options) => {
+            if (!index_1.Db.ws) {
+                index_1.Db.ws = new websocket_client_1.RealtimeWebSocketClient({
+                    context: {
+                        appConfig: {
+                            docSizeLimit: 1000,
+                            realtimePingInterval: 10000,
+                            realtimePongWaitTimeout: 5000,
+                            request: this._request
+                        }
+                    }
+                });
+            }
+            const { limit, order } = this._apiOptions;
+            return index_1.Db.ws.watch(Object.assign(Object.assign({}, options), { envId: this._db.config.env, collectionName: this._coll, query: JSON.stringify(this._fieldFilters), limit, orderBy: order
+                    ? order.reduce((acc, cur) => {
+                        acc[cur.field] = cur.direction;
+                        return acc;
+                    }, {})
+                    : undefined }));
+        };
+        this._db = db;
+        this._coll = coll;
+        this._fieldFilters = fieldFilters;
+        this._apiOptions = apiOptions || {};
+        this._request = new index_1.Db.reqClass(this._db.config);
+        this._transactionId = transactionId;
+    }
+    async get() {
+        const order = this._apiOptions.order;
+        let param = {
+            collectionName: this._coll,
+            queryType: constant_1.QueryType.WHERE,
+            transactionId: this._transactionId
+        };
+        if (this._fieldFilters) {
+            param.query = this._fieldFilters;
+        }
+        if (order) {
+            param.order = utils_1.stringifyByEJSON(order);
+        }
+        const offset = this._apiOptions.offset;
+        if (offset) {
+            param.offset = offset;
+        }
+        const limit = this._apiOptions.limit;
+        if (limit) {
+            param.limit = limit < 1000 ? limit : 1000;
+        }
+        else {
+            param.limit = 100;
+        }
+        const projection = this._apiOptions.projection;
+        if (projection) {
+            param.projection = utils_1.stringifyByEJSON(projection);
+        }
+        const res = await this._request.send('database.getDocument', param, utils_1.getReqOpts(this._apiOptions));
+        if (res.code) {
+            return res;
+        }
+        const list = res.data.list.map(item => bson_1.EJSON.parse(item));
+        const documents = util_1.Util.formatResDocumentData(list);
+        const result = {
+            data: documents,
+            requestId: res.requestId
+        };
+        if (res.limit)
+            result.limit = res.limit;
+        if (res.offset)
+            result.offset = res.offset;
+        return result;
+    }
+    async count() {
+        let param = {
+            collectionName: this._coll,
+            queryType: constant_1.QueryType.WHERE
+        };
+        if (this._fieldFilters) {
+            param.query = this._fieldFilters;
+        }
+        const res = await this._request.send('database.calculateDocument', param, utils_1.getReqOpts(this._apiOptions));
+        if (res.code) {
+            return res;
+        }
+        return {
+            requestId: res.requestId,
+            total: res.data.total
+        };
+    }
+    where(query) {
+        if (Object.prototype.toString.call(query).slice(8, -1) !== 'Object') {
+            throw Error(constant_2.ErrorCode.QueryParamTypeError);
+        }
+        const keys = Object.keys(query);
+        const checkFlag = keys.some(item => {
+            return query[item] !== undefined;
+        });
+        if (keys.length && !checkFlag) {
+            throw Error(constant_2.ErrorCode.QueryParamValueError);
+        }
+        return new Query(this._db, this._coll, query_1.QuerySerializer.encodeEJSON(query), this._apiOptions, this._transactionId);
+    }
+    options(apiOptions) {
+        validate_1.Validate.isValidOptions(apiOptions);
+        return new Query(this._db, this._coll, this._fieldFilters, apiOptions, this._transactionId);
+    }
+    orderBy(fieldPath, directionStr) {
+        validate_1.Validate.isFieldPath(fieldPath);
+        validate_1.Validate.isFieldOrder(directionStr);
+        const newOrder = {
+            [fieldPath]: directionStr === 'desc' ? -1 : 1
+        };
+        const order = this._apiOptions.order || {};
+        const newApiOption = Object.assign({}, this._apiOptions, {
+            order: Object.assign({}, order, newOrder)
+        });
+        return new Query(this._db, this._coll, this._fieldFilters, newApiOption, this._transactionId);
+    }
+    limit(limit) {
+        validate_1.Validate.isInteger('limit', limit);
+        let newApiOption = Object.assign({}, this._apiOptions);
+        newApiOption.limit = limit;
+        return new Query(this._db, this._coll, this._fieldFilters, newApiOption, this._transactionId);
+    }
+    skip(offset) {
+        validate_1.Validate.isInteger('offset', offset);
+        let newApiOption = Object.assign({}, this._apiOptions);
+        newApiOption.offset = offset;
+        return new Query(this._db, this._coll, this._fieldFilters, newApiOption, this._transactionId);
+    }
+    async update(data) {
+        if (!data || typeof data !== 'object') {
+            return utils_1.processReturn(this._db.config.throwOnCode, Object.assign(Object.assign({}, code_1.ERRORS.INVALID_PARAM), { message: '参数必需是非空对象' }));
+        }
+        if (data.hasOwnProperty('_id')) {
+            return utils_1.processReturn(this._db.config.throwOnCode, Object.assign(Object.assign({}, code_1.ERRORS.INVALID_PARAM), { message: '不能更新_id的值' }));
+        }
+        let { multiple } = this._apiOptions;
+        const multi = multiple === undefined ? true : multiple;
+        let param = {
+            collectionName: this._coll,
+            queryType: constant_1.QueryType.WHERE,
+            multi,
+            merge: true,
+            upsert: false,
+            data: update_1.UpdateSerializer.encodeEJSON(data)
+        };
+        if (this._fieldFilters) {
+            param.query = this._fieldFilters;
+        }
+        const res = await this._request.send('database.modifyDocument', param, utils_1.getReqOpts(this._apiOptions));
+        if (res.code) {
+            return res;
+        }
+        return {
+            requestId: res.requestId,
+            updated: res.data.updated,
+            upsertId: res.data.upsert_id
+        };
+    }
+    field(projection) {
+        let transformProjection = {};
+        for (let k in projection) {
+            if (typeof projection[k] === 'boolean') {
+                transformProjection[k] = projection[k] === true ? 1 : 0;
+            }
+            if (typeof projection[k] === 'number') {
+                transformProjection[k] = projection[k] > 0 ? 1 : 0;
+            }
+            if (typeof projection[k] === 'object') {
+                transformProjection[k] = projection[k];
+            }
+        }
+        let newApiOption = Object.assign({}, this._apiOptions);
+        newApiOption.projection = transformProjection;
+        return new Query(this._db, this._coll, this._fieldFilters, newApiOption, this._transactionId);
+    }
+    async remove() {
+        const { offset, limit, projection, order } = this._apiOptions;
+        if (offset !== undefined ||
+            limit !== undefined ||
+            projection !== undefined ||
+            order !== undefined) {
+            console.warn('`offset`, `limit`, `projection`, `orderBy` are not supported in remove() operation');
+        }
+        let { multiple } = this._apiOptions;
+        const multi = multiple === undefined ? true : multiple;
+        const param = {
+            collectionName: this._coll,
+            query: this._fieldFilters,
+            queryType: constant_1.QueryType.WHERE,
+            multi
+        };
+        const res = await this._request.send('database.removeDocument', param, utils_1.getReqOpts(this._apiOptions));
+        if (res.code) {
+            return res;
+        }
+        return {
+            requestId: res.requestId,
+            deleted: res.data.deleted
+        };
+    }
+    async updateAndReturn(data) {
+        if (!data || typeof data !== 'object') {
+            return utils_1.processReturn(this._db.config.throwOnCode, Object.assign(Object.assign({}, code_1.ERRORS.INVALID_PARAM), { message: '参数必需是非空对象' }));
+        }
+        if (data.hasOwnProperty('_id')) {
+            return utils_1.processReturn(this._db.config.throwOnCode, Object.assign(Object.assign({}, code_1.ERRORS.INVALID_PARAM), { message: '不能更新_id的值' }));
+        }
+        let param = {
+            collectionName: this._coll,
+            queryType: constant_1.QueryType.WHERE,
+            data: update_1.UpdateSerializer.encodeEJSON(data)
+        };
+        if (this._transactionId) {
+            param.transactionId = this._transactionId;
+        }
+        if (this._fieldFilters) {
+            param.query = this._fieldFilters;
+        }
+        const res = await this._request.send('database.modifyAndReturnDoc', param, utils_1.getReqOpts(this._apiOptions));
+        if (res.code) {
+            return res;
+        }
+        return {
+            requestId: res.requestId,
+            updated: res.data.updated,
+            doc: res.data.doc && bson_1.EJSON.parse(res.data.doc)
+        };
+    }
+}
+exports.Query = Query;

+ 7 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/realtime/error.d.ts

@@ -0,0 +1,7 @@
+import { IResponseMessageErrorMsg } from '../typings/realtime';
+export declare class RealtimeErrorMessageError extends Error {
+    isRealtimeErrorMessageError: boolean;
+    payload: IResponseMessageErrorMsg;
+    constructor(serverErrorMsg: IResponseMessageErrorMsg);
+}
+export declare const isRealtimeErrorMessageError: (e: any) => e is RealtimeErrorMessageError;

+ 11 - 0
cloudfunctions/quickstartFunctions/node_modules/@cloudbase/database/dist/commonjs/realtime/error.js

@@ -0,0 +1,11 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+class RealtimeErrorMessageError extends Error {
+    constructor(serverErrorMsg) {
+        super(`Watch Error ${JSON.stringify(serverErrorMsg.msgData)} (requestid: ${serverErrorMsg.requestId})`);
+        this.isRealtimeErrorMessageError = true;
+        this.payload = serverErrorMsg;
+    }
+}
+exports.RealtimeErrorMessageError = RealtimeErrorMessageError;
+exports.isRealtimeErrorMessageError = (e) => e && e.isRealtimeErrorMessageError;

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.