apify 4.0.0-beta.20 → 4.0.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/actor.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { EventManager, EventTypeName, RecordOptions, UseStateOptions } from '@crawlee/core';
2
- import { Dataset, RequestQueue } from '@crawlee/core';
2
+ import { Dataset, KeyValueStore, RequestQueue } from '@crawlee/core';
3
3
  import type { Awaitable, Dictionary, StorageBackend } from '@crawlee/types';
4
4
  import type { ActorCallOptions, ActorStartOptions, ApifyClientOptions, RunAbortOptions, TaskCallOptions, Webhook, WebhookEventType } from 'apify-client';
5
5
  import { ActorRun as ClientActorRun, ApifyClient } from 'apify-client';
@@ -9,7 +9,6 @@ import type { ChargeOptions, ChargeResult } from './charging.js';
9
9
  import { ChargingManager } from './charging.js';
10
10
  import type { ConfigurationOptions } from './configuration.js';
11
11
  import { Configuration } from './configuration.js';
12
- import { KeyValueStore } from './key_value_store.js';
13
12
  import type { ProxyConfigurationOptions } from './proxy_configuration.js';
14
13
  import { ProxyConfiguration } from './proxy_configuration.js';
15
14
  import type { OpenStorageOptions, StorageIdentifier, StorageIdentifierWithoutAlias } from './storage.js';
package/dist/actor.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createPrivateKey } from 'node:crypto';
2
- import { Dataset, purgeDefaultStorages, RequestQueue, serviceLocator } from '@crawlee/core';
2
+ import { Dataset, KeyValueStore, purgeDefaultStorages, RequestQueue, serviceLocator } from '@crawlee/core';
3
3
  import { sleep } from '@crawlee/utils';
4
4
  import { ApifyClient } from 'apify-client';
5
5
  import { z } from 'zod';
