gql.js 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123
  1. // 注意是否使用 gql
  2. // apollo client 需要使用 gql
  3. // graphql-request 不需要使用 gql
  4. // import gql from "graphql-tag";
  5. const GET_USER = `
  6. query USER($id: ID!) {
  7. user_by_id(id: $id) {
  8. email
  9. updatedAt
  10. password
  11. telephone
  12. nickname
  13. username
  14. createdAt
  15. openid
  16. id
  17. avatar
  18. }
  19. }
  20. `;
  21. const SEARCH_USER = `
  22. query USER($username: String) {
  23. user_by_props(username: $username) {
  24. email
  25. updatedAt
  26. password
  27. telephone
  28. nickname
  29. username
  30. createdAt
  31. openid
  32. id
  33. avatar
  34. }
  35. }
  36. `;
  37. const ADD_USER = `
  38. mutation USER($email: String, $language: String, $updatedAt: String, $password: String, $telephone: String, $nickname: String, $username: String, $createdAt: String, $openid: String, $id: ID!, $avatar: String) {
  39. create_user(
  40. language: $language
  41. email: $email
  42. updatedAt: $updatedAt
  43. password: $password
  44. telephone: $telephone
  45. nickname: $nickname
  46. username: $username
  47. createdAt: $createdAt
  48. openid: $openid
  49. id: $id
  50. avatar: $avatar
  51. ) {
  52. language
  53. email
  54. updatedAt
  55. password
  56. telephone
  57. nickname
  58. username
  59. createdAt
  60. openid
  61. id
  62. avatar
  63. }
  64. }
  65. `;
  66. const UPDATE_USER = `
  67. mutation USER($email: String, $language: String, $updatedAt: String, $telephone: String, $nickname: String, $openid: String, $id: ID!, $avatar: String) {
  68. update_user(
  69. id: $id
  70. language: $language
  71. email: $email
  72. updatedAt: $updatedAt
  73. telephone: $telephone
  74. nickname: $nickname
  75. openid: $openid
  76. avatar: $avatar
  77. ) {
  78. language
  79. email
  80. updatedAt
  81. password
  82. telephone
  83. nickname
  84. username
  85. createdAt
  86. openid
  87. id
  88. avatar
  89. }
  90. }
  91. `;
  92. const SHOW_SCHEMA = `
  93. query SCHEMA($user_id: ID) {
  94. schema_by_props(user_id: $user_id) {
  95. schemaData
  96. schemaName
  97. id
  98. reference
  99. schemaState
  100. }
  101. }
  102. `;
  103. const SHOW_CASE_SCHEMA = `
  104. query SHOW_CASE_SCHEMA {
  105. caseSchema:schema_by_props(user_id: "ioobot") {
  106. schemaData
  107. schemaName
  108. id
  109. reference
  110. schemaState
  111. }
  112. }
  113. `;
  114. const SHOW_ALL_SCHEMA = `
  115. query SCHEMA($user_id: ID) {
  116. userSchema:schema_by_props(user_id: $user_id) {
  117. schemaData
  118. schemaName
  119. id
  120. reference
  121. schemaState
  122. }
  123. caseSchema:schema_by_props(user_id: "ioobot") {
  124. schemaData
  125. schemaName
  126. id
  127. reference
  128. schemaState
  129. }
  130. }
  131. `;
  132. const SEARCH_SCHEMA = `
  133. query SCHEMA($id: ID!) {
  134. schema_by_id(id: $id) {
  135. schemaName
  136. schemaData
  137. id
  138. reference
  139. schemaState
  140. }
  141. }
  142. `;
  143. const ADD_SCHEMA = `
  144. mutation SCHEMA($id: ID!, $user_id: ID!, $schemaName: String!, $schemaData: String!, $createdAt: String, $updatedAt: String, $schemaState: String, $reference: String) {
  145. create_schema(
  146. id: $id,
  147. user_id: $user_id,
  148. schemaName: $schemaName,
  149. createdAt: $createdAt,
  150. updatedAt: $updatedAt,
  151. schemaData: $schemaData,
  152. schemaState: $schemaState
  153. reference: $reference
  154. ) {
  155. schemaName,
  156. schemaData
  157. id
  158. reference
  159. schemaState
  160. }
  161. }
  162. `;
  163. const DELETE_SCHEMA = `
  164. mutation SCHEMA($schemaName: String, $user_id: ID) {
  165. delete_schema(schemaName: $schemaName, user_id: $user_id)
  166. }
  167. `;
  168. const UPDATE_SCHEMA = `
  169. mutation SCHEMA($id: ID!, $schemaData: String!, $updatedAt: String, $schemaState: String) {
  170. update_schema(
  171. id: $id,
  172. updatedAt: $updatedAt,
  173. schemaData: $schemaData,
  174. schemaState: $schemaState
  175. ) {
  176. schemaName,
  177. schemaData
  178. id
  179. schemaState
  180. }
  181. }
  182. `;
  183. const UPDATE_SCHEMA_PROJECT_NAME = `
  184. mutation UPDATE_SCHEMA_PROJECT_NAME($schemaID: ID!, $projectID: ID, $schemaName: String, $updatedAt: String) {
  185. update_schema(
  186. id: $schemaID,
  187. updatedAt: $updatedAt,
  188. schemaName: $schemaName,
  189. ) {
  190. schemaName,
  191. id
  192. schemaState
  193. }
  194. update_project(
  195. id: $projectID,
  196. updatedAt: $updatedAt,
  197. projectName: $schemaName,
  198. ){
  199. projectName,
  200. id,
  201. schema_id{
  202. id
  203. }
  204. }
  205. }
  206. `;
  207. const ADD_PROJECT_AND_SCHEMA = `
  208. mutation ADD_PROJECT_AND_SCHEMA($schemaId: ID!, $user_id: ID!, $schemaName: String!, $schemaData: String!, $schemaCreatedAt: String, $schemaUpdatedAt: String, $schemaState: String, $reference: String,
  209. , $projectStatus: String, $projectCreatedAt: String, $projectUpdatedAt: String, $database_id: ID, $case_id: ID, $apiGWGroup_id: ID, $projectName: String, $deploy_id: ID, $projectId: ID!, $projectType: String, $cloud_id: ID, $user_id: ID, $wxConfig_id: ID, $schema_id: ID) {
  210. create_schema(
  211. id: $schemaId,
  212. user_id: $user_id,
  213. schemaName: $schemaName,
  214. createdAt: $schemaCreatedAt,
  215. updatedAt: $schemaUpdatedAt,
  216. schemaData: $schemaData,
  217. schemaState: $schemaState
  218. reference: $reference
  219. ) {
  220. schemaName,
  221. schemaData
  222. id
  223. reference
  224. schemaState
  225. }
  226. create_project(
  227. createdAt: $projectCreatedAt,
  228. updatedAt: $projectUpdatedAt,
  229. database_id: $database_id,
  230. apiGWGroup_id: $apiGWGroup_id,
  231. projectName: $projectName,
  232. deploy_id: $deploy_id,
  233. id: $projectId,
  234. projectType: $projectType,
  235. cloud_id: $cloud_id,
  236. user_id: $user_id,
  237. wxConfig_id: $wxConfig_id,
  238. schema_id: $schema_id
  239. projectStatus: $projectStatus
  240. case_id: $case_id
  241. ) {
  242. projectStatus
  243. updatedAt
  244. createdAt
  245. projectName
  246. id
  247. projectType
  248. schema_id {
  249. updatedAt
  250. schemaState
  251. authWrite
  252. authReadObjects
  253. createdAt
  254. authRead
  255. schemaName
  256. reference
  257. id
  258. schemaData
  259. authReadWrite
  260. authWriteObjects
  261. }
  262. }
  263. }
  264. `;
  265. const ADD_PROJECT = `
  266. mutation createproject($updatedAt: String, $database_id: ID, $apiGWGroup_id: ID, $case_id: ID, $createdAt: String, $projectStatus: String, $projectName: String, $deploy_id: ID, $notification_id: ID, $id: ID!, $projectType: String, $cloud_id: ID, $user_id: ID, $wxConfig_id: ID, $schema_id: ID) {
  267. createproject: create_project(updatedAt: $updatedAt database_id: $database_id case_id: $case_id apiGWGroup_id: $apiGWGroup_id createdAt: $createdAt projectStatus: $projectStatus projectName: $projectName deploy_id: $deploy_id notification_id: $notification_id id: $id projectType: $projectType cloud_id: $cloud_id user_id: $user_id wxConfig_id: $wxConfig_id schema_id: $schema_id) {
  268. projectStatus
  269. updatedAt
  270. createdAt
  271. projectName
  272. id
  273. projectType
  274. }
  275. }
  276. `;
  277. const ADD_PROJECT_AND_WX = `
  278. mutation ADD_PROJECT_AND_WX($wxUpdatedAt: String, $mch_id: String, $appName: String, $notify_url: String, $appSecret: String, $wxCreatedAt: String, $appID: String, $token: String, $spbill_create_ip: String, $enter_url: String, $wxConfigId: ID!, $pay_api_key: String, $user_id: ID, $body: String, $welcome_words: String, $attach: String
  279. , $projectStatus: String, $projectCreatedAt: String, $projectUpdatedAt: String, $database_id: ID, $case_id: ID, $apiGWGroup_id: ID, $projectName: String, $deploy_id: ID, $projectId: ID!, $projectType: String, $cloud_id: ID, $user_id: ID, $wxConfig_id: ID, $schema_id: ID) {
  280. create_wxConfig(
  281. createdAt: $wxCreatedAt
  282. updatedAt: $wxUpdatedAt
  283. mch_id: $mch_id
  284. appName: $appName
  285. notify_url: $notify_url
  286. appSecret: $appSecret
  287. appID: $appID
  288. token: $token
  289. spbill_create_ip: $spbill_create_ip
  290. enter_url: $enter_url
  291. id: $wxConfigId
  292. pay_api_key: $pay_api_key
  293. user_id: $user_id
  294. body: $body
  295. welcome_words: $welcome_words
  296. attach: $attach
  297. ) {
  298. mch_id
  299. appName
  300. notify_url
  301. appSecret
  302. appID
  303. token
  304. spbill_create_ip
  305. enter_url
  306. id
  307. pay_api_key
  308. body
  309. welcome_words
  310. attach
  311. }
  312. create_project(
  313. createdAt: $projectCreatedAt,
  314. updatedAt: $projectUpdatedAt,
  315. database_id: $database_id,
  316. apiGWGroup_id: $apiGWGroup_id,
  317. projectName: $projectName,
  318. deploy_id: $deploy_id,
  319. id: $projectId,
  320. projectType: $projectType,
  321. cloud_id: $cloud_id,
  322. user_id: $user_id,
  323. wxConfig_id: $wxConfig_id,
  324. schema_id: $schema_id
  325. projectStatus: $projectStatus
  326. case_id: $case_id
  327. ) {
  328. projectStatus
  329. updatedAt
  330. createdAt
  331. projectName
  332. id
  333. projectType
  334. schema_id {
  335. updatedAt
  336. schemaState
  337. authWrite
  338. authReadObjects
  339. createdAt
  340. authRead
  341. schemaName
  342. reference
  343. id
  344. schemaData
  345. authReadWrite
  346. authWriteObjects
  347. }
  348. }
  349. }
  350. `;
  351. const CASE_AND_PROJECT = `
  352. query CASE_AND_PROJECT($user_id: ID, $projectType: String ) {
  353. caseProject:project_by_props(
  354. projectType: $projectType,
  355. user_id: "ioobot"
  356. ) {
  357. updatedAt
  358. apiGWGroup_id {
  359. id
  360. }
  361. createdAt
  362. projectName
  363. id
  364. projectType
  365. wxConfig_id {
  366. id
  367. appName
  368. }
  369. schema_id {
  370. schemaData
  371. schemaName
  372. id
  373. reference
  374. schemaState
  375. }
  376. }
  377. project:project_by_props(
  378. projectType: $projectType,
  379. user_id: $user_id
  380. ) {
  381. updatedAt
  382. apiGWGroup_id {
  383. id
  384. }
  385. createdAt
  386. projectName
  387. id
  388. case_id {
  389. id
  390. }
  391. projectType
  392. wxConfig_id {
  393. id
  394. appName
  395. }
  396. schema_id {
  397. id
  398. }
  399. }
  400. }
  401. `;
  402. const SHOW_PROJECT = `
  403. query PROJECT_BY_PROPS($projectType: String, $user_id: ID) {
  404. project:project_by_props(
  405. projectType: $projectType,
  406. user_id: $user_id
  407. ) {
  408. updatedAt
  409. apiGWGroup_id {
  410. id
  411. }
  412. createdAt
  413. projectName
  414. id
  415. case_id {
  416. id
  417. }
  418. projectType
  419. wxConfig_id {
  420. id
  421. }
  422. schema_id {
  423. id
  424. }
  425. }
  426. }
  427. `;
  428. const DELETE_PROJECT = `
  429. mutation DELETE_PROJECT($id: ID, $user_id: ID) {
  430. delete_project(id: $id, user_id: $user_id)
  431. }
  432. `;
  433. const SHOW_TABLE = `
  434. query TABLE($schema_id: ID!) {
  435. schema_by_id(id: $schema_id) {
  436. schemaData
  437. schemaName
  438. reference
  439. schemaState
  440. }
  441. }
  442. `;
  443. const ADD_CLOUD = `
  444. mutation CLOUD($id: ID!, $user_id: ID, $cloudName: String, $secretId: String, $secretKey: String, $updatedAt: String, $createdAt: String, $appId: String) {
  445. create_cloud(
  446. id: $id
  447. user_id: $user_id
  448. cloudName: $cloudName
  449. secretId: $secretId
  450. secretKey: $secretKey
  451. createdAt: $createdAt
  452. updatedAt: $updatedAt
  453. appId: $appId
  454. ) {
  455. id
  456. cloudName
  457. secretId
  458. secretKey
  459. appId
  460. }
  461. }
  462. `;
  463. const SHOW_CLOUD = `
  464. query CLOUD($user_id: ID!) {
  465. cloud_by_props(user_id: $user_id) {
  466. id
  467. cloudName
  468. secretId
  469. secretKey
  470. appId
  471. }
  472. }
  473. `;
  474. const UPDATE_CLOUD = `
  475. mutation updatecloud($id: ID, $secretId: String, $secretKey: String $updatedAt: String, $appId: String) {
  476. update_cloud(
  477. id: $id
  478. secretId: $secretId
  479. secretKey: $secretKey
  480. updatedAt: $updatedAt
  481. appId: $appId
  482. ) {
  483. id
  484. cloudName
  485. secretId
  486. secretKey
  487. appId
  488. }
  489. }
  490. `;
  491. const ADD_DEPLOY = `
  492. mutation DEPLOY($serviceName:String, $description: String, $updatedAt: String, $cosBucketName: String, $memorySize: Int, $fc_id: ID, $createdAt: String, $subnetId: String, $cosObjectName: String, $region: String, $vpcId: String, $cosBucketRegion: String, $id: ID!, $cloud_id: ID, $user_id: ID, $timeout: Int, $handler: String, $functionName: String) {
  493. create_deploy(
  494. id: $id
  495. description: $description
  496. cosBucketName: $cosBucketName
  497. memorySize: $memorySize
  498. fc_id: $fc_id
  499. subnetId: $subnetId
  500. cosObjectName: $cosObjectName
  501. region: $region
  502. vpcId: $vpcId
  503. cosBucketRegion: $cosBucketRegion
  504. cloud_id: $cloud_id
  505. user_id: $user_id
  506. timeout: $timeout
  507. handler: $handler
  508. functionName: $functionName
  509. serviceName: $serviceName
  510. createdAt: $createdAt
  511. updatedAt: $updatedAt
  512. ) {
  513. id
  514. }
  515. }
  516. `;
  517. const UPDATE_DEPLOY = `
  518. mutation DEPLOY($id: ID!, $description: String, $updatedAt: String, $cosBucketName: String, $subnetId: String, $cosObjectName: String, $region: String, $vpcId: String, $cosBucketRegion: String, $functionName: String) {
  519. update_deploy(
  520. id: $id
  521. description: $description
  522. cosBucketName: $cosBucketName
  523. subnetId: $subnetId
  524. cosObjectName: $cosObjectName
  525. region: $region
  526. vpcId: $vpcId
  527. cosBucketRegion: $cosBucketRegion
  528. functionName: $functionName
  529. updatedAt: $updatedAt
  530. ) {
  531. id
  532. }
  533. }
  534. `;
  535. const SEARCH_APIGROUP = `
  536. query apiGWGroupbyid($id: ID) {
  537. apiGWGroupbyid: apiGWGroup_by_id(id: $id) {
  538. environmentName
  539. userStatus
  540. defaultDomain
  541. updatedAt
  542. userDomain
  543. groupName
  544. createdAt
  545. frontType
  546. region
  547. serviceId
  548. status
  549. id
  550. }
  551. }
  552. `;
  553. const SHOW_APIGROUP = `
  554. query apiGWGroupbyprops($user_id: ID, $groupName: String) {
  555. apiGWGroupbyprops: apiGWGroup_by_props(user_id: $user_id, groupName: $groupName) {
  556. environmentName
  557. userStatus
  558. defaultDomain
  559. updatedAt
  560. userDomain
  561. groupName
  562. createdAt
  563. frontType
  564. region
  565. serviceId
  566. status
  567. id
  568. cloud_id {
  569. cloudName
  570. }
  571. }
  572. }
  573. `;
  574. const ADD_APIGROUP = `
  575. mutation GROUP($serviceId: String, $environmentName: String, $userStatus: String, $defaultDomain: String, $updatedAt: String, $userDomain: String, $groupName: String, $createdAt: String, $frontType: String, $region: String, $status: String, $id: ID!, $cloud_id: ID, $user_id: ID) {
  576. create_apiGWGroup(
  577. id: $id
  578. userStatus: $userStatus
  579. defaultDomain: $defaultDomain
  580. updatedAt: $updatedAt
  581. userDomain: $userDomain
  582. groupName: $groupName
  583. createdAt: $createdAt
  584. frontType: $frontType
  585. region: $region
  586. status: $status
  587. cloud_id: $cloud_id
  588. user_id: $user_id
  589. environmentName: $environmentName
  590. serviceId: $serviceId
  591. ) {
  592. id
  593. userStatus
  594. }
  595. }
  596. `;
  597. const UPDATE_APIGROUP = `
  598. mutation GROUP($id:ID!, $environmentName: String, $userStatus: String, $updatedAt: String, $userDomain: String, $groupName: String, $frontType: String, $region: String) {
  599. update_apiGWGroup(
  600. id: $id
  601. userStatus: $userStatus
  602. userDomain: $userDomain
  603. groupName: $groupName
  604. frontType: $frontType
  605. region: $region
  606. environmentName: $environmentName
  607. updatedAt: $updatedAt
  608. ) {
  609. id
  610. userStatus
  611. }
  612. }
  613. `;
  614. const DELETE_APIGROUP = `
  615. mutation deleteapiGWGroup($id: ID, $user_id: ID) {
  616. delete_apiGWGroup(id: $id user_id: $user_id)
  617. }
  618. `;
  619. const SHOW_APIGWPATH = `
  620. query PATH($apiGWGroup_id: ID!) {
  621. apiGWPath_by_props(apiGWGroup_id: $apiGWGroup_id) {
  622. id
  623. apiGWName
  624. apiGWDesc
  625. requestMethod
  626. apiGWPath
  627. }
  628. }
  629. `;
  630. const ADD_APIGWPATH = `
  631. mutation PATH($apiId: String, $apiGWName: String, $updatedAt: String, $apiGWGroup_id: ID, $createdAt: String, $deploy_id: ID, $serviceType: String, $id: ID!, $apiGWPath: String, $user_id: ID, $timeout: Int, $apiGWDesc: String, $requestMethod: String) {
  632. create_apiGWPath(
  633. apiGWName: $apiGWName
  634. updatedAt: $updatedAt
  635. apiGWGroup_id: $apiGWGroup_id
  636. createdAt: $createdAt
  637. deploy_id: $deploy_id
  638. serviceType: $serviceType
  639. id: $id
  640. apiGWPath: $apiGWPath
  641. user_id: $user_id
  642. timeout: $timeout
  643. apiGWDesc: $apiGWDesc
  644. requestMethod: $requestMethod
  645. apiId: $apiId
  646. ) {
  647. id
  648. }
  649. }
  650. `;
  651. const UPDATE_APIGWPATH = `
  652. mutation PATH($apiGWName: String, $updatedAt: String, $apiGWDesc: String, $requestMethod: String) {
  653. update_apiGWPath(
  654. apiGWName: $apiGWName
  655. apiGWDesc: $apiGWDesc
  656. requestMethod: $requestMethod
  657. updatedAt: $updatedAt
  658. ) {
  659. id
  660. }
  661. }
  662. `;
  663. const DELETE_APIGWPATH = `
  664. mutation deleteapiGWPath($id: ID, $user_id: ID) {
  665. delete_apiGWPath(id: $id user_id: $user_id)
  666. }
  667. `;
  668. const SHOW_ALL_WXCONFIG = `
  669. query WXCONFIG($user_id: ID) {
  670. userWxConfig:wxConfig_by_props(user_id: $user_id) {
  671. appID
  672. appName
  673. appSecret
  674. attach
  675. body
  676. enter_url
  677. id
  678. mch_id
  679. notify_url
  680. pay_api_key
  681. spbill_create_ip
  682. token
  683. welcome_words
  684. }
  685. caseWxConfig:wxConfig_by_props(user_id: "ioobot") {
  686. appID
  687. appName
  688. appSecret
  689. attach
  690. body
  691. enter_url
  692. id
  693. mch_id
  694. notify_url
  695. pay_api_key
  696. spbill_create_ip
  697. token
  698. welcome_words
  699. }
  700. }
  701. `;
  702. const SHOW_WXCONFIG = `
  703. query WXCONFIG($user_id: ID) {
  704. wxConfig_by_props(user_id: $user_id) {
  705. appID
  706. appName
  707. appSecret
  708. attach
  709. body
  710. enter_url
  711. id
  712. mch_id
  713. notify_url
  714. pay_api_key
  715. spbill_create_ip
  716. token
  717. welcome_words
  718. }
  719. }
  720. `;
  721. const ADD_WXCONFIG = `
  722. mutation createwxConfig($updatedAt: String, $mch_id: String, $appName: String, $notify_url: String, $appSecret: String, $createdAt: String, $appID: String, $token: String, $spbill_create_ip: String, $enter_url: String, $id: ID!, $pay_api_key: String, $user_id: ID, $body: String, $welcome_words: String, $attach: String) {
  723. create_wxConfig(
  724. updatedAt: $updatedAt
  725. mch_id: $mch_id
  726. appName: $appName
  727. notify_url: $notify_url
  728. appSecret: $appSecret
  729. createdAt: $createdAt
  730. appID: $appID
  731. token: $token
  732. spbill_create_ip: $spbill_create_ip
  733. enter_url: $enter_url
  734. id: $id
  735. pay_api_key: $pay_api_key
  736. user_id: $user_id
  737. body: $body
  738. welcome_words: $welcome_words
  739. attach: $attach
  740. ) {
  741. mch_id
  742. appName
  743. notify_url
  744. appSecret
  745. appID
  746. token
  747. spbill_create_ip
  748. enter_url
  749. id
  750. pay_api_key
  751. body
  752. welcome_words
  753. attach
  754. }
  755. }
  756. `;
  757. const SHOW_WXCONTENT = `
  758. query wxConfigbyid($id: ID) {
  759. wxConfig_by_id(id: $id) {
  760. mch_id
  761. appName
  762. notify_url
  763. appSecret
  764. appID
  765. token
  766. spbill_create_ip
  767. enter_url
  768. id
  769. pay_api_key
  770. body
  771. welcome_words
  772. attach
  773. }
  774. }
  775. `;
  776. const UPDATE_WXCONFIG = `
  777. mutation updatewxConfig($id: ID, $updatedAt: String, $mch_id: String, $appName: String, $notify_url: String, $appSecret: String, $appID: String, $token: String, $spbill_create_ip: String, $enter_url: String, $pay_api_key: String, $body: String, $welcome_words: String, $attach: String) {
  778. update_wxConfig(
  779. id: $id
  780. updatedAt: $updatedAt
  781. mch_id: $mch_id
  782. appName: $appName
  783. notify_url: $notify_url
  784. appSecret: $appSecret
  785. appID: $appID
  786. token: $token
  787. spbill_create_ip: $spbill_create_ip
  788. enter_url: $enter_url
  789. pay_api_key: $pay_api_key
  790. body: $body
  791. welcome_words: $welcome_words
  792. attach: $attach
  793. ) {
  794. id
  795. mch_id
  796. appName
  797. notify_url
  798. appSecret
  799. appID
  800. token
  801. spbill_create_ip
  802. enter_url
  803. pay_api_key
  804. body
  805. welcome_words
  806. attach
  807. }
  808. }
  809. `;
  810. const DELETE_WXCONFIG = `
  811. mutation deletewxConfig($id: ID) {
  812. delete_wxConfig(id: $id)
  813. }
  814. `;
  815. const GET_PROJECT = `
  816. query projectbyid($id: ID) {
  817. project_by_id(id: $id) {
  818. updatedAt
  819. projectStatus
  820. database_id {
  821. id
  822. }
  823. apiGWGroup_id {
  824. id
  825. groupName
  826. region
  827. frontType
  828. defaultDomain
  829. userStatus
  830. userDomain
  831. serviceId
  832. environmentName
  833. }
  834. projectName
  835. deploy_id {
  836. description
  837. updatedAt
  838. cosBucketName
  839. memorySize
  840. createdAt
  841. subnetId
  842. cosObjectName
  843. region
  844. vpcId
  845. cosBucketRegion
  846. id
  847. serviceName
  848. timeout
  849. handler
  850. functionName
  851. }
  852. case_id {
  853. id
  854. }
  855. id
  856. projectType
  857. cloud_id {
  858. id
  859. cloudName
  860. secretId
  861. secretKey
  862. appId
  863. createdAt
  864. updatedAt
  865. }
  866. user_id {
  867. id
  868. }
  869. wxConfig_id {
  870. id
  871. updatedAt
  872. mch_id
  873. appName
  874. notify_url
  875. appSecret
  876. createdAt
  877. appID
  878. token
  879. spbill_create_ip
  880. enter_url
  881. id
  882. pay_api_key
  883. body
  884. welcome_words
  885. attach
  886. }
  887. schema_id {
  888. updatedAt
  889. schemaState
  890. createdAt
  891. schemaName
  892. reference
  893. id
  894. schemaData
  895. }
  896. notification_id {
  897. id
  898. type
  899. webhook
  900. name
  901. }
  902. }
  903. }
  904. `;
  905. const UPDATE_PROJECT_GROUP = `
  906. mutation updateproject($id: ID, $updatedAt: String, $apiGWGroup_id: ID, $projectStatus: String) {
  907. update_project(id: $id updatedAt: $updatedAt apiGWGroup_id: $apiGWGroup_id projectStatus: $projectStatus) {
  908. projectStatus
  909. updatedAt
  910. projectName
  911. id
  912. projectType
  913. }
  914. }
  915. `;
  916. const UPDATE_PROJECT_DEPLOY = `
  917. mutation updateproject($id: ID, $updatedAt: String, $deploy_id: ID, $projectStatus: String) {
  918. update_project(id: $id updatedAt: $updatedAt deploy_id: $deploy_id projectStatus: $projectStatus) {
  919. projectStatus
  920. updatedAt
  921. projectName
  922. id
  923. projectType
  924. }
  925. }
  926. `;
  927. const UPDATE_PROJECT_CLOUD = `
  928. mutation updateproject($id: ID, $updatedAt: String, $cloud_id: ID, $projectStatus: String) {
  929. update_project(id: $id updatedAt: $updatedAt cloud_id: $cloud_id projectStatus: $projectStatus) {
  930. projectStatus
  931. updatedAt
  932. projectName
  933. id
  934. projectType
  935. }
  936. }
  937. `;
  938. const UPDATE_PROJECT_DATABASE = `
  939. mutation updateproject($id: ID, $updatedAt: String, $database_id: ID, $projectStatus: String) {
  940. update_project(id: $id updatedAt: $updatedAt database_id: $database_id projectStatus: $projectStatus) {
  941. projectStatus
  942. updatedAt
  943. projectName
  944. id
  945. projectType
  946. }
  947. }
  948. `;
  949. const UPDATE_PROJECT_DEPLOY_AND_CLOUD = `
  950. mutation updateproject($id: ID, $updatedAt: String, $deploy_id: ID, $cloud_id: ID, $projectStatus: String) {
  951. update_project(id: $id updatedAt: $updatedAt deploy_id: $deploy_id cloud_id: $cloud_id projectStatus: $projectStatus) {
  952. projectStatus
  953. updatedAt
  954. projectName
  955. id
  956. projectType
  957. }
  958. }
  959. `;
  960. const UPDATE_PROJECT_ONLY_STATUS = `
  961. mutation updateproject($id: ID, $updatedAt: String, $projectStatus: String) {
  962. update_project(id: $id updatedAt: $updatedAt projectStatus: $projectStatus) {
  963. projectStatus
  964. updatedAt
  965. projectName
  966. id
  967. projectType
  968. }
  969. }
  970. `;
  971. const ADD_NOTIFICATION = `
  972. mutation createnotification($id: ID!, $type: String, $webhook: String, $name: String, $user_id: ID) {
  973. create_notification(id: $id type: $type webhook: $webhook name: $name user_id: $user_id) {
  974. id
  975. type
  976. webhook
  977. name
  978. user_id {
  979. id
  980. }
  981. }
  982. }
  983. `;
  984. const UPDATE_NOTIFICATION = `
  985. mutation updatenotification($id: ID, $type: String, $webhook: String, $name: String) {
  986. update_notification(id: $id type: $type webhook: $webhook name: $name) {
  987. id
  988. type
  989. webhook
  990. name
  991. }
  992. }
  993. `;
  994. const SHOW_CASE = `
  995. query CASE($user_id: ID!) {
  996. case_by_props(user_id: $user_id) {
  997. id
  998. img
  999. schema_id {
  1000. id
  1001. }
  1002. img
  1003. deployedNum
  1004. title
  1005. description
  1006. detailDescription
  1007. detailImages
  1008. }
  1009. }
  1010. `;
  1011. export {
  1012. ADD_USER,
  1013. GET_USER,
  1014. SEARCH_USER,
  1015. UPDATE_USER,
  1016. SEARCH_SCHEMA,
  1017. ADD_SCHEMA,
  1018. SHOW_CASE_SCHEMA,
  1019. SHOW_ALL_SCHEMA,
  1020. SHOW_SCHEMA,
  1021. UPDATE_SCHEMA,
  1022. UPDATE_SCHEMA_PROJECT_NAME,
  1023. DELETE_SCHEMA,
  1024. DELETE_PROJECT,
  1025. SHOW_TABLE,
  1026. ADD_PROJECT_AND_SCHEMA,
  1027. CASE_AND_PROJECT,
  1028. SHOW_PROJECT,
  1029. ADD_CLOUD,
  1030. SHOW_CLOUD,
  1031. UPDATE_CLOUD,
  1032. ADD_DEPLOY,
  1033. UPDATE_DEPLOY,
  1034. SEARCH_APIGROUP,
  1035. SHOW_APIGROUP,
  1036. ADD_APIGROUP,
  1037. UPDATE_APIGROUP,
  1038. DELETE_APIGROUP,
  1039. SHOW_APIGWPATH,
  1040. ADD_APIGWPATH,
  1041. UPDATE_APIGWPATH,
  1042. DELETE_APIGWPATH,
  1043. ADD_PROJECT_AND_WX,
  1044. SHOW_ALL_WXCONFIG,
  1045. SHOW_WXCONFIG,
  1046. ADD_WXCONFIG,
  1047. SHOW_WXCONTENT,
  1048. UPDATE_WXCONFIG,
  1049. DELETE_WXCONFIG,
  1050. GET_PROJECT,
  1051. UPDATE_PROJECT_GROUP,
  1052. UPDATE_PROJECT_DEPLOY,
  1053. UPDATE_PROJECT_CLOUD,
  1054. UPDATE_PROJECT_DATABASE,
  1055. UPDATE_PROJECT_DEPLOY_AND_CLOUD,
  1056. UPDATE_PROJECT_ONLY_STATUS,
  1057. ADD_NOTIFICATION,
  1058. UPDATE_NOTIFICATION,
  1059. SHOW_CASE,
  1060. ADD_PROJECT
  1061. }