@@ -33,6 +33,10 @@ import {
3333 VersionedModuleAliasesPaginatedResult ,
3434 StorageObject ,
3535 CreateStorageObjectInput ,
36+ Token ,
37+ ServiceAccountInput ,
38+ ServiceAccount ,
39+ ServiceAccountsListResult ,
3640} from "./types" ;
3741import { Readable } from "stream" ;
3842
@@ -343,6 +347,23 @@ export class YepCodeApi {
343347 return this . request ( "POST" , `/processes/${ processId } /versions` , { data } ) ;
344348 }
345349
350+ async getProcessVersion (
351+ processId : string ,
352+ versionId : string
353+ ) : Promise < VersionedProcess > {
354+ return this . request ( "GET" , `/processes/${ processId } /versions/${ versionId } ` ) ;
355+ }
356+
357+ async deleteProcessVersion (
358+ processId : string ,
359+ versionId : string
360+ ) : Promise < void > {
361+ return this . request (
362+ "DELETE" ,
363+ `/processes/${ processId } /versions/${ versionId } `
364+ ) ;
365+ }
366+
346367 async getProcessVersionAliases (
347368 processId : string ,
348369 params : {
@@ -361,6 +382,30 @@ export class YepCodeApi {
361382 return this . request ( "POST" , `/processes/${ processId } /aliases` , { data } ) ;
362383 }
363384
385+ async getProcessVersionAlias (
386+ processId : string ,
387+ aliasId : string
388+ ) : Promise < VersionedProcessAlias > {
389+ return this . request ( "GET" , `/processes/${ processId } /aliases/${ aliasId } ` ) ;
390+ }
391+
392+ async updateProcessVersionAlias (
393+ processId : string ,
394+ aliasId : string ,
395+ data : VersionedProcessAliasInput
396+ ) : Promise < VersionedProcessAlias > {
397+ return this . request ( "PATCH" , `/processes/${ processId } /aliases/${ aliasId } ` , {
398+ data,
399+ } ) ;
400+ }
401+
402+ async deleteProcessVersionAlias (
403+ processId : string ,
404+ aliasId : string
405+ ) : Promise < void > {
406+ return this . request ( "DELETE" , `/processes/${ processId } /aliases/${ aliasId } ` ) ;
407+ }
408+
364409 async getProcesses (
365410 params : {
366411 keywords ?: string ;
@@ -439,6 +484,8 @@ export class YepCodeApi {
439484 processId ?: string ;
440485 status ?:
441486 | "CREATED"
487+ | "QUEUED"
488+ | "DEQUEUED"
442489 | "RUNNING"
443490 | "FINISHED"
444491 | "KILLED"
@@ -509,6 +556,13 @@ export class YepCodeApi {
509556 return this . request ( "PUT" , `/schedules/${ id } /resume` ) ;
510557 }
511558
559+ async updateSchedule (
560+ id : string ,
561+ data : ScheduledProcessInput
562+ ) : Promise < Schedule > {
563+ return this . request ( "PATCH" , `/schedules/${ id } ` , { data } ) ;
564+ }
565+
512566 async getVariables (
513567 params : {
514568 page ?: number ;
@@ -580,6 +634,20 @@ export class YepCodeApi {
580634 return this . request ( "POST" , `/modules/${ moduleId } /versions` , { data } ) ;
581635 }
582636
637+ async getModuleVersion (
638+ moduleId : string ,
639+ versionId : string
640+ ) : Promise < VersionedModule > {
641+ return this . request ( "GET" , `/modules/${ moduleId } /versions/${ versionId } ` ) ;
642+ }
643+
644+ async deleteModuleVersion (
645+ moduleId : string ,
646+ versionId : string
647+ ) : Promise < void > {
648+ return this . request ( "DELETE" , `/modules/${ moduleId } /versions/${ versionId } ` ) ;
649+ }
650+
583651 async getModuleVersionAliases (
584652 moduleId : string ,
585653 params : {
@@ -598,14 +666,36 @@ export class YepCodeApi {
598666 return this . request ( "POST" , `/modules/${ moduleId } /aliases` , { data } ) ;
599667 }
600668
601- async getObjects (
602- params : { prefix ?: string } = { }
603- ) : Promise < StorageObject [ ] > {
669+ async getModuleVersionAlias (
670+ moduleId : string ,
671+ aliasId : string
672+ ) : Promise < VersionedModuleAlias > {
673+ return this . request ( "GET" , `/modules/${ moduleId } /aliases/${ aliasId } ` ) ;
674+ }
675+
676+ async updateModuleVersionAlias (
677+ moduleId : string ,
678+ aliasId : string ,
679+ data : VersionedModuleAliasInput
680+ ) : Promise < VersionedModuleAlias > {
681+ return this . request ( "PATCH" , `/modules/${ moduleId } /aliases/${ aliasId } ` , {
682+ data,
683+ } ) ;
684+ }
685+
686+ async deleteModuleVersionAlias (
687+ moduleId : string ,
688+ aliasId : string
689+ ) : Promise < void > {
690+ return this . request ( "DELETE" , `/modules/${ moduleId } /aliases/${ aliasId } ` ) ;
691+ }
692+
693+ async getObjects ( params : { prefix ?: string } = { } ) : Promise < StorageObject [ ] > {
604694 return this . request ( "GET" , "/storage/objects" , { params } ) ;
605695 }
606696
607- async getObject ( name : string ) : Promise < Readable > {
608- return this . request ( "GET" , `/storage/objects/${ name } ` , {
697+ async getObject ( filename : string ) : Promise < Readable > {
698+ return this . request ( "GET" , `/storage/objects/${ filename } ` , {
609699 responseType : "stream" ,
610700 } ) ;
611701 }
@@ -642,15 +732,38 @@ export class YepCodeApi {
642732
643733 return this . request (
644734 "POST" ,
645- `/storage/objects?name =${ encodeURIComponent ( data . name ) } ` ,
735+ `/storage/objects?filename =${ encodeURIComponent ( data . name ) } ` ,
646736 options
647737 ) ;
648738 }
649739
650- async deleteObject ( name : string ) : Promise < void > {
740+ async deleteObject ( filename : string ) : Promise < void > {
651741 return this . request (
652742 "DELETE" ,
653- `/storage/objects/${ encodeURIComponent ( name ) } `
743+ `/storage/objects/${ encodeURIComponent ( filename ) } `
654744 ) ;
655745 }
746+
747+ // Auth endpoints
748+ async getToken ( apiToken : string ) : Promise < Token > {
749+ return this . request ( "POST" , "/auth/token" , {
750+ headers : {
751+ "x-api-token" : apiToken ,
752+ } ,
753+ } ) ;
754+ }
755+
756+ async getAllServiceAccounts ( ) : Promise < ServiceAccountsListResult > {
757+ return this . request ( "GET" , "/auth/service-accounts" ) ;
758+ }
759+
760+ async createServiceAccount (
761+ data : ServiceAccountInput
762+ ) : Promise < ServiceAccount > {
763+ return this . request ( "POST" , "/auth/service-accounts" , { data } ) ;
764+ }
765+
766+ async deleteServiceAccount ( id : string ) : Promise < void > {
767+ return this . request ( "DELETE" , `/auth/service-accounts/${ id } ` ) ;
768+ }
656769}
0 commit comments