Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"@crawlee/core": "^4.0.0-rc.0",
"@crawlee/types": "^4.0.0-rc.0",
"@crawlee/utils": "^4.0.0-rc.0",
"apify-client": "^2.25.0",
"apify-client": "github:apify/apify-client-js#feat/openapi-generated-models",
"minimatch": "^10.2.6",
"semver": "^7.8.5",
"tslib": "^2.8.1",
Expand Down
14 changes: 8 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ minimumReleaseAgeExclude:
onlyBuiltDependencies:
- '@playwright/browser-chromium'
- '@swc/core'
- apify-client
- esbuild
- playwright
- puppeteer
Expand Down
3 changes: 2 additions & 1 deletion src/apify_dataset_backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export class ApifyDatasetBackend implements DatasetBackend {
if (!metadata) {
throw new Error('Dataset not found or has been deleted.');
}
return metadata;
// The API reports an unnamed store as `null`; crawlee spells that absence as `undefined`.
return { ...metadata, name: metadata.name ?? undefined };
}

async drop(): Promise<void> {
Expand Down
5 changes: 4 additions & 1 deletion src/apify_key_value_store_backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export class ApifyKeyValueStoreBackend implements KeyValueStoreBackend {
if (!metadata) {
throw new Error('Key-value store not found or has been deleted.');
}
return metadata;
// The API reports an unnamed store as `null`; crawlee spells that absence as `undefined`.
return { ...metadata, name: metadata.name ?? undefined };
}

async drop(): Promise<void> {
Expand Down Expand Up @@ -59,6 +60,8 @@ export class ApifyKeyValueStoreBackend implements KeyValueStoreBackend {
// requires the field, so it is left undefined via the cast.
return {
...result,
exclusiveStartKey: result.exclusiveStartKey ?? undefined,
nextExclusiveStartKey: result.nextExclusiveStartKey ?? undefined,
items: result.items.map(({ key, size }) => ({ key, size }) as KeyValueStoreItemData),
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/apify_request_queue_backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export abstract class ApifyRequestQueueBackend implements RequestQueueBackend {
}
return {
id: metadata.id,
name: metadata.name,
name: metadata.name ?? undefined,
createdAt: metadata.createdAt,
modifiedAt: metadata.modifiedAt,
accessedAt: metadata.accessedAt,
Expand Down
7 changes: 5 additions & 2 deletions src/charging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,12 @@ export class ChargingManager {

// Load per-event pricing information
if (pricingInfo?.pricingModel === 'PAY_PER_EVENT') {
for (const [eventName, eventPricing] of Object.entries(pricingInfo.pricingPerEvent.actorChargeEvents)) {
// The specification marks the event map and its per-event price optional, so an absent
// price counts as no charge for that event.
const chargeEvents = pricingInfo.pricingPerEvent.actorChargeEvents ?? {};
for (const [eventName, eventPricing] of Object.entries(chargeEvents)) {
this.pricingInfo[eventName] = {
price: eventPricing.eventPriceUsd,
price: eventPricing.eventPriceUsd ?? 0,
title: eventPricing.eventTitle,
};
}
Expand Down
Loading