Skip to content

Commit 3917a92

Browse files
authored
Merge branch 'master' into feature/input-schema-file-upload
2 parents fc21454 + 7f28477 commit 3917a92

File tree

25 files changed

+1043
-1475
lines changed

25 files changed

+1043
-1475
lines changed

.github/workflows/pr-previews.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Docs PR Previews
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, closed]
6+
7+
concurrency:
8+
cancel-in-progress: false
9+
group: 'docs-pr-previews-${{ github.event.pull_request.number }}'
10+
11+
jobs:
12+
trigger-preview:
13+
if: github.event.action != 'closed'
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Trigger preview
19+
run: gh workflow run apify_docs_pr.yml --repo apify/apify-docs-private --field pr-number=${{ github.event.pull_request.number }} --field original-repository=${{ github.repository }}
20+
env:
21+
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
22+
23+
delete-preview:
24+
if: github.event.action == 'closed'
25+
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Delete preview
30+
run: gh workflow run apify_docs_pr.yml --repo apify/apify-docs-private --field pr-number=${{ github.event.pull_request.number }} --field original-repository=${{ github.repository }} --field action=delete
31+
env:
32+
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

apify-api/openapi/openapi.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,8 @@ paths:
581581
$ref: 'paths/request-queues/request-queues@{queueId}.yaml'
582582
'/v2/request-queues/{queueId}/requests/batch':
583583
$ref: 'paths/request-queues/request-queues@{queueId}@[email protected]'
584+
'/v2/request-queues/{queueId}/requests/unlock':
585+
$ref: 'paths/request-queues/request-queues@{queueId}@[email protected]'
584586
'/v2/request-queues/{queueId}/requests':
585587
$ref: 'paths/request-queues/request-queues@{queueId}@requests.yaml'
586588
'/v2/request-queues/{queueId}/requests/{requestId}':

apify-api/openapi/paths/key-value-stores/key-value-stores@{storeId}@keys.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ get:
3838
type: number
3939
format: double
4040
example: 100
41+
- name: collection
42+
in: query
43+
description: Limit the results to keys that belong to a specific collection from the key-value store schema.
44+
The key-value store need to have a schema defined for this parameter to work.
45+
schema:
46+
type: string
47+
example: postImages
48+
- name: prefix
49+
in: query
50+
description: Limit the results to keys that start with a specific prefix.
51+
schema:
52+
type: string
53+
example: post-images-
4154
responses:
4255
'200':
4356
description: ''

apify-api/openapi/paths/logs/logs@{buildOrRunId}.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ get:
4040
schema:
4141
type: boolean
4242
example: false
43+
- name: raw
44+
in: query
45+
description: |
46+
If `true` or `1`, the logs will be kept verbatim. By default, the API removes
47+
ANSI escape codes from the logs, keeping only printable characters.
48+
required: false
49+
style: form
50+
explode: true
51+
schema:
52+
type: boolean
53+
example: false
4354
responses:
4455
'200':
4556
description: ''
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
post:
2+
tags:
3+
- Storage/Request queues/Requests locks
4+
summary: Unlock requests
5+
description: |
6+
Unlocks requests in the queue that are currently locked by the client.
7+
8+
* If the client is within an Actor run, it unlocks all requests locked by that specific run plus all requests locked by the same clientKey.
9+
* If the client is outside of an Actor run, it unlocks all requests locked using the same clientKey.
10+
operationId: requestQueue_requests_unlock_post
11+
parameters:
12+
- name: queueId
13+
in: path
14+
description: Queue ID or `username~queue-name`.
15+
required: true
16+
style: simple
17+
schema:
18+
type: string
19+
example: WkzbQMuFYuamGv3YF
20+
- name: clientKey
21+
in: query
22+
description: |
23+
A unique identifier of the client accessing the request queue. It must
24+
be a string between 1 and 32 characters long
25+
style: form
26+
explode: true
27+
schema:
28+
type: string
29+
example: client-abc
30+
responses:
31+
'200':
32+
description: 'Number of requests that were unlocked'
33+
content:
34+
application/json:
35+
schema:
36+
type: object
37+
required:
38+
- data
39+
properties:
40+
data:
41+
type: object
42+
required:
43+
- unlockedCount
44+
properties:
45+
unlockedCount:
46+
type: integer
47+
description: 'Number of requests that were successfully unlocked'
48+
example:
49+
data:
50+
unlockedCount: 10
51+
52+
deprecated: false
53+
x-js-parent: RequestQueueClient
54+
x-js-name: unlockRequests
55+
x-js-doc-url: https://docs.apify.com/api/client/js/reference/class/RequestQueueClient#unlockRequests
56+
x-py-parent: RequestQueueClientAsync
57+
x-py-name: unlock_requests
58+
x-py-doc-url: https://docs.apify.com/api/client/python/reference/class/RequestQueueClientAsync#unlock_requests

