@vercel/sdk 1.18.1 → 1.18.3
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 +75 -80
- package/bin/mcp-server.js +4746 -2929
- package/bin/mcp-server.js.map +63 -45
- package/esm/__tests__/domains.test.js +12 -65
- package/esm/__tests__/domains.test.js.map +1 -1
- package/esm/__tests__/edgeconfig.test.js +6 -6
- package/esm/__tests__/edgeconfig.test.js.map +1 -1
- package/esm/__tests__/integrations.test.js +1 -1
- package/esm/__tests__/logdrains.test.js +6 -2
- package/esm/__tests__/logdrains.test.js.map +1 -1
- package/esm/__tests__/security.test.js +20 -35
- package/esm/__tests__/security.test.js.map +1 -1
- package/esm/__tests__/teams.test.js +16 -0
- package/esm/__tests__/teams.test.js.map +1 -1
- package/esm/__tests__/vercel.test.js +150 -1
- package/esm/__tests__/vercel.test.js.map +1 -1
- package/esm/funcs/deleteV1BulkRedirects.d.ts +14 -0
- package/esm/funcs/deleteV1BulkRedirects.d.ts.map +1 -0
- package/esm/funcs/deleteV1BulkRedirects.js +74 -0
- package/esm/funcs/deleteV1BulkRedirects.js.map +1 -0
- package/esm/funcs/domainsCreateOrTransferDomain.js +2 -2
- package/esm/funcs/domainsCreateOrTransferDomain.js.map +1 -1
- package/esm/funcs/getV1BulkRedirects.d.ts +14 -0
- package/esm/funcs/getV1BulkRedirects.d.ts.map +1 -0
- package/esm/funcs/getV1BulkRedirects.js +80 -0
- package/esm/funcs/getV1BulkRedirects.js.map +1 -0
- package/esm/funcs/getV1BulkRedirectsVersions.d.ts +14 -0
- package/esm/funcs/getV1BulkRedirectsVersions.d.ts.map +1 -0
- package/esm/funcs/getV1BulkRedirectsVersions.js +73 -0
- package/esm/funcs/getV1BulkRedirectsVersions.js.map +1 -0
- package/esm/funcs/integrationsGetBillingPlans.js +1 -0
- package/esm/funcs/integrationsGetBillingPlans.js.map +1 -1
- package/esm/funcs/patchV1BulkRedirects.d.ts +14 -0
- package/esm/funcs/patchV1BulkRedirects.d.ts.map +1 -0
- package/esm/funcs/patchV1BulkRedirects.js +74 -0
- package/esm/funcs/patchV1BulkRedirects.js.map +1 -0
- package/esm/funcs/postV1BulkRedirectsRestore.d.ts +14 -0
- package/esm/funcs/postV1BulkRedirectsRestore.d.ts.map +1 -0
- package/esm/funcs/postV1BulkRedirectsRestore.js +74 -0
- package/esm/funcs/postV1BulkRedirectsRestore.js.map +1 -0
- package/esm/funcs/postV1BulkRedirectsVersions.d.ts +14 -0
- package/esm/funcs/postV1BulkRedirectsVersions.d.ts.map +1 -0
- package/esm/funcs/postV1BulkRedirectsVersions.js +74 -0
- package/esm/funcs/postV1BulkRedirectsVersions.js.map +1 -0
- package/esm/funcs/putV1BulkRedirects.d.ts +11 -0
- package/esm/funcs/putV1BulkRedirects.d.ts.map +1 -0
- package/esm/funcs/putV1BulkRedirects.js +69 -0
- package/esm/funcs/putV1BulkRedirects.js.map +1 -0
- package/esm/funcs/teamsPostTeamDsyncRoles.d.ts +17 -0
- package/esm/funcs/teamsPostTeamDsyncRoles.d.ts.map +1 -0
- package/esm/funcs/{domainsBuyDomain.js → teamsPostTeamDsyncRoles.js} +17 -12
- package/esm/funcs/teamsPostTeamDsyncRoles.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.d.ts.map +1 -1
- package/esm/mcp-server/server.js +17 -5
- package/esm/mcp-server/server.js.map +1 -1
- package/esm/mcp-server/tools/deleteV1BulkRedirects.d.ts +7 -0
- package/esm/mcp-server/tools/deleteV1BulkRedirects.d.ts.map +1 -0
- package/esm/mcp-server/tools/deleteV1BulkRedirects.js +26 -0
- package/esm/mcp-server/tools/deleteV1BulkRedirects.js.map +1 -0
- package/esm/mcp-server/tools/getV1BulkRedirects.d.ts +7 -0
- package/esm/mcp-server/tools/getV1BulkRedirects.d.ts.map +1 -0
- package/esm/mcp-server/tools/getV1BulkRedirects.js +26 -0
- package/esm/mcp-server/tools/getV1BulkRedirects.js.map +1 -0
- package/esm/mcp-server/tools/getV1BulkRedirectsVersions.d.ts +7 -0
- package/esm/mcp-server/tools/getV1BulkRedirectsVersions.d.ts.map +1 -0
- package/esm/mcp-server/tools/getV1BulkRedirectsVersions.js +26 -0
- package/esm/mcp-server/tools/getV1BulkRedirectsVersions.js.map +1 -0
- package/esm/mcp-server/tools/patchV1BulkRedirects.d.ts +7 -0
- package/esm/mcp-server/tools/patchV1BulkRedirects.d.ts.map +1 -0
- package/esm/mcp-server/tools/patchV1BulkRedirects.js +26 -0
- package/esm/mcp-server/tools/patchV1BulkRedirects.js.map +1 -0
- package/esm/mcp-server/tools/postV1BulkRedirectsRestore.d.ts +7 -0
- package/esm/mcp-server/tools/postV1BulkRedirectsRestore.d.ts.map +1 -0
- package/esm/mcp-server/tools/postV1BulkRedirectsRestore.js +26 -0
- package/esm/mcp-server/tools/postV1BulkRedirectsRestore.js.map +1 -0
- package/esm/mcp-server/tools/postV1BulkRedirectsVersions.d.ts +7 -0
- package/esm/mcp-server/tools/postV1BulkRedirectsVersions.d.ts.map +1 -0
- package/esm/mcp-server/tools/postV1BulkRedirectsVersions.js +26 -0
- package/esm/mcp-server/tools/postV1BulkRedirectsVersions.js.map +1 -0
- package/esm/mcp-server/tools/putV1BulkRedirects.d.ts +7 -0
- package/esm/mcp-server/tools/putV1BulkRedirects.d.ts.map +1 -0
- package/esm/mcp-server/tools/putV1BulkRedirects.js +26 -0
- package/esm/mcp-server/tools/putV1BulkRedirects.js.map +1 -0
- package/esm/mcp-server/tools/teamsPostTeamDsyncRoles.d.ts +7 -0
- package/esm/mcp-server/tools/teamsPostTeamDsyncRoles.d.ts.map +1 -0
- package/esm/mcp-server/tools/teamsPostTeamDsyncRoles.js +28 -0
- package/esm/mcp-server/tools/teamsPostTeamDsyncRoles.js.map +1 -0
- package/esm/models/artifactqueryop.d.ts +8 -8
- package/esm/models/artifactqueryop.d.ts.map +1 -1
- package/esm/models/artifactqueryop.js +8 -8
- package/esm/models/artifactqueryop.js.map +1 -1
- package/esm/models/authuser.d.ts +5 -0
- package/esm/models/authuser.d.ts.map +1 -1
- package/esm/models/authuser.js +2 -0
- package/esm/models/authuser.js.map +1 -1
- package/esm/models/canceldeploymentop.d.ts +48 -2
- package/esm/models/canceldeploymentop.d.ts.map +1 -1
- package/esm/models/canceldeploymentop.js +44 -2
- package/esm/models/canceldeploymentop.js.map +1 -1
- package/esm/models/createdeploymentop.d.ts +48 -2
- package/esm/models/createdeploymentop.d.ts.map +1 -1
- package/esm/models/createdeploymentop.js +48 -2
- package/esm/models/createdeploymentop.js.map +1 -1
- package/esm/models/createedgeconfigop.d.ts +5 -0
- package/esm/models/createedgeconfigop.d.ts.map +1 -1
- package/esm/models/createedgeconfigop.js +2 -0
- package/esm/models/createedgeconfigop.js.map +1 -1
- package/esm/models/createintegrationstoredirectop.d.ts +222 -152
- package/esm/models/createintegrationstoredirectop.d.ts.map +1 -1
- package/esm/models/createintegrationstoredirectop.js +298 -218
- package/esm/models/createintegrationstoredirectop.js.map +1 -1
- package/esm/models/createortransferdomainop.d.ts +4 -40
- package/esm/models/createortransferdomainop.d.ts.map +1 -1
- package/esm/models/createortransferdomainop.js +0 -24
- package/esm/models/createortransferdomainop.js.map +1 -1
- package/esm/models/createprojectop.d.ts +138 -6
- package/esm/models/createprojectop.d.ts.map +1 -1
- package/esm/models/createprojectop.js +126 -6
- package/esm/models/createprojectop.js.map +1 -1
- package/esm/models/createwebhookop.d.ts +4 -2
- package/esm/models/createwebhookop.d.ts.map +1 -1
- package/esm/models/createwebhookop.js +4 -2
- package/esm/models/createwebhookop.js.map +1 -1
- package/esm/models/deletev1bulkredirectsop.d.ts +102 -0
- package/esm/models/deletev1bulkredirectsop.d.ts.map +1 -0
- package/esm/models/deletev1bulkredirectsop.js +95 -0
- package/esm/models/deletev1bulkredirectsop.js.map +1 -0
- package/esm/models/getbillingplansop.d.ts +2 -0
- package/esm/models/getbillingplansop.d.ts.map +1 -1
- package/esm/models/getbillingplansop.js +2 -0
- package/esm/models/getbillingplansop.js.map +1 -1
- package/esm/models/getconfigurationop.d.ts +61 -1
- package/esm/models/getconfigurationop.d.ts.map +1 -1
- package/esm/models/getconfigurationop.js +44 -1
- package/esm/models/getconfigurationop.js.map +1 -1
- package/esm/models/getconfigurationproductsop.d.ts +200 -200
- package/esm/models/getconfigurationproductsop.js +290 -290
- package/esm/models/getconfigurationsop.d.ts +61 -0
- package/esm/models/getconfigurationsop.d.ts.map +1 -1
- package/esm/models/getconfigurationsop.js +44 -0
- package/esm/models/getconfigurationsop.js.map +1 -1
- package/esm/models/getdeploymenteventsop.d.ts +6 -6
- package/esm/models/getdeploymenteventsop.d.ts.map +1 -1
- package/esm/models/getdeploymenteventsop.js +6 -6
- package/esm/models/getdeploymenteventsop.js.map +1 -1
- package/esm/models/getdeploymentop.d.ts +94 -4
- package/esm/models/getdeploymentop.d.ts.map +1 -1
- package/esm/models/getdeploymentop.js +86 -4
- package/esm/models/getdeploymentop.js.map +1 -1
- package/esm/models/getedgeconfigop.d.ts +5 -0
- package/esm/models/getedgeconfigop.d.ts.map +1 -1
- package/esm/models/getedgeconfigop.js +2 -0
- package/esm/models/getedgeconfigop.js.map +1 -1
- package/esm/models/getfirewallconfigop.d.ts +336 -103
- package/esm/models/getfirewallconfigop.d.ts.map +1 -1
- package/esm/models/getfirewallconfigop.js +358 -98
- package/esm/models/getfirewallconfigop.js.map +1 -1
- package/esm/models/getorderop.d.ts +126 -42
- package/esm/models/getorderop.d.ts.map +1 -1
- package/esm/models/getorderop.js +138 -24
- package/esm/models/getorderop.js.map +1 -1
- package/esm/models/getprojectdomainsop.d.ts +5 -5
- package/esm/models/getprojectdomainsop.d.ts.map +1 -1
- package/esm/models/getprojectdomainsop.js +5 -6
- package/esm/models/getprojectdomainsop.js.map +1 -1
- package/esm/models/getprojectsop.d.ts +109 -6
- package/esm/models/getprojectsop.d.ts.map +1 -1
- package/esm/models/getprojectsop.js +97 -6
- package/esm/models/getprojectsop.js.map +1 -1
- package/esm/models/getv1bulkredirectsop.d.ts +190 -0
- package/esm/models/getv1bulkredirectsop.d.ts.map +1 -0
- package/esm/models/getv1bulkredirectsop.js +195 -0
- package/esm/models/getv1bulkredirectsop.js.map +1 -0
- package/esm/models/getv1bulkredirectsversionsop.d.ts +80 -0
- package/esm/models/getv1bulkredirectsversionsop.d.ts.map +1 -0
- package/esm/models/getv1bulkredirectsversionsop.js +64 -0
- package/esm/models/getv1bulkredirectsversionsop.js.map +1 -0
- package/esm/models/getwebhookop.d.ts +2 -1
- package/esm/models/getwebhookop.d.ts.map +1 -1
- package/esm/models/getwebhookop.js +2 -1
- package/esm/models/getwebhookop.js.map +1 -1
- package/esm/models/getwebhooksop.d.ts +4 -2
- package/esm/models/getwebhooksop.d.ts.map +1 -1
- package/esm/models/getwebhooksop.js +4 -2
- package/esm/models/getwebhooksop.js.map +1 -1
- package/esm/models/listaccessgroupsop.d.ts +8 -8
- package/esm/models/listaccessgroupsop.d.ts.map +1 -1
- package/esm/models/listaccessgroupsop.js +8 -8
- package/esm/models/listaccessgroupsop.js.map +1 -1
- package/esm/models/patchv1bulkredirectsop.d.ts +133 -0
- package/esm/models/patchv1bulkredirectsop.d.ts.map +1 -0
- package/esm/models/patchv1bulkredirectsop.js +121 -0
- package/esm/models/patchv1bulkredirectsop.js.map +1 -0
- package/esm/models/postteamdsyncrolesop.d.ts +98 -0
- package/esm/models/postteamdsyncrolesop.d.ts.map +1 -0
- package/esm/models/postteamdsyncrolesop.js +113 -0
- package/esm/models/postteamdsyncrolesop.js.map +1 -0
- package/esm/models/postv1bulkredirectsrestoreop.d.ts +104 -0
- package/esm/models/postv1bulkredirectsrestoreop.d.ts.map +1 -0
- package/esm/models/postv1bulkredirectsrestoreop.js +96 -0
- package/esm/models/postv1bulkredirectsrestoreop.js.map +1 -0
- package/esm/models/postv1bulkredirectsversionsop.d.ts +110 -0
- package/esm/models/postv1bulkredirectsversionsop.d.ts.map +1 -0
- package/esm/models/postv1bulkredirectsversionsop.js +102 -0
- package/esm/models/postv1bulkredirectsversionsop.js.map +1 -0
- package/esm/models/putfirewallconfigop.d.ts +357 -100
- package/esm/models/putfirewallconfigop.d.ts.map +1 -1
- package/esm/models/putfirewallconfigop.js +379 -102
- package/esm/models/putfirewallconfigop.js.map +1 -1
- package/esm/models/putv1bulkredirectsop.d.ts +122 -0
- package/esm/models/putv1bulkredirectsop.d.ts.map +1 -0
- package/esm/models/putv1bulkredirectsop.js +108 -0
- package/esm/models/putv1bulkredirectsop.js.map +1 -0
- package/esm/models/updateedgeconfigop.d.ts +5 -0
- package/esm/models/updateedgeconfigop.d.ts.map +1 -1
- package/esm/models/updateedgeconfigop.js +2 -0
- package/esm/models/updateedgeconfigop.js.map +1 -1
- package/esm/models/updatefirewallconfigop.d.ts +30 -0
- package/esm/models/updatefirewallconfigop.d.ts.map +1 -1
- package/esm/models/updatefirewallconfigop.js +32 -0
- package/esm/models/updatefirewallconfigop.js.map +1 -1
- package/esm/models/updateinstallationop.d.ts +18 -0
- package/esm/models/updateinstallationop.d.ts.map +1 -1
- package/esm/models/updateinstallationop.js +17 -0
- package/esm/models/updateinstallationop.js.map +1 -1
- package/esm/models/updateprojectdatacacheop.d.ts +124 -21
- package/esm/models/updateprojectdatacacheop.d.ts.map +1 -1
- package/esm/models/updateprojectdatacacheop.js +118 -24
- package/esm/models/updateprojectdatacacheop.js.map +1 -1
- package/esm/models/updateprojectop.d.ts +138 -6
- package/esm/models/updateprojectop.d.ts.map +1 -1
- package/esm/models/updateprojectop.js +126 -6
- package/esm/models/updateprojectop.js.map +1 -1
- package/esm/models/updateprojectprotectionbypassop.d.ts +49 -0
- package/esm/models/updateprojectprotectionbypassop.d.ts.map +1 -1
- package/esm/models/updateprojectprotectionbypassop.js +27 -0
- package/esm/models/updateprojectprotectionbypassop.js.map +1 -1
- package/esm/models/userevent.d.ts +792 -966
- package/esm/models/userevent.d.ts.map +1 -1
- package/esm/models/userevent.js +1047 -1248
- package/esm/models/userevent.js.map +1 -1
- package/esm/sdk/domains.d.ts +0 -16
- package/esm/sdk/domains.d.ts.map +1 -1
- package/esm/sdk/domains.js +0 -20
- package/esm/sdk/domains.js.map +1 -1
- package/esm/sdk/sdk.d.ts +33 -1
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +47 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/teams.d.ts +8 -0
- package/esm/sdk/teams.d.ts.map +1 -1
- package/esm/sdk/teams.js +10 -0
- package/esm/sdk/teams.js.map +1 -1
- package/examples/package-lock.json +2 -2
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/__tests__/domains.test.ts +16 -70
- package/src/__tests__/edgeconfig.test.ts +6 -6
- package/src/__tests__/integrations.test.ts +1 -1
- package/src/__tests__/logdrains.test.ts +6 -2
- package/src/__tests__/security.test.ts +20 -35
- package/src/__tests__/teams.test.ts +19 -0
- package/src/__tests__/vercel.test.ts +177 -1
- package/src/funcs/deleteV1BulkRedirects.ts +161 -0
- package/src/funcs/domainsCreateOrTransferDomain.ts +2 -2
- package/src/funcs/getV1BulkRedirects.ts +167 -0
- package/src/funcs/getV1BulkRedirectsVersions.ts +160 -0
- package/src/funcs/integrationsGetBillingPlans.ts +1 -0
- package/src/funcs/patchV1BulkRedirects.ts +161 -0
- package/src/funcs/postV1BulkRedirectsRestore.ts +161 -0
- package/src/funcs/postV1BulkRedirectsVersions.ts +161 -0
- package/src/funcs/putV1BulkRedirects.ts +156 -0
- package/src/funcs/{domainsBuyDomain.ts → teamsPostTeamDsyncRoles.ts} +29 -24
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +17 -5
- package/src/mcp-server/tools/deleteV1BulkRedirects.ts +36 -0
- package/src/mcp-server/tools/getV1BulkRedirects.ts +35 -0
- package/src/mcp-server/tools/getV1BulkRedirectsVersions.ts +35 -0
- package/src/mcp-server/tools/patchV1BulkRedirects.ts +36 -0
- package/src/mcp-server/tools/postV1BulkRedirectsRestore.ts +36 -0
- package/src/mcp-server/tools/postV1BulkRedirectsVersions.ts +36 -0
- package/src/mcp-server/tools/putV1BulkRedirects.ts +35 -0
- package/src/mcp-server/tools/teamsPostTeamDsyncRoles.ts +37 -0
- package/src/models/artifactqueryop.ts +21 -17
- package/src/models/authuser.ts +7 -0
- package/src/models/canceldeploymentop.ts +133 -4
- package/src/models/createdeploymentop.ts +116 -4
- package/src/models/createedgeconfigop.ts +7 -0
- package/src/models/createintegrationstoredirectop.ts +708 -471
- package/src/models/createortransferdomainop.ts +0 -83
- package/src/models/createprojectop.ts +346 -12
- package/src/models/createwebhookop.ts +4 -2
- package/src/models/deletev1bulkredirectsop.ts +267 -0
- package/src/models/getbillingplansop.ts +4 -0
- package/src/models/getconfigurationop.ts +87 -1
- package/src/models/getconfigurationproductsop.ts +627 -627
- package/src/models/getconfigurationsop.ts +87 -0
- package/src/models/getdeploymenteventsop.ts +17 -13
- package/src/models/getdeploymentop.ts +271 -8
- package/src/models/getedgeconfigop.ts +7 -0
- package/src/models/getfirewallconfigop.ts +835 -274
- package/src/models/getorderop.ts +469 -112
- package/src/models/getprojectdomainsop.ts +11 -9
- package/src/models/getprojectsop.ts +260 -12
- package/src/models/getv1bulkredirectsop.ts +467 -0
- package/src/models/getv1bulkredirectsversionsop.ts +192 -0
- package/src/models/getwebhookop.ts +2 -1
- package/src/models/getwebhooksop.ts +4 -2
- package/src/models/listaccessgroupsop.ts +26 -18
- package/src/models/patchv1bulkredirectsop.ts +336 -0
- package/src/models/postteamdsyncrolesop.ts +291 -0
- package/src/models/postv1bulkredirectsrestoreop.ts +275 -0
- package/src/models/postv1bulkredirectsversionsop.ts +296 -0
- package/src/models/putfirewallconfigop.ts +1025 -284
- package/src/models/putv1bulkredirectsop.ts +304 -0
- package/src/models/updateedgeconfigop.ts +7 -0
- package/src/models/updatefirewallconfigop.ts +107 -0
- package/src/models/updateinstallationop.ts +30 -0
- package/src/models/updateprojectdatacacheop.ts +322 -63
- package/src/models/updateprojectop.ts +346 -12
- package/src/models/updateprojectprotectionbypassop.ts +84 -0
- package/src/models/userevent.ts +2415 -2887
- package/src/sdk/domains.ts +0 -41
- package/src/sdk/sdk.ts +132 -1
- package/src/sdk/teams.ts +22 -0
- package/vercel-spec.json +3260 -1294
- package/esm/funcs/domainsBuyDomain.d.ts +0 -17
- package/esm/funcs/domainsBuyDomain.d.ts.map +0 -1
- package/esm/funcs/domainsBuyDomain.js.map +0 -1
- package/esm/mcp-server/tools/domainsBuyDomain.d.ts +0 -7
- package/esm/mcp-server/tools/domainsBuyDomain.d.ts.map +0 -1
- package/esm/mcp-server/tools/domainsBuyDomain.js +0 -28
- package/esm/mcp-server/tools/domainsBuyDomain.js.map +0 -1
- package/esm/models/buydomainop.d.ts +0 -180
- package/esm/models/buydomainop.d.ts.map +0 -1
- package/esm/models/buydomainop.js +0 -159
- package/esm/models/buydomainop.js.map +0 -1
- package/src/mcp-server/tools/domainsBuyDomain.ts +0 -37
- package/src/models/buydomainop.ts +0 -453
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { VercelCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
GetV1BulkRedirectsVersionsRequest,
|
|
14
|
+
GetV1BulkRedirectsVersionsRequest$outboundSchema,
|
|
15
|
+
GetV1BulkRedirectsVersionsResponseBody,
|
|
16
|
+
GetV1BulkRedirectsVersionsResponseBody$inboundSchema,
|
|
17
|
+
} from "../models/getv1bulkredirectsversionsop.js";
|
|
18
|
+
import {
|
|
19
|
+
ConnectionError,
|
|
20
|
+
InvalidRequestError,
|
|
21
|
+
RequestAbortedError,
|
|
22
|
+
RequestTimeoutError,
|
|
23
|
+
UnexpectedClientError,
|
|
24
|
+
} from "../models/httpclienterrors.js";
|
|
25
|
+
import { ResponseValidationError } from "../models/responsevalidationerror.js";
|
|
26
|
+
import { SDKValidationError } from "../models/sdkvalidationerror.js";
|
|
27
|
+
import { VercelError } from "../models/vercelerror.js";
|
|
28
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
+
import { Result } from "../types/fp.js";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get the version history for a project's bulk redirects
|
|
33
|
+
*/
|
|
34
|
+
export function getV1BulkRedirectsVersions(
|
|
35
|
+
client: VercelCore,
|
|
36
|
+
request: GetV1BulkRedirectsVersionsRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
GetV1BulkRedirectsVersionsResponseBody,
|
|
41
|
+
| VercelError
|
|
42
|
+
| ResponseValidationError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| InvalidRequestError
|
|
47
|
+
| UnexpectedClientError
|
|
48
|
+
| SDKValidationError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client: VercelCore,
|
|
60
|
+
request: GetV1BulkRedirectsVersionsRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
GetV1BulkRedirectsVersionsResponseBody,
|
|
66
|
+
| VercelError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>,
|
|
75
|
+
APICall,
|
|
76
|
+
]
|
|
77
|
+
> {
|
|
78
|
+
const parsed = safeParse(
|
|
79
|
+
request,
|
|
80
|
+
(value) => GetV1BulkRedirectsVersionsRequest$outboundSchema.parse(value),
|
|
81
|
+
"Input validation failed",
|
|
82
|
+
);
|
|
83
|
+
if (!parsed.ok) {
|
|
84
|
+
return [parsed, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const payload = parsed.value;
|
|
87
|
+
const body = null;
|
|
88
|
+
|
|
89
|
+
const path = pathToFunc("/v1/bulk-redirects/versions")();
|
|
90
|
+
|
|
91
|
+
const query = encodeFormQuery({
|
|
92
|
+
"projectId": payload.projectId,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const headers = new Headers(compactMap({
|
|
96
|
+
Accept: "application/json",
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
const context = {
|
|
100
|
+
options: client._options,
|
|
101
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
102
|
+
operationID: "get_/v1/bulk-redirects/versions",
|
|
103
|
+
oAuth2Scopes: null,
|
|
104
|
+
|
|
105
|
+
resolvedSecurity: null,
|
|
106
|
+
|
|
107
|
+
securitySource: null,
|
|
108
|
+
retryConfig: options?.retries
|
|
109
|
+
|| client._options.retryConfig
|
|
110
|
+
|| { strategy: "none" },
|
|
111
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const requestRes = client._createRequest(context, {
|
|
115
|
+
method: "GET",
|
|
116
|
+
baseURL: options?.serverURL,
|
|
117
|
+
path: path,
|
|
118
|
+
headers: headers,
|
|
119
|
+
query: query,
|
|
120
|
+
body: body,
|
|
121
|
+
userAgent: client._options.userAgent,
|
|
122
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
123
|
+
}, options);
|
|
124
|
+
if (!requestRes.ok) {
|
|
125
|
+
return [requestRes, { status: "invalid" }];
|
|
126
|
+
}
|
|
127
|
+
const req = requestRes.value;
|
|
128
|
+
|
|
129
|
+
const doResult = await client._do(req, {
|
|
130
|
+
context,
|
|
131
|
+
errorCodes: ["400", "401", "403", "4XX", "500", "5XX"],
|
|
132
|
+
retryConfig: context.retryConfig,
|
|
133
|
+
retryCodes: context.retryCodes,
|
|
134
|
+
});
|
|
135
|
+
if (!doResult.ok) {
|
|
136
|
+
return [doResult, { status: "request-error", request: req }];
|
|
137
|
+
}
|
|
138
|
+
const response = doResult.value;
|
|
139
|
+
|
|
140
|
+
const [result] = await M.match<
|
|
141
|
+
GetV1BulkRedirectsVersionsResponseBody,
|
|
142
|
+
| VercelError
|
|
143
|
+
| ResponseValidationError
|
|
144
|
+
| ConnectionError
|
|
145
|
+
| RequestAbortedError
|
|
146
|
+
| RequestTimeoutError
|
|
147
|
+
| InvalidRequestError
|
|
148
|
+
| UnexpectedClientError
|
|
149
|
+
| SDKValidationError
|
|
150
|
+
>(
|
|
151
|
+
M.json(200, GetV1BulkRedirectsVersionsResponseBody$inboundSchema),
|
|
152
|
+
M.fail([400, 401, 403, "4XX"]),
|
|
153
|
+
M.fail([500, "5XX"]),
|
|
154
|
+
)(response, req);
|
|
155
|
+
if (!result.ok) {
|
|
156
|
+
return [result, { status: "complete", request: req, response }];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return [result, { status: "complete", request: req, response }];
|
|
160
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { VercelCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../models/httpclienterrors.js";
|
|
19
|
+
import {
|
|
20
|
+
PatchV1BulkRedirectsRequest,
|
|
21
|
+
PatchV1BulkRedirectsRequest$outboundSchema,
|
|
22
|
+
PatchV1BulkRedirectsResponseBody,
|
|
23
|
+
PatchV1BulkRedirectsResponseBody$inboundSchema,
|
|
24
|
+
} from "../models/patchv1bulkredirectsop.js";
|
|
25
|
+
import { ResponseValidationError } from "../models/responsevalidationerror.js";
|
|
26
|
+
import { SDKValidationError } from "../models/sdkvalidationerror.js";
|
|
27
|
+
import { VercelError } from "../models/vercelerror.js";
|
|
28
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
+
import { Result } from "../types/fp.js";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Edits a single redirect identified by its source path. Stages a new change with the modified redirect and returns the alias for the new version in the response.
|
|
33
|
+
*/
|
|
34
|
+
export function patchV1BulkRedirects(
|
|
35
|
+
client: VercelCore,
|
|
36
|
+
request: PatchV1BulkRedirectsRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
PatchV1BulkRedirectsResponseBody,
|
|
41
|
+
| VercelError
|
|
42
|
+
| ResponseValidationError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| InvalidRequestError
|
|
47
|
+
| UnexpectedClientError
|
|
48
|
+
| SDKValidationError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client: VercelCore,
|
|
60
|
+
request: PatchV1BulkRedirectsRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
PatchV1BulkRedirectsResponseBody,
|
|
66
|
+
| VercelError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>,
|
|
75
|
+
APICall,
|
|
76
|
+
]
|
|
77
|
+
> {
|
|
78
|
+
const parsed = safeParse(
|
|
79
|
+
request,
|
|
80
|
+
(value) => PatchV1BulkRedirectsRequest$outboundSchema.parse(value),
|
|
81
|
+
"Input validation failed",
|
|
82
|
+
);
|
|
83
|
+
if (!parsed.ok) {
|
|
84
|
+
return [parsed, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const payload = parsed.value;
|
|
87
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
88
|
+
|
|
89
|
+
const path = pathToFunc("/v1/bulk-redirects")();
|
|
90
|
+
|
|
91
|
+
const query = encodeFormQuery({
|
|
92
|
+
"projectId": payload.projectId,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const headers = new Headers(compactMap({
|
|
96
|
+
"Content-Type": "application/json",
|
|
97
|
+
Accept: "application/json",
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
const context = {
|
|
101
|
+
options: client._options,
|
|
102
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
103
|
+
operationID: "patch_/v1/bulk-redirects",
|
|
104
|
+
oAuth2Scopes: null,
|
|
105
|
+
|
|
106
|
+
resolvedSecurity: null,
|
|
107
|
+
|
|
108
|
+
securitySource: null,
|
|
109
|
+
retryConfig: options?.retries
|
|
110
|
+
|| client._options.retryConfig
|
|
111
|
+
|| { strategy: "none" },
|
|
112
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const requestRes = client._createRequest(context, {
|
|
116
|
+
method: "PATCH",
|
|
117
|
+
baseURL: options?.serverURL,
|
|
118
|
+
path: path,
|
|
119
|
+
headers: headers,
|
|
120
|
+
query: query,
|
|
121
|
+
body: body,
|
|
122
|
+
userAgent: client._options.userAgent,
|
|
123
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
124
|
+
}, options);
|
|
125
|
+
if (!requestRes.ok) {
|
|
126
|
+
return [requestRes, { status: "invalid" }];
|
|
127
|
+
}
|
|
128
|
+
const req = requestRes.value;
|
|
129
|
+
|
|
130
|
+
const doResult = await client._do(req, {
|
|
131
|
+
context,
|
|
132
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
133
|
+
retryConfig: context.retryConfig,
|
|
134
|
+
retryCodes: context.retryCodes,
|
|
135
|
+
});
|
|
136
|
+
if (!doResult.ok) {
|
|
137
|
+
return [doResult, { status: "request-error", request: req }];
|
|
138
|
+
}
|
|
139
|
+
const response = doResult.value;
|
|
140
|
+
|
|
141
|
+
const [result] = await M.match<
|
|
142
|
+
PatchV1BulkRedirectsResponseBody,
|
|
143
|
+
| VercelError
|
|
144
|
+
| ResponseValidationError
|
|
145
|
+
| ConnectionError
|
|
146
|
+
| RequestAbortedError
|
|
147
|
+
| RequestTimeoutError
|
|
148
|
+
| InvalidRequestError
|
|
149
|
+
| UnexpectedClientError
|
|
150
|
+
| SDKValidationError
|
|
151
|
+
>(
|
|
152
|
+
M.json(200, PatchV1BulkRedirectsResponseBody$inboundSchema),
|
|
153
|
+
M.fail([400, 401, 403, 404, "4XX"]),
|
|
154
|
+
M.fail([500, "5XX"]),
|
|
155
|
+
)(response, req);
|
|
156
|
+
if (!result.ok) {
|
|
157
|
+
return [result, { status: "complete", request: req, response }];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return [result, { status: "complete", request: req, response }];
|
|
161
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { VercelCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../models/httpclienterrors.js";
|
|
19
|
+
import {
|
|
20
|
+
PostV1BulkRedirectsRestoreRequest,
|
|
21
|
+
PostV1BulkRedirectsRestoreRequest$outboundSchema,
|
|
22
|
+
PostV1BulkRedirectsRestoreResponseBody,
|
|
23
|
+
PostV1BulkRedirectsRestoreResponseBody$inboundSchema,
|
|
24
|
+
} from "../models/postv1bulkredirectsrestoreop.js";
|
|
25
|
+
import { ResponseValidationError } from "../models/responsevalidationerror.js";
|
|
26
|
+
import { SDKValidationError } from "../models/sdkvalidationerror.js";
|
|
27
|
+
import { VercelError } from "../models/vercelerror.js";
|
|
28
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
+
import { Result } from "../types/fp.js";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Restores the provided redirects in the staging version to the value in the production version. If no production version exists, removes the redirects from staging.
|
|
33
|
+
*/
|
|
34
|
+
export function postV1BulkRedirectsRestore(
|
|
35
|
+
client: VercelCore,
|
|
36
|
+
request: PostV1BulkRedirectsRestoreRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
PostV1BulkRedirectsRestoreResponseBody,
|
|
41
|
+
| VercelError
|
|
42
|
+
| ResponseValidationError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| InvalidRequestError
|
|
47
|
+
| UnexpectedClientError
|
|
48
|
+
| SDKValidationError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client: VercelCore,
|
|
60
|
+
request: PostV1BulkRedirectsRestoreRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
PostV1BulkRedirectsRestoreResponseBody,
|
|
66
|
+
| VercelError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>,
|
|
75
|
+
APICall,
|
|
76
|
+
]
|
|
77
|
+
> {
|
|
78
|
+
const parsed = safeParse(
|
|
79
|
+
request,
|
|
80
|
+
(value) => PostV1BulkRedirectsRestoreRequest$outboundSchema.parse(value),
|
|
81
|
+
"Input validation failed",
|
|
82
|
+
);
|
|
83
|
+
if (!parsed.ok) {
|
|
84
|
+
return [parsed, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const payload = parsed.value;
|
|
87
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
88
|
+
|
|
89
|
+
const path = pathToFunc("/v1/bulk-redirects/restore")();
|
|
90
|
+
|
|
91
|
+
const query = encodeFormQuery({
|
|
92
|
+
"projectId": payload.projectId,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const headers = new Headers(compactMap({
|
|
96
|
+
"Content-Type": "application/json",
|
|
97
|
+
Accept: "application/json",
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
const context = {
|
|
101
|
+
options: client._options,
|
|
102
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
103
|
+
operationID: "post_/v1/bulk-redirects/restore",
|
|
104
|
+
oAuth2Scopes: null,
|
|
105
|
+
|
|
106
|
+
resolvedSecurity: null,
|
|
107
|
+
|
|
108
|
+
securitySource: null,
|
|
109
|
+
retryConfig: options?.retries
|
|
110
|
+
|| client._options.retryConfig
|
|
111
|
+
|| { strategy: "none" },
|
|
112
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const requestRes = client._createRequest(context, {
|
|
116
|
+
method: "POST",
|
|
117
|
+
baseURL: options?.serverURL,
|
|
118
|
+
path: path,
|
|
119
|
+
headers: headers,
|
|
120
|
+
query: query,
|
|
121
|
+
body: body,
|
|
122
|
+
userAgent: client._options.userAgent,
|
|
123
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
124
|
+
}, options);
|
|
125
|
+
if (!requestRes.ok) {
|
|
126
|
+
return [requestRes, { status: "invalid" }];
|
|
127
|
+
}
|
|
128
|
+
const req = requestRes.value;
|
|
129
|
+
|
|
130
|
+
const doResult = await client._do(req, {
|
|
131
|
+
context,
|
|
132
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
133
|
+
retryConfig: context.retryConfig,
|
|
134
|
+
retryCodes: context.retryCodes,
|
|
135
|
+
});
|
|
136
|
+
if (!doResult.ok) {
|
|
137
|
+
return [doResult, { status: "request-error", request: req }];
|
|
138
|
+
}
|
|
139
|
+
const response = doResult.value;
|
|
140
|
+
|
|
141
|
+
const [result] = await M.match<
|
|
142
|
+
PostV1BulkRedirectsRestoreResponseBody,
|
|
143
|
+
| VercelError
|
|
144
|
+
| ResponseValidationError
|
|
145
|
+
| ConnectionError
|
|
146
|
+
| RequestAbortedError
|
|
147
|
+
| RequestTimeoutError
|
|
148
|
+
| InvalidRequestError
|
|
149
|
+
| UnexpectedClientError
|
|
150
|
+
| SDKValidationError
|
|
151
|
+
>(
|
|
152
|
+
M.json(200, PostV1BulkRedirectsRestoreResponseBody$inboundSchema),
|
|
153
|
+
M.fail([400, 401, 403, 404, "4XX"]),
|
|
154
|
+
M.fail([500, "5XX"]),
|
|
155
|
+
)(response, req);
|
|
156
|
+
if (!result.ok) {
|
|
157
|
+
return [result, { status: "complete", request: req, response }];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return [result, { status: "complete", request: req, response }];
|
|
161
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { VercelCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeJSON } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../models/httpclienterrors.js";
|
|
19
|
+
import {
|
|
20
|
+
PostV1BulkRedirectsVersionsRequest,
|
|
21
|
+
PostV1BulkRedirectsVersionsRequest$outboundSchema,
|
|
22
|
+
PostV1BulkRedirectsVersionsResponseBody,
|
|
23
|
+
PostV1BulkRedirectsVersionsResponseBody$inboundSchema,
|
|
24
|
+
} from "../models/postv1bulkredirectsversionsop.js";
|
|
25
|
+
import { ResponseValidationError } from "../models/responsevalidationerror.js";
|
|
26
|
+
import { SDKValidationError } from "../models/sdkvalidationerror.js";
|
|
27
|
+
import { VercelError } from "../models/vercelerror.js";
|
|
28
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
+
import { Result } from "../types/fp.js";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Update a version by promoting staging to production or restoring a previous production version
|
|
33
|
+
*/
|
|
34
|
+
export function postV1BulkRedirectsVersions(
|
|
35
|
+
client: VercelCore,
|
|
36
|
+
request: PostV1BulkRedirectsVersionsRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
PostV1BulkRedirectsVersionsResponseBody,
|
|
41
|
+
| VercelError
|
|
42
|
+
| ResponseValidationError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| InvalidRequestError
|
|
47
|
+
| UnexpectedClientError
|
|
48
|
+
| SDKValidationError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client: VercelCore,
|
|
60
|
+
request: PostV1BulkRedirectsVersionsRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
PostV1BulkRedirectsVersionsResponseBody,
|
|
66
|
+
| VercelError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>,
|
|
75
|
+
APICall,
|
|
76
|
+
]
|
|
77
|
+
> {
|
|
78
|
+
const parsed = safeParse(
|
|
79
|
+
request,
|
|
80
|
+
(value) => PostV1BulkRedirectsVersionsRequest$outboundSchema.parse(value),
|
|
81
|
+
"Input validation failed",
|
|
82
|
+
);
|
|
83
|
+
if (!parsed.ok) {
|
|
84
|
+
return [parsed, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const payload = parsed.value;
|
|
87
|
+
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
88
|
+
|
|
89
|
+
const path = pathToFunc("/v1/bulk-redirects/versions")();
|
|
90
|
+
|
|
91
|
+
const query = encodeFormQuery({
|
|
92
|
+
"projectId": payload.projectId,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const headers = new Headers(compactMap({
|
|
96
|
+
"Content-Type": "application/json",
|
|
97
|
+
Accept: "application/json",
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
const context = {
|
|
101
|
+
options: client._options,
|
|
102
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
103
|
+
operationID: "post_/v1/bulk-redirects/versions",
|
|
104
|
+
oAuth2Scopes: null,
|
|
105
|
+
|
|
106
|
+
resolvedSecurity: null,
|
|
107
|
+
|
|
108
|
+
securitySource: null,
|
|
109
|
+
retryConfig: options?.retries
|
|
110
|
+
|| client._options.retryConfig
|
|
111
|
+
|| { strategy: "none" },
|
|
112
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const requestRes = client._createRequest(context, {
|
|
116
|
+
method: "POST",
|
|
117
|
+
baseURL: options?.serverURL,
|
|
118
|
+
path: path,
|
|
119
|
+
headers: headers,
|
|
120
|
+
query: query,
|
|
121
|
+
body: body,
|
|
122
|
+
userAgent: client._options.userAgent,
|
|
123
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
124
|
+
}, options);
|
|
125
|
+
if (!requestRes.ok) {
|
|
126
|
+
return [requestRes, { status: "invalid" }];
|
|
127
|
+
}
|
|
128
|
+
const req = requestRes.value;
|
|
129
|
+
|
|
130
|
+
const doResult = await client._do(req, {
|
|
131
|
+
context,
|
|
132
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
133
|
+
retryConfig: context.retryConfig,
|
|
134
|
+
retryCodes: context.retryCodes,
|
|
135
|
+
});
|
|
136
|
+
if (!doResult.ok) {
|
|
137
|
+
return [doResult, { status: "request-error", request: req }];
|
|
138
|
+
}
|
|
139
|
+
const response = doResult.value;
|
|
140
|
+
|
|
141
|
+
const [result] = await M.match<
|
|
142
|
+
PostV1BulkRedirectsVersionsResponseBody,
|
|
143
|
+
| VercelError
|
|
144
|
+
| ResponseValidationError
|
|
145
|
+
| ConnectionError
|
|
146
|
+
| RequestAbortedError
|
|
147
|
+
| RequestTimeoutError
|
|
148
|
+
| InvalidRequestError
|
|
149
|
+
| UnexpectedClientError
|
|
150
|
+
| SDKValidationError
|
|
151
|
+
>(
|
|
152
|
+
M.json(200, PostV1BulkRedirectsVersionsResponseBody$inboundSchema),
|
|
153
|
+
M.fail([400, 401, 403, 404, "4XX"]),
|
|
154
|
+
M.fail([500, "5XX"]),
|
|
155
|
+
)(response, req);
|
|
156
|
+
if (!result.ok) {
|
|
157
|
+
return [result, { status: "complete", request: req, response }];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return [result, { status: "complete", request: req, response }];
|
|
161
|
+
}
|