File tree 1 file changed +10
-1
lines changed 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
import type { StorageManagerOptions } from '@crawlee/core' ;
2
2
import { KeyValueStore as CoreKeyValueStore } from '@crawlee/core' ;
3
3
4
+ import type { Configuration } from './configuration' ;
5
+
6
+ // @ts -ignore newer crawlee versions already declare this method in core
7
+ const { getPublicUrl } = CoreKeyValueStore . prototype ;
8
+
4
9
/**
5
10
* @inheritDoc
6
11
*/
@@ -10,6 +15,10 @@ export class KeyValueStore extends CoreKeyValueStore {
10
15
* access the value in the remote key-value store.
11
16
*/
12
17
getPublicUrl ( key : string ) : string {
18
+ if ( ! ( this . config as Configuration ) . get ( 'isAtHome' ) && getPublicUrl ) {
19
+ return getPublicUrl . call ( this , key ) ;
20
+ }
21
+
13
22
return `https://api.apify.com/v2/key-value-stores/${ this . id } /records/${ key } ` ;
14
23
}
15
24
@@ -21,5 +30,5 @@ export class KeyValueStore extends CoreKeyValueStore {
21
30
}
22
31
}
23
32
24
- // @ts -expect-error extension of the core class to make this only a type-issue
33
+ // @ts -ignore newer crawlee versions already declare this method in core
25
34
CoreKeyValueStore . prototype . getPublicUrl = KeyValueStore . prototype . getPublicUrl ;
You can’t perform that action at this time.
0 commit comments