@@ -6,6 +6,7 @@ import * as errors from "../errors";
66import * as serializers from "../serialization" ;
77import { mergeHeaders , mergeOnlyDefinedHeaders } from "../core/headers" ;
88import * as SchemaOverrides from "./schemas" ;
9+ import urlJoin from "url-join" ;
910
1011declare module "../api/resources/collections/resources/items/client/Client" {
1112 export namespace Items { }
@@ -90,24 +91,24 @@ export class Client extends Items {
9091 requestOptions ?. headers ,
9192 ) ;
9293 const _response = await core . fetcher ( {
93- url : core . url . join (
94+ url : urlJoin (
9495 ( await core . Supplier . get ( this . _options . baseUrl ) ) ??
9596 ( ( await core . Supplier . get ( this . _options . environment ) ) ?? environments . WebflowEnvironment . DataApi )
9697 . base ,
97- `collections/${ core . url . encodePathParam ( collectionId ) } /items` ,
98+ `collections/${ encodeURIComponent ( collectionId ) } /items` ,
9899 ) ,
99100 method : "POST" ,
100101 headers : _headers ,
101102 contentType : "application/json" ,
102- queryParameters : { ... _queryParams , ... requestOptions ?. queryParams } ,
103+ queryParameters : _queryParams ,
103104 requestType : "json" ,
104105 body : serializers . collections . ItemsCreateItemRequestBody . jsonOrThrow ( _body , {
105106 unrecognizedObjectKeys : "passthrough" ,
106107 allowUnrecognizedUnionMembers : true ,
107108 allowUnrecognizedEnumValues : true ,
108109 } ) ,
109- timeoutMs : ( requestOptions ?. timeoutInSeconds ?? this . _options ?. timeoutInSeconds ?? 60 ) * 1000 ,
110- maxRetries : requestOptions ?. maxRetries ?? this . _options ?. maxRetries ,
110+ timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 60000 ,
111+ maxRetries : requestOptions ?. maxRetries ,
111112 abortSignal : requestOptions ?. abortSignal ,
112113 } ) ;
113114 if ( _response . ok ) {
@@ -254,24 +255,24 @@ export class Client extends Items {
254255 requestOptions ?. headers ,
255256 ) ;
256257 const _response = await core . fetcher ( {
257- url : core . url . join (
258+ url : urlJoin (
258259 ( await core . Supplier . get ( this . _options . baseUrl ) ) ??
259260 ( ( await core . Supplier . get ( this . _options . environment ) ) ?? environments . WebflowEnvironment . DataApi )
260261 . base ,
261- `collections/${ core . url . encodePathParam ( collectionId ) } /items/${ core . url . encodePathParam ( itemId ) } ` ,
262+ `collections/${ encodeURIComponent ( collectionId ) } /items/${ encodeURIComponent ( itemId ) } ` ,
262263 ) ,
263264 method : "PATCH" ,
264265 headers : _headers ,
265266 contentType : "application/json" ,
266- queryParameters : { ... _queryParams , ... requestOptions ?. queryParams } ,
267+ queryParameters : _queryParams ,
267268 requestType : "json" ,
268269 body : serializers . CollectionItemPatchSingle . jsonOrThrow ( _body , {
269270 unrecognizedObjectKeys : "passthrough" ,
270271 allowUnrecognizedUnionMembers : true ,
271272 allowUnrecognizedEnumValues : true ,
272273 } ) ,
273- timeoutMs : ( requestOptions ?. timeoutInSeconds ?? this . _options ?. timeoutInSeconds ?? 60 ) * 1000 ,
274- maxRetries : requestOptions ?. maxRetries ?? this . _options ?. maxRetries ,
274+ timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 60000 ,
275+ maxRetries : requestOptions ?. maxRetries ,
275276 abortSignal : requestOptions ?. abortSignal ,
276277 } ) ;
277278 if ( _response . ok ) {
@@ -438,24 +439,24 @@ export class Client extends Items {
438439 requestOptions ?. headers ,
439440 ) ;
440441 const _response = await core . fetcher ( {
441- url : core . url . join (
442+ url : urlJoin (
442443 ( await core . Supplier . get ( this . _options . baseUrl ) ) ??
443444 ( ( await core . Supplier . get ( this . _options . environment ) ) ?? environments . WebflowEnvironment . DataApi )
444445 . base ,
445- `collections/${ core . url . encodePathParam ( collectionId ) } /items/live` ,
446+ `collections/${ encodeURIComponent ( collectionId ) } /items/live` ,
446447 ) ,
447448 method : "POST" ,
448449 headers : _headers ,
449450 contentType : "application/json" ,
450- queryParameters : { ... _queryParams , ... requestOptions ?. queryParams } ,
451+ queryParameters : _queryParams ,
451452 requestType : "json" ,
452453 body : serializers . collections . ItemsCreateItemLiveRequestBody . jsonOrThrow ( _body , {
453454 unrecognizedObjectKeys : "passthrough" ,
454455 allowUnrecognizedUnionMembers : true ,
455456 allowUnrecognizedEnumValues : true ,
456457 } ) ,
457- timeoutMs : ( requestOptions ?. timeoutInSeconds ?? this . _options ?. timeoutInSeconds ?? 60 ) * 1000 ,
458- maxRetries : requestOptions ?. maxRetries ?? this . _options ?. maxRetries ,
458+ timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 60000 ,
459+ maxRetries : requestOptions ?. maxRetries ,
459460 abortSignal : requestOptions ?. abortSignal ,
460461 } ) ;
461462 if ( _response . ok ) {
@@ -603,24 +604,24 @@ export class Client extends Items {
603604 requestOptions ?. headers ,
604605 ) ;
605606 const _response = await core . fetcher ( {
606- url : core . url . join (
607+ url : urlJoin (
607608 ( await core . Supplier . get ( this . _options . baseUrl ) ) ??
608609 ( ( await core . Supplier . get ( this . _options . environment ) ) ?? environments . WebflowEnvironment . DataApi )
609610 . base ,
610- `collections/${ core . url . encodePathParam ( collectionId ) } /items/${ core . url . encodePathParam ( itemId ) } /live` ,
611+ `collections/${ encodeURIComponent ( collectionId ) } /items/${ encodeURIComponent ( itemId ) } /live` ,
611612 ) ,
612613 method : "PATCH" ,
613614 headers : _headers ,
614615 contentType : "application/json" ,
615- queryParameters : { ... _queryParams , ... requestOptions ?. queryParams } ,
616+ queryParameters : _queryParams ,
616617 requestType : "json" ,
617618 body : serializers . CollectionItemPatchSingle . jsonOrThrow ( _body , {
618619 unrecognizedObjectKeys : "passthrough" ,
619620 allowUnrecognizedUnionMembers : true ,
620621 allowUnrecognizedEnumValues : true ,
621622 } ) ,
622- timeoutMs : ( requestOptions ?. timeoutInSeconds ?? this . _options ?. timeoutInSeconds ?? 60 ) * 1000 ,
623- maxRetries : requestOptions ?. maxRetries ?? this . _options ?. maxRetries ,
623+ timeoutMs : requestOptions ?. timeoutInSeconds != null ? requestOptions . timeoutInSeconds * 1000 : 60000 ,
624+ maxRetries : requestOptions ?. maxRetries ,
624625 abortSignal : requestOptions ?. abortSignal ,
625626 } ) ;
626627 if ( _response . ok ) {
0 commit comments