apify-api/openapi/paths/request-queues/request-queues@{queueId}@requests@{requestId}.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ put:
8383
description: |
8484
Updates a request in a queue. Mark request as handled by setting
8585
`request.handledAt = new Date()`.
86-
If `handledAt` is set, the request will be removed from head of the queue.
86+
If `handledAt` is set, the request will be removed from head of the queue (and unlocked, if applicable).
8787
operationId: requestQueue_request_put
8888
parameters:
8989
- name: queueId

apify-docs-theme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apify/docs-theme",
3-
"version": "1.0.174",
3+
"version": "1.0.175",
44
"description": "",
55
"main": "./src/index.js",
66
"files": [

apify-docs-theme/src/config.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
/* eslint-disable global-require */
2-
// eslint-disable-next-line no-nested-ternary
3-
const absoluteUrl = process.env.LOCALHOST
4-
? 'http://localhost:3000'
5-
: process.env.DEV
6-
? 'http://docs.apify.loc'
7-
: 'https://docs.apify.com';
82

9-
const themeConfig = ({
3+
let absoluteUrl = 'https://docs.apify.com';
4+
5+
if (process.env.LOCALHOST) {
6+
absoluteUrl = 'http://localhost:3000';
7+
} else if (process.env.DEV) {
8+
absoluteUrl = 'http://docs.apify.loc';
9+
} else if (process.env.APIFY_DOCS_ABSOLUTE_URL) {
10+
absoluteUrl = process.env.APIFY_DOCS_ABSOLUTE_URL;
11+
}
12+
13+
const themeConfig = {
1014
docs: {
1115
versionPersistence: 'localStorage',
1216
sidebar: {
@@ -277,7 +281,7 @@ const themeConfig = ({
277281
async: true,
278282
defer: true,
279283
},
280-
});
284+
};
281285

282286
const plugins = [
283287
[
@@ -294,7 +298,9 @@ const plugins = [
294298
return {
295299
resolveLoader: {
296300
alias: {
297-
'roa-loader': require.resolve(`${__dirname}/roa-loader/`),
301+
'roa-loader': require.resolve(
302+
`${__dirname}/roa-loader/`,
303+
),
298304
},
299305
},
300306
};

docusaurus.config.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { join } = require('node:path');
1+
const { join, resolve } = require('node:path');
22

33
const clsx = require('clsx');
44
const { createApiPageMD } = require('docusaurus-plugin-openapi-docs/lib/markdown');
@@ -46,21 +46,6 @@ module.exports = {
4646
sizes: 'any',
4747
},
4848
},
49-
// Segment analytics
50-
process.env.SEGMENT_TOKEN && {
51-
tagName: 'script',
52-
innerHTML: `
53-
!function(){var i="analytics",analytics=window[i]=window[i]||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","screen","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware","register"];analytics.factory=function(e){return function(){if(window[i].initialized)return window[i][e].apply(window[i],arguments);var n=Array.prototype.slice.call(arguments);if(["track","screen","alias","group","page","identify"].indexOf(e)>-1){var c=document.querySelector("link[rel='canonical']");n.push({__t:"bpc",c:c&&c.getAttribute("href")||void 0,p:location.pathname,u:location.href,s:location.search,t:document.title,r:document.referrer})}n.unshift(e);analytics.push(n);return analytics}};for(var n=0;n<analytics.methods.length;n++){var key=analytics.methods[n];analytics[key]=analytics.factory(key)}analytics.load=function(key,n){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.setAttribute("data-global-segment-analytics-key",i);t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(t,r);analytics._loadOptions=n};analytics._writeKey="FAretQHrDlKZJl9dE9xRgH2ia0a4ACXB";;analytics.SNIPPET_VERSION="5.2.0";
54-
analytics.load("${process.env.SEGMENT_TOKEN}", { integrations: { "Segment.io": { apiHost: "analytics.apify.com/v1" }}});
55-
analytics.page({
56-
app: 'docs',
57-
pageType: 'DOCS_PAGE',
58-
page_type: 'DOCS_PAGE'
59-
});
60-
}}();
61-
`,
62-
attributes: {},
63-
},
6449
// Intercom messenger
6550
process.env.INTERCOM_APP_ID && {
6651
tagName: 'script',
@@ -250,14 +235,21 @@ module.exports = {
250235
},
251236
},
252237
],
238+
[
239+
resolve(__dirname, 'src/plugins/docusaurus-plugin-segment'),
240+
{
241+
writeKey: process.env.SEGMENT_TOKEN,
242+
allowedInDev: false,
243+
},
244+
],
253245
() => ({
254246
name: 'webpack-loader-fix',
255247
configureWebpack() {
256248
return {
257249
module: {
258250
rules: [
259251
{
260-
test: /apify-docs\/examples\//i,
252+
test: /\/examples\//i,
261253
type: 'asset/source',
262254
},
263255
],

examples/ts-parallel-scraping/orchestrator/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if (state.isInitialized) {
5959
state.isInitialized = true;
6060
}
6161

62-
const parallelRunPromises = state.parallelRunIds.map((runId) => {
62+
const parallelRunPromises = state.parallelRunIds.map(async (runId) => {
6363
const runClient = apifyClient.run(runId);
6464
return runClient.waitForFinish();
6565
});

0 commit comments

Comments
 (0)