@@ -11,7 +11,6 @@ import { ApifyStorageBackend, pushDataChargingContext, USES_PUSH_DATA_INTERCEPTI
11
11
  import { ChargingManager, pushDataAndCharge } from './charging.js';
12
12
  import { Configuration } from './configuration.js';
13
13
  import { getDefaultsFromInputSchema, noActorInputSchemaDefinedMarker, readInputSchema } from './input-schemas.js';
14
- import { KeyValueStore } from './key_value_store.js';
15
14
  import { PlatformEventManager } from './platform_event_manager.js';
16
15
  import { ProxyConfiguration } from './proxy_configuration.js';
17
16
  import { openStorage } from './storage.js';
package/dist/index.d.ts CHANGED
@@ -7,7 +7,6 @@ export { ChargeOptions, ChargeResult, ActorPricingInfo, ChargingManager } from '
7
7
  export * from './configuration.js';
8
8
  export * from './proxy_configuration.js';
9
9
  export * from './platform_event_manager.js';
10
- export * from './key_value_store.js';
11
- export { Dataset, DatasetDataOptions, DatasetIteratorOptions, DatasetConsumer, DatasetMapper, DatasetReducer, DatasetOptions, DatasetContent, RequestQueue, RequestQueueOperationOptions, RequestQueueOptions, KeyConsumer, KeyValueStoreOptions, RecordOptions, KeyValueStoreIteratorOptions, log, Log, LoggerOptions, LogLevel, Logger, LoggerJson, LoggerText, } from '@crawlee/core';
10
+ export { Dataset, DatasetDataOptions, DatasetIteratorOptions, DatasetConsumer, DatasetMapper, DatasetReducer, DatasetOptions, DatasetContent, RequestQueue, RequestQueueOperationOptions, RequestQueueOptions, KeyValueStore, KeyConsumer, KeyValueStoreOptions, RecordOptions, KeyValueStoreIteratorOptions, log, Log, LoggerOptions, LogLevel, Logger, LoggerJson, LoggerText, } from '@crawlee/core';
12
11
  export type { QueueOperationInfo } from '@crawlee/types';
13
12
  export { ApifyClient, ApifyClientOptions } from 'apify-client';
package/dist/index.js CHANGED
@@ -5,6 +5,5 @@ export { ChargingManager } from './charging.js';
5
5
  export * from './configuration.js';
6
6
  export * from './proxy_configuration.js';
7
7
  export * from './platform_event_manager.js';
8
- export * from './key_value_store.js';
9
- export { Dataset, RequestQueue, log, Log, LogLevel, Logger, LoggerJson, LoggerText, } from '@crawlee/core';
8
+ export { Dataset, RequestQueue, KeyValueStore, log, Log, LogLevel, Logger, LoggerJson, LoggerText, } from '@crawlee/core';
10
9
  export { ApifyClient } from 'apify-client';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apify",
3
- "version": "4.0.0-beta.20",
3
+ "version": "4.0.0-beta.21",
4
4
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
@@ -1,21 +0,0 @@
1
- import type { StorageOpenOptions } from '@crawlee/core';
2
- import { KeyValueStore as CoreKeyValueStore } from '@crawlee/core';
3
- /**
4
- * @inheritDoc
5
- */
6
- export declare class KeyValueStore extends CoreKeyValueStore {
7
- /**
8
- * Returns a URL for the given key that may be used to publicly
9
- * access the value in the remote key-value store.
10
- *
11
- * On the Apify platform the URL is signed with the store's
12
- * `urlSigningSecretKey` so that anyone with the URL can read the record
13
- * without authentication. Locally we delegate to crawlee's default
14
- * implementation (which produces a `file://` URL or returns `undefined`).
15
- */
16
- getPublicUrl(key: string): Promise<string | undefined>;
17
- /**
18
- * @inheritDoc
19
- */
20
- static open(storeIdOrName?: string | null, options?: StorageOpenOptions): Promise<KeyValueStore>;
21
- }
@@ -1,40 +0,0 @@
1
- import { KeyValueStore as CoreKeyValueStore, serviceLocator } from '@crawlee/core';
2
- import { createHmacSignature } from '@apify/utilities';
3
- import { ApifyKeyValueStoreBackend } from './apify_key_value_store_backend.js';
4
- /**
5
- * @inheritDoc
6
- */
7
- export class KeyValueStore extends CoreKeyValueStore {
8
- /**
9
- * Returns a URL for the given key that may be used to publicly
10
- * access the value in the remote key-value store.
11
- *
12
- * On the Apify platform the URL is signed with the store's
13
- * `urlSigningSecretKey` so that anyone with the URL can read the record
14
- * without authentication. Locally we delegate to crawlee's default
15
- * implementation (which produces a `file://` URL or returns `undefined`).
16
- */
17
- async getPublicUrl(key) {
18
- const config = serviceLocator.getConfiguration();
19
- // Detect a remote (Apify) store by its backend type rather than by
20
- // `isAtHome`, so that a `forceCloud` store opened locally still gets a
21
- // signed Apify URL (matching the platform behaviour). `backend` is
22
- // `private` on `CoreKeyValueStore`, so bypass the visibility check.
23
- const { backend } = this;
24
- if (!(backend instanceof ApifyKeyValueStoreBackend)) {
25
- return super.getPublicUrl(key);
26
- }
27
- const publicUrl = new URL(`${config.apiPublicBaseUrl}/v2/key-value-stores/${this.id}/records/${key}`);
28
- const metadata = (await backend.getMetadata());
29
- if (metadata?.urlSigningSecretKey) {
30
- publicUrl.searchParams.append('signature', createHmacSignature(metadata.urlSigningSecretKey, key));
31
- }
32
- return publicUrl.toString();
33
- }
34
- /**
35
- * @inheritDoc
36
- */
37
- static async open(storeIdOrName, options = {}) {
38
- return super.open(storeIdOrName, options);
39
- }
40
- }