11import fs from 'fs' ;
22import path from 'path' ;
3- import { OpenAPI } from '@gitee/typescript-sdk-v5' ;
4- import { RepositoriesService } from '@gitee/typescript-sdk-v5/src/services.gen' ;
3+ import Gitee from '@gitee/typescript-sdk-v5' ;
54import { Release } from 'zotero-plugin-scaffold' ;
65import loadConfig from './config' ;
76
87const owner = 'const_volatile' , repo = 'chartero' ;
9- OpenAPI . TOKEN = process . env . GITEE_TOKEN ;
8+ Gitee . OpenAPI . TOKEN = process . env . GITEE_TOKEN ;
109
1110main ( ) ;
1211
@@ -30,9 +29,9 @@ async function main() {
3029}
3130
3231async function rewriteRelease ( tag : string , name : string , body : string , prerelease = false ) {
33- const old = await RepositoriesService . getV5ReposOwnerRepoReleasesTagsTag ( { owner, repo, tag } ) ;
32+ const old = await Gitee . RepositoriesService . getV5ReposOwnerRepoReleasesTagsTag ( { owner, repo, tag } ) ;
3433 if ( old ?. id )
35- return RepositoriesService . patchV5ReposOwnerRepoReleasesId ( {
34+ return Gitee . RepositoriesService . patchV5ReposOwnerRepoReleasesId ( {
3635 owner,
3736 repo,
3837 name,
@@ -41,7 +40,7 @@ async function rewriteRelease(tag: string, name: string, body: string, prereleas
4140 id : old . id ,
4241 tagName : tag ,
4342 } ) ;
44- return RepositoriesService . postV5ReposOwnerRepoReleases ( {
43+ return Gitee . RepositoriesService . postV5ReposOwnerRepoReleases ( {
4544 owner,
4645 repo,
4746 name,
@@ -53,22 +52,22 @@ async function rewriteRelease(tag: string, name: string, body: string, prereleas
5352}
5453
5554async function rewriteAttach ( releaseId : number , file : string ) {
56- const assets = await RepositoriesService . getV5ReposOwnerRepoReleasesReleaseIdAttachFiles ( {
55+ const assets = await Gitee . RepositoriesService . getV5ReposOwnerRepoReleasesReleaseIdAttachFiles ( {
5756 owner,
5857 repo,
5958 releaseId,
6059 } ) , fileBuffer = fs . readFileSync ( file ) ;
6160 for ( const asset of assets )
6261 if ( asset . name == path . basename ( file ) )
63- await RepositoriesService
62+ await Gitee . RepositoriesService
6463 . deleteV5ReposOwnerRepoReleasesReleaseIdAttachFilesAttachFileId ( {
6564 owner,
6665 repo,
6766 releaseId,
6867 attachFileId : asset . id ! ,
6968 } )
7069 . catch ( console . error ) ;
71- RepositoriesService . postV5ReposOwnerRepoReleasesReleaseIdAttachFiles ( {
70+ Gitee . RepositoriesService . postV5ReposOwnerRepoReleasesReleaseIdAttachFiles ( {
7271 owner,
7372 repo,
7473 releaseId,
0 commit comments