1- import {
2- Subscription ,
3- Chain ,
4- DeployCodeToCloudEnv ,
5- DeployCodeToCloudURIKind ,
6- GraphQLTypes ,
7- ValueTypes ,
8- } from '@/zeus/index.js' ;
1+ import { Subscription , Chain , GraphQLTypes , ValueTypes } from '@/zeus/index.js' ;
92import { Config } from '@/Configuration/index.js' ;
103import fetch from 'node-fetch' ;
114import { COMMON_FILES } from '@/gshared/constants/index.js' ;
@@ -22,8 +15,8 @@ const jolt = () => {
2215 const token = Config . getTokenOptions ( 'token' ) ;
2316 const headers : Record < string , string > = token
2417 ? {
25- Authorization : `Bearer ${ token } ` ,
26- }
18+ Authorization : `Bearer ${ token } ` ,
19+ }
2720 : { } ;
2821 return Chain ( 'https://api.staging.project.graphqleditor.com/graphql' , {
2922 headers,
@@ -34,8 +27,8 @@ const joltSubscription = () => {
3427 const token = Config . getTokenOptions ( 'token' ) ;
3528 const headers : Record < string , string > = token
3629 ? {
37- Authorization : `Bearer ${ token } ` ,
38- }
30+ Authorization : `Bearer ${ token } ` ,
31+ }
3932 : { } ;
4033 return Subscription ( 'https://api.staging.project.graphqleditor.com/graphql' , {
4134 headers,
@@ -184,9 +177,14 @@ export class Editor {
184177 ? ( await fetch ( libraryURL . getUrl ! ) ) . text ( )
185178 : new Promise < string > ( ( resolve ) => resolve ( '' ) ) ,
186179 ] ) ;
187- const sdlMerge = mergeSDLs ( graphqlFile , libraryFile )
188- if ( sdlMerge . __typename === 'error' ) throw new Error ( sdlMerge . errors . map ( e => `Conflict on: ${ e . conflictingNode } .${ e . conflictingField } ` ) . join ( "\n" ) )
189- return sdlMerge . sdl
180+ const sdlMerge = mergeSDLs ( graphqlFile , libraryFile ) ;
181+ if ( sdlMerge . __typename === 'error' )
182+ throw new Error (
183+ sdlMerge . errors
184+ . map ( ( e ) => `Conflict on: ${ e . conflictingNode } .${ e . conflictingField } ` )
185+ . join ( '\n' ) ,
186+ ) ;
187+ return sdlMerge . sdl ;
190188 } ;
191189
192190 public static getSchema = async ( resolve : {
@@ -328,12 +326,6 @@ export class Editor {
328326 } ) ,
329327 ) ;
330328 } ;
331- public static deployProjectToCloud = async ( projectId : string ) => {
332- const response = await jolt ( ) ( 'mutation' ) ( {
333- createCloudDeployment : [ { id : projectId } , true ] ,
334- } ) ;
335- return response . createCloudDeployment ;
336- } ;
337329 public static getServerLessMongo = async ( projectId : string ) => {
338330 const checking = ora (
339331 'Checking if remote mongo serverless configuration exists' ,
@@ -351,31 +343,6 @@ export class Editor {
351343 else checking . fail ( ) ;
352344 return result ;
353345 } ;
354- public static deployRepoToSharedWorker = async (
355- projectId : string ,
356- zipURI : string ,
357- opts : Pick < ValueTypes [ 'DeployCodeToCloudInput' ] , 'node14Opts' | 'secrets' > ,
358- ) => {
359- const response = await jolt ( ) ( 'mutation' ) ( {
360- deployCodeToCloud : [
361- {
362- id : projectId ,
363- opts : {
364- codeURI : zipURI ,
365- env : DeployCodeToCloudEnv . NODE14 ,
366- kind : DeployCodeToCloudURIKind . ZIP ,
367- ...opts ,
368- } ,
369- } ,
370- true ,
371- ] ,
372- } ) ;
373- const deploymentId = response . deployCodeToCloud ;
374- if ( ! deploymentId ) {
375- throw new Error ( 'Cannot deploy project' ) ;
376- }
377- return deploymentId ;
378- } ;
379346 public static publishIntegration = async (
380347 projectId : string ,
381348 integration : ValueTypes [ 'AddProjectInput' ] ,
@@ -395,12 +362,6 @@ export class Editor {
395362 } ) ;
396363 return response . marketplace ?. removeProject ;
397364 } ;
398- public static showDeploymentLogs = async ( streamID : string ) => {
399- const response = await joltSubscription ( ) ( 'subscription' ) ( {
400- watchLogs : [ { streamID } , true ] ,
401- } ) ;
402- return response ;
403- } ;
404365 public static getDeviceCode = async ( ) => {
405366 const response = await fetch (
406367 'https://auth.graphqleditor.com/oauth/device/code' ,
0 commit comments