@@ -137,14 +137,18 @@ export default class Connector {
137137 } ,
138138 'connector.secret_post' : {
139139 path : [ ] ,
140- body : [ ] ,
140+ body : [
141+ 'value'
142+ ] ,
141143 query : [ ]
142144 } ,
143145 'connector.secret_put' : {
144146 path : [
145147 'id'
146148 ] ,
147- body : [ ] ,
149+ body : [
150+ 'value'
151+ ] ,
148152 query : [ ]
149153 } ,
150154 'connector.sync_job_cancel' : {
@@ -769,12 +773,12 @@ export default class Connector {
769773 }
770774
771775 /**
772- * Deletes a connector secret
776+ * Deletes a connector secret.
773777 */
774- async secretDelete ( this : That , params ? : T . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
775- async secretDelete ( this : That , params ? : T . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
776- async secretDelete ( this : That , params ? : T . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
777- async secretDelete ( this : That , params ? : T . TODO , options ?: TransportRequestOptions ) : Promise < any > {
778+ async secretDelete ( this : That , params : T . ConnectorSecretDeleteRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . ConnectorSecretDeleteResponse >
779+ async secretDelete ( this : That , params : T . ConnectorSecretDeleteRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . ConnectorSecretDeleteResponse , unknown > >
780+ async secretDelete ( this : That , params : T . ConnectorSecretDeleteRequest , options ?: TransportRequestOptions ) : Promise < T . ConnectorSecretDeleteResponse >
781+ async secretDelete ( this : That , params : T . ConnectorSecretDeleteRequest , options ?: TransportRequestOptions ) : Promise < any > {
778782 const {
779783 path : acceptedPath
780784 } = this [ kAcceptedParams ] [ 'connector.secret_delete' ]
@@ -792,11 +796,11 @@ export default class Connector {
792796 }
793797 }
794798
795- params = params ?? { }
796799 for ( const key in params ) {
797800 if ( acceptedPath . includes ( key ) ) {
798801 continue
799802 } else if ( key !== 'body' && key !== 'querystring' ) {
803+ // @ts -expect-error
800804 querystring [ key ] = params [ key ]
801805 }
802806 }
@@ -816,12 +820,12 @@ export default class Connector {
816820 }
817821
818822 /**
819- * Retrieves a secret stored by Connectors
823+ * Retrieves a secret stored by Connectors.
820824 */
821- async secretGet ( this : That , params ? : T . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
822- async secretGet ( this : That , params ? : T . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
823- async secretGet ( this : That , params ? : T . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
824- async secretGet ( this : That , params ? : T . TODO , options ?: TransportRequestOptions ) : Promise < any > {
825+ async secretGet ( this : That , params : T . ConnectorSecretGetRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . ConnectorSecretGetResponse >
826+ async secretGet ( this : That , params : T . ConnectorSecretGetRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . ConnectorSecretGetResponse , unknown > >
827+ async secretGet ( this : That , params : T . ConnectorSecretGetRequest , options ?: TransportRequestOptions ) : Promise < T . ConnectorSecretGetResponse >
828+ async secretGet ( this : That , params : T . ConnectorSecretGetRequest , options ?: TransportRequestOptions ) : Promise < any > {
825829 const {
826830 path : acceptedPath
827831 } = this [ kAcceptedParams ] [ 'connector.secret_get' ]
@@ -839,11 +843,11 @@ export default class Connector {
839843 }
840844 }
841845
842- params = params ?? { }
843846 for ( const key in params ) {
844847 if ( acceptedPath . includes ( key ) ) {
845848 continue
846849 } else if ( key !== 'body' && key !== 'querystring' ) {
850+ // @ts -expect-error
847851 querystring [ key ] = params [ key ]
848852 }
849853 }
@@ -863,14 +867,16 @@ export default class Connector {
863867 }
864868
865869 /**
866- * Creates a secret for a Connector
870+ * Creates a secret for a Connector.
867871 */
868- async secretPost ( this : That , params ?: T . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
869- async secretPost ( this : That , params ?: T . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
870- async secretPost ( this : That , params ?: T . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
871- async secretPost ( this : That , params ?: T . TODO , options ?: TransportRequestOptions ) : Promise < any > {
872+ async secretPost ( this : That , params ?: T . ConnectorSecretPostRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . ConnectorSecretPostResponse >
873+ async secretPost ( this : That , params ?: T . ConnectorSecretPostRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . ConnectorSecretPostResponse , unknown > >
874+ async secretPost ( this : That , params ?: T . ConnectorSecretPostRequest , options ?: TransportRequestOptions ) : Promise < T . ConnectorSecretPostResponse >
875+ async secretPost ( this : That , params ?: T . ConnectorSecretPostRequest , options ?: TransportRequestOptions ) : Promise < any > {
872876 const {
873- path : acceptedPath
877+ path : acceptedPath ,
878+ body : acceptedBody ,
879+ query : acceptedQuery
874880 } = this [ kAcceptedParams ] [ 'connector.secret_post' ]
875881
876882 const userQuery = params ?. querystring
@@ -888,10 +894,21 @@ export default class Connector {
888894
889895 params = params ?? { }
890896 for ( const key in params ) {
891- if ( acceptedPath . includes ( key ) ) {
897+ if ( acceptedBody . includes ( key ) ) {
898+ body = body ?? { }
899+ // @ts -expect-error
900+ body [ key ] = params [ key ]
901+ } else if ( acceptedPath . includes ( key ) ) {
892902 continue
893903 } else if ( key !== 'body' && key !== 'querystring' ) {
894- querystring [ key ] = params [ key ]
904+ if ( acceptedQuery . includes ( key ) || commonQueryParams . includes ( key ) ) {
905+ // @ts -expect-error
906+ querystring [ key ] = params [ key ]
907+ } else {
908+ body = body ?? { }
909+ // @ts -expect-error
910+ body [ key ] = params [ key ]
911+ }
895912 }
896913 }
897914
@@ -900,20 +917,23 @@ export default class Connector {
900917 const meta : TransportRequestMetadata = {
901918 name : 'connector.secret_post' ,
902919 acceptedParams : [
920+ 'value'
903921 ]
904922 }
905923 return await this . transport . request ( { path, method, querystring, body, meta } , options )
906924 }
907925
908926 /**
909- * Creates or updates a secret for a Connector
927+ * Creates or updates a secret for a Connector.
910928 */
911- async secretPut ( this : That , params ? : T . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
912- async secretPut ( this : That , params ? : T . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
913- async secretPut ( this : That , params ? : T . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
914- async secretPut ( this : That , params ? : T . TODO , options ?: TransportRequestOptions ) : Promise < any > {
929+ async secretPut ( this : That , params : T . ConnectorSecretPutRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . ConnectorSecretPutResponse >
930+ async secretPut ( this : That , params : T . ConnectorSecretPutRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . ConnectorSecretPutResponse , unknown > >
931+ async secretPut ( this : That , params : T . ConnectorSecretPutRequest , options ?: TransportRequestOptions ) : Promise < T . ConnectorSecretPutResponse >
932+ async secretPut ( this : That , params : T . ConnectorSecretPutRequest , options ?: TransportRequestOptions ) : Promise < any > {
915933 const {
916- path : acceptedPath
934+ path : acceptedPath ,
935+ body : acceptedBody ,
936+ query : acceptedQuery
917937 } = this [ kAcceptedParams ] [ 'connector.secret_put' ]
918938
919939 const userQuery = params ?. querystring
@@ -929,12 +949,22 @@ export default class Connector {
929949 }
930950 }
931951
932- params = params ?? { }
933952 for ( const key in params ) {
934- if ( acceptedPath . includes ( key ) ) {
953+ if ( acceptedBody . includes ( key ) ) {
954+ body = body ?? { }
955+ // @ts -expect-error
956+ body [ key ] = params [ key ]
957+ } else if ( acceptedPath . includes ( key ) ) {
935958 continue
936959 } else if ( key !== 'body' && key !== 'querystring' ) {
937- querystring [ key ] = params [ key ]
960+ if ( acceptedQuery . includes ( key ) || commonQueryParams . includes ( key ) ) {
961+ // @ts -expect-error
962+ querystring [ key ] = params [ key ]
963+ } else {
964+ body = body ?? { }
965+ // @ts -expect-error
966+ body [ key ] = params [ key ]
967+ }
938968 }
939969 }
940970
@@ -946,7 +976,8 @@ export default class Connector {
946976 id : params . id
947977 } ,
948978 acceptedParams : [
949- 'id'
979+ 'id' ,
980+ 'value'
950981 ]
951982 }
952983 return await this . transport . request ( { path, method, querystring, body, meta } , options )
0 commit comments