apify-client 3.0.0-beta.1 → 3.0.0-beta.100
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/README.md +21 -5
- package/dist/apify_api_error.d.ts +64 -22
- package/dist/apify_api_error.js +100 -30
- package/dist/apify_client.d.ts +150 -35
- package/dist/apify_client.js +198 -118
- package/dist/apify_client_error.d.ts +10 -0
- package/dist/apify_client_error.js +10 -0
- package/dist/base/api_client.d.ts +9 -9
- package/dist/base/api_client.js +41 -45
- package/dist/base/resource_client.d.ts +24 -10
- package/dist/base/resource_client.js +78 -48
- package/dist/base/resource_collection_client.d.ts +15 -6
- package/dist/base/resource_collection_client.js +40 -21
- package/dist/body_parser.d.ts +3 -4
- package/dist/body_parser.js +20 -32
- package/dist/bundle.js +47 -52
- package/dist/bundle.js.map +1 -1
- package/dist/generated/api.d.ts +3363 -1185
- package/dist/generated/api.js +1 -2
- package/dist/generated/schemas.d.ts +8146 -0
- package/dist/generated/schemas.js +1866 -0
- package/dist/http_clients/axios.d.ts +61 -0
- package/dist/http_clients/axios.js +119 -0
- package/dist/http_clients/base.d.ts +391 -0
- package/dist/http_clients/base.js +650 -0
- package/dist/http_clients/index.d.ts +4 -0
- package/dist/http_clients/index.js +2 -0
- package/dist/http_compressors/base.d.ts +40 -0
- package/dist/http_compressors/base.js +9 -0
- package/dist/http_compressors/brotli.d.ts +33 -0
- package/dist/http_compressors/brotli.js +39 -0
- package/dist/http_compressors/gzip.d.ts +33 -0
- package/dist/http_compressors/gzip.js +39 -0
- package/dist/http_compressors/index.d.ts +8 -0
- package/dist/http_compressors/index.js +3 -0
- package/dist/http_compressors/resolve.d.ts +24 -0
- package/dist/http_compressors/resolve.js +30 -0
- package/dist/http_compressors/zstd.d.ts +34 -0
- package/dist/http_compressors/zstd.js +43 -0
- package/dist/index.d.ts +38 -32
- package/dist/index.js +36 -36
- package/dist/invalid_response_body_error.d.ts +14 -0
- package/dist/invalid_response_body_error.js +18 -0
- package/dist/lazy_schema.d.ts +8 -0
- package/dist/lazy_schema.js +11 -0
- package/dist/models.d.ts +196 -278
- package/dist/models.js +14 -15
- package/dist/resource_clients/actor.d.ts +115 -45
- package/dist/resource_clients/actor.js +187 -116
- package/dist/resource_clients/actor_collection.d.ts +21 -17
- package/dist/resource_clients/actor_collection.js +26 -21
- package/dist/resource_clients/actor_env_var.d.ts +13 -6
- package/dist/resource_clients/actor_env_var.js +21 -14
- package/dist/resource_clients/actor_env_var_collection.d.ts +18 -22
- package/dist/resource_clients/actor_env_var_collection.js +23 -20
- package/dist/resource_clients/actor_server.d.ts +149 -0
- package/dist/resource_clients/actor_server.js +199 -0
- package/dist/resource_clients/actor_version.d.ts +30 -10
- package/dist/resource_clients/actor_version.js +29 -23
- package/dist/resource_clients/actor_version_collection.d.ts +20 -21
- package/dist/resource_clients/actor_version_collection.js +25 -20
- package/dist/resource_clients/build.d.ts +24 -11
- package/dist/resource_clients/build.js +43 -26
- package/dist/resource_clients/build_collection.d.ts +10 -8
- package/dist/resource_clients/build_collection.js +13 -13
- package/dist/resource_clients/dataset.d.ts +87 -40
- package/dist/resource_clients/dataset.js +159 -175
- package/dist/resource_clients/dataset_collection.d.ts +13 -9
- package/dist/resource_clients/dataset_collection.js +29 -21
- package/dist/resource_clients/key_value_store.d.ts +110 -28
- package/dist/resource_clients/key_value_store.js +177 -99
- package/dist/resource_clients/key_value_store_collection.d.ts +13 -9
- package/dist/resource_clients/key_value_store_collection.js +29 -21
- package/dist/resource_clients/log.d.ts +42 -23
- package/dist/resource_clients/log.js +156 -85
- package/dist/resource_clients/request_queue.d.ts +77 -38
- package/dist/resource_clients/request_queue.js +251 -172
- package/dist/resource_clients/request_queue_collection.d.ts +12 -8
- package/dist/resource_clients/request_queue_collection.js +23 -20
- package/dist/resource_clients/run.d.ts +134 -34
- package/dist/resource_clients/run.js +225 -84
- package/dist/resource_clients/run_collection.d.ts +8 -6
- package/dist/resource_clients/run_collection.js +18 -18
- package/dist/resource_clients/schedule.d.ts +20 -11
- package/dist/resource_clients/schedule.js +36 -30
- package/dist/resource_clients/schedule_collection.d.ts +10 -6
- package/dist/resource_clients/schedule_collection.js +20 -17
- package/dist/resource_clients/store_collection.d.ts +9 -7
- package/dist/resource_clients/store_collection.js +18 -18
- package/dist/resource_clients/task.d.ts +44 -21
- package/dist/resource_clients/task.js +116 -86
- package/dist/resource_clients/task_collection.d.ts +13 -9
- package/dist/resource_clients/task_collection.js +19 -16
- package/dist/resource_clients/user.d.ts +22 -13
- package/dist/resource_clients/user.js +46 -47
- package/dist/resource_clients/webhook.d.ts +21 -12
- package/dist/resource_clients/webhook.js +35 -30
- package/dist/resource_clients/webhook_collection.d.ts +11 -7
- package/dist/resource_clients/webhook_collection.js +20 -17
- package/dist/resource_clients/webhook_dispatch.d.ts +9 -6
- package/dist/resource_clients/webhook_dispatch.js +11 -10
- package/dist/resource_clients/webhook_dispatch_collection.d.ts +7 -5
- package/dist/resource_clients/webhook_dispatch_collection.js +13 -13
- package/dist/response_validation_error.d.ts +27 -0
- package/dist/response_validation_error.js +38 -0
- package/dist/runtime/node.d.ts +6 -0
- package/dist/runtime/node.js +87 -0
- package/dist/runtime/types.d.ts +60 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/web.d.ts +5 -0
- package/dist/runtime/web.js +21 -0
- package/dist/schemas.d.ts +381 -0
- package/dist/schemas.js +37 -0
- package/dist/statistics.d.ts +1 -6
- package/dist/statistics.js +7 -11
- package/dist/timeouts.d.ts +84 -0
- package/dist/timeouts.js +37 -0
- package/dist/timezones.d.ts +1 -1
- package/dist/timezones.js +1 -2
- package/dist/utils.d.ts +99 -70
- package/dist/utils.js +251 -229
- package/dist/wait_for_resources.d.ts +8 -0
- package/dist/wait_for_resources.js +39 -0
- package/package.json +48 -47
- package/dist/argument_validation_error.d.ts +0 -17
- package/dist/argument_validation_error.js +0 -157
- package/dist/http_client.d.ts +0 -88
- package/dist/http_client.js +0 -260
- package/dist/index.mjs +0 -42
- package/dist/interceptors.d.ts +0 -19
- package/dist/interceptors.js +0 -110
|
@@ -0,0 +1,1866 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by `scripts/generate_schemas.mts`.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { lazySchema } from '../lazy_schema.js';
|
|
7
|
+
/** Common pagination fields for list responses. */
|
|
8
|
+
export const PaginationResponse = lazySchema(() => z.looseObject({
|
|
9
|
+
total: z.int().min(0),
|
|
10
|
+
offset: z.int().min(0),
|
|
11
|
+
limit: z.int().min(1),
|
|
12
|
+
desc: z.boolean(),
|
|
13
|
+
count: z.int().min(0),
|
|
14
|
+
}));
|
|
15
|
+
/** Usage statistics and Apify Store metrics for the Actor. */
|
|
16
|
+
export const ActorStats = lazySchema(() => z.looseObject({
|
|
17
|
+
totalBuilds: z.int().optional(),
|
|
18
|
+
totalRuns: z.int().optional(),
|
|
19
|
+
totalUsers: z.int().optional(),
|
|
20
|
+
totalUsers7Days: z.int().optional(),
|
|
21
|
+
totalUsers30Days: z.int().optional(),
|
|
22
|
+
totalUsers90Days: z.int().optional(),
|
|
23
|
+
totalMetamorphs: z.int().optional(),
|
|
24
|
+
lastRunStartedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).optional(),
|
|
25
|
+
actorReviewCount: z.int().optional(),
|
|
26
|
+
actorReviewRating: z.number().optional(),
|
|
27
|
+
bookmarkCount: z.int().optional(),
|
|
28
|
+
publicActorRunStats30Days: z.looseObject({
|
|
29
|
+
ABORTED: z.int().optional(),
|
|
30
|
+
FAILED: z.int().optional(),
|
|
31
|
+
SUCCEEDED: z.int().optional(),
|
|
32
|
+
"TIMED-OUT": z.int().optional(),
|
|
33
|
+
TOTAL: z.int().optional(),
|
|
34
|
+
}).optional(),
|
|
35
|
+
}));
|
|
36
|
+
export const ActorListItem = lazySchema(() => z.looseObject({
|
|
37
|
+
id: z.string(),
|
|
38
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
39
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
40
|
+
name: z.string(),
|
|
41
|
+
username: z.string(),
|
|
42
|
+
title: z.string().optional(),
|
|
43
|
+
stats: ActorStats().nullable().optional(),
|
|
44
|
+
}));
|
|
45
|
+
export const ListOfActors = lazySchema(() => PaginationResponse().extend({
|
|
46
|
+
items: z.array(ActorListItem()),
|
|
47
|
+
}));
|
|
48
|
+
export const ListOfActorsResponse = lazySchema(() => z.looseObject({
|
|
49
|
+
data: ListOfActors(),
|
|
50
|
+
}));
|
|
51
|
+
/** Machine-processable error type identifier. */
|
|
52
|
+
export const ErrorType = lazySchema(() => z.enum(["3d-secure-auth-failed", "access-right-already-exists", "action-not-found", "actor-already-rented", "actor-can-not-be-rented", "actor-disabled", "actor-is-not-rented", "actor-memory-limit-exceeded", "actor-name-exists-new-owner", "actor-name-not-unique", "actor-not-found", "actor-not-github-actor", "actor-not-public", "actor-permission-level-not-supported-for-agentic-payments", "actor-review-already-exists", "actor-run-failed", "actor-standby-not-supported-for-agentic-payments", "actor-task-name-not-unique", "agentic-payment-info-retrieval-error", "agentic-payment-information-missing", "agentic-payment-insufficient-amount", "agentic-payment-provider-internal-error", "agentic-payment-provider-unauthorized", "airtable-webhook-deprecated", "already-subscribed-to-paid-actor", "apify-plan-required-to-use-paid-actor", "apify-signup-not-allowed", "auth-method-not-supported", "authorization-server-not-found", "auto-issue-date-invalid", "background-check-required", "billing-system-error", "black-friday-plan-expired", "braintree-error", "braintree-not-linked", "braintree-operation-timed-out", "braintree-unsupported-currency", "build-not-found", "build-outdated", "cannot-add-apify-events-to-ppe-actor", "cannot-add-multiple-pricing-infos", "cannot-add-pricing-info-that-alters-past", "cannot-add-second-future-pricing-info", "cannot-build-actor-from-webhook", "cannot-change-billing-interval", "cannot-change-owner", "cannot-charge-apify-event", "cannot-charge-non-pay-per-event-actor", "cannot-comment-as-other-user", "cannot-copy-actor-task", "cannot-create-payout", "cannot-create-public-actor", "cannot-create-tax-transaction", "cannot-delete-critical-actor", "cannot-delete-invoice", "cannot-delete-paid-actor", "cannot-disable-one-time-event-for-apify-start-event", "cannot-disable-organization-with-enabled-members", "cannot-disable-user-with-subscription", "cannot-link-oauth-to-unverified-email", "cannot-metamorph-to-pay-per-result-actor", "cannot-modify-actor-pricing-too-frequently", "cannot-modify-actor-pricing-with-immediate-effect", "cannot-monetize-without-payout-billing-info", "cannot-override-paid-actor-trial", "cannot-permanently-delete-subscription", "cannot-publish-actor", "cannot-publish-actor-task", "cannot-reduce-last-full-token", "cannot-reimburse-more-than-original-charge", "cannot-reimburse-non-rental-charge", "cannot-remove-own-actor-from-recently-used", "cannot-remove-payment-method", "cannot-remove-pricing-info", "cannot-remove-running-run", "cannot-remove-user-with-public-actors", "cannot-remove-user-with-subscription", "cannot-remove-user-with-unpaid-invoice", "cannot-rename-env-var", "cannot-rent-paid-actor", "cannot-review-own-actor", "cannot-set-access-rights-for-owner", "cannot-set-is-status-message-terminal", "cannot-unpublish-critical-actor", "cannot-unpublish-paid-actor", "cannot-unpublish-profile", "cannot-update-invoice-field", "concurrent-runs-limit-exceeded", "concurrent-update-detected", "conference-token-not-found", "content-encoding-forbidden-for-html", "coupon-already-redeemed", "coupon-expired", "coupon-for-new-customers", "coupon-for-subscribed-users", "coupon-limits-are-in-conflict-with-current-limits", "coupon-max-number-of-redemptions-reached", "coupon-not-found", "coupon-not-unique", "coupons-disabled", "create-github-issue-not-allowed", "creator-plan-not-available", "cron-expression-invalid", "daily-ai-token-limit-exceeded", "daily-publication-limit-exceeded", "dataset-does-not-have-fields-schema", "dataset-does-not-have-schema", "dataset-locked", "dataset-schema-invalid", "dcr-not-supported", "default-dataset-not-found", "deleting-default-build", "deleting-unfinished-build", "email-already-taken", "email-already-taken-removed-user", "email-domain-not-allowed-for-coupon", "email-invalid", "email-not-allowed", "email-not-valid", "email-update-too-soon", "elevated-permissions-needed", "env-var-already-exists", "exchange-rate-fetch-failed", "expired-conference-token", "failed-to-charge-user", "final-invoice-negative", "full-permission-actor-blocked-for-admin", "full-permission-actor-not-approved", "full-permissions-require-verified-owner", "github-branch-empty", "github-issue-already-exists", "github-public-key-not-found", "github-repository-not-found", "github-signature-does-not-match-payload", "github-user-not-authorized-for-issues", "gmail-not-allowed", "id-does-not-match", "incompatible-billing-interval", "incomplete-payout-billing-info", "inconsistent-currencies", "incorrect-pricing-modifier-prefix", "input-json-invalid-characters", "input-json-not-object", "input-json-too-long", "input-update-collision", "input-validation-timed-out", "insufficient-permissions", "insufficient-permissions-to-change-field", "insufficient-security-measures", "insufficient-tax-country-evidence", "integration-auth-error", "internal-server-error", "invalid-billing-info", "invalid-billing-period-for-payout", "invalid-build", "invalid-client-key", "invalid-collection", "invalid-conference-login-password", "invalid-content-type-header", "invalid-credentials", "invalid-git-auth-token", "invalid-github-issue-url", "invalid-header", "invalid-id", "invalid-idempotency-key", "invalid-input", "invalid-input-schema", "invalid-invoice", "invalid-invoice-type", "invalid-issue-date", "invalid-label-params", "invalid-main-account-user-id", "invalid-oauth-app", "invalid-oauth-scope", "invalid-one-time-invoice", "invalid-parameter", "invalid-payout-status", "invalid-picture-url", "invalid-record-key", "invalid-request", "invalid-resource-type", "invalid-signature", "invalid-subscription-plan", "invalid-tax-number", "invalid-tax-number-format", "invalid-token", "invalid-token-type", "invalid-two-factor-code", "invalid-two-factor-code-or-recovery-code", "invalid-two-factor-recovery-code", "invalid-username", "invalid-value", "invitation-invalid-resource-type", "invitation-no-longer-valid", "invoice-canceled", "invoice-cannot-be-refunded-due-to-too-high-amount", "invoice-incomplete", "invoice-is-draft", "invoice-locked", "invoice-must-be-buffer", "invoice-not-canceled", "invoice-not-draft", "invoice-not-found", "invoice-outdated", "invoice-paid-already", "issue-already-connected-to-github", "issue-not-found", "issues-bad-request", "issuer-not-registered", "job-finished", "label-already-linked", "last-api-token", "limit-reached", "max-items-must-be-greater-than-zero", "max-metamorphs-exceeded", "max-total-charge-usd-below-minimum", "max-total-charge-usd-must-be-greater-than-zero", "mcp-connector-actor-not-allowed", "method-not-allowed", "migration-disabled", "missing-actor-rights", "missing-api-token", "missing-billing-info", "missing-line-items", "missing-payment-date", "missing-payout-billing-info", "missing-proxy-password", "missing-reporting-fields", "missing-resource-name", "missing-settings", "missing-username", "monthly-usage-limit-too-low", "more-public-actors-require-verified-owner", "more-than-one-update-not-allowed", "multiple-records-found", "must-be-admin", "name-not-unique", "next-runtime-computation-failed", "no-columns-in-exported-dataset", "no-payment-attempt-for-refund-found", "no-payment-method-available", "no-team-account-seats-available", "non-temporary-email", "not-enough-usage-to-run-paid-actor", "not-implemented", "not-supported-currencies", "o-auth-service-already-connected", "o-auth-service-not-connected", "oauth-resource-access-failed", "one-time-invoice-already-marked-paid", "only-drafts-can-be-deleted", "operation-canceled", "operation-not-allowed", "operation-timed-out", "organization-cannot-own-itself", "organization-role-not-found", "overlapping-payout-billing-periods", "own-token-required", "page-not-found", "param-not-one-of", "parameter-required", "parameters-mismatched", "password-reset-email-already-sent", "password-reset-token-expired", "pay-as-you-go-without-monthly-interval", "payment-attempt-status-message-required", "payout-already-paid", "payout-canceled", "payout-invalid-state", "payout-must-be-approved-to-be-marked-paid", "payout-not-found", "payout-number-already-exists", "phone-number-invalid", "phone-number-landline", "phone-number-opted-out", "phone-verification-disabled", "platform-feature-disabled", "price-overrides-validation-failed", "pricing-model-not-supported", "promotional-plan-not-available", "proxy-auth-ip-not-unique", "public-actor-disabled", "query-timeout", "quoted-price-outdated", "rate-limit-exceeded", "readme-required", "recaptcha-invalid", "recaptcha-required", "record-not-found", "record-not-public", "record-or-token-not-found", "record-too-large", "redirect-uri-mismatch", "reduced-plan-not-available", "rental-charge-already-reimbursed", "rental-not-allowed", "request-aborted-prematurely", "request-handled-or-locked", "request-id-invalid", "request-queue-duplicate-requests", "request-too-large", "requested-dataset-view-does-not-exist", "resume-token-expired", "run-failed", "run-input-body-not-valid-json", "run-timeout-exceeded", "russia-is-evil", "same-user", "schedule-actor-not-found", "schedule-actor-task-not-found", "schedule-name-not-unique", "schema-validation", "schema-validation-error", "schema-validation-failed", "schemas-required", "service-worker-registration-not-allowed", "sign-up-method-not-allowed", "slack-integration-not-custom", "socket-closed", "socket-destroyed", "standby-deployment-invalid", "store-schema-invalid", "store-terms-not-accepted", "stripe-enabled", "stripe-generic-decline", "stripe-not-enabled", "stripe-not-enabled-for-user", "tagged-build-required", "tax-country-invalid", "tax-number-invalid", "tax-number-validation-failed", "taxamo-call-failed", "taxamo-request-failed", "testing-error", "token-not-provided", "too-few-versions", "too-many-actor-tasks", "too-many-actors", "too-many-labels-on-resource", "too-many-mcp-connectors", "too-many-o-auth-apps", "too-many-organizations", "too-many-public-actor-tasks-per-account", "too-many-public-actor-tasks-per-actor", "too-many-requests", "too-many-schedules", "too-many-ui-access-keys", "too-many-user-labels", "too-many-values", "too-many-versions", "too-many-webhooks", "unexpected-route", "unknown-build-tag", "unknown-payment-provider", "unsubscribe-token-invalid", "unsupported-actor-pricing-model-for-agentic-payments", "unsupported-content-encoding", "unsupported-file-type-for-issue", "unsupported-file-type-image-expected", "unsupported-file-type-text-or-json-expected", "unsupported-permission", "upcoming-subscription-bill-not-up-to-date", "user-already-exists", "user-already-verified", "user-creates-organizations-too-fast", "user-disabled", "user-email-is-disposable", "user-email-not-set", "user-email-not-verified", "user-has-no-subscription", "user-integration-not-found", "user-is-already-invited", "user-is-already-organization-member", "user-is-not-member-of-organization", "user-is-not-organization", "user-is-organization", "user-is-organization-owner", "user-is-removed", "user-not-found", "user-not-logged-in", "user-not-verified", "user-or-token-not-found", "user-plan-not-allowed-for-coupon", "user-problem-with-card", "user-record-not-found", "username-already-taken", "username-missing", "username-not-allowed", "username-removal-forbidden", "username-required", "verification-email-already-sent", "verification-token-expired", "version-already-exists", "versions-size-exceeded", "weak-password", "x402-agentic-payment-already-finalized", "x402-agentic-payment-insufficient-amount", "x402-agentic-payment-malformed-token", "x402-agentic-payment-settlement-failed", "x402-agentic-payment-settlement-in-progress", "x402-agentic-payment-settlement-stuck", "x402-agentic-payment-unauthorized", "x402-payment-required", "zero-invoice"]).or(z.string()));
|
|
53
|
+
export const ErrorDetail = lazySchema(() => z.looseObject({
|
|
54
|
+
type: ErrorType().optional(),
|
|
55
|
+
message: z.string().optional(),
|
|
56
|
+
data: z.record(z.string(), z.unknown()).optional(),
|
|
57
|
+
}));
|
|
58
|
+
export const ErrorResponse = lazySchema(() => z.looseObject({
|
|
59
|
+
error: ErrorDetail(),
|
|
60
|
+
}));
|
|
61
|
+
/** Determines the permission level that the Actor requires to run. For details, see [Actor permissions](https://docs.apify.com/platform/actors/development/permissions). */
|
|
62
|
+
export const ActorPermissionLevel = lazySchema(() => z.enum(["LIMITED_PERMISSIONS", "FULL_PERMISSIONS"]).or(z.string()));
|
|
63
|
+
/** The version source types accepted in request bodies. Same as `VersionSourceType`, without `SOURCE_CODE`. */
|
|
64
|
+
export const WritableVersionSourceType = lazySchema(() => z.enum(["SOURCE_FILES", "GIT_REPO", "TARBALL", "GITHUB_GIST"]).or(z.string()));
|
|
65
|
+
export const EnvVarRequest = lazySchema(() => z.looseObject({
|
|
66
|
+
name: z.string(),
|
|
67
|
+
value: z.string(),
|
|
68
|
+
isSecret: z.boolean().nullable().optional(),
|
|
69
|
+
}));
|
|
70
|
+
export const SourceCodeFileFormat = lazySchema(() => z.enum(["BASE64", "TEXT"]).or(z.string()));
|
|
71
|
+
/** Represents a single file in the Actor's source code. */
|
|
72
|
+
export const SourceCodeFile = lazySchema(() => z.looseObject({
|
|
73
|
+
format: SourceCodeFileFormat().optional(),
|
|
74
|
+
content: z.string().optional(),
|
|
75
|
+
name: z.string(),
|
|
76
|
+
}));
|
|
77
|
+
/**
|
|
78
|
+
* Represents a folder in the Actor's source code structure. Distinguished from
|
|
79
|
+
* SourceCodeFile by the presence of the `folder` property set to `true`.
|
|
80
|
+
*/
|
|
81
|
+
export const SourceCodeFolder = lazySchema(() => z.looseObject({
|
|
82
|
+
name: z.string(),
|
|
83
|
+
folder: z.boolean(),
|
|
84
|
+
}));
|
|
85
|
+
export const VersionSourceFiles = lazySchema(() => z.array(z.union([SourceCodeFile(), SourceCodeFolder()])));
|
|
86
|
+
export const CreateVersionRequest = lazySchema(() => z.looseObject({
|
|
87
|
+
versionNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/),
|
|
88
|
+
sourceType: WritableVersionSourceType(),
|
|
89
|
+
envVars: z.array(EnvVarRequest()).optional(),
|
|
90
|
+
applyEnvVarsToBuild: z.boolean().nullable().optional(),
|
|
91
|
+
buildTag: z.string().nullable().optional(),
|
|
92
|
+
sourceFiles: VersionSourceFiles().optional(),
|
|
93
|
+
gitRepoUrl: z.string().optional(),
|
|
94
|
+
tarballUrl: z.string().optional(),
|
|
95
|
+
gitHubGistUrl: z.string().optional(),
|
|
96
|
+
actorPath: z.string().min(1).max(255).nullable().optional(),
|
|
97
|
+
}));
|
|
98
|
+
/** The default settings applied to an Actor run. Can be overridden elsewhere. */
|
|
99
|
+
export const DefaultRunOptions = lazySchema(() => z.looseObject({
|
|
100
|
+
build: z.string().optional(),
|
|
101
|
+
timeoutSecs: z.int().optional(),
|
|
102
|
+
memoryMbytes: z.int().optional(),
|
|
103
|
+
restartOnError: z.boolean().nullable().optional(),
|
|
104
|
+
maxItems: z.int().nullable().optional(),
|
|
105
|
+
maxTotalChargeUsd: z.number().nullable().optional(),
|
|
106
|
+
isMaxTotalChargeUsdSetByUser: z.boolean().nullable().optional(),
|
|
107
|
+
forcePermissionLevel: ActorPermissionLevel().nullable().optional(),
|
|
108
|
+
}));
|
|
109
|
+
export const ActorStandby = lazySchema(() => z.looseObject({
|
|
110
|
+
isEnabled: z.boolean().nullable().optional(),
|
|
111
|
+
desiredRequestsPerActorRun: z.int().nullable().optional(),
|
|
112
|
+
maxRequestsPerActorRun: z.int().nullable().optional(),
|
|
113
|
+
idleTimeoutSecs: z.int().nullable().optional(),
|
|
114
|
+
build: z.string().nullable().optional(),
|
|
115
|
+
memoryMbytes: z.int().nullable().optional(),
|
|
116
|
+
disableStandbyFieldsOverride: z.boolean().nullable().optional(),
|
|
117
|
+
shouldPassActorInput: z.boolean().nullable().optional(),
|
|
118
|
+
tenancy: z.enum(["SINGLE_TENANT", "MULTI_TENANT"]).or(z.string()).nullable().optional(),
|
|
119
|
+
isConsoleAuthEnabled: z.boolean().nullable().optional(),
|
|
120
|
+
isTokenlessEnabled: z.boolean().nullable().optional(),
|
|
121
|
+
}));
|
|
122
|
+
export const ExampleRunInput = lazySchema(() => z.looseObject({
|
|
123
|
+
body: z.string().optional(),
|
|
124
|
+
contentType: z.string().optional(),
|
|
125
|
+
}));
|
|
126
|
+
export const CreateActorRequest = lazySchema(() => z.looseObject({
|
|
127
|
+
name: z.string().nullable().optional(),
|
|
128
|
+
description: z.string().nullable().optional(),
|
|
129
|
+
title: z.string().nullable().optional(),
|
|
130
|
+
isPublic: z.boolean().optional(),
|
|
131
|
+
actorPermissionLevel: ActorPermissionLevel().optional(),
|
|
132
|
+
seoTitle: z.string().nullable().optional(),
|
|
133
|
+
seoDescription: z.string().nullable().optional(),
|
|
134
|
+
restartOnError: z.boolean().optional(),
|
|
135
|
+
versions: z.array(CreateVersionRequest()).min(1).optional(),
|
|
136
|
+
categories: z.array(z.string()).nullable().optional(),
|
|
137
|
+
defaultRunOptions: DefaultRunOptions().optional(),
|
|
138
|
+
actorStandby: ActorStandby().nullable().optional(),
|
|
139
|
+
exampleRunInput: ExampleRunInput().nullable().optional(),
|
|
140
|
+
isDeprecated: z.boolean().nullable().optional(),
|
|
141
|
+
}));
|
|
142
|
+
export const VersionSourceType = lazySchema(() => z.enum(["SOURCE_FILES", "GIT_REPO", "TARBALL", "GITHUB_GIST", "SOURCE_CODE"]).or(z.string()));
|
|
143
|
+
export const EnvVar = lazySchema(() => z.looseObject({
|
|
144
|
+
name: z.string(),
|
|
145
|
+
value: z.string().optional(),
|
|
146
|
+
isSecret: z.boolean().nullable().optional(),
|
|
147
|
+
valueHash: z.string().optional(),
|
|
148
|
+
}));
|
|
149
|
+
export const Version = lazySchema(() => z.looseObject({
|
|
150
|
+
versionNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/),
|
|
151
|
+
sourceType: VersionSourceType().nullable(),
|
|
152
|
+
envVars: z.array(EnvVar()).nullable().optional(),
|
|
153
|
+
applyEnvVarsToBuild: z.boolean().nullable().optional(),
|
|
154
|
+
buildTag: z.string().nullable().optional(),
|
|
155
|
+
sourceFiles: VersionSourceFiles().optional(),
|
|
156
|
+
gitRepoUrl: z.string().nullable().optional(),
|
|
157
|
+
tarballUrl: z.string().nullable().optional(),
|
|
158
|
+
gitHubGistUrl: z.string().nullable().optional(),
|
|
159
|
+
actorPath: z.string().min(1).max(255).nullable().optional(),
|
|
160
|
+
githubWebhookId: z.int().nullable().optional(),
|
|
161
|
+
gitlabWebhookId: z.int().nullable().optional(),
|
|
162
|
+
bitbucketWebhookId: z.string().nullable().optional(),
|
|
163
|
+
}));
|
|
164
|
+
export const CommonActorPricingInfo = lazySchema(() => z.looseObject({
|
|
165
|
+
apifyMarginPercentage: z.number(),
|
|
166
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
167
|
+
startedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
168
|
+
notifiedAboutFutureChangeAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
169
|
+
notifiedAboutChangeAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
170
|
+
notifiedAboutRentalToPpePriceChangeAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
171
|
+
reasonForChange: z.string().nullable().optional(),
|
|
172
|
+
isPriceChangeNotificationSuppressed: z.boolean().optional(),
|
|
173
|
+
forceContainsSignificantPriceChange: z.boolean().optional(),
|
|
174
|
+
}));
|
|
175
|
+
/** A single tier's price-per-event entry. */
|
|
176
|
+
export const TieredPricingPerEventEntry = lazySchema(() => z.looseObject({
|
|
177
|
+
tieredEventPriceUsd: z.number(),
|
|
178
|
+
}));
|
|
179
|
+
/**
|
|
180
|
+
* Tiered price-per-event pricing for a single charge event, keyed by subscription tier (e.g. `FREE`, `BRONZE`,
|
|
181
|
+
* `SILVER`, `GOLD`, `PLATINUM`, `DIAMOND`). The actual price applied is resolved from the user's tier.
|
|
182
|
+
*/
|
|
183
|
+
export const TieredPricingPerEvent = lazySchema(() => z.record(z.string(), TieredPricingPerEventEntry()));
|
|
184
|
+
/**
|
|
185
|
+
* Definition of a single chargeable event for a pay-per-event Actor. Each event is either flat-priced
|
|
186
|
+
* (`eventPriceUsd` is set) or tier-priced (`eventTieredPricingUsd` is set); the two are mutually exclusive.
|
|
187
|
+
*/
|
|
188
|
+
export const ActorChargeEvent = lazySchema(() => z.looseObject({
|
|
189
|
+
eventTitle: z.string(),
|
|
190
|
+
eventDescription: z.string(),
|
|
191
|
+
eventPriceUsd: z.number().optional(),
|
|
192
|
+
eventTieredPricingUsd: TieredPricingPerEvent().optional(),
|
|
193
|
+
isPrimaryEvent: z.boolean().optional(),
|
|
194
|
+
isOneTimeEvent: z.boolean().nullable().optional(),
|
|
195
|
+
}));
|
|
196
|
+
export const PayPerEventActorPricingInfo = lazySchema(() => CommonActorPricingInfo().extend({
|
|
197
|
+
pricingModel: z.literal("PAY_PER_EVENT"),
|
|
198
|
+
pricingPerEvent: z.looseObject({
|
|
199
|
+
actorChargeEvents: z.record(z.string(), ActorChargeEvent()).optional(),
|
|
200
|
+
}),
|
|
201
|
+
minimalMaxTotalChargeUsd: z.number().nullable().optional(),
|
|
202
|
+
isPPEPlatformUsagePaidByUser: z.boolean().nullable().optional(),
|
|
203
|
+
}));
|
|
204
|
+
/** A single tier's price-per-dataset-item entry. */
|
|
205
|
+
export const TieredPricingPerDatasetItemEntry = lazySchema(() => z.looseObject({
|
|
206
|
+
tieredPricePerUnitUsd: z.number(),
|
|
207
|
+
}));
|
|
208
|
+
/**
|
|
209
|
+
* Tiered price-per-dataset-item pricing, keyed by subscription tier (e.g. `FREE`, `BRONZE`, `SILVER`, `GOLD`,
|
|
210
|
+
* `PLATINUM`, `DIAMOND`). The actual price applied to a run is resolved from the user's tier.
|
|
211
|
+
*/
|
|
212
|
+
export const TieredPricingPerDatasetItem = lazySchema(() => z.record(z.string(), TieredPricingPerDatasetItemEntry()));
|
|
213
|
+
export const PricePerDatasetItemActorPricingInfo = lazySchema(() => CommonActorPricingInfo().extend({
|
|
214
|
+
pricingModel: z.literal("PRICE_PER_DATASET_ITEM"),
|
|
215
|
+
unitName: z.string(),
|
|
216
|
+
pricePerUnitUsd: z.number().optional(),
|
|
217
|
+
tieredPricing: TieredPricingPerDatasetItem().optional(),
|
|
218
|
+
}));
|
|
219
|
+
/** Rental pricing model, which is no longer supported. */
|
|
220
|
+
export const FlatPricePerMonthActorPricingInfo = lazySchema(() => CommonActorPricingInfo().extend({
|
|
221
|
+
pricingModel: z.literal("FLAT_PRICE_PER_MONTH"),
|
|
222
|
+
trialMinutes: z.int(),
|
|
223
|
+
pricePerUnitUsd: z.number(),
|
|
224
|
+
}));
|
|
225
|
+
export const FreeActorPricingInfo = lazySchema(() => CommonActorPricingInfo().extend({
|
|
226
|
+
pricingModel: z.literal("FREE"),
|
|
227
|
+
}));
|
|
228
|
+
export const ActorRunPricingInfo = lazySchema(() => z.discriminatedUnion("pricingModel", [PayPerEventActorPricingInfo(), PricePerDatasetItemActorPricingInfo(), FlatPricePerMonthActorPricingInfo(), FreeActorPricingInfo()]));
|
|
229
|
+
/** Information about a tagged build. */
|
|
230
|
+
export const TaggedBuildInfo = lazySchema(() => z.looseObject({
|
|
231
|
+
buildId: z.string().optional(),
|
|
232
|
+
buildNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).nullable().optional(),
|
|
233
|
+
buildNumberInt: z.int().optional(),
|
|
234
|
+
finishedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
235
|
+
}));
|
|
236
|
+
/** A dictionary mapping build tag names (e.g., "latest", "beta") to their build information. */
|
|
237
|
+
export const TaggedBuilds = lazySchema(() => z.record(z.string(), TaggedBuildInfo().nullable()));
|
|
238
|
+
/** A warning displayed on the Actor's page in Apify Store and Console. Can be set by the Actor's developer or automatically by Apify's quality checks. */
|
|
239
|
+
export const ActorNotice = lazySchema(() => z.enum(["NONE", "RESIDENTIAL_PROXY_REQUIRED", "UNDER_MAINTENANCE"]).or(z.string()).nullable());
|
|
240
|
+
export const ActorResource = lazySchema(() => z.looseObject({
|
|
241
|
+
id: z.string(),
|
|
242
|
+
userId: z.string(),
|
|
243
|
+
name: z.string(),
|
|
244
|
+
username: z.string(),
|
|
245
|
+
description: z.string().nullable().optional(),
|
|
246
|
+
restartOnError: z.boolean().nullable().optional(),
|
|
247
|
+
isPublic: z.boolean(),
|
|
248
|
+
actorPermissionLevel: ActorPermissionLevel().optional(),
|
|
249
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
250
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
251
|
+
stats: ActorStats(),
|
|
252
|
+
versions: z.array(Version()),
|
|
253
|
+
pricingInfos: z.array(ActorRunPricingInfo()).optional(),
|
|
254
|
+
defaultRunOptions: DefaultRunOptions(),
|
|
255
|
+
exampleRunInput: ExampleRunInput().nullable().optional(),
|
|
256
|
+
isDeprecated: z.boolean().nullable().optional(),
|
|
257
|
+
deploymentKey: z.string().optional(),
|
|
258
|
+
title: z.string().nullable().optional(),
|
|
259
|
+
taggedBuilds: TaggedBuilds().nullable().optional(),
|
|
260
|
+
actorStandby: ActorStandby().nullable().optional(),
|
|
261
|
+
readmeSummary: z.string().optional(),
|
|
262
|
+
seoTitle: z.string().nullable().optional(),
|
|
263
|
+
seoDescription: z.string().nullable().optional(),
|
|
264
|
+
pictureUrl: z.string().nullable().optional(),
|
|
265
|
+
standbyUrl: z.string().nullable().optional(),
|
|
266
|
+
notice: ActorNotice().optional(),
|
|
267
|
+
categories: z.array(z.string()).optional(),
|
|
268
|
+
isCritical: z.boolean().optional(),
|
|
269
|
+
isGeneric: z.boolean().optional(),
|
|
270
|
+
isSourceCodeHidden: z.boolean().optional(),
|
|
271
|
+
hasNoDataset: z.boolean().optional(),
|
|
272
|
+
}));
|
|
273
|
+
/** Response containing Actor data. */
|
|
274
|
+
export const ActorResponse = lazySchema(() => z.looseObject({
|
|
275
|
+
data: ActorResource(),
|
|
276
|
+
}));
|
|
277
|
+
/** The name of the build tag. */
|
|
278
|
+
export const UpdatedBuildProperty = lazySchema(() => z.looseObject({
|
|
279
|
+
buildId: z.string(),
|
|
280
|
+
}).nullable());
|
|
281
|
+
export const UpdateActorRequest = lazySchema(() => z.looseObject({
|
|
282
|
+
name: z.string().optional(),
|
|
283
|
+
description: z.string().nullable().optional(),
|
|
284
|
+
isPublic: z.boolean().optional(),
|
|
285
|
+
actorPermissionLevel: ActorPermissionLevel().optional(),
|
|
286
|
+
seoTitle: z.string().nullable().optional(),
|
|
287
|
+
seoDescription: z.string().nullable().optional(),
|
|
288
|
+
title: z.string().nullable().optional(),
|
|
289
|
+
restartOnError: z.boolean().optional(),
|
|
290
|
+
versions: z.array(CreateVersionRequest()).min(1).optional(),
|
|
291
|
+
pricingInfos: z.array(ActorRunPricingInfo()).optional(),
|
|
292
|
+
categories: z.array(z.string()).nullable().optional(),
|
|
293
|
+
defaultRunOptions: DefaultRunOptions().nullable().optional(),
|
|
294
|
+
taggedBuilds: z.record(z.string(), UpdatedBuildProperty()).nullable().optional(),
|
|
295
|
+
actorStandby: ActorStandby().nullable().optional(),
|
|
296
|
+
exampleRunInput: ExampleRunInput().nullable().optional(),
|
|
297
|
+
isDeprecated: z.boolean().nullable().optional(),
|
|
298
|
+
}));
|
|
299
|
+
export const ListOfVersions = lazySchema(() => z.looseObject({
|
|
300
|
+
total: z.int(),
|
|
301
|
+
items: z.array(Version()),
|
|
302
|
+
}));
|
|
303
|
+
export const ListOfVersionsResponse = lazySchema(() => z.looseObject({
|
|
304
|
+
data: ListOfVersions(),
|
|
305
|
+
}));
|
|
306
|
+
export const VersionResponse = lazySchema(() => z.looseObject({
|
|
307
|
+
data: Version(),
|
|
308
|
+
}));
|
|
309
|
+
export const UpdateVersionRequest = lazySchema(() => z.looseObject({
|
|
310
|
+
versionNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/).optional(),
|
|
311
|
+
sourceType: WritableVersionSourceType().optional(),
|
|
312
|
+
envVars: z.array(EnvVarRequest()).optional(),
|
|
313
|
+
applyEnvVarsToBuild: z.boolean().nullable().optional(),
|
|
314
|
+
buildTag: z.string().nullable().optional(),
|
|
315
|
+
sourceFiles: VersionSourceFiles().optional(),
|
|
316
|
+
gitRepoUrl: z.string().optional(),
|
|
317
|
+
tarballUrl: z.string().optional(),
|
|
318
|
+
gitHubGistUrl: z.string().optional(),
|
|
319
|
+
actorPath: z.string().min(1).max(255).nullable().optional(),
|
|
320
|
+
}));
|
|
321
|
+
export const UpdateBuildOnPushRequest = lazySchema(() => z.looseObject({
|
|
322
|
+
providerId: z.string(),
|
|
323
|
+
enabled: z.boolean(),
|
|
324
|
+
}));
|
|
325
|
+
export const ListOfEnvVars = lazySchema(() => z.looseObject({
|
|
326
|
+
total: z.int(),
|
|
327
|
+
items: z.array(EnvVar()),
|
|
328
|
+
}));
|
|
329
|
+
export const ListOfEnvVarsResponse = lazySchema(() => z.looseObject({
|
|
330
|
+
data: ListOfEnvVars(),
|
|
331
|
+
}));
|
|
332
|
+
export const EnvVarResponse = lazySchema(() => z.looseObject({
|
|
333
|
+
data: EnvVar(),
|
|
334
|
+
}));
|
|
335
|
+
/** Type of event that triggers the webhook. */
|
|
336
|
+
export const WebhookEventType = lazySchema(() => z.enum(["ACTOR.BUILD.ABORTED", "ACTOR.BUILD.CREATED", "ACTOR.BUILD.FAILED", "ACTOR.BUILD.SUCCEEDED", "ACTOR.BUILD.TIMED_OUT", "ACTOR.RUN.ABORTED", "ACTOR.RUN.CREATED", "ACTOR.RUN.FAILED", "ACTOR.RUN.RESURRECTED", "ACTOR.RUN.SUCCEEDED", "ACTOR.RUN.TIMED_OUT", "TEST"]).or(z.string()));
|
|
337
|
+
export const WebhookCondition = lazySchema(() => z.looseObject({
|
|
338
|
+
actorId: z.string().nullable().optional(),
|
|
339
|
+
actorTaskId: z.string().nullable().optional(),
|
|
340
|
+
actorRunId: z.string().nullable().optional(),
|
|
341
|
+
}));
|
|
342
|
+
/** Slack message configuration. Present only when `actionType` is `SLACK_MESSAGE`. */
|
|
343
|
+
export const WebhookSlackMessage = lazySchema(() => z.looseObject({
|
|
344
|
+
userIntegrationId: z.string().optional(),
|
|
345
|
+
channelId: z.string().optional(),
|
|
346
|
+
messageTemplate: z.string().optional(),
|
|
347
|
+
}));
|
|
348
|
+
/** Selects which dataset item fields are included in the output. */
|
|
349
|
+
export const WebhookDatasetTransformation = lazySchema(() => z.looseObject({
|
|
350
|
+
fields: z.array(z.string()).optional(),
|
|
351
|
+
omit: z.array(z.string()).optional(),
|
|
352
|
+
}));
|
|
353
|
+
/** Gmail email configuration. Present only when `actionType` is `GOOGLE_MAIL`. */
|
|
354
|
+
export const WebhookGoogleMail = lazySchema(() => z.looseObject({
|
|
355
|
+
userIntegrationId: z.string().optional(),
|
|
356
|
+
emailTo: z.array(z.string()).optional(),
|
|
357
|
+
subject: z.string().optional(),
|
|
358
|
+
body: z.string().optional(),
|
|
359
|
+
attachmentFormat: z.string().optional(),
|
|
360
|
+
attachmentTransformation: WebhookDatasetTransformation().optional(),
|
|
361
|
+
}));
|
|
362
|
+
/** Google Drive upload configuration. Present only when `actionType` is `GOOGLE_DRIVE`. */
|
|
363
|
+
export const WebhookGoogleDrive = lazySchema(() => z.looseObject({
|
|
364
|
+
userIntegrationId: z.string().optional(),
|
|
365
|
+
filename: z.string().optional(),
|
|
366
|
+
format: z.string().nullable().optional(),
|
|
367
|
+
transformation: WebhookDatasetTransformation().optional(),
|
|
368
|
+
}));
|
|
369
|
+
/** GitHub issue configuration. Present only when `actionType` is `GITHUB_ISSUE`. */
|
|
370
|
+
export const WebhookGithubIssue = lazySchema(() => z.looseObject({
|
|
371
|
+
userIntegrationId: z.string().optional(),
|
|
372
|
+
repository: z.string().optional(),
|
|
373
|
+
title: z.string().optional(),
|
|
374
|
+
body: z.string().optional(),
|
|
375
|
+
}));
|
|
376
|
+
/** Status of the webhook dispatch indicating whether the HTTP request was successful. */
|
|
377
|
+
export const WebhookDispatchStatus = lazySchema(() => z.enum(["ACTIVE", "SUCCEEDED", "FAILED"]).or(z.string()));
|
|
378
|
+
export const WebhookLastDispatch = lazySchema(() => z.looseObject({
|
|
379
|
+
status: WebhookDispatchStatus(),
|
|
380
|
+
finishedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
381
|
+
removedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
382
|
+
}));
|
|
383
|
+
export const WebhookStats = lazySchema(() => z.looseObject({
|
|
384
|
+
totalDispatches: z.int().optional(),
|
|
385
|
+
}));
|
|
386
|
+
export const WebhookResource = lazySchema(() => z.looseObject({
|
|
387
|
+
id: z.string(),
|
|
388
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
389
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
390
|
+
userId: z.string(),
|
|
391
|
+
isAdHoc: z.boolean().nullable().optional(),
|
|
392
|
+
isEnabled: z.boolean().optional(),
|
|
393
|
+
actionType: z.string().optional(),
|
|
394
|
+
isApifyIntegration: z.boolean().nullable().optional(),
|
|
395
|
+
shouldInterpolateStrings: z.boolean().nullable().optional(),
|
|
396
|
+
eventTypes: z.array(WebhookEventType()),
|
|
397
|
+
condition: WebhookCondition(),
|
|
398
|
+
ignoreSslErrors: z.boolean(),
|
|
399
|
+
doNotRetry: z.boolean().nullable().optional(),
|
|
400
|
+
requestUrl: z.url({ normalize: true }).nullable().optional(),
|
|
401
|
+
payloadTemplate: z.string().nullable().optional(),
|
|
402
|
+
headersTemplate: z.string().nullable().optional(),
|
|
403
|
+
title: z.string().nullable().optional(),
|
|
404
|
+
description: z.string().nullable().optional(),
|
|
405
|
+
slackMessage: WebhookSlackMessage().optional(),
|
|
406
|
+
googleMail: WebhookGoogleMail().optional(),
|
|
407
|
+
googleDrive: WebhookGoogleDrive().optional(),
|
|
408
|
+
githubIssue: WebhookGithubIssue().optional(),
|
|
409
|
+
lastDispatch: WebhookLastDispatch().nullable().optional(),
|
|
410
|
+
stats: WebhookStats().nullable().optional(),
|
|
411
|
+
}));
|
|
412
|
+
/** Paginated list of webhooks with all their fields, including `payloadTemplate`. */
|
|
413
|
+
export const ListOfWebhookResources = lazySchema(() => PaginationResponse().extend({
|
|
414
|
+
items: z.array(WebhookResource()),
|
|
415
|
+
}));
|
|
416
|
+
export const ListOfWebhookResourcesResponse = lazySchema(() => z.looseObject({
|
|
417
|
+
data: ListOfWebhookResources(),
|
|
418
|
+
}));
|
|
419
|
+
/** An OAuth connection configured on an Actor. Secret credentials are never returned. */
|
|
420
|
+
export const ActorOAuthConnection = lazySchema(() => z.looseObject({
|
|
421
|
+
_id: z.string(),
|
|
422
|
+
actorId: z.string(),
|
|
423
|
+
oAuthProviderType: z.enum(["CUSTOM", "GOOGLE"]).or(z.string()),
|
|
424
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
425
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
426
|
+
credentials: z.looseObject({
|
|
427
|
+
clientId: z.string().optional(),
|
|
428
|
+
scope: z.string().optional(),
|
|
429
|
+
label: z.string().optional(),
|
|
430
|
+
imageUrl: z.string().optional(),
|
|
431
|
+
}).optional(),
|
|
432
|
+
}));
|
|
433
|
+
export const ListOfActorOAuthConnections = lazySchema(() => z.looseObject({
|
|
434
|
+
total: z.int(),
|
|
435
|
+
items: z.array(ActorOAuthConnection()),
|
|
436
|
+
}));
|
|
437
|
+
export const ListOfActorOAuthConnectionsResponse = lazySchema(() => z.looseObject({
|
|
438
|
+
data: ListOfActorOAuthConnections(),
|
|
439
|
+
}));
|
|
440
|
+
/** Status of an Actor job (run or build). */
|
|
441
|
+
export const ActorJobStatus = lazySchema(() => z.enum(["READY", "RUNNING", "SUCCEEDED", "FAILED", "TIMING-OUT", "TIMED-OUT", "ABORTING", "ABORTED"]).or(z.string()));
|
|
442
|
+
export const RunOrigin = lazySchema(() => z.enum(["DEVELOPMENT", "WEB", "API", "SCHEDULER", "TEST", "WEBHOOK", "ACTOR", "CLI", "CI", "STANDBY", "MCP"]).or(z.string()));
|
|
443
|
+
export const BuildMeta = lazySchema(() => z.looseObject({
|
|
444
|
+
origin: RunOrigin(),
|
|
445
|
+
clientIp: z.string().optional(),
|
|
446
|
+
userAgent: z.string().optional(),
|
|
447
|
+
githubActionsRunUrl: z.string().optional(),
|
|
448
|
+
actorRunId: z.string().optional(),
|
|
449
|
+
webhookDispatchId: z.string().optional(),
|
|
450
|
+
}));
|
|
451
|
+
export const BuildListItem = lazySchema(() => z.looseObject({
|
|
452
|
+
id: z.string(),
|
|
453
|
+
actId: z.string().optional(),
|
|
454
|
+
userId: z.string().optional(),
|
|
455
|
+
status: ActorJobStatus(),
|
|
456
|
+
startedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
457
|
+
finishedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
458
|
+
usageTotalUsd: z.number().optional(),
|
|
459
|
+
buildNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/),
|
|
460
|
+
buildNumberInt: z.int().optional(),
|
|
461
|
+
meta: BuildMeta().optional(),
|
|
462
|
+
}));
|
|
463
|
+
export const ListOfBuilds = lazySchema(() => PaginationResponse().extend({
|
|
464
|
+
items: z.array(BuildListItem()),
|
|
465
|
+
}));
|
|
466
|
+
export const ListOfBuildsResponse = lazySchema(() => z.looseObject({
|
|
467
|
+
data: ListOfBuilds(),
|
|
468
|
+
}));
|
|
469
|
+
export const BuildStats = lazySchema(() => z.looseObject({
|
|
470
|
+
durationMillis: z.int().optional(),
|
|
471
|
+
runTimeSecs: z.number().optional(),
|
|
472
|
+
computeUnits: z.number().optional(),
|
|
473
|
+
imageSizeBytes: z.int().nullable().optional(),
|
|
474
|
+
}));
|
|
475
|
+
export const BuildOptions = lazySchema(() => z.looseObject({
|
|
476
|
+
useCache: z.boolean().nullable().optional(),
|
|
477
|
+
betaPackages: z.boolean().nullable().optional(),
|
|
478
|
+
memoryMbytes: z.int().nullable().optional(),
|
|
479
|
+
diskMbytes: z.int().nullable().optional(),
|
|
480
|
+
tag: z.string().nullable().optional(),
|
|
481
|
+
debug: z.boolean().nullable().optional(),
|
|
482
|
+
}));
|
|
483
|
+
export const BuildUsage = lazySchema(() => z.looseObject({
|
|
484
|
+
ACTOR_COMPUTE_UNITS: z.number().nullable().optional(),
|
|
485
|
+
}));
|
|
486
|
+
/** Additional information about the Actor. */
|
|
487
|
+
export const ActorDefinitionMeta = lazySchema(() => z.looseObject({
|
|
488
|
+
templateId: z.string().optional(),
|
|
489
|
+
generatedBy: z.string().optional(),
|
|
490
|
+
}));
|
|
491
|
+
/** The definition of the Actor, the full specification of this field can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/actor-json) */
|
|
492
|
+
export const ActorDefinition = lazySchema(() => z.looseObject({
|
|
493
|
+
actorSpecification: z.literal(1).optional(),
|
|
494
|
+
name: z.string().optional(),
|
|
495
|
+
title: z.string().optional(),
|
|
496
|
+
description: z.string().optional(),
|
|
497
|
+
version: z.string().regex(/^[0-9]+(\.[0-9]+)+$/).optional(),
|
|
498
|
+
buildTag: z.string().optional(),
|
|
499
|
+
meta: ActorDefinitionMeta().optional(),
|
|
500
|
+
environmentVariables: z.record(z.string(), z.string()).optional(),
|
|
501
|
+
dockerfile: z.string().optional(),
|
|
502
|
+
dockerContextDir: z.string().optional(),
|
|
503
|
+
readme: z.string().nullable().optional(),
|
|
504
|
+
input: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
505
|
+
output: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
506
|
+
changelog: z.string().nullable().optional(),
|
|
507
|
+
storages: z.looseObject({
|
|
508
|
+
dataset: z.record(z.string(), z.unknown()).optional(),
|
|
509
|
+
datasets: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
|
|
510
|
+
keyValueStore: z.record(z.string(), z.unknown()).optional(),
|
|
511
|
+
}).optional(),
|
|
512
|
+
defaultMemoryMbytes: z.union([z.string(), z.int()]).optional(),
|
|
513
|
+
minMemoryMbytes: z.int().min(128).optional(),
|
|
514
|
+
maxMemoryMbytes: z.int().min(128).optional(),
|
|
515
|
+
usesStandbyMode: z.boolean().optional(),
|
|
516
|
+
webServerSchema: z.record(z.string(), z.unknown()).optional(),
|
|
517
|
+
webServerMcpPath: z.string().optional(),
|
|
518
|
+
}));
|
|
519
|
+
export const Build = lazySchema(() => z.looseObject({
|
|
520
|
+
id: z.string(),
|
|
521
|
+
actId: z.string(),
|
|
522
|
+
userId: z.string(),
|
|
523
|
+
startedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
524
|
+
finishedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
525
|
+
status: ActorJobStatus(),
|
|
526
|
+
meta: BuildMeta(),
|
|
527
|
+
stats: BuildStats().nullable().optional(),
|
|
528
|
+
options: BuildOptions().nullable().optional(),
|
|
529
|
+
usage: BuildUsage().nullable().optional(),
|
|
530
|
+
usageTotalUsd: z.number().nullable().optional(),
|
|
531
|
+
usageUsd: BuildUsage().nullable().optional(),
|
|
532
|
+
inputSchema: z.string().nullable().optional(),
|
|
533
|
+
readme: z.string().nullable().optional(),
|
|
534
|
+
changelog: z.string().nullable().optional(),
|
|
535
|
+
exitCode: z.int().nullable().optional(),
|
|
536
|
+
gitCommitId: z.string().optional(),
|
|
537
|
+
gitBranchName: z.string().optional(),
|
|
538
|
+
createdByOrganizationMemberUserId: z.string().optional(),
|
|
539
|
+
buildNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/),
|
|
540
|
+
imageDigest: z.string().nullable().optional(),
|
|
541
|
+
actVersion: z.looseObject({
|
|
542
|
+
sourceType: VersionSourceType().optional(),
|
|
543
|
+
buildTag: z.string().nullable().optional(),
|
|
544
|
+
versionNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/).optional(),
|
|
545
|
+
gitRepoUrl: z.string().optional(),
|
|
546
|
+
sourceFiles: z.array(SourceCodeFile()).optional(),
|
|
547
|
+
gitHubGistUrl: z.string().optional(),
|
|
548
|
+
tarballUrl: z.string().optional(),
|
|
549
|
+
actorPath: z.string().nullable().optional(),
|
|
550
|
+
}).optional(),
|
|
551
|
+
actorDefinition: ActorDefinition().nullable().optional(),
|
|
552
|
+
}));
|
|
553
|
+
/** Response containing Actor build data. */
|
|
554
|
+
export const BuildResponse = lazySchema(() => z.looseObject({
|
|
555
|
+
data: Build(),
|
|
556
|
+
}));
|
|
557
|
+
export const RunMeta = lazySchema(() => z.looseObject({
|
|
558
|
+
origin: RunOrigin(),
|
|
559
|
+
clientIp: z.string().nullable().optional(),
|
|
560
|
+
userAgent: z.string().nullable().optional(),
|
|
561
|
+
scheduleId: z.string().nullable().optional(),
|
|
562
|
+
scheduledAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
563
|
+
actorRunId: z.string().optional(),
|
|
564
|
+
webhookDispatchId: z.string().optional(),
|
|
565
|
+
scheduledAct2Id: z.string().optional(),
|
|
566
|
+
scheduledActorTaskId: z.string().optional(),
|
|
567
|
+
}));
|
|
568
|
+
/** Standby configuration of the run. Present only on Actor Standby runs. */
|
|
569
|
+
export const RunStandby = lazySchema(() => z.looseObject({
|
|
570
|
+
deployment: z.enum(["SINGLE_TENANT", "MULTI_TENANT_OWNER_PAID", "MULTI_TENANT_FREE_USERS", "MULTI_TENANT_PAYING_USERS"]).or(z.string()),
|
|
571
|
+
}));
|
|
572
|
+
export const RunListItem = lazySchema(() => z.looseObject({
|
|
573
|
+
id: z.string(),
|
|
574
|
+
actId: z.string(),
|
|
575
|
+
userId: z.string().optional(),
|
|
576
|
+
actorTaskId: z.string().nullable().optional(),
|
|
577
|
+
status: ActorJobStatus(),
|
|
578
|
+
startedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
579
|
+
finishedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
580
|
+
buildId: z.string(),
|
|
581
|
+
buildNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).optional(),
|
|
582
|
+
buildNumberInt: z.int().optional(),
|
|
583
|
+
meta: RunMeta(),
|
|
584
|
+
usageTotalUsd: z.number(),
|
|
585
|
+
defaultKeyValueStoreId: z.string(),
|
|
586
|
+
defaultDatasetId: z.string(),
|
|
587
|
+
defaultRequestQueueId: z.string(),
|
|
588
|
+
standby: RunStandby().nullable().optional(),
|
|
589
|
+
}));
|
|
590
|
+
export const ListOfRuns = lazySchema(() => PaginationResponse().extend({
|
|
591
|
+
items: z.array(RunListItem()),
|
|
592
|
+
}));
|
|
593
|
+
export const ListOfRunsResponse = lazySchema(() => z.looseObject({
|
|
594
|
+
data: ListOfRuns(),
|
|
595
|
+
}));
|
|
596
|
+
/**
|
|
597
|
+
* Minimal representation of an ad-hoc webhook attached to a single Actor run or build via the
|
|
598
|
+
* `webhooks` query parameter. The query parameter value is a Base64-encoded JSON array whose
|
|
599
|
+
* items match this schema. Persistent webhook fields (e.g. `condition`) are not used here.
|
|
600
|
+
*/
|
|
601
|
+
export const WebhookRepresentation = lazySchema(() => z.looseObject({
|
|
602
|
+
eventTypes: z.array(WebhookEventType()),
|
|
603
|
+
requestUrl: z.string(),
|
|
604
|
+
payloadTemplate: z.string().nullable().optional(),
|
|
605
|
+
headersTemplate: z.string().nullable().optional(),
|
|
606
|
+
shouldInterpolateStrings: z.boolean().nullable().optional(),
|
|
607
|
+
idempotencyKey: z.string().nullable().optional(),
|
|
608
|
+
ignoreSslErrors: z.boolean().nullable().optional(),
|
|
609
|
+
doNotRetry: z.boolean().nullable().optional(),
|
|
610
|
+
}));
|
|
611
|
+
export const RunStats = lazySchema(() => z.looseObject({
|
|
612
|
+
inputBodyLen: z.int().min(0).nullable().optional(),
|
|
613
|
+
migrationCount: z.int().min(0).optional(),
|
|
614
|
+
rebootCount: z.int().min(0).optional(),
|
|
615
|
+
restartCount: z.int().min(0).optional(),
|
|
616
|
+
resurrectCount: z.int().min(0).optional(),
|
|
617
|
+
memAvgBytes: z.number().optional(),
|
|
618
|
+
memMaxBytes: z.int().min(0).optional(),
|
|
619
|
+
memCurrentBytes: z.int().min(0).optional(),
|
|
620
|
+
cpuAvgUsage: z.number().optional(),
|
|
621
|
+
cpuMaxUsage: z.number().optional(),
|
|
622
|
+
cpuCurrentUsage: z.number().optional(),
|
|
623
|
+
netRxBytes: z.int().min(0).optional(),
|
|
624
|
+
netTxBytes: z.int().min(0).optional(),
|
|
625
|
+
durationMillis: z.int().min(0).optional(),
|
|
626
|
+
runTimeSecs: z.number().min(0).optional(),
|
|
627
|
+
metamorph: z.int().min(0).optional(),
|
|
628
|
+
computeUnits: z.number().min(0).optional(),
|
|
629
|
+
}));
|
|
630
|
+
/** Cost of a single pay-per-event event type charged during the run. */
|
|
631
|
+
export const RunEventUsage = lazySchema(() => z.looseObject({
|
|
632
|
+
eventTotalUsd: z.number(),
|
|
633
|
+
eventTitle: z.string(),
|
|
634
|
+
}));
|
|
635
|
+
/** Information about the third-party integration that created the resource. */
|
|
636
|
+
export const IntegrationTracking = lazySchema(() => z.looseObject({
|
|
637
|
+
platform: z.string().optional(),
|
|
638
|
+
appId: z.string().optional(),
|
|
639
|
+
isAiTool: z.boolean().optional(),
|
|
640
|
+
}));
|
|
641
|
+
export const RunOptions = lazySchema(() => z.looseObject({
|
|
642
|
+
build: z.string(),
|
|
643
|
+
timeoutSecs: z.int().min(0),
|
|
644
|
+
memoryMbytes: z.int().min(128).max(32768),
|
|
645
|
+
diskMbytes: z.int().min(0),
|
|
646
|
+
restartOnError: z.boolean().nullable().optional(),
|
|
647
|
+
maxItems: z.int().min(0).nullable().optional(),
|
|
648
|
+
maxTotalChargeUsd: z.number().min(0).nullable().optional(),
|
|
649
|
+
isMaxTotalChargeUsdSetByUser: z.boolean().optional(),
|
|
650
|
+
}));
|
|
651
|
+
/** Defines the general access level for the resource. */
|
|
652
|
+
export const GeneralAccess = lazySchema(() => z.enum(["ANYONE_WITH_ID_CAN_READ", "ANYONE_WITH_NAME_CAN_READ", "FOLLOW_USER_SETTING", "RESTRICTED"]).or(z.string()));
|
|
653
|
+
export const RunUsage = lazySchema(() => z.looseObject({
|
|
654
|
+
ACTOR_COMPUTE_UNITS: z.number().nullable().optional(),
|
|
655
|
+
DATASET_READS: z.int().nullable().optional(),
|
|
656
|
+
DATASET_WRITES: z.int().nullable().optional(),
|
|
657
|
+
KEY_VALUE_STORE_READS: z.int().nullable().optional(),
|
|
658
|
+
KEY_VALUE_STORE_WRITES: z.int().nullable().optional(),
|
|
659
|
+
KEY_VALUE_STORE_LISTS: z.int().nullable().optional(),
|
|
660
|
+
REQUEST_QUEUE_READS: z.int().nullable().optional(),
|
|
661
|
+
REQUEST_QUEUE_WRITES: z.int().nullable().optional(),
|
|
662
|
+
DATA_TRANSFER_INTERNAL_GBYTES: z.number().nullable().optional(),
|
|
663
|
+
DATA_TRANSFER_EXTERNAL_GBYTES: z.number().nullable().optional(),
|
|
664
|
+
PROXY_RESIDENTIAL_TRANSFER_GBYTES: z.number().nullable().optional(),
|
|
665
|
+
PROXY_SERPS: z.int().nullable().optional(),
|
|
666
|
+
PROXY_UNBLOCKER_UNITS: z.number().nullable().optional(),
|
|
667
|
+
}));
|
|
668
|
+
/** Resource usage costs in USD. All values are monetary amounts in US dollars. */
|
|
669
|
+
export const RunUsageUsd = lazySchema(() => z.looseObject({
|
|
670
|
+
ACTOR_COMPUTE_UNITS: z.number().nullable().optional(),
|
|
671
|
+
DATASET_READS: z.number().nullable().optional(),
|
|
672
|
+
DATASET_WRITES: z.number().nullable().optional(),
|
|
673
|
+
KEY_VALUE_STORE_READS: z.number().nullable().optional(),
|
|
674
|
+
KEY_VALUE_STORE_WRITES: z.number().nullable().optional(),
|
|
675
|
+
KEY_VALUE_STORE_LISTS: z.number().nullable().optional(),
|
|
676
|
+
REQUEST_QUEUE_READS: z.number().nullable().optional(),
|
|
677
|
+
REQUEST_QUEUE_WRITES: z.number().nullable().optional(),
|
|
678
|
+
DATA_TRANSFER_INTERNAL_GBYTES: z.number().nullable().optional(),
|
|
679
|
+
DATA_TRANSFER_EXTERNAL_GBYTES: z.number().nullable().optional(),
|
|
680
|
+
PROXY_RESIDENTIAL_TRANSFER_GBYTES: z.number().nullable().optional(),
|
|
681
|
+
PROXY_SERPS: z.number().nullable().optional(),
|
|
682
|
+
PROXY_UNBLOCKER_UNITS: z.number().nullable().optional(),
|
|
683
|
+
}));
|
|
684
|
+
/** Information about a metamorph event that occurred during the run. */
|
|
685
|
+
export const RunMetamorphEvent = lazySchema(() => z.looseObject({
|
|
686
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
687
|
+
actorId: z.string(),
|
|
688
|
+
buildId: z.string(),
|
|
689
|
+
inputKey: z.string().nullable().optional(),
|
|
690
|
+
buildTags: z.array(z.string()).optional(),
|
|
691
|
+
}));
|
|
692
|
+
/** Represents an Actor run and its associated data. */
|
|
693
|
+
export const Run = lazySchema(() => z.looseObject({
|
|
694
|
+
id: z.string(),
|
|
695
|
+
actId: z.string(),
|
|
696
|
+
userId: z.string(),
|
|
697
|
+
actorTaskId: z.string().nullable().optional(),
|
|
698
|
+
startedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
699
|
+
finishedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
700
|
+
status: ActorJobStatus(),
|
|
701
|
+
statusMessage: z.string().nullable().optional(),
|
|
702
|
+
isStatusMessageTerminal: z.boolean().nullable().optional(),
|
|
703
|
+
meta: RunMeta(),
|
|
704
|
+
pricingInfo: ActorRunPricingInfo().optional(),
|
|
705
|
+
stats: RunStats(),
|
|
706
|
+
chargedEventCounts: z.record(z.string(), z.int()).optional(),
|
|
707
|
+
accountedChargedEventCounts: z.record(z.string(), z.int()).nullable().optional(),
|
|
708
|
+
eventUsage: z.record(z.string(), RunEventUsage()).optional(),
|
|
709
|
+
externalChargedTotalUsd: z.number().optional(),
|
|
710
|
+
standby: RunStandby().nullable().optional(),
|
|
711
|
+
integrationTracking: IntegrationTracking().optional(),
|
|
712
|
+
createdByOrganizationMemberUserId: z.string().optional(),
|
|
713
|
+
consoleUrl: z.url({ normalize: true }).optional(),
|
|
714
|
+
output: z.record(z.string(), z.url({ normalize: true })).optional(),
|
|
715
|
+
options: RunOptions(),
|
|
716
|
+
buildId: z.string(),
|
|
717
|
+
exitCode: z.int().nullable().optional(),
|
|
718
|
+
generalAccess: GeneralAccess().nullable().optional(),
|
|
719
|
+
defaultKeyValueStoreId: z.string(),
|
|
720
|
+
defaultDatasetId: z.string(),
|
|
721
|
+
defaultRequestQueueId: z.string(),
|
|
722
|
+
storageIds: z.looseObject({
|
|
723
|
+
datasets: z.looseObject({
|
|
724
|
+
default: z.string().optional(),
|
|
725
|
+
}).catchall(z.string()).optional(),
|
|
726
|
+
keyValueStores: z.looseObject({
|
|
727
|
+
default: z.string().optional(),
|
|
728
|
+
}).catchall(z.string()).optional(),
|
|
729
|
+
requestQueues: z.looseObject({
|
|
730
|
+
default: z.string().optional(),
|
|
731
|
+
}).catchall(z.string()).optional(),
|
|
732
|
+
}).optional(),
|
|
733
|
+
buildNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])(\.[1-9][0-9]{0,4})$/).nullable().optional(),
|
|
734
|
+
containerUrl: z.url({ normalize: true }).optional(),
|
|
735
|
+
isContainerServerReady: z.boolean().nullable().optional(),
|
|
736
|
+
gitBranchName: z.string().nullable().optional(),
|
|
737
|
+
usage: RunUsage().nullable().optional(),
|
|
738
|
+
usageTotalUsd: z.number().nullable().optional(),
|
|
739
|
+
usageUsd: RunUsageUsd().nullable().optional(),
|
|
740
|
+
metamorphs: z.array(RunMetamorphEvent()).nullable().optional(),
|
|
741
|
+
platformUsageBillingModel: z.string().optional(),
|
|
742
|
+
}));
|
|
743
|
+
export const RunResponse = lazySchema(() => z.looseObject({
|
|
744
|
+
data: Run(),
|
|
745
|
+
}));
|
|
746
|
+
export const DatasetStats = lazySchema(() => z.looseObject({
|
|
747
|
+
readCount: z.int().optional(),
|
|
748
|
+
writeCount: z.int().optional(),
|
|
749
|
+
storageBytes: z.int().optional(),
|
|
750
|
+
inflatedBytes: z.int().optional(),
|
|
751
|
+
}));
|
|
752
|
+
export const DatasetResource = lazySchema(() => z.looseObject({
|
|
753
|
+
id: z.string(),
|
|
754
|
+
name: z.string().nullable().optional(),
|
|
755
|
+
title: z.string().nullable().optional(),
|
|
756
|
+
userId: z.string(),
|
|
757
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
758
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
759
|
+
accessedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
760
|
+
itemCount: z.int().min(0),
|
|
761
|
+
cleanItemCount: z.int().min(0),
|
|
762
|
+
actId: z.string().nullable().optional(),
|
|
763
|
+
actRunId: z.string().nullable().optional(),
|
|
764
|
+
fields: z.array(z.string()).nullable().optional(),
|
|
765
|
+
schema: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
766
|
+
consoleUrl: z.url({ normalize: true }),
|
|
767
|
+
itemsPublicUrl: z.url({ normalize: true }).optional(),
|
|
768
|
+
urlSigningSecretKey: z.string().nullable().optional(),
|
|
769
|
+
generalAccess: GeneralAccess().nullable().optional(),
|
|
770
|
+
stats: DatasetStats().optional(),
|
|
771
|
+
}));
|
|
772
|
+
/** Response containing dataset metadata. */
|
|
773
|
+
export const DatasetResponse = lazySchema(() => z.looseObject({
|
|
774
|
+
data: DatasetResource(),
|
|
775
|
+
}));
|
|
776
|
+
export const UpdateDatasetRequest = lazySchema(() => z.looseObject({
|
|
777
|
+
name: z.string().nullable().optional(),
|
|
778
|
+
generalAccess: GeneralAccess().optional(),
|
|
779
|
+
}));
|
|
780
|
+
/**
|
|
781
|
+
* The request body containing the item(s) to add to the dataset. Can be a single
|
|
782
|
+
* object or an array of objects. Each object represents one dataset item.
|
|
783
|
+
*/
|
|
784
|
+
export const PutItemsRequest = lazySchema(() => z.record(z.string(), z.unknown()));
|
|
785
|
+
export const DatasetItemValidationError = lazySchema(() => z.looseObject({
|
|
786
|
+
instancePath: z.string().optional(),
|
|
787
|
+
schemaPath: z.string().optional(),
|
|
788
|
+
keyword: z.string().optional(),
|
|
789
|
+
message: z.string().optional(),
|
|
790
|
+
params: z.record(z.string(), z.unknown()).optional(),
|
|
791
|
+
}));
|
|
792
|
+
export const InvalidDatasetItem = lazySchema(() => z.looseObject({
|
|
793
|
+
itemPosition: z.int().optional(),
|
|
794
|
+
validationErrors: z.array(DatasetItemValidationError()).optional(),
|
|
795
|
+
}));
|
|
796
|
+
export const DatasetSchemaValidationErrorData = lazySchema(() => z.looseObject({
|
|
797
|
+
invalidItems: z.array(InvalidDatasetItem()),
|
|
798
|
+
}));
|
|
799
|
+
export const DatasetSchemaValidationError = lazySchema(() => z.looseObject({
|
|
800
|
+
type: z.string().optional(),
|
|
801
|
+
message: z.string().optional(),
|
|
802
|
+
data: DatasetSchemaValidationErrorData().optional(),
|
|
803
|
+
}));
|
|
804
|
+
export const PutItemsErrorResponse = lazySchema(() => z.looseObject({
|
|
805
|
+
error: DatasetSchemaValidationError(),
|
|
806
|
+
}));
|
|
807
|
+
export const DatasetFieldStatistics = lazySchema(() => z.looseObject({
|
|
808
|
+
min: z.number().nullable().optional(),
|
|
809
|
+
max: z.number().nullable().optional(),
|
|
810
|
+
nullCount: z.int().nullable().optional(),
|
|
811
|
+
emptyCount: z.int().nullable().optional(),
|
|
812
|
+
}));
|
|
813
|
+
export const DatasetStatistics = lazySchema(() => z.looseObject({
|
|
814
|
+
fieldStatistics: z.record(z.string(), DatasetFieldStatistics()).nullable().optional(),
|
|
815
|
+
}));
|
|
816
|
+
export const DatasetStatisticsResponse = lazySchema(() => z.looseObject({
|
|
817
|
+
data: DatasetStatistics(),
|
|
818
|
+
}));
|
|
819
|
+
export const KeyValueStoreStats = lazySchema(() => z.looseObject({
|
|
820
|
+
readCount: z.int().optional(),
|
|
821
|
+
writeCount: z.int().optional(),
|
|
822
|
+
deleteCount: z.int().optional(),
|
|
823
|
+
listCount: z.int().optional(),
|
|
824
|
+
s3StorageBytes: z.int().optional(),
|
|
825
|
+
storageBytes: z.int().optional(),
|
|
826
|
+
}));
|
|
827
|
+
export const KeyValueStoreResource = lazySchema(() => z.looseObject({
|
|
828
|
+
id: z.string(),
|
|
829
|
+
name: z.string().nullable().optional(),
|
|
830
|
+
title: z.string().nullable().optional(),
|
|
831
|
+
userId: z.string().nullable().optional(),
|
|
832
|
+
username: z.string().nullable().optional(),
|
|
833
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
834
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
835
|
+
accessedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
836
|
+
actId: z.string().nullable().optional(),
|
|
837
|
+
actRunId: z.string().nullable().optional(),
|
|
838
|
+
consoleUrl: z.url({ normalize: true }).optional(),
|
|
839
|
+
keysPublicUrl: z.url({ normalize: true }).optional(),
|
|
840
|
+
recordsPublicUrl: z.url({ normalize: true }).optional(),
|
|
841
|
+
schema: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
842
|
+
urlSigningSecretKey: z.string().nullable().optional(),
|
|
843
|
+
generalAccess: GeneralAccess().nullable().optional(),
|
|
844
|
+
stats: KeyValueStoreStats().optional(),
|
|
845
|
+
}));
|
|
846
|
+
/** Response containing key-value store data. */
|
|
847
|
+
export const KeyValueStoreResponse = lazySchema(() => z.looseObject({
|
|
848
|
+
data: KeyValueStoreResource(),
|
|
849
|
+
}));
|
|
850
|
+
export const UpdateKeyValueStoreRequest = lazySchema(() => z.looseObject({
|
|
851
|
+
name: z.string().nullable().optional(),
|
|
852
|
+
generalAccess: GeneralAccess().optional(),
|
|
853
|
+
}));
|
|
854
|
+
export const KeyValueStoreKey = lazySchema(() => z.looseObject({
|
|
855
|
+
key: z.string(),
|
|
856
|
+
size: z.int(),
|
|
857
|
+
recordPublicUrl: z.url({ normalize: true }),
|
|
858
|
+
}));
|
|
859
|
+
export const ListOfKeys = lazySchema(() => z.looseObject({
|
|
860
|
+
items: z.array(KeyValueStoreKey()),
|
|
861
|
+
count: z.int(),
|
|
862
|
+
limit: z.int(),
|
|
863
|
+
exclusiveStartKey: z.string().nullable().optional(),
|
|
864
|
+
isTruncated: z.boolean(),
|
|
865
|
+
nextExclusiveStartKey: z.string().nullable().optional(),
|
|
866
|
+
}));
|
|
867
|
+
export const ListOfKeysResponse = lazySchema(() => z.looseObject({
|
|
868
|
+
data: ListOfKeys(),
|
|
869
|
+
}));
|
|
870
|
+
/**
|
|
871
|
+
* The response body contains the value of the record. The content type of the response
|
|
872
|
+
* is determined by the Content-Type header stored with the record.
|
|
873
|
+
*/
|
|
874
|
+
export const RecordResponse = lazySchema(() => z.record(z.string(), z.unknown()));
|
|
875
|
+
/**
|
|
876
|
+
* The request body contains the value to store in the record. The content type
|
|
877
|
+
* should be specified in the Content-Type header.
|
|
878
|
+
*/
|
|
879
|
+
export const PutRecordRequest = lazySchema(() => z.record(z.string(), z.unknown()));
|
|
880
|
+
/** A unique identifier assigned to the request queue. */
|
|
881
|
+
export const QueueId = lazySchema(() => z.string());
|
|
882
|
+
/** The ID of the user who owns the request queue. */
|
|
883
|
+
export const QueueUserId = lazySchema(() => z.string());
|
|
884
|
+
/** The timestamp when the request queue was created. */
|
|
885
|
+
export const QueueCreatedAt = lazySchema(() => z.iso.datetime({ offset: true }).pipe(z.coerce.date()));
|
|
886
|
+
/** The timestamp when the request queue was last modified. Modifications include adding, updating, or removing requests, as well as locking or unlocking requests in the request queue. */
|
|
887
|
+
export const QueueModifiedAt = lazySchema(() => z.iso.datetime({ offset: true }).pipe(z.coerce.date()));
|
|
888
|
+
/** The timestamp when the request queue was last accessed. */
|
|
889
|
+
export const QueueAccessedAt = lazySchema(() => z.iso.datetime({ offset: true }).pipe(z.coerce.date()));
|
|
890
|
+
/** The total number of requests in the request queue. */
|
|
891
|
+
export const TotalRequestCount = lazySchema(() => z.int().min(0));
|
|
892
|
+
/** The number of requests that have been handled. */
|
|
893
|
+
export const HandledRequestCount = lazySchema(() => z.int().min(0));
|
|
894
|
+
/** The number of requests that are pending and have not been handled yet. */
|
|
895
|
+
export const PendingRequestCount = lazySchema(() => z.int());
|
|
896
|
+
/** Whether the request queue has been accessed by multiple different clients. */
|
|
897
|
+
export const HadMultipleClients = lazySchema(() => z.boolean());
|
|
898
|
+
/** Statistics about request queue operations and storage. */
|
|
899
|
+
export const RequestQueueStats = lazySchema(() => z.looseObject({
|
|
900
|
+
deleteCount: z.int().optional(),
|
|
901
|
+
headItemReadCount: z.int().optional(),
|
|
902
|
+
readCount: z.int().optional(),
|
|
903
|
+
storageBytes: z.int().optional(),
|
|
904
|
+
writeCount: z.int().optional(),
|
|
905
|
+
}));
|
|
906
|
+
/** A request queue object containing metadata and statistics. */
|
|
907
|
+
export const RequestQueueResource = lazySchema(() => z.looseObject({
|
|
908
|
+
id: QueueId(),
|
|
909
|
+
name: z.string().nullable().optional(),
|
|
910
|
+
title: z.string().nullable().optional(),
|
|
911
|
+
userId: QueueUserId(),
|
|
912
|
+
actId: z.string().nullable().optional(),
|
|
913
|
+
actRunId: z.string().nullable().optional(),
|
|
914
|
+
createdAt: QueueCreatedAt(),
|
|
915
|
+
modifiedAt: QueueModifiedAt(),
|
|
916
|
+
accessedAt: QueueAccessedAt(),
|
|
917
|
+
totalRequestCount: TotalRequestCount(),
|
|
918
|
+
handledRequestCount: HandledRequestCount(),
|
|
919
|
+
pendingRequestCount: PendingRequestCount(),
|
|
920
|
+
hadMultipleClients: HadMultipleClients(),
|
|
921
|
+
consoleUrl: z.url({ normalize: true }),
|
|
922
|
+
stats: RequestQueueStats().optional(),
|
|
923
|
+
generalAccess: GeneralAccess().nullable().optional(),
|
|
924
|
+
}));
|
|
925
|
+
/** Response containing request queue data. */
|
|
926
|
+
export const RequestQueueResponse = lazySchema(() => z.looseObject({
|
|
927
|
+
data: RequestQueueResource(),
|
|
928
|
+
}));
|
|
929
|
+
/** Request object for updating a request queue. */
|
|
930
|
+
export const UpdateRequestQueueRequest = lazySchema(() => z.looseObject({
|
|
931
|
+
name: z.string().nullable().optional(),
|
|
932
|
+
generalAccess: GeneralAccess().optional(),
|
|
933
|
+
}));
|
|
934
|
+
/** A unique key used for request de-duplication. Requests with the same unique key are considered identical. */
|
|
935
|
+
export const UniqueKey = lazySchema(() => z.string());
|
|
936
|
+
/** The URL of the request. */
|
|
937
|
+
export const RequestUrl = lazySchema(() => z.string());
|
|
938
|
+
export const HttpMethod = lazySchema(() => z.enum(["GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"]).or(z.string()));
|
|
939
|
+
/** The HTTP method of the request. */
|
|
940
|
+
export const RequestMethod = lazySchema(() => HttpMethod());
|
|
941
|
+
/** The number of times this request has been retried. */
|
|
942
|
+
export const RetryCount = lazySchema(() => z.int());
|
|
943
|
+
/** Custom user data attached to the request. Can contain arbitrary fields. */
|
|
944
|
+
export const RequestUserData = lazySchema(() => z.record(z.string(), z.unknown()));
|
|
945
|
+
export const RequestBase = lazySchema(() => z.looseObject({
|
|
946
|
+
uniqueKey: UniqueKey(),
|
|
947
|
+
url: RequestUrl(),
|
|
948
|
+
method: RequestMethod().optional(),
|
|
949
|
+
retryCount: RetryCount().optional(),
|
|
950
|
+
loadedUrl: z.string().nullable().optional(),
|
|
951
|
+
payload: z.union([z.string(), z.record(z.string(), z.unknown())]).nullable().optional(),
|
|
952
|
+
headers: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
953
|
+
userData: RequestUserData().optional(),
|
|
954
|
+
noRetry: z.boolean().nullable().optional(),
|
|
955
|
+
errorMessages: z.array(z.string()).nullable().optional(),
|
|
956
|
+
handledAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
957
|
+
}));
|
|
958
|
+
/** A unique identifier assigned to the request. */
|
|
959
|
+
export const RequestId = lazySchema(() => z.string());
|
|
960
|
+
/** The timestamp when the lock on this request expires. */
|
|
961
|
+
export const LockExpiresAt = lazySchema(() => z.iso.datetime({ offset: true }).pipe(z.coerce.date()));
|
|
962
|
+
/** A request stored in the request queue, including its metadata and processing state. */
|
|
963
|
+
export const RequestResource = lazySchema(() => RequestBase().extend({
|
|
964
|
+
id: RequestId().optional(),
|
|
965
|
+
lockExpiresAt: LockExpiresAt().optional(),
|
|
966
|
+
lockByClient: z.string().optional(),
|
|
967
|
+
}).required({ id: true }));
|
|
968
|
+
/** A paginated list of requests from the request queue. */
|
|
969
|
+
export const ListOfRequests = lazySchema(() => z.looseObject({
|
|
970
|
+
items: z.array(RequestResource()),
|
|
971
|
+
limit: z.int(),
|
|
972
|
+
exclusiveStartId: z.string().optional(),
|
|
973
|
+
cursor: z.string().optional(),
|
|
974
|
+
nextCursor: z.string().optional(),
|
|
975
|
+
}));
|
|
976
|
+
/** Response containing a list of requests from the request queue. */
|
|
977
|
+
export const ListOfRequestsResponse = lazySchema(() => z.looseObject({
|
|
978
|
+
data: ListOfRequests(),
|
|
979
|
+
}));
|
|
980
|
+
/** A request stored in the request queue, including its metadata and processing state, without the assigned ID. */
|
|
981
|
+
export const RequestWithoutId = lazySchema(() => RequestBase());
|
|
982
|
+
/** Indicates whether a request with the same unique key already existed in the request queue. If true, no new request was created. */
|
|
983
|
+
export const WasAlreadyPresent = lazySchema(() => z.boolean());
|
|
984
|
+
/** Indicates whether a request with the same unique key has already been processed by the request queue. */
|
|
985
|
+
export const WasAlreadyHandled = lazySchema(() => z.boolean());
|
|
986
|
+
/** Result of registering a request in the request queue, either by adding a new request or updating an existing one. */
|
|
987
|
+
export const RequestRegistration = lazySchema(() => z.looseObject({
|
|
988
|
+
requestId: RequestId(),
|
|
989
|
+
wasAlreadyPresent: WasAlreadyPresent(),
|
|
990
|
+
wasAlreadyHandled: WasAlreadyHandled(),
|
|
991
|
+
}));
|
|
992
|
+
/** Response containing the result of adding a request to the request queue. */
|
|
993
|
+
export const AddRequestResponse = lazySchema(() => z.looseObject({
|
|
994
|
+
data: RequestRegistration(),
|
|
995
|
+
}));
|
|
996
|
+
/** Information about a request that was successfully added to a request queue. */
|
|
997
|
+
export const AddedRequest = lazySchema(() => z.looseObject({
|
|
998
|
+
requestId: RequestId(),
|
|
999
|
+
uniqueKey: UniqueKey(),
|
|
1000
|
+
wasAlreadyPresent: WasAlreadyPresent(),
|
|
1001
|
+
wasAlreadyHandled: WasAlreadyHandled(),
|
|
1002
|
+
}));
|
|
1003
|
+
/** A request that failed to be processed during a request queue operation and can be retried. */
|
|
1004
|
+
export const UnprocessedRequest = lazySchema(() => z.looseObject({
|
|
1005
|
+
id: RequestId().optional(),
|
|
1006
|
+
uniqueKey: UniqueKey(),
|
|
1007
|
+
url: RequestUrl(),
|
|
1008
|
+
method: RequestMethod().optional(),
|
|
1009
|
+
}));
|
|
1010
|
+
/** Result of a batch add operation containing successfully processed and failed requests. */
|
|
1011
|
+
export const BatchAddResult = lazySchema(() => z.looseObject({
|
|
1012
|
+
processedRequests: z.array(AddedRequest()),
|
|
1013
|
+
unprocessedRequests: z.array(UnprocessedRequest()),
|
|
1014
|
+
}));
|
|
1015
|
+
/** Response containing the result of a batch add operation. */
|
|
1016
|
+
export const BatchAddResponse = lazySchema(() => z.looseObject({
|
|
1017
|
+
data: BatchAddResult(),
|
|
1018
|
+
}));
|
|
1019
|
+
/** A request that should be deleted, identified by its ID. */
|
|
1020
|
+
export const RequestToDeleteById = lazySchema(() => z.looseObject({
|
|
1021
|
+
id: RequestId(),
|
|
1022
|
+
uniqueKey: UniqueKey().optional(),
|
|
1023
|
+
}));
|
|
1024
|
+
/** A request that should be deleted, identified by its unique key. */
|
|
1025
|
+
export const RequestToDeleteByUniqueKey = lazySchema(() => z.looseObject({
|
|
1026
|
+
id: RequestId().optional(),
|
|
1027
|
+
uniqueKey: UniqueKey(),
|
|
1028
|
+
}));
|
|
1029
|
+
/** A request that should be deleted. */
|
|
1030
|
+
export const RequestToDelete = lazySchema(() => z.union([RequestToDeleteById(), RequestToDeleteByUniqueKey()]));
|
|
1031
|
+
/** Confirmation of a request that was successfully deleted, identified by its ID. */
|
|
1032
|
+
export const DeletedRequestById = lazySchema(() => z.looseObject({
|
|
1033
|
+
uniqueKey: UniqueKey().optional(),
|
|
1034
|
+
id: RequestId(),
|
|
1035
|
+
}));
|
|
1036
|
+
/** Confirmation of a request that was successfully deleted, identified by its unique key. */
|
|
1037
|
+
export const DeletedRequestByUniqueKey = lazySchema(() => z.looseObject({
|
|
1038
|
+
uniqueKey: UniqueKey(),
|
|
1039
|
+
id: RequestId().optional(),
|
|
1040
|
+
}));
|
|
1041
|
+
/** Confirmation of a request that was successfully deleted from a request queue. */
|
|
1042
|
+
export const DeletedRequest = lazySchema(() => z.union([DeletedRequestById(), DeletedRequestByUniqueKey()]));
|
|
1043
|
+
/** Result of a batch delete operation containing successfully deleted and failed requests. */
|
|
1044
|
+
export const BatchDeleteResult = lazySchema(() => z.looseObject({
|
|
1045
|
+
processedRequests: z.array(DeletedRequest()),
|
|
1046
|
+
unprocessedRequests: z.array(UnprocessedRequest()),
|
|
1047
|
+
}));
|
|
1048
|
+
/** Response containing the result of a batch delete operation. */
|
|
1049
|
+
export const BatchDeleteResponse = lazySchema(() => z.looseObject({
|
|
1050
|
+
data: BatchDeleteResult(),
|
|
1051
|
+
}));
|
|
1052
|
+
/** Result of unlocking requests in the request queue. */
|
|
1053
|
+
export const UnlockRequestsResult = lazySchema(() => z.looseObject({
|
|
1054
|
+
unlockedCount: z.int(),
|
|
1055
|
+
}));
|
|
1056
|
+
/** Response containing the result of unlocking requests. */
|
|
1057
|
+
export const UnlockRequestsResponse = lazySchema(() => z.looseObject({
|
|
1058
|
+
data: UnlockRequestsResult(),
|
|
1059
|
+
}));
|
|
1060
|
+
/** Response containing a single request from the request queue. */
|
|
1061
|
+
export const RequestResponse = lazySchema(() => z.looseObject({
|
|
1062
|
+
data: RequestResource(),
|
|
1063
|
+
}));
|
|
1064
|
+
/** Response containing the result of updating a request in the request queue. */
|
|
1065
|
+
export const UpdateRequestResponse = lazySchema(() => z.looseObject({
|
|
1066
|
+
data: RequestRegistration(),
|
|
1067
|
+
}));
|
|
1068
|
+
/** Information about a request lock. */
|
|
1069
|
+
export const RequestLockInfo = lazySchema(() => z.looseObject({
|
|
1070
|
+
lockExpiresAt: LockExpiresAt(),
|
|
1071
|
+
}));
|
|
1072
|
+
/** Response containing updated lock information after prolonging a request lock. */
|
|
1073
|
+
export const ProlongRequestLockResponse = lazySchema(() => z.looseObject({
|
|
1074
|
+
data: RequestLockInfo(),
|
|
1075
|
+
}));
|
|
1076
|
+
/** The maximum number of requests returned. */
|
|
1077
|
+
export const HeadLimit = lazySchema(() => z.int());
|
|
1078
|
+
/** A request from the request queue head without lock information. */
|
|
1079
|
+
export const RequestQueueHeadItem = lazySchema(() => z.looseObject({
|
|
1080
|
+
id: RequestId(),
|
|
1081
|
+
uniqueKey: UniqueKey(),
|
|
1082
|
+
url: RequestUrl(),
|
|
1083
|
+
method: RequestMethod().optional(),
|
|
1084
|
+
retryCount: RetryCount().optional(),
|
|
1085
|
+
}));
|
|
1086
|
+
/** A batch of requests from the request queue head without locking. */
|
|
1087
|
+
export const RequestQueueHead = lazySchema(() => z.looseObject({
|
|
1088
|
+
limit: HeadLimit(),
|
|
1089
|
+
queueModifiedAt: QueueModifiedAt(),
|
|
1090
|
+
hadMultipleClients: HadMultipleClients(),
|
|
1091
|
+
items: z.array(RequestQueueHeadItem()),
|
|
1092
|
+
}));
|
|
1093
|
+
/** Response containing requests from the request queue head without locking. */
|
|
1094
|
+
export const RequestQueueHeadResponse = lazySchema(() => z.looseObject({
|
|
1095
|
+
data: RequestQueueHead(),
|
|
1096
|
+
}));
|
|
1097
|
+
/** A request from the request queue head that has been locked for processing. */
|
|
1098
|
+
export const LockedRequestQueueHeadItem = lazySchema(() => z.looseObject({
|
|
1099
|
+
id: RequestId(),
|
|
1100
|
+
uniqueKey: UniqueKey(),
|
|
1101
|
+
url: RequestUrl(),
|
|
1102
|
+
method: RequestMethod().optional(),
|
|
1103
|
+
retryCount: RetryCount().optional(),
|
|
1104
|
+
lockExpiresAt: LockExpiresAt(),
|
|
1105
|
+
}));
|
|
1106
|
+
/** A batch of locked requests from the request queue head. */
|
|
1107
|
+
export const LockedRequestQueueHead = lazySchema(() => z.looseObject({
|
|
1108
|
+
limit: HeadLimit(),
|
|
1109
|
+
queueModifiedAt: QueueModifiedAt(),
|
|
1110
|
+
queueHasLockedRequests: z.boolean().optional(),
|
|
1111
|
+
clientKey: z.string().optional(),
|
|
1112
|
+
hadMultipleClients: HadMultipleClients(),
|
|
1113
|
+
lockSecs: z.int(),
|
|
1114
|
+
items: z.array(LockedRequestQueueHeadItem()),
|
|
1115
|
+
}));
|
|
1116
|
+
/** Response containing locked requests from the request queue head. */
|
|
1117
|
+
export const LockedRequestQueueHeadResponse = lazySchema(() => z.looseObject({
|
|
1118
|
+
data: LockedRequestQueueHead(),
|
|
1119
|
+
}));
|
|
1120
|
+
export const TaskStats = lazySchema(() => z.looseObject({
|
|
1121
|
+
totalRuns: z.int().optional(),
|
|
1122
|
+
lastRunStartedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
1123
|
+
}));
|
|
1124
|
+
export const TaskListItem = lazySchema(() => z.looseObject({
|
|
1125
|
+
id: z.string(),
|
|
1126
|
+
userId: z.string(),
|
|
1127
|
+
actId: z.string(),
|
|
1128
|
+
actName: z.string().nullable().optional(),
|
|
1129
|
+
name: z.string(),
|
|
1130
|
+
title: z.string().nullable().optional(),
|
|
1131
|
+
username: z.string().nullable().optional(),
|
|
1132
|
+
actUsername: z.string().nullable().optional(),
|
|
1133
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1134
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1135
|
+
stats: TaskStats().nullable().optional(),
|
|
1136
|
+
isPublic: z.boolean().optional(),
|
|
1137
|
+
}));
|
|
1138
|
+
export const ListOfTasks = lazySchema(() => PaginationResponse().extend({
|
|
1139
|
+
items: z.array(TaskListItem()),
|
|
1140
|
+
}));
|
|
1141
|
+
export const ListOfTasksResponse = lazySchema(() => z.looseObject({
|
|
1142
|
+
data: ListOfTasks(),
|
|
1143
|
+
}));
|
|
1144
|
+
export const TaskOptions = lazySchema(() => z.looseObject({
|
|
1145
|
+
build: z.string().nullable().optional(),
|
|
1146
|
+
timeoutSecs: z.int().nullable().optional(),
|
|
1147
|
+
memoryMbytes: z.int().nullable().optional(),
|
|
1148
|
+
maxItems: z.int().nullable().optional(),
|
|
1149
|
+
maxTotalChargeUsd: z.number().nullable().optional(),
|
|
1150
|
+
restartOnError: z.boolean().nullable().optional(),
|
|
1151
|
+
isMaxTotalChargeUsdSetByUser: z.boolean().nullable().optional(),
|
|
1152
|
+
forcePermissionLevel: ActorPermissionLevel().nullable().optional(),
|
|
1153
|
+
}));
|
|
1154
|
+
/**
|
|
1155
|
+
* The input configuration for the Actor task. This is a user-defined JSON object
|
|
1156
|
+
* that will be passed to the Actor when the task is run.
|
|
1157
|
+
*/
|
|
1158
|
+
export const TaskInput = lazySchema(() => z.record(z.string(), z.unknown()));
|
|
1159
|
+
/**
|
|
1160
|
+
* Public-facing configuration of a published task, used by the task's public landing page.
|
|
1161
|
+
* The task's publication state is determined by `publishedAt` - a task is published when
|
|
1162
|
+
* `publishedAt` is set and unpublished when it is `null`.
|
|
1163
|
+
*/
|
|
1164
|
+
export const TaskPublicConfig = lazySchema(() => z.looseObject({
|
|
1165
|
+
publishedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
1166
|
+
seoTitle: z.string().max(60).nullable().optional(),
|
|
1167
|
+
seoDescription: z.string().max(160).nullable().optional(),
|
|
1168
|
+
inputSchemaFields: z.array(z.string()).nullable().optional(),
|
|
1169
|
+
datasetName: z.string().nullable().optional(),
|
|
1170
|
+
datasetView: z.string().nullable().optional(),
|
|
1171
|
+
categorization: z.string().nullable().optional(),
|
|
1172
|
+
highlightedFields: z.array(z.string()).nullable().optional(),
|
|
1173
|
+
faq: z.array(z.looseObject({
|
|
1174
|
+
question: z.string(),
|
|
1175
|
+
answer: z.string(),
|
|
1176
|
+
})).nullable().optional(),
|
|
1177
|
+
}));
|
|
1178
|
+
export const CreateTaskRequest = lazySchema(() => z.looseObject({
|
|
1179
|
+
actId: z.string(),
|
|
1180
|
+
name: z.string().optional(),
|
|
1181
|
+
options: TaskOptions().nullable().optional(),
|
|
1182
|
+
input: z.union([TaskInput(), z.array(TaskInput())]).nullable().optional(),
|
|
1183
|
+
title: z.string().nullable().optional(),
|
|
1184
|
+
description: z.string().nullable().optional(),
|
|
1185
|
+
actorStandby: ActorStandby().nullable().optional(),
|
|
1186
|
+
publicConfig: TaskPublicConfig().optional(),
|
|
1187
|
+
}));
|
|
1188
|
+
export const Task = lazySchema(() => z.looseObject({
|
|
1189
|
+
id: z.string(),
|
|
1190
|
+
userId: z.string(),
|
|
1191
|
+
actId: z.string(),
|
|
1192
|
+
name: z.string(),
|
|
1193
|
+
nameLowerCase: z.string().optional(),
|
|
1194
|
+
username: z.string().nullable().optional(),
|
|
1195
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1196
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1197
|
+
removedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
1198
|
+
stats: TaskStats().nullable().optional(),
|
|
1199
|
+
options: TaskOptions().nullable().optional(),
|
|
1200
|
+
input: z.union([TaskInput(), z.array(TaskInput())]).nullable().optional(),
|
|
1201
|
+
title: z.string().nullable().optional(),
|
|
1202
|
+
description: z.string().nullable().optional(),
|
|
1203
|
+
actorStandby: ActorStandby().nullable().optional(),
|
|
1204
|
+
standbyUrl: z.url({ normalize: true }).nullable().optional(),
|
|
1205
|
+
isPublic: z.boolean().optional(),
|
|
1206
|
+
publicConfig: TaskPublicConfig().nullable().optional(),
|
|
1207
|
+
}));
|
|
1208
|
+
/** Response containing Actor task data. */
|
|
1209
|
+
export const TaskResponse = lazySchema(() => z.looseObject({
|
|
1210
|
+
data: Task(),
|
|
1211
|
+
}));
|
|
1212
|
+
export const UpdateTaskRequest = lazySchema(() => z.looseObject({
|
|
1213
|
+
name: z.string().optional(),
|
|
1214
|
+
options: TaskOptions().nullable().optional(),
|
|
1215
|
+
input: z.union([TaskInput(), z.array(TaskInput())]).nullable().optional(),
|
|
1216
|
+
title: z.string().nullable().optional(),
|
|
1217
|
+
description: z.string().nullable().optional(),
|
|
1218
|
+
actorStandby: ActorStandby().nullable().optional(),
|
|
1219
|
+
publicConfig: TaskPublicConfig().optional(),
|
|
1220
|
+
isPublic: z.boolean().optional(),
|
|
1221
|
+
}));
|
|
1222
|
+
export const UpdateRunRequest = lazySchema(() => z.looseObject({
|
|
1223
|
+
runId: z.string().optional(),
|
|
1224
|
+
statusMessage: z.string().optional(),
|
|
1225
|
+
isStatusMessageTerminal: z.boolean().optional(),
|
|
1226
|
+
generalAccess: GeneralAccess().optional(),
|
|
1227
|
+
}));
|
|
1228
|
+
export const ChargeRunRequest = lazySchema(() => z.looseObject({
|
|
1229
|
+
eventName: z.string(),
|
|
1230
|
+
count: z.int(),
|
|
1231
|
+
requestId: z.string().optional(),
|
|
1232
|
+
}));
|
|
1233
|
+
/** An account a user connected through an Actor OAuth connection. */
|
|
1234
|
+
export const ActorOAuthAccount = lazySchema(() => z.looseObject({
|
|
1235
|
+
_id: z.string(),
|
|
1236
|
+
userId: z.string(),
|
|
1237
|
+
connectionId: z.string(),
|
|
1238
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1239
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1240
|
+
authorizedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
1241
|
+
description: z.string().nullable().optional(),
|
|
1242
|
+
data: z.record(z.string(), z.unknown()),
|
|
1243
|
+
}));
|
|
1244
|
+
export const ListOfActorOAuthAccounts = lazySchema(() => z.looseObject({
|
|
1245
|
+
total: z.int(),
|
|
1246
|
+
items: z.array(ActorOAuthAccount()),
|
|
1247
|
+
}));
|
|
1248
|
+
export const ListOfActorOAuthAccountsResponse = lazySchema(() => z.looseObject({
|
|
1249
|
+
data: ListOfActorOAuthAccounts(),
|
|
1250
|
+
}));
|
|
1251
|
+
export const ActorOAuthAccountResponse = lazySchema(() => z.looseObject({
|
|
1252
|
+
data: ActorOAuthAccount(),
|
|
1253
|
+
}));
|
|
1254
|
+
export const StorageOwnership = lazySchema(() => z.enum(["ownedByMe", "sharedWithMe"]).or(z.string()));
|
|
1255
|
+
export const KeyValueStoreListStats = lazySchema(() => z.looseObject({
|
|
1256
|
+
readCount: z.int().optional(),
|
|
1257
|
+
writeCount: z.int().optional(),
|
|
1258
|
+
deleteCount: z.int().optional(),
|
|
1259
|
+
listCount: z.int().optional(),
|
|
1260
|
+
s3StorageBytes: z.int().optional(),
|
|
1261
|
+
}));
|
|
1262
|
+
export const KeyValueStoreListItem = lazySchema(() => z.looseObject({
|
|
1263
|
+
id: z.string(),
|
|
1264
|
+
name: z.string().nullable().optional(),
|
|
1265
|
+
title: z.string().nullable().optional(),
|
|
1266
|
+
userId: z.string().nullable().optional(),
|
|
1267
|
+
username: z.string().nullable().optional(),
|
|
1268
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1269
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1270
|
+
accessedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1271
|
+
actId: z.string().nullable().optional(),
|
|
1272
|
+
actRunId: z.string().nullable().optional(),
|
|
1273
|
+
schema: z.union([z.record(z.string(), z.unknown()), z.string()]).nullable().optional(),
|
|
1274
|
+
generalAccess: GeneralAccess().nullable().optional(),
|
|
1275
|
+
stats: KeyValueStoreListStats().optional(),
|
|
1276
|
+
}));
|
|
1277
|
+
export const ListOfKeyValueStores = lazySchema(() => PaginationResponse().extend({
|
|
1278
|
+
unnamed: z.boolean().optional(),
|
|
1279
|
+
items: z.array(KeyValueStoreListItem()),
|
|
1280
|
+
}));
|
|
1281
|
+
export const ListOfKeyValueStoresResponse = lazySchema(() => z.looseObject({
|
|
1282
|
+
data: ListOfKeyValueStores(),
|
|
1283
|
+
}));
|
|
1284
|
+
export const DatasetListItem = lazySchema(() => z.looseObject({
|
|
1285
|
+
id: z.string(),
|
|
1286
|
+
name: z.string().nullable().optional(),
|
|
1287
|
+
userId: z.string(),
|
|
1288
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1289
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1290
|
+
accessedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1291
|
+
itemCount: z.int(),
|
|
1292
|
+
cleanItemCount: z.int(),
|
|
1293
|
+
actId: z.string().nullable().optional(),
|
|
1294
|
+
actRunId: z.string().nullable().optional(),
|
|
1295
|
+
title: z.string().nullable().optional(),
|
|
1296
|
+
username: z.string().optional(),
|
|
1297
|
+
generalAccess: GeneralAccess().nullable().optional(),
|
|
1298
|
+
stats: DatasetStats().optional(),
|
|
1299
|
+
}));
|
|
1300
|
+
export const ListOfDatasets = lazySchema(() => PaginationResponse().extend({
|
|
1301
|
+
unnamed: z.boolean().optional(),
|
|
1302
|
+
items: z.array(DatasetListItem()),
|
|
1303
|
+
}));
|
|
1304
|
+
export const ListOfDatasetsResponse = lazySchema(() => z.looseObject({
|
|
1305
|
+
data: ListOfDatasets(),
|
|
1306
|
+
}));
|
|
1307
|
+
/** Statistics about request queue operations and storage, as returned in request queue lists. */
|
|
1308
|
+
export const RequestQueueListStats = lazySchema(() => z.looseObject({
|
|
1309
|
+
deleteCount: z.int().optional(),
|
|
1310
|
+
headItemReadCount: z.int().optional(),
|
|
1311
|
+
readCount: z.int().optional(),
|
|
1312
|
+
writeCount: z.int().optional(),
|
|
1313
|
+
s3StorageBytes: z.int().optional(),
|
|
1314
|
+
dynamodbStorageBytes: z.int().optional(),
|
|
1315
|
+
}));
|
|
1316
|
+
/** A shortened request queue object for list responses. */
|
|
1317
|
+
export const RequestQueueListItem = lazySchema(() => z.looseObject({
|
|
1318
|
+
id: QueueId(),
|
|
1319
|
+
name: z.string().nullable().optional(),
|
|
1320
|
+
title: z.string().nullable().optional(),
|
|
1321
|
+
userId: QueueUserId(),
|
|
1322
|
+
username: z.string().optional(),
|
|
1323
|
+
createdAt: QueueCreatedAt(),
|
|
1324
|
+
modifiedAt: QueueModifiedAt(),
|
|
1325
|
+
accessedAt: QueueAccessedAt(),
|
|
1326
|
+
expireAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).optional(),
|
|
1327
|
+
totalRequestCount: TotalRequestCount(),
|
|
1328
|
+
handledRequestCount: HandledRequestCount(),
|
|
1329
|
+
pendingRequestCount: PendingRequestCount(),
|
|
1330
|
+
actId: z.string().nullable().optional(),
|
|
1331
|
+
actRunId: z.string().nullable().optional(),
|
|
1332
|
+
hadMultipleClients: HadMultipleClients(),
|
|
1333
|
+
generalAccess: GeneralAccess().nullable().optional(),
|
|
1334
|
+
stats: RequestQueueListStats().optional(),
|
|
1335
|
+
}));
|
|
1336
|
+
/** A paginated list of request queues. */
|
|
1337
|
+
export const ListOfRequestQueues = lazySchema(() => PaginationResponse().extend({
|
|
1338
|
+
unnamed: z.boolean().optional(),
|
|
1339
|
+
items: z.array(RequestQueueListItem()),
|
|
1340
|
+
}));
|
|
1341
|
+
/** Response containing a list of request queues. */
|
|
1342
|
+
export const ListOfRequestQueuesResponse = lazySchema(() => z.looseObject({
|
|
1343
|
+
data: ListOfRequestQueues(),
|
|
1344
|
+
}));
|
|
1345
|
+
export const WebhookListItem = lazySchema(() => z.looseObject({
|
|
1346
|
+
id: z.string(),
|
|
1347
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1348
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1349
|
+
userId: z.string(),
|
|
1350
|
+
isAdHoc: z.boolean().nullable().optional(),
|
|
1351
|
+
isApifyIntegration: z.boolean().optional(),
|
|
1352
|
+
isEnabled: z.boolean().optional(),
|
|
1353
|
+
actionType: z.string().optional(),
|
|
1354
|
+
shouldInterpolateStrings: z.boolean().nullable().optional(),
|
|
1355
|
+
eventTypes: z.array(WebhookEventType()),
|
|
1356
|
+
condition: WebhookCondition(),
|
|
1357
|
+
ignoreSslErrors: z.boolean(),
|
|
1358
|
+
doNotRetry: z.boolean(),
|
|
1359
|
+
requestUrl: z.url({ normalize: true }).nullable().optional(),
|
|
1360
|
+
headersTemplate: z.string().nullable().optional(),
|
|
1361
|
+
title: z.string().nullable().optional(),
|
|
1362
|
+
description: z.string().nullable().optional(),
|
|
1363
|
+
slackMessage: WebhookSlackMessage().optional(),
|
|
1364
|
+
googleMail: WebhookGoogleMail().optional(),
|
|
1365
|
+
googleDrive: WebhookGoogleDrive().optional(),
|
|
1366
|
+
githubIssue: WebhookGithubIssue().optional(),
|
|
1367
|
+
lastDispatch: WebhookLastDispatch().nullable().optional(),
|
|
1368
|
+
stats: WebhookStats().nullable().optional(),
|
|
1369
|
+
}));
|
|
1370
|
+
export const ListOfWebhooks = lazySchema(() => PaginationResponse().extend({
|
|
1371
|
+
items: z.array(WebhookListItem()),
|
|
1372
|
+
}));
|
|
1373
|
+
export const ListOfWebhooksResponse = lazySchema(() => z.looseObject({
|
|
1374
|
+
data: ListOfWebhooks(),
|
|
1375
|
+
}));
|
|
1376
|
+
export const CreateWebhookRequest = lazySchema(() => z.looseObject({
|
|
1377
|
+
isAdHoc: z.boolean().nullable().optional(),
|
|
1378
|
+
eventTypes: z.array(WebhookEventType()),
|
|
1379
|
+
condition: WebhookCondition(),
|
|
1380
|
+
idempotencyKey: z.string().nullable().optional(),
|
|
1381
|
+
ignoreSslErrors: z.boolean().nullable().optional(),
|
|
1382
|
+
doNotRetry: z.boolean().nullable().optional(),
|
|
1383
|
+
requestUrl: z.string(),
|
|
1384
|
+
payloadTemplate: z.string().nullable().optional(),
|
|
1385
|
+
headersTemplate: z.string().nullable().optional(),
|
|
1386
|
+
description: z.string().nullable().optional(),
|
|
1387
|
+
shouldInterpolateStrings: z.boolean().nullable().optional(),
|
|
1388
|
+
}));
|
|
1389
|
+
/** Response containing webhook data. */
|
|
1390
|
+
export const WebhookResponse = lazySchema(() => z.looseObject({
|
|
1391
|
+
data: WebhookResource(),
|
|
1392
|
+
}));
|
|
1393
|
+
export const UpdateWebhookRequest = lazySchema(() => z.looseObject({
|
|
1394
|
+
isAdHoc: z.boolean().nullable().optional(),
|
|
1395
|
+
eventTypes: z.array(WebhookEventType()).nullable().optional(),
|
|
1396
|
+
condition: WebhookCondition().nullable().optional(),
|
|
1397
|
+
ignoreSslErrors: z.boolean().nullable().optional(),
|
|
1398
|
+
doNotRetry: z.boolean().nullable().optional(),
|
|
1399
|
+
requestUrl: z.url({ normalize: true }).nullable().optional(),
|
|
1400
|
+
payloadTemplate: z.string().nullable().optional(),
|
|
1401
|
+
headersTemplate: z.string().nullable().optional(),
|
|
1402
|
+
description: z.string().nullable().optional(),
|
|
1403
|
+
shouldInterpolateStrings: z.boolean().nullable().optional(),
|
|
1404
|
+
}));
|
|
1405
|
+
/** A summary of the webhook that triggered this dispatch. */
|
|
1406
|
+
export const WebhookDispatchWebhookSummary = lazySchema(() => z.looseObject({
|
|
1407
|
+
_id: z.string().optional(),
|
|
1408
|
+
actionType: z.string().optional(),
|
|
1409
|
+
condition: WebhookCondition().optional(),
|
|
1410
|
+
requestUrl: z.url({ normalize: true }).nullable().optional(),
|
|
1411
|
+
isAdHoc: z.boolean().optional(),
|
|
1412
|
+
isApifyIntegration: z.boolean().nullable().optional(),
|
|
1413
|
+
slackMessage: WebhookSlackMessage().optional(),
|
|
1414
|
+
googleMail: WebhookGoogleMail().optional(),
|
|
1415
|
+
googleDrive: WebhookGoogleDrive().optional(),
|
|
1416
|
+
githubIssue: WebhookGithubIssue().optional(),
|
|
1417
|
+
}));
|
|
1418
|
+
export const WebhookDispatch = lazySchema(() => z.looseObject({
|
|
1419
|
+
id: z.string(),
|
|
1420
|
+
userId: z.string(),
|
|
1421
|
+
webhookId: z.string(),
|
|
1422
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1423
|
+
status: WebhookDispatchStatus(),
|
|
1424
|
+
eventType: WebhookEventType(),
|
|
1425
|
+
eventData: z.looseObject({
|
|
1426
|
+
actorId: z.string(),
|
|
1427
|
+
actorRunId: z.string().optional(),
|
|
1428
|
+
actorBuildId: z.string().optional(),
|
|
1429
|
+
actorTaskId: z.string().nullable().optional(),
|
|
1430
|
+
}).nullable().optional(),
|
|
1431
|
+
webhook: WebhookDispatchWebhookSummary().nullable().optional(),
|
|
1432
|
+
calls: z.array(z.looseObject({
|
|
1433
|
+
startedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
1434
|
+
finishedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
1435
|
+
errorMessage: z.string().nullable().optional(),
|
|
1436
|
+
responseStatus: z.int().nullable().optional(),
|
|
1437
|
+
responseBody: z.string().nullable().optional(),
|
|
1438
|
+
debugPostMessage: z.record(z.string(), z.unknown()).optional(),
|
|
1439
|
+
})).optional(),
|
|
1440
|
+
}));
|
|
1441
|
+
export const WebhookDispatchResponse = lazySchema(() => z.looseObject({
|
|
1442
|
+
data: WebhookDispatch(),
|
|
1443
|
+
}));
|
|
1444
|
+
export const ListOfWebhookDispatches = lazySchema(() => PaginationResponse().extend({
|
|
1445
|
+
items: z.array(WebhookDispatch()),
|
|
1446
|
+
}));
|
|
1447
|
+
export const ListOfWebhookDispatchesResponse = lazySchema(() => z.looseObject({
|
|
1448
|
+
data: ListOfWebhookDispatches(),
|
|
1449
|
+
}));
|
|
1450
|
+
export const ScheduleBase = lazySchema(() => z.looseObject({
|
|
1451
|
+
id: z.string(),
|
|
1452
|
+
userId: z.string(),
|
|
1453
|
+
name: z.string(),
|
|
1454
|
+
cronExpression: z.string(),
|
|
1455
|
+
timezone: z.string(),
|
|
1456
|
+
isEnabled: z.boolean(),
|
|
1457
|
+
isExclusive: z.boolean(),
|
|
1458
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1459
|
+
modifiedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1460
|
+
nextRunAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
1461
|
+
lastRunAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
1462
|
+
}));
|
|
1463
|
+
/** Notification settings for this schedule. */
|
|
1464
|
+
export const ScheduleNotifications = lazySchema(() => z.looseObject({
|
|
1465
|
+
email: z.boolean().optional(),
|
|
1466
|
+
}));
|
|
1467
|
+
export const ScheduleListItemActionRunActor = lazySchema(() => z.looseObject({
|
|
1468
|
+
id: z.string(),
|
|
1469
|
+
type: z.literal("RUN_ACTOR"),
|
|
1470
|
+
actorId: z.string(),
|
|
1471
|
+
}));
|
|
1472
|
+
export const ScheduleListItemActionRunActorTask = lazySchema(() => z.looseObject({
|
|
1473
|
+
id: z.string(),
|
|
1474
|
+
type: z.literal("RUN_ACTOR_TASK"),
|
|
1475
|
+
actorTaskId: z.string(),
|
|
1476
|
+
}));
|
|
1477
|
+
export const ScheduleListItemAction = lazySchema(() => z.discriminatedUnion("type", [ScheduleListItemActionRunActor(), ScheduleListItemActionRunActorTask()]));
|
|
1478
|
+
export const ScheduleListItem = lazySchema(() => ScheduleBase().extend({
|
|
1479
|
+
title: z.string().nullable().optional(),
|
|
1480
|
+
notifications: ScheduleNotifications().optional(),
|
|
1481
|
+
integrationTracking: IntegrationTracking().optional(),
|
|
1482
|
+
actions: z.array(ScheduleListItemAction()),
|
|
1483
|
+
}));
|
|
1484
|
+
export const ListOfSchedules = lazySchema(() => PaginationResponse().extend({
|
|
1485
|
+
items: z.array(ScheduleListItem()),
|
|
1486
|
+
}));
|
|
1487
|
+
export const ListOfSchedulesResponse = lazySchema(() => z.looseObject({
|
|
1488
|
+
data: ListOfSchedules(),
|
|
1489
|
+
}));
|
|
1490
|
+
export const ScheduleActionRunInput = lazySchema(() => z.looseObject({
|
|
1491
|
+
body: z.string().nullable().optional(),
|
|
1492
|
+
contentType: z.string().nullable().optional(),
|
|
1493
|
+
}));
|
|
1494
|
+
export const ScheduleCreateActionRunActor = lazySchema(() => z.looseObject({
|
|
1495
|
+
type: z.literal("RUN_ACTOR"),
|
|
1496
|
+
actorId: z.string(),
|
|
1497
|
+
runInput: ScheduleActionRunInput().nullable().optional(),
|
|
1498
|
+
runOptions: TaskOptions().nullable().optional(),
|
|
1499
|
+
}));
|
|
1500
|
+
export const ScheduleCreateActionRunActorTask = lazySchema(() => z.looseObject({
|
|
1501
|
+
type: z.literal("RUN_ACTOR_TASK"),
|
|
1502
|
+
actorTaskId: z.string(),
|
|
1503
|
+
input: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
1504
|
+
}));
|
|
1505
|
+
export const ScheduleCreateAction = lazySchema(() => z.discriminatedUnion("type", [ScheduleCreateActionRunActor(), ScheduleCreateActionRunActorTask()]));
|
|
1506
|
+
export const CreateOrUpdateScheduleRequest = lazySchema(() => z.looseObject({
|
|
1507
|
+
name: z.string().nullable().optional(),
|
|
1508
|
+
isEnabled: z.boolean().nullable().optional(),
|
|
1509
|
+
isExclusive: z.boolean().nullable().optional(),
|
|
1510
|
+
cronExpression: z.string().nullable().optional(),
|
|
1511
|
+
timezone: z.string().nullable().optional(),
|
|
1512
|
+
description: z.string().nullable().optional(),
|
|
1513
|
+
title: z.string().nullable().optional(),
|
|
1514
|
+
notifications: ScheduleNotifications().optional(),
|
|
1515
|
+
actions: z.array(ScheduleCreateAction()).nullable().optional(),
|
|
1516
|
+
}));
|
|
1517
|
+
/** State of the schedule editor in Apify Console. It's removed when an API update changes `cronExpression` or `timezone`. */
|
|
1518
|
+
export const ScheduleUiState = lazySchema(() => z.looseObject({
|
|
1519
|
+
version: z.int().optional(),
|
|
1520
|
+
data: z.looseObject({
|
|
1521
|
+
cronExpression: z.string().optional(),
|
|
1522
|
+
timezone: z.string().optional(),
|
|
1523
|
+
}).optional(),
|
|
1524
|
+
}));
|
|
1525
|
+
export const ScheduleActionRunActor = lazySchema(() => z.looseObject({
|
|
1526
|
+
id: z.string(),
|
|
1527
|
+
type: z.literal("RUN_ACTOR"),
|
|
1528
|
+
actorId: z.string(),
|
|
1529
|
+
runInput: ScheduleActionRunInput().nullable().optional(),
|
|
1530
|
+
runOptions: TaskOptions().nullable().optional(),
|
|
1531
|
+
}));
|
|
1532
|
+
export const ScheduleActionRunActorTask = lazySchema(() => z.looseObject({
|
|
1533
|
+
id: z.string(),
|
|
1534
|
+
type: z.literal("RUN_ACTOR_TASK"),
|
|
1535
|
+
actorTaskId: z.string(),
|
|
1536
|
+
input: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
1537
|
+
}));
|
|
1538
|
+
export const ScheduleAction = lazySchema(() => z.discriminatedUnion("type", [ScheduleActionRunActor(), ScheduleActionRunActorTask()]));
|
|
1539
|
+
export const Schedule = lazySchema(() => ScheduleBase().extend({
|
|
1540
|
+
description: z.string().nullable().optional(),
|
|
1541
|
+
title: z.string().nullable().optional(),
|
|
1542
|
+
notifications: ScheduleNotifications().optional(),
|
|
1543
|
+
uiState: ScheduleUiState().optional(),
|
|
1544
|
+
integrationTracking: IntegrationTracking().optional(),
|
|
1545
|
+
actions: z.array(ScheduleAction()),
|
|
1546
|
+
}));
|
|
1547
|
+
export const ScheduleResponse = lazySchema(() => z.looseObject({
|
|
1548
|
+
data: Schedule(),
|
|
1549
|
+
}));
|
|
1550
|
+
export const ScheduleLogEntry = lazySchema(() => z.looseObject({
|
|
1551
|
+
message: z.string(),
|
|
1552
|
+
level: z.string(),
|
|
1553
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1554
|
+
}));
|
|
1555
|
+
export const ScheduleLogResponse = lazySchema(() => z.looseObject({
|
|
1556
|
+
data: z.array(ScheduleLogEntry()),
|
|
1557
|
+
}));
|
|
1558
|
+
export const CurrentPricingInfo = lazySchema(() => z.looseObject({
|
|
1559
|
+
pricingModel: z.string(),
|
|
1560
|
+
apifyMarginPercentage: z.number().optional(),
|
|
1561
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).optional(),
|
|
1562
|
+
startedAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).optional(),
|
|
1563
|
+
notifiedAboutChangeAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
1564
|
+
notifiedAboutFutureChangeAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
1565
|
+
isPriceChangeNotificationSuppressed: z.boolean().optional(),
|
|
1566
|
+
forceContainsSignificantPriceChange: z.boolean().optional(),
|
|
1567
|
+
isPPEPlatformUsagePaidByUser: z.boolean().optional(),
|
|
1568
|
+
reasonForChange: z.string().nullable().optional(),
|
|
1569
|
+
minimalMaxTotalChargeUsd: z.number().nullable().optional(),
|
|
1570
|
+
pricingPerEvent: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
1571
|
+
pricePerUnitUsd: z.number().optional(),
|
|
1572
|
+
trialMinutes: z.int().optional(),
|
|
1573
|
+
unitName: z.string().optional(),
|
|
1574
|
+
tieredPricing: z.record(z.string(), z.looseObject({
|
|
1575
|
+
tieredPricePerUnitUsd: z.number().optional(),
|
|
1576
|
+
})).optional(),
|
|
1577
|
+
notifiedAboutRentalToPpePriceChangeAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable().optional(),
|
|
1578
|
+
}));
|
|
1579
|
+
export const StoreActor = lazySchema(() => z.looseObject({
|
|
1580
|
+
id: z.string(),
|
|
1581
|
+
title: z.string(),
|
|
1582
|
+
name: z.string(),
|
|
1583
|
+
username: z.string(),
|
|
1584
|
+
userFullName: z.string().nullable().optional(),
|
|
1585
|
+
description: z.string().nullable().optional(),
|
|
1586
|
+
categories: z.array(z.string()).optional(),
|
|
1587
|
+
notice: ActorNotice().optional(),
|
|
1588
|
+
pictureUrl: z.string().nullable().optional(),
|
|
1589
|
+
userPictureUrl: z.url({ normalize: true }).nullable().optional(),
|
|
1590
|
+
url: z.url({ normalize: true }).nullable().optional(),
|
|
1591
|
+
stats: ActorStats(),
|
|
1592
|
+
currentPricingInfo: CurrentPricingInfo().optional(),
|
|
1593
|
+
isWhiteListedForAgenticPayments: z.boolean().nullable().optional(),
|
|
1594
|
+
actorReviewCount: z.int().optional(),
|
|
1595
|
+
actorReviewRating: z.number().optional(),
|
|
1596
|
+
bookmarkCount: z.int().optional(),
|
|
1597
|
+
badge: z.string().nullable().optional(),
|
|
1598
|
+
readmeSummary: z.string().optional(),
|
|
1599
|
+
inputSchema: z.looseObject({
|
|
1600
|
+
type: z.string(),
|
|
1601
|
+
properties: z.record(z.string(), z.looseObject({
|
|
1602
|
+
type: z.union([z.string(), z.array(z.string())]).optional(),
|
|
1603
|
+
})),
|
|
1604
|
+
required: z.array(z.string()).optional(),
|
|
1605
|
+
}).optional(),
|
|
1606
|
+
}));
|
|
1607
|
+
export const ListOfStoreActors = lazySchema(() => PaginationResponse().extend({
|
|
1608
|
+
items: z.array(StoreActor()),
|
|
1609
|
+
}));
|
|
1610
|
+
export const ListOfStoreActorsResponse = lazySchema(() => z.looseObject({
|
|
1611
|
+
data: ListOfStoreActors(),
|
|
1612
|
+
}));
|
|
1613
|
+
export const UserProfile = lazySchema(() => z.looseObject({
|
|
1614
|
+
bio: z.string().nullable().optional(),
|
|
1615
|
+
readme: z.string().nullable().optional(),
|
|
1616
|
+
name: z.string().optional(),
|
|
1617
|
+
pictureUrl: z.url({ normalize: true }).nullable().optional(),
|
|
1618
|
+
githubUsername: z.string().nullable().optional(),
|
|
1619
|
+
websiteUrl: z.url({ normalize: true }).nullable().optional(),
|
|
1620
|
+
twitterUsername: z.string().nullable().optional(),
|
|
1621
|
+
}));
|
|
1622
|
+
export const UserPublicInfo = lazySchema(() => z.looseObject({
|
|
1623
|
+
username: z.string(),
|
|
1624
|
+
profile: UserProfile().optional(),
|
|
1625
|
+
}));
|
|
1626
|
+
export const UserPublicInfoResponse = lazySchema(() => z.looseObject({
|
|
1627
|
+
data: UserPublicInfo(),
|
|
1628
|
+
}));
|
|
1629
|
+
export const ProxyGroup = lazySchema(() => z.looseObject({
|
|
1630
|
+
id: z.string().optional(),
|
|
1631
|
+
name: z.string(),
|
|
1632
|
+
description: z.string().nullable(),
|
|
1633
|
+
availableCount: z.int().optional(),
|
|
1634
|
+
}));
|
|
1635
|
+
/** Proxy access info. Omitted when the user has no access to Apify Proxy. */
|
|
1636
|
+
export const ProxyResource = lazySchema(() => z.looseObject({
|
|
1637
|
+
password: z.string().nullable().optional(),
|
|
1638
|
+
groups: z.array(ProxyGroup()),
|
|
1639
|
+
}));
|
|
1640
|
+
/**
|
|
1641
|
+
* A dictionary mapping proxy group names to the number of available proxies in each group.
|
|
1642
|
+
* The keys are proxy group names (e.g., "RESIDENTIAL", "DATACENTER") and values are
|
|
1643
|
+
* the count of available proxies.
|
|
1644
|
+
*/
|
|
1645
|
+
export const AvailableProxyGroups = lazySchema(() => z.record(z.string(), z.int()));
|
|
1646
|
+
export const UserPlan = lazySchema(() => z.looseObject({
|
|
1647
|
+
id: z.string().optional(),
|
|
1648
|
+
description: z.string().optional(),
|
|
1649
|
+
isEnabled: z.boolean().optional(),
|
|
1650
|
+
monthlyBasePriceUsd: z.number().optional(),
|
|
1651
|
+
monthlyUsageCreditsUsd: z.number().optional(),
|
|
1652
|
+
usageDiscountPercent: z.number().optional(),
|
|
1653
|
+
enabledPlatformFeatures: z.array(z.string()).optional(),
|
|
1654
|
+
maxMonthlyUsageUsd: z.number().optional(),
|
|
1655
|
+
maxActorMemoryGbytes: z.number().optional(),
|
|
1656
|
+
maxMonthlyActorComputeUnits: z.number().optional(),
|
|
1657
|
+
maxMonthlyResidentialProxyGbytes: z.number().optional(),
|
|
1658
|
+
maxMonthlyProxySerps: z.int().optional(),
|
|
1659
|
+
maxMonthlyExternalDataTransferGbytes: z.number().optional(),
|
|
1660
|
+
maxActorCount: z.int().optional(),
|
|
1661
|
+
maxActorTaskCount: z.int().optional(),
|
|
1662
|
+
dataRetentionDays: z.int().optional(),
|
|
1663
|
+
availableProxyGroups: AvailableProxyGroups(),
|
|
1664
|
+
teamAccountSeatCount: z.int().optional(),
|
|
1665
|
+
supportLevel: z.string().optional(),
|
|
1666
|
+
availableAddOns: z.array(z.string()).optional(),
|
|
1667
|
+
tier: z.string().optional(),
|
|
1668
|
+
apiRateLimitBoosts: z.int().optional(),
|
|
1669
|
+
maxScheduleCount: z.int().optional(),
|
|
1670
|
+
maxConcurrentActorRuns: z.int().optional(),
|
|
1671
|
+
planPricing: z.record(z.string(), z.unknown()).optional(),
|
|
1672
|
+
planVersion: z.number().optional(),
|
|
1673
|
+
legacyPlanId: z.string().optional(),
|
|
1674
|
+
planTags: z.array(z.string()).optional(),
|
|
1675
|
+
overageThresholdUsd: z.number().optional(),
|
|
1676
|
+
maxMonthlyUnblockerUnits: z.int().optional(),
|
|
1677
|
+
maxPublicActorTaskCount: z.int().optional(),
|
|
1678
|
+
maxPublicActorTaskCountPerActor: z.int().optional(),
|
|
1679
|
+
forceBillingInterval: z.string().optional(),
|
|
1680
|
+
personalizedSupport: z.string().nullable().optional(),
|
|
1681
|
+
monitoringLevel: z.enum(["STANDARD"]).or(z.string()).nullable().optional(),
|
|
1682
|
+
isPayingCustomer: z.boolean().optional(),
|
|
1683
|
+
}));
|
|
1684
|
+
export const EffectivePlatformFeature = lazySchema(() => z.looseObject({
|
|
1685
|
+
isEnabled: z.boolean(),
|
|
1686
|
+
disabledReason: z.string().nullable(),
|
|
1687
|
+
disabledReasonType: z.string().nullable(),
|
|
1688
|
+
isTrial: z.boolean(),
|
|
1689
|
+
trialExpirationAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).nullable(),
|
|
1690
|
+
}));
|
|
1691
|
+
export const EffectivePlatformFeatures = lazySchema(() => z.looseObject({
|
|
1692
|
+
ACTORS: EffectivePlatformFeature(),
|
|
1693
|
+
STORAGE: EffectivePlatformFeature(),
|
|
1694
|
+
SCHEDULER: EffectivePlatformFeature(),
|
|
1695
|
+
PROXY: EffectivePlatformFeature(),
|
|
1696
|
+
PROXY_EXTERNAL_ACCESS: EffectivePlatformFeature(),
|
|
1697
|
+
PROXY_RESIDENTIAL: EffectivePlatformFeature(),
|
|
1698
|
+
PROXY_SERPS: EffectivePlatformFeature(),
|
|
1699
|
+
WEBHOOKS: EffectivePlatformFeature(),
|
|
1700
|
+
ACTORS_PUBLIC_ALL: EffectivePlatformFeature(),
|
|
1701
|
+
ACTORS_PUBLIC_DEVELOPER: EffectivePlatformFeature(),
|
|
1702
|
+
}));
|
|
1703
|
+
export const UserPrivateInfo = lazySchema(() => z.looseObject({
|
|
1704
|
+
id: z.string().optional(),
|
|
1705
|
+
username: z.string(),
|
|
1706
|
+
profile: UserProfile().optional(),
|
|
1707
|
+
email: z.string().nullable().optional(),
|
|
1708
|
+
proxy: ProxyResource().optional(),
|
|
1709
|
+
plan: UserPlan().optional(),
|
|
1710
|
+
effectivePlatformFeatures: EffectivePlatformFeatures().optional(),
|
|
1711
|
+
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()).optional(),
|
|
1712
|
+
isPaying: z.boolean().optional(),
|
|
1713
|
+
organizationOwnerUserId: z.string().nullable().optional(),
|
|
1714
|
+
}));
|
|
1715
|
+
export const UserPrivateInfoResponse = lazySchema(() => z.looseObject({
|
|
1716
|
+
data: UserPrivateInfo(),
|
|
1717
|
+
}));
|
|
1718
|
+
export const UsageCycle = lazySchema(() => z.looseObject({
|
|
1719
|
+
startAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1720
|
+
endAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1721
|
+
}));
|
|
1722
|
+
export const PriceTier = lazySchema(() => z.looseObject({
|
|
1723
|
+
quantityAbove: z.number(),
|
|
1724
|
+
discountPercent: z.number(),
|
|
1725
|
+
tierQuantity: z.number(),
|
|
1726
|
+
unitPriceUsd: z.number(),
|
|
1727
|
+
priceUsd: z.number(),
|
|
1728
|
+
}));
|
|
1729
|
+
export const UsageItem = lazySchema(() => z.looseObject({
|
|
1730
|
+
quantity: z.number(),
|
|
1731
|
+
baseAmountUsd: z.number(),
|
|
1732
|
+
baseUnitPriceUsd: z.number().optional(),
|
|
1733
|
+
amountAfterVolumeDiscountUsd: z.number().optional(),
|
|
1734
|
+
priceTiers: z.array(PriceTier()).optional(),
|
|
1735
|
+
}));
|
|
1736
|
+
/** A map of usage item names (e.g., ACTOR_COMPUTE_UNITS) to their usage details. */
|
|
1737
|
+
export const MonthlyServiceUsage = lazySchema(() => z.record(z.string(), UsageItem()));
|
|
1738
|
+
/** A map of service usage item names to their usage details. */
|
|
1739
|
+
export const ServiceUsage = lazySchema(() => z.record(z.string(), UsageItem()));
|
|
1740
|
+
export const DailyServiceUsage = lazySchema(() => z.looseObject({
|
|
1741
|
+
date: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
1742
|
+
serviceUsage: ServiceUsage(),
|
|
1743
|
+
totalUsageCreditsUsd: z.number(),
|
|
1744
|
+
}));
|
|
1745
|
+
export const MonthlyUsage = lazySchema(() => z.looseObject({
|
|
1746
|
+
usageCycle: UsageCycle(),
|
|
1747
|
+
monthlyServiceUsage: MonthlyServiceUsage(),
|
|
1748
|
+
dailyServiceUsages: z.array(DailyServiceUsage()),
|
|
1749
|
+
totalUsageCreditsUsdBeforeVolumeDiscount: z.number(),
|
|
1750
|
+
totalUsageCreditsUsdAfterVolumeDiscount: z.number(),
|
|
1751
|
+
}));
|
|
1752
|
+
export const MonthlyUsageResponse = lazySchema(() => z.looseObject({
|
|
1753
|
+
data: MonthlyUsage(),
|
|
1754
|
+
}));
|
|
1755
|
+
export const Limits = lazySchema(() => z.looseObject({
|
|
1756
|
+
maxMonthlyUsageUsd: z.number(),
|
|
1757
|
+
maxMonthlyActorComputeUnits: z.number(),
|
|
1758
|
+
maxMonthlyExternalDataTransferGbytes: z.number(),
|
|
1759
|
+
maxMonthlyProxySerps: z.int(),
|
|
1760
|
+
maxMonthlyResidentialProxyGbytes: z.number(),
|
|
1761
|
+
maxActorMemoryGbytes: z.number(),
|
|
1762
|
+
maxActorCount: z.int(),
|
|
1763
|
+
maxActorTaskCount: z.int(),
|
|
1764
|
+
maxConcurrentActorJobs: z.int(),
|
|
1765
|
+
maxTeamAccountSeatCount: z.int(),
|
|
1766
|
+
dataRetentionDays: z.int(),
|
|
1767
|
+
maxScheduleCount: z.int().optional(),
|
|
1768
|
+
maxMonthlyUnblockerUnits: z.number().optional(),
|
|
1769
|
+
}));
|
|
1770
|
+
export const CurrentUsage = lazySchema(() => z.looseObject({
|
|
1771
|
+
monthlyUsageUsd: z.number(),
|
|
1772
|
+
monthlyActorComputeUnits: z.number(),
|
|
1773
|
+
monthlyExternalDataTransferGbytes: z.number(),
|
|
1774
|
+
monthlyProxySerps: z.int(),
|
|
1775
|
+
monthlyResidentialProxyGbytes: z.number(),
|
|
1776
|
+
actorMemoryGbytes: z.number(),
|
|
1777
|
+
actorCount: z.int(),
|
|
1778
|
+
actorTaskCount: z.int(),
|
|
1779
|
+
activeActorJobCount: z.int(),
|
|
1780
|
+
teamAccountSeatCount: z.int(),
|
|
1781
|
+
scheduleCount: z.int().optional(),
|
|
1782
|
+
monthlyUnblockerUnits: z.number().optional(),
|
|
1783
|
+
}));
|
|
1784
|
+
export const AccountLimits = lazySchema(() => z.looseObject({
|
|
1785
|
+
monthlyUsageCycle: UsageCycle(),
|
|
1786
|
+
limits: Limits(),
|
|
1787
|
+
current: CurrentUsage(),
|
|
1788
|
+
}));
|
|
1789
|
+
export const AccountLimitsResponse = lazySchema(() => z.looseObject({
|
|
1790
|
+
data: AccountLimits(),
|
|
1791
|
+
}));
|
|
1792
|
+
export const UpdateLimitsRequest = lazySchema(() => z.looseObject({
|
|
1793
|
+
maxMonthlyUsageUsd: z.number().optional(),
|
|
1794
|
+
dataRetentionDays: z.int().optional(),
|
|
1795
|
+
}));
|
|
1796
|
+
/** A place the user can create a repository in, such as their own account or an organization, group or workspace they can access. */
|
|
1797
|
+
export const GitProviderWorkspace = lazySchema(() => z.looseObject({
|
|
1798
|
+
id: z.string(),
|
|
1799
|
+
label: z.string(),
|
|
1800
|
+
}));
|
|
1801
|
+
/** A connected git provider account the user can create repositories through. */
|
|
1802
|
+
export const GitProviderIntegration = lazySchema(() => z.looseObject({
|
|
1803
|
+
id: z.string(),
|
|
1804
|
+
provider: z.enum(["github", "gitlab", "bitbucket"]).or(z.string()),
|
|
1805
|
+
workspaces: z.array(GitProviderWorkspace()),
|
|
1806
|
+
addWorkspaceUrl: z.string().optional(),
|
|
1807
|
+
}));
|
|
1808
|
+
export const ListOfGitProviderIntegrationsResponse = lazySchema(() => z.looseObject({
|
|
1809
|
+
data: z.array(GitProviderIntegration()),
|
|
1810
|
+
}));
|
|
1811
|
+
/** A file to commit into the new repository. */
|
|
1812
|
+
export const GitRepoFile = lazySchema(() => z.looseObject({
|
|
1813
|
+
path: z.string(),
|
|
1814
|
+
content: z.string(),
|
|
1815
|
+
encoding: z.enum(["utf-8", "base64"]).or(z.string()),
|
|
1816
|
+
}));
|
|
1817
|
+
export const CreateGitRepoRequest = lazySchema(() => z.looseObject({
|
|
1818
|
+
workspace: z.string(),
|
|
1819
|
+
repoName: z.string(),
|
|
1820
|
+
isPrivate: z.boolean(),
|
|
1821
|
+
files: z.array(GitRepoFile()).optional(),
|
|
1822
|
+
templateArchiveUrl: z.string().optional(),
|
|
1823
|
+
}));
|
|
1824
|
+
/** URLs of a newly created repository. */
|
|
1825
|
+
export const GitRepo = lazySchema(() => z.looseObject({
|
|
1826
|
+
sshUrl: z.string(),
|
|
1827
|
+
httpsUrl: z.string(),
|
|
1828
|
+
htmlUrl: z.string(),
|
|
1829
|
+
}));
|
|
1830
|
+
export const GitRepoResponse = lazySchema(() => z.looseObject({
|
|
1831
|
+
data: GitRepo(),
|
|
1832
|
+
}));
|
|
1833
|
+
export const RegisterDeploymentKeyRequest = lazySchema(() => z.looseObject({
|
|
1834
|
+
actorId: z.string(),
|
|
1835
|
+
repoName: z.string(),
|
|
1836
|
+
}));
|
|
1837
|
+
export const RegisterDeploymentKeyResponse = lazySchema(() => z.looseObject({
|
|
1838
|
+
data: z.looseObject({
|
|
1839
|
+
repoName: z.string(),
|
|
1840
|
+
}),
|
|
1841
|
+
}));
|
|
1842
|
+
export const BrowserInfoResponse = lazySchema(() => z.looseObject({
|
|
1843
|
+
method: z.string(),
|
|
1844
|
+
clientIp: z.string().nullable(),
|
|
1845
|
+
countryCode: z.string().nullable(),
|
|
1846
|
+
bodyLength: z.int(),
|
|
1847
|
+
headers: z.record(z.string(), z.union([z.string(), z.array(z.string())])).optional(),
|
|
1848
|
+
rawHeaders: z.array(z.string()).optional(),
|
|
1849
|
+
}));
|
|
1850
|
+
export const EncodeAndSignResult = lazySchema(() => z.looseObject({
|
|
1851
|
+
encoded: z.string(),
|
|
1852
|
+
}));
|
|
1853
|
+
export const EncodeAndSignResponse = lazySchema(() => z.looseObject({
|
|
1854
|
+
data: EncodeAndSignResult(),
|
|
1855
|
+
}));
|
|
1856
|
+
export const DecodeAndVerifyRequest = lazySchema(() => z.looseObject({
|
|
1857
|
+
encoded: z.string(),
|
|
1858
|
+
}));
|
|
1859
|
+
export const DecodeAndVerifyResult = lazySchema(() => z.looseObject({
|
|
1860
|
+
decoded: z.unknown(),
|
|
1861
|
+
encodedByUserId: z.string().nullable(),
|
|
1862
|
+
isVerifiedUser: z.boolean(),
|
|
1863
|
+
}));
|
|
1864
|
+
export const DecodeAndVerifyResponse = lazySchema(() => z.looseObject({
|
|
1865
|
+
data: DecodeAndVerifyResult(),
|
|
1866
|
+
}));
|