@@ -25,7 +25,7 @@ export interface PieceMetadataCapture {
2525}
2626
2727export function createAndAddPiecesHandler ( txHash : Hex , options : PDPMockOptions = { } ) {
28- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
28+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
2929 return http . post ( `${ baseUrl } /pdp/data-sets/create-and-add` , ( ) => {
3030 return new HttpResponse ( null , {
3131 status : 201 ,
@@ -49,7 +49,7 @@ export function dataSetCreationStatusHandler(
4949 } ,
5050 options : PDPMockOptions = { }
5151) {
52- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
52+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
5353
5454 return http . get ( `${ baseUrl } /pdp/data-sets/created/:txHash` , ( { params } ) => {
5555 if ( params . txHash !== txHash ) {
@@ -69,7 +69,7 @@ export function pieceAdditionStatusHandler(
6969 response : any ,
7070 options : PDPMockOptions = { }
7171) {
72- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
72+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
7373
7474 return http . get ( `${ baseUrl } /pdp/data-sets/:id/pieces/added/:txHash` , ( { params } ) => {
7575 if ( params . id !== dataSetId . toString ( ) || params . txHash !== txHash ) {
@@ -84,7 +84,7 @@ export function pieceAdditionStatusHandler(
8484 * Creates a handler for finding pieces
8585 */
8686export function findPieceHandler ( pieceCid : string , found : boolean , options : PDPMockOptions = { } ) {
87- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
87+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
8888
8989 return http . get ( `${ baseUrl } /pdp/piece` , ( { request } ) => {
9090 const url = new URL ( request . url )
@@ -102,7 +102,7 @@ export function findPieceHandler(pieceCid: string, found: boolean, options: PDPM
102102}
103103
104104export function findAnyPieceHandler ( found : boolean , options : PDPMockOptions = { } ) {
105- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
105+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
106106 return http . get ( `${ baseUrl } /pdp/piece` , ( { request } ) => {
107107 const url = new URL ( request . url )
108108 const queryCid = url . searchParams . get ( 'pieceCid' )
@@ -119,7 +119,7 @@ export function findAnyPieceHandler(found: boolean, options: PDPMockOptions = {}
119119 * Returns a UUID for 201, or a CID for 200
120120 */
121121export function postPieceHandler ( pieceCid : string , uuid ?: string , options : PDPMockOptions = { } ) {
122- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
122+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
123123 return http . post < Record < string , never > , { pieceCid : string } > ( `${ baseUrl } /pdp/piece` , async ( { request } ) => {
124124 const body = await request . json ( )
125125 assert ( body != null , 'Body should be defined' )
@@ -142,7 +142,7 @@ export function postPieceHandler(pieceCid: string, uuid?: string, options: PDPMo
142142}
143143
144144export function uploadPieceHandler ( uuid : string , options : PDPMockOptions = { } ) {
145- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
145+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
146146 return http . put ( `${ baseUrl } /pdp/piece/upload/${ uuid } ` , async ( ) => {
147147 return HttpResponse . text ( 'No Content' , {
148148 status : 204 ,
@@ -156,7 +156,7 @@ export function uploadPieceHandler(uuid: string, options: PDPMockOptions = {}) {
156156 * Note: This endpoint doesn't require a request body
157157 */
158158export function postPieceUploadsHandler ( uuid : string , options : PDPMockOptions = { } ) {
159- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
159+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
160160 return http . post ( `${ baseUrl } /pdp/piece/uploads` , async ( ) => {
161161 // Create upload session, return UUID in Location header
162162 return HttpResponse . text ( 'Created' , {
@@ -173,7 +173,7 @@ export function postPieceUploadsHandler(uuid: string, options: PDPMockOptions =
173173 * PUT /pdp/piece/uploads/:uuid - streams piece data
174174 */
175175export function uploadPieceStreamingHandler ( uuid : string , options : PDPMockOptions = { } ) {
176- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
176+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
177177 return http . put ( `${ baseUrl } /pdp/piece/uploads/${ uuid } ` , async ( { request } ) => {
178178 await request . arrayBuffer ( )
179179 return HttpResponse . text ( 'No Content' , {
@@ -187,7 +187,7 @@ export function uploadPieceStreamingHandler(uuid: string, options: PDPMockOption
187187 * POST /pdp/piece/uploads/:uuid - finalize with PieceCID
188188 */
189189export function finalizePieceUploadHandler ( uuid : string , expectedPieceCid ?: string , options : PDPMockOptions = { } ) {
190- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
190+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
191191 return http . post < { uuid : string } , { pieceCid : string } > (
192192 `${ baseUrl } /pdp/piece/uploads/${ uuid } ` ,
193193 async ( { request } ) => {
@@ -211,7 +211,7 @@ export function finalizePieceUploadHandler(uuid: string, expectedPieceCid?: stri
211211 * Returns array of handlers for: POST /pdp/piece/uploads, PUT /pdp/piece/uploads/:uuid, POST /pdp/piece/uploads/:uuid
212212 */
213213export function streamingUploadHandlers ( options : PDPMockOptions = { } ) {
214- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
214+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
215215 let uploadCounter = 0
216216
217217 return [
@@ -288,7 +288,7 @@ export function createDataSetWithMetadataCapture(
288288 captureCallback : ( metadata : MetadataCapture ) => void ,
289289 options : PDPMockOptions = { }
290290) {
291- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
291+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
292292
293293 return http . post ( `${ baseUrl } /pdp/data-sets` , async ( { request } ) => {
294294 const body = ( await request . json ( ) ) as any
@@ -330,7 +330,7 @@ export function addPiecesWithMetadataCapture(
330330 captureCallback : ( metadata : PieceMetadataCapture ) => void ,
331331 options : PDPMockOptions = { }
332332) {
333- const baseUrl = options . baseUrl ?? 'http ://pdp.local '
333+ const baseUrl = options . baseUrl ?? 'https ://pdp.example.com '
334334
335335 return http . post < { id : string } , addPieces . RequestBody > (
336336 `${ baseUrl } /pdp/data-sets/:id/pieces` ,
0 commit comments