@@ -406,7 +406,7 @@ class SocketSdk {
406
406
/**
407
407
* @param {string } orgSlug
408
408
* @param {string } repoSlug
409
- * @returns {Promise<SocketSdkResultType<'getAuditLogEvents '>> }
409
+ * @returns {Promise<SocketSdkResultType<'getOrgRepo '>> }
410
410
*/
411
411
async getOrgRepo ( orgSlug , repoSlug ) {
412
412
const orgSlugParam = encodeURIComponent ( orgSlug )
@@ -417,14 +417,14 @@ class SocketSdk {
417
417
const data = await client . get ( `orgs/${ orgSlugParam } /repos/${ repoSlugParam } ` ) . json ( )
418
418
return { success : true , status : 200 , data }
419
419
} catch ( err ) {
420
- return /** @type {SocketSdkErrorType<'getAuditLogEvents '> } */ ( this . #handleApiError( err ) )
420
+ return /** @type {SocketSdkErrorType<'getOrgRepo '> } */ ( this . #handleApiError( err ) )
421
421
}
422
422
}
423
423
424
424
/**
425
425
* @param {string } orgSlug
426
426
* @param {string } repoSlug
427
- * @returns {Promise<SocketSdkResultType<'getAuditLogEvents '>> }
427
+ * @returns {Promise<SocketSdkResultType<'deleteOrgRepo '>> }
428
428
*/
429
429
async deleteOrgRepo ( orgSlug , repoSlug ) {
430
430
const orgSlugParam = encodeURIComponent ( orgSlug )
@@ -435,14 +435,14 @@ class SocketSdk {
435
435
const data = await client . delete ( `orgs/${ orgSlugParam } /repos/${ repoSlugParam } ` ) . json ( )
436
436
return { success : true , status : 200 , data }
437
437
} catch ( err ) {
438
- return /** @type {SocketSdkErrorType<'getAuditLogEvents '> } */ ( this . #handleApiError( err ) )
438
+ return /** @type {SocketSdkErrorType<'deleteOrgRepo '> } */ ( this . #handleApiError( err ) )
439
439
}
440
440
}
441
441
442
442
/**
443
443
* @param {string } orgSlug
444
444
* @param {{[key: string]: any } } queryParams
445
- * @returns {Promise<SocketSdkResultType<'getAuditLogEvents '>> }
445
+ * @returns {Promise<SocketSdkResultType<'getOrgRepoList '>> }
446
446
*/
447
447
async getOrgRepoList ( orgSlug , queryParams ) {
448
448
const orgSlugParam = encodeURIComponent ( orgSlug )
@@ -453,41 +453,42 @@ class SocketSdk {
453
453
const data = await client . get ( `orgs/${ orgSlugParam } /repos?${ formattedQueryParam } ` ) . json ( )
454
454
return { success : true , status : 200 , data }
455
455
} catch ( err ) {
456
- return /** @type {SocketSdkErrorType<'getAuditLogEvents '> } */ ( this . #handleApiError( err ) )
456
+ return /** @type {SocketSdkErrorType<'getOrgRepoList '> } */ ( this . #handleApiError( err ) )
457
457
}
458
458
}
459
459
460
460
/**
461
461
* @param {string } orgSlug
462
462
* @param {string } params
463
- * @returns {Promise<SocketSdkResultType<'getAuditLogEvents '>> }
463
+ * @returns {Promise<SocketSdkResultType<'createOrgRepo '>> }
464
464
*/
465
465
async createOrgRepo ( orgSlug , params ) {
466
466
const orgSlugParam = encodeURIComponent ( orgSlug )
467
467
468
468
try {
469
469
const client = await this . #getClient( )
470
- const data = await client . post ( `orgs/${ orgSlugParam } /repos` , { body : params } ) . json ( )
470
+ const data = await client . post ( `orgs/${ orgSlugParam } /repos` , { json : params } ) . json ( )
471
471
return { success : true , status : 200 , data }
472
472
} catch ( err ) {
473
- return /** @type {SocketSdkErrorType<'getAuditLogEvents '> } */ ( this . #handleApiError( err ) )
473
+ return /** @type {SocketSdkErrorType<'createOrgRepo '> } */ ( this . #handleApiError( err ) )
474
474
}
475
475
}
476
476
477
477
/**
478
478
* @param {string } orgSlug
479
479
* @param {string } repoSlug
480
- * @returns {Promise<SocketSdkResultType<'getAuditLogEvents'>> }
480
+ * @param {string } params
481
+ * @returns {Promise<SocketSdkResultType<'updateOrgRepo'>> }
481
482
*/
482
- async updateOrgRepo ( orgSlug , repoSlug ) {
483
+ async updateOrgRepo ( orgSlug , repoSlug , params ) {
483
484
const orgSlugParam = encodeURIComponent ( orgSlug )
484
485
485
486
try {
486
487
const client = await this . #getClient( )
487
- const data = await client . post ( `orgs/${ orgSlugParam } /repos/${ repoSlug } ` ) . json ( )
488
+ const data = await client . post ( `orgs/${ orgSlugParam } /repos/${ repoSlug } ` , { json : params } ) . json ( )
488
489
return { success : true , status : 200 , data }
489
490
} catch ( err ) {
490
- return /** @type {SocketSdkErrorType<'getAuditLogEvents '> } */ ( this . #handleApiError( err ) )
491
+ return /** @type {SocketSdkErrorType<'updateOrgRepo '> } */ ( this . #handleApiError( err ) )
491
492
}
492
493
}
493
494
0 commit comments