vercel-api-js 0.25.3 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.mts +228 -0
- package/dist/client.d.ts +228 -0
- package/dist/client.js +75 -0
- package/dist/client.mjs +68 -0
- package/dist/generated/components.d.mts +2600 -0
- package/dist/generated/components.d.ts +2600 -0
- package/dist/generated/components.js +3579 -0
- package/dist/generated/components.mjs +3395 -0
- package/dist/generated/mcp.d.mts +2061 -0
- package/dist/generated/mcp.d.ts +2061 -0
- package/dist/generated/mcp.js +4692 -0
- package/dist/generated/mcp.mjs +4508 -0
- package/dist/generated/schemas.d.mts +19403 -0
- package/dist/generated/schemas.d.ts +19403 -0
- package/dist/generated/schemas.js +7619 -0
- package/dist/generated/schemas.mjs +7589 -0
- package/dist/generated/types.d.mts +15009 -0
- package/dist/generated/types.d.ts +15009 -0
- package/dist/generated/types.js +951 -0
- package/dist/generated/types.mjs +946 -0
- package/dist/index.d.mts +1711 -30847
- package/dist/index.d.ts +1711 -30847
- package/dist/index.js +49 -0
- package/dist/index.mjs +7 -845
- package/dist/mcp.d.mts +1 -0
- package/dist/mcp.d.ts +1 -0
- package/dist/mcp.js +5 -0
- package/dist/mcp.mjs +1 -0
- package/dist/utils/fetch.d.mts +18 -0
- package/dist/utils/fetch.d.ts +18 -0
- package/dist/utils/fetch.js +8 -0
- package/dist/utils/fetch.mjs +5 -0
- package/dist/utils/fetcher.d.mts +21 -0
- package/dist/utils/fetcher.d.ts +21 -0
- package/dist/utils/fetcher.js +69 -0
- package/dist/utils/fetcher.mjs +66 -0
- package/dist/utils/lang.d.mts +1 -0
- package/dist/utils/lang.d.ts +1 -0
- package/dist/utils/lang.js +9 -0
- package/dist/utils/lang.mjs +6 -0
- package/dist/utils/mcp.d.mts +1 -0
- package/dist/utils/mcp.d.ts +1 -0
- package/dist/utils/mcp.js +2 -0
- package/dist/utils/mcp.mjs +1 -0
- package/dist/utils/types.d.mts +3 -0
- package/dist/utils/types.d.ts +3 -0
- package/dist/utils/types.js +2 -0
- package/dist/utils/types.mjs +1 -0
- package/package.json +37 -17
- package/.turbo/turbo-build.log +0 -14
- package/CHANGELOG.md +0 -764
- package/dist/index.cjs +0 -847
- package/dist/index.d.cts +0 -30854
- package/tsconfig.json +0 -19
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { type operationsByPath, operationsByTag, type tagDictionary } from "./generated/components.mjs";
|
|
2
|
+
import { type FetchImpl } from "./utils/fetch.mjs";
|
|
3
|
+
import { type FetcherConfig } from "./utils/fetcher.mjs";
|
|
4
|
+
import type { RequiredKeys } from "./utils/types.mjs";
|
|
5
|
+
export interface VercelApiOptions {
|
|
6
|
+
token: string | null;
|
|
7
|
+
fetch?: FetchImpl;
|
|
8
|
+
}
|
|
9
|
+
export type ApiClient = {
|
|
10
|
+
[Tag in keyof typeof operationsByTag]: {
|
|
11
|
+
[Method in keyof (typeof operationsByTag)[Tag]]: (typeof operationsByTag)[Tag][Method] extends infer Operation extends (...args: any) => any ? Omit<Parameters<Operation>[0], keyof FetcherConfig> extends infer Params ? RequiredKeys<Params> extends never ? (params?: Params) => ReturnType<Operation> : (params: Params) => ReturnType<Operation> : never : never;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
15
|
+
export type ApiOperation = {
|
|
16
|
+
[Tag in keyof typeof operationsByTag]: keyof (typeof operationsByTag)[Tag] extends string ? `${Tag}.${keyof (typeof operationsByTag)[Tag]}` : never;
|
|
17
|
+
}[keyof typeof operationsByTag];
|
|
18
|
+
export type ApiOperationByMethod<Method extends HttpMethod> = {
|
|
19
|
+
[Tag in keyof typeof tagDictionary]: {
|
|
20
|
+
[TagMethod in keyof (typeof tagDictionary)[Tag]]: TagMethod extends Method ? (typeof tagDictionary)[Tag][TagMethod] extends readonly any[] ? `${Tag}.${(typeof tagDictionary)[Tag][TagMethod][number]}` : never : never;
|
|
21
|
+
}[keyof (typeof tagDictionary)[Tag]];
|
|
22
|
+
}[keyof typeof tagDictionary];
|
|
23
|
+
export type ApiOperationParams<T extends ApiOperation> = T extends `${infer Tag}.${infer Operation}` ? Tag extends keyof typeof operationsByTag ? Operation extends keyof (typeof operationsByTag)[Tag] ? (typeof operationsByTag)[Tag][Operation] extends infer Operation extends (...args: any) => any ? Omit<Parameters<Operation>[0], keyof FetcherConfig> : never : never : never : never;
|
|
24
|
+
export type ApiOperationResult<T extends ApiOperation> = T extends `${infer Tag}.${infer Operation}` ? Tag extends keyof typeof operationsByTag ? Operation extends keyof (typeof operationsByTag)[Tag] ? (typeof operationsByTag)[Tag][Operation] extends (...args: any) => any ? Awaited<ReturnType<(typeof operationsByTag)[Tag][Operation]>> : never : never : never : never;
|
|
25
|
+
type RequestEndpointParams<T extends keyof typeof operationsByPath> = Omit<Parameters<(typeof operationsByPath)[T]>[0], keyof FetcherConfig>;
|
|
26
|
+
export declare class XataApi {
|
|
27
|
+
token: string | null;
|
|
28
|
+
fetch: FetchImpl;
|
|
29
|
+
constructor(options: VercelApiOptions);
|
|
30
|
+
get api(): ApiClient;
|
|
31
|
+
get auth(): {
|
|
32
|
+
accessToken: ({ code, redirectUri, clientId, clientSecret }: AccessTokenOptions) => Promise<AccessTokenResult>;
|
|
33
|
+
};
|
|
34
|
+
request<Endpoint extends keyof typeof operationsByPath>(endpoint: Endpoint, params: RequestEndpointParams<Endpoint>): Promise<ReturnType<{
|
|
35
|
+
'GET /v1/access-groups/{idOrName}': typeof import("./generated/components").readAccessGroup;
|
|
36
|
+
'POST /v1/access-groups/{idOrName}': typeof import("./generated/components").updateAccessGroup;
|
|
37
|
+
'DELETE /v1/access-groups/{idOrName}': typeof import("./generated/components").deleteAccessGroup;
|
|
38
|
+
'GET /v1/access-groups/{idOrName}/members': typeof import("./generated/components").listAccessGroupMembers;
|
|
39
|
+
'GET /v1/access-groups': typeof import("./generated/components").listAccessGroups;
|
|
40
|
+
'POST /v1/access-groups': typeof import("./generated/components").createAccessGroup;
|
|
41
|
+
'GET /v1/access-groups/{idOrName}/projects': typeof import("./generated/components").listAccessGroupProjects;
|
|
42
|
+
'POST /v1/access-groups/{accessGroupIdOrName}/projects': typeof import("./generated/components").createAccessGroupProject;
|
|
43
|
+
'GET /v1/access-groups/{accessGroupIdOrName}/projects/{projectId}': typeof import("./generated/components").readAccessGroupProject;
|
|
44
|
+
'PATCH /v1/access-groups/{accessGroupIdOrName}/projects/{projectId}': typeof import("./generated/components").updateAccessGroupProject;
|
|
45
|
+
'DELETE /v1/access-groups/{accessGroupIdOrName}/projects/{projectId}': typeof import("./generated/components").deleteAccessGroupProject;
|
|
46
|
+
'POST /v8/artifacts/events': typeof import("./generated/components").recordEvents;
|
|
47
|
+
'GET /v8/artifacts/status': typeof import("./generated/components").status;
|
|
48
|
+
'PUT /v8/artifacts/{hash}': typeof import("./generated/components").uploadArtifact;
|
|
49
|
+
'GET /v8/artifacts/{hash}': typeof import("./generated/components").downloadArtifact;
|
|
50
|
+
'POST /v8/artifacts': typeof import("./generated/components").artifactQuery;
|
|
51
|
+
'POST /v1/deployments/{deploymentId}/checks': typeof import("./generated/components").createCheck;
|
|
52
|
+
'GET /v1/deployments/{deploymentId}/checks': typeof import("./generated/components").getAllChecks;
|
|
53
|
+
'GET /v1/deployments/{deploymentId}/checks/{checkId}': typeof import("./generated/components").getCheck;
|
|
54
|
+
'PATCH /v1/deployments/{deploymentId}/checks/{checkId}': typeof import("./generated/components").updateCheck;
|
|
55
|
+
'POST /v1/deployments/{deploymentId}/checks/{checkId}/rerequest': typeof import("./generated/components").rerequestCheck;
|
|
56
|
+
'DELETE /data-cache/purge-all': typeof import("./generated/components").purgeAllDataCache;
|
|
57
|
+
'PATCH /data-cache/billing-settings': typeof import("./generated/components").updateDataCacheBillingSettings;
|
|
58
|
+
'PATCH /v1/data-cache/projects/{projectId}': typeof import("./generated/components").updateProjectDataCache;
|
|
59
|
+
'GET /v3/deployments/{idOrUrl}/events': typeof import("./generated/components").getDeploymentEvents;
|
|
60
|
+
'PATCH /v1/deployments/{deploymentId}/integrations/{integrationConfigurationId}/resources/{resourceId}/actions/{action}': typeof import("./generated/components").updateIntegrationDeploymentAction;
|
|
61
|
+
'GET /v13/deployments/{idOrUrl}': typeof import("./generated/components").getDeployment;
|
|
62
|
+
'POST /v13/deployments': typeof import("./generated/components").createDeployment;
|
|
63
|
+
'PATCH /v12/deployments/{id}/cancel': typeof import("./generated/components").cancelDeployment;
|
|
64
|
+
'POST /v5/domains/buy': typeof import("./generated/components").buyDomain;
|
|
65
|
+
'GET /v4/domains/price': typeof import("./generated/components").checkDomainPrice;
|
|
66
|
+
'GET /v4/domains/status': typeof import("./generated/components").checkDomainStatus;
|
|
67
|
+
'GET /v4/domains/{domain}/records': typeof import("./generated/components").getRecords;
|
|
68
|
+
'POST /v2/domains/{domain}/records': typeof import("./generated/components").createRecord;
|
|
69
|
+
'PATCH /v1/domains/records/{recordId}': typeof import("./generated/components").updateRecord;
|
|
70
|
+
'DELETE /v2/domains/{domain}/records/{recordId}': typeof import("./generated/components").removeRecord;
|
|
71
|
+
'GET /v1/domains/{domain}/registry': typeof import("./generated/components").getDomainTransfer;
|
|
72
|
+
'GET /v6/domains/{domain}/config': typeof import("./generated/components").getDomainConfig;
|
|
73
|
+
'GET /v5/domains/{domain}': typeof import("./generated/components").getDomain;
|
|
74
|
+
'GET /v5/domains': typeof import("./generated/components").getDomains;
|
|
75
|
+
'POST /v7/domains': typeof import("./generated/components").createOrTransferDomain;
|
|
76
|
+
'PATCH /v3/domains/{domain}': typeof import("./generated/components").patchDomain;
|
|
77
|
+
'DELETE /v6/domains/{domain}': typeof import("./generated/components").deleteDomain;
|
|
78
|
+
'GET /v1/edge-config': typeof import("./generated/components").getEdgeConfigs;
|
|
79
|
+
'POST /v1/edge-config': typeof import("./generated/components").createEdgeConfig;
|
|
80
|
+
'GET /v1/edge-config/{edgeConfigId}': typeof import("./generated/components").getEdgeConfig;
|
|
81
|
+
'PUT /v1/edge-config/{edgeConfigId}': typeof import("./generated/components").updateEdgeConfig;
|
|
82
|
+
'DELETE /v1/edge-config/{edgeConfigId}': typeof import("./generated/components").deleteEdgeConfig;
|
|
83
|
+
'GET /v1/edge-config/{edgeConfigId}/items': typeof import("./generated/components").getEdgeConfigItems;
|
|
84
|
+
'PATCH /v1/edge-config/{edgeConfigId}/items': typeof import("./generated/components").patchEdgeConfigItems;
|
|
85
|
+
'GET /v1/edge-config/{edgeConfigId}/schema': typeof import("./generated/components").getEdgeConfigSchema;
|
|
86
|
+
'POST /v1/edge-config/{edgeConfigId}/schema': typeof import("./generated/components").patchEdgeConfigSchema;
|
|
87
|
+
'DELETE /v1/edge-config/{edgeConfigId}/schema': typeof import("./generated/components").deleteEdgeConfigSchema;
|
|
88
|
+
'GET /v1/edge-config/{edgeConfigId}/item/{edgeConfigItemKey}': typeof import("./generated/components").getEdgeConfigItem;
|
|
89
|
+
'GET /v1/edge-config/{edgeConfigId}/tokens': typeof import("./generated/components").getEdgeConfigTokens;
|
|
90
|
+
'DELETE /v1/edge-config/{edgeConfigId}/tokens': typeof import("./generated/components").deleteEdgeConfigTokens;
|
|
91
|
+
'GET /v1/edge-config/{edgeConfigId}/token/{token}': typeof import("./generated/components").getEdgeConfigToken;
|
|
92
|
+
'POST /v1/edge-config/{edgeConfigId}/token': typeof import("./generated/components").createEdgeConfigToken;
|
|
93
|
+
'GET /v1/edge-config/{edgeConfigId}/backups/{edgeConfigBackupVersionId}': typeof import("./generated/components").getEdgeConfigBackup;
|
|
94
|
+
'GET /v1/edge-config/{edgeConfigId}/backups': typeof import("./generated/components").getEdgeConfigBackups;
|
|
95
|
+
'GET /v3/events': typeof import("./generated/components").listUserEvents;
|
|
96
|
+
'GET /v1/installations/{integrationConfigurationId}/account': typeof import("./generated/components").getAccountInfo;
|
|
97
|
+
'GET /v1/installations/{integrationConfigurationId}/member/{memberId}': typeof import("./generated/components").getMember;
|
|
98
|
+
'POST /v1/installations/{integrationConfigurationId}/events': typeof import("./generated/components").createEvent;
|
|
99
|
+
'GET /v1/installations/{integrationConfigurationId}/resources': typeof import("./generated/components").getIntegrationResources;
|
|
100
|
+
'GET /v1/installations/{integrationConfigurationId}/resources/{resourceId}': typeof import("./generated/components").getIntegrationResource;
|
|
101
|
+
'DELETE /v1/installations/{integrationConfigurationId}/resources/{resourceId}': typeof import("./generated/components").deleteIntegrationResource;
|
|
102
|
+
'PUT /v1/installations/{integrationConfigurationId}/resources/{resourceId}': typeof import("./generated/components").importResource;
|
|
103
|
+
'POST /v1/installations/{integrationConfigurationId}/billing': typeof import("./generated/components").submitBillingData;
|
|
104
|
+
'POST /v1/installations/{integrationConfigurationId}/billing/invoices': typeof import("./generated/components").submitInvoice;
|
|
105
|
+
'GET /v1/installations/{integrationConfigurationId}/billing/invoices/{invoiceId}': typeof import("./generated/components").getInvoice;
|
|
106
|
+
'POST /v1/installations/{integrationConfigurationId}/billing/invoices/{invoiceId}/actions': typeof import("./generated/components").updateInvoice;
|
|
107
|
+
'POST /v1/installations/{integrationConfigurationId}/billing/balance': typeof import("./generated/components").submitPrepaymentBalances;
|
|
108
|
+
'PUT /v1/installations/{integrationConfigurationId}/products/{integrationProductIdOrSlug}/resources/{resourceId}/secrets': typeof import("./generated/components").updateResourceSecrets;
|
|
109
|
+
'PUT /v1/installations/{integrationConfigurationId}/resources/{resourceId}/secrets': typeof import("./generated/components").updateResourceSecretsById;
|
|
110
|
+
'GET /v1/integrations/configurations': typeof import("./generated/components").getConfigurations;
|
|
111
|
+
'GET /v1/integrations/configuration/{id}': typeof import("./generated/components").getConfiguration;
|
|
112
|
+
'DELETE /v1/integrations/configuration/{id}': typeof import("./generated/components").deleteConfiguration;
|
|
113
|
+
'POST /v1/integrations/sso/token': typeof import("./generated/components").exchangeSsoToken;
|
|
114
|
+
'GET /v2/integrations/log-drains': typeof import("./generated/components").getIntegrationLogDrains;
|
|
115
|
+
'POST /v2/integrations/log-drains': typeof import("./generated/components").createLogDrain;
|
|
116
|
+
'DELETE /v1/integrations/log-drains/{id}': typeof import("./generated/components").deleteIntegrationLogDrain;
|
|
117
|
+
'GET /v1/projects/{projectId}/deployments/{deploymentId}/runtime-logs': typeof import("./generated/components").getRuntimeLogs;
|
|
118
|
+
'POST /v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/items': typeof import("./generated/components").createExperimentationItem;
|
|
119
|
+
'PATCH /v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/items/{itemId}': typeof import("./generated/components").updateExperimentationItem;
|
|
120
|
+
'DELETE /v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/items/{itemId}': typeof import("./generated/components").deleteExperimentationItem;
|
|
121
|
+
'PUT /v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/edge-config': typeof import("./generated/components").updateExperimentationEdgeConfig;
|
|
122
|
+
'GET /v1/projects/{idOrName}/members': typeof import("./generated/components").getProjectMembers;
|
|
123
|
+
'POST /v1/projects/{idOrName}/members': typeof import("./generated/components").addProjectMember;
|
|
124
|
+
'DELETE /v1/projects/{idOrName}/members/{uid}': typeof import("./generated/components").removeProjectMember;
|
|
125
|
+
'GET /v10/projects': typeof import("./generated/components").getProjects;
|
|
126
|
+
'POST /v11/projects': typeof import("./generated/components").createProject;
|
|
127
|
+
'GET /v9/projects/{idOrName}': typeof import("./generated/components").getProject;
|
|
128
|
+
'PATCH /v9/projects/{idOrName}': typeof import("./generated/components").updateProject;
|
|
129
|
+
'DELETE /v9/projects/{idOrName}': typeof import("./generated/components").deleteProject;
|
|
130
|
+
'POST /v9/projects/{idOrName}/custom-environments': typeof import("./generated/components").createCustomEnvironment;
|
|
131
|
+
'GET /v9/projects/{idOrName}/custom-environments': typeof import("./generated/components").listCustomEnvironments;
|
|
132
|
+
'GET /v9/projects/{idOrName}/custom-environments/{environmentSlugOrId}': typeof import("./generated/components").getCustomEnvironment;
|
|
133
|
+
'PATCH /v9/projects/{idOrName}/custom-environments/{environmentSlugOrId}': typeof import("./generated/components").updateCustomEnvironment;
|
|
134
|
+
'DELETE /v9/projects/{idOrName}/custom-environments/{environmentSlugOrId}': typeof import("./generated/components").removeCustomEnvironment;
|
|
135
|
+
'GET /v9/projects/{idOrName}/domains': typeof import("./generated/components").getProjectDomains;
|
|
136
|
+
'GET /v9/projects/{idOrName}/domains/{domain}': typeof import("./generated/components").getProjectDomain;
|
|
137
|
+
'PATCH /v9/projects/{idOrName}/domains/{domain}': typeof import("./generated/components").updateProjectDomain;
|
|
138
|
+
'DELETE /v9/projects/{idOrName}/domains/{domain}': typeof import("./generated/components").removeProjectDomain;
|
|
139
|
+
'POST /v10/projects/{idOrName}/domains': typeof import("./generated/components").addProjectDomain;
|
|
140
|
+
'POST /v1/projects/{idOrName}/domains/{domain}/move': typeof import("./generated/components").moveProjectDomain;
|
|
141
|
+
'POST /v9/projects/{idOrName}/domains/{domain}/verify': typeof import("./generated/components").verifyProjectDomain;
|
|
142
|
+
'GET /v10/projects/{idOrName}/env': typeof import("./generated/components").filterProjectEnvs;
|
|
143
|
+
'POST /v10/projects/{idOrName}/env': typeof import("./generated/components").createProjectEnv;
|
|
144
|
+
'GET /v1/projects/{idOrName}/env/{id}': typeof import("./generated/components").getProjectEnv;
|
|
145
|
+
'DELETE /v9/projects/{idOrName}/env/{id}': typeof import("./generated/components").removeProjectEnv;
|
|
146
|
+
'PATCH /v9/projects/{idOrName}/env/{id}': typeof import("./generated/components").editProjectEnv;
|
|
147
|
+
'GET /v1/projects/{idOrName}/rolling-release/billing': typeof import("./generated/components").getRollingReleaseBillingStatus;
|
|
148
|
+
'GET /v1/projects/{idOrName}/rolling-release/config': typeof import("./generated/components").getRollingReleaseConfig;
|
|
149
|
+
'DELETE /v1/projects/{idOrName}/rolling-release/config': typeof import("./generated/components").deleteRollingReleaseConfig;
|
|
150
|
+
'PATCH /v1/projects/{idOrName}/rolling-release/config': typeof import("./generated/components").updateRollingReleaseConfig;
|
|
151
|
+
'GET /v1/projects/{idOrName}/rolling-release': typeof import("./generated/components").getRollingRelease;
|
|
152
|
+
'POST /v1/projects/{idOrName}/rolling-release/approve-stage': typeof import("./generated/components").approveRollingReleaseStage;
|
|
153
|
+
'POST /v1/projects/{idOrName}/rolling-release/complete': typeof import("./generated/components").completeRollingRelease;
|
|
154
|
+
'POST /projects/{idOrName}/transfer-request': typeof import("./generated/components").createProjectTransferRequest;
|
|
155
|
+
'PUT /projects/transfer-request/{code}': typeof import("./generated/components").acceptProjectTransferRequest;
|
|
156
|
+
'PATCH /v1/projects/{idOrName}/protection-bypass': typeof import("./generated/components").updateProjectProtectionBypass;
|
|
157
|
+
'POST /v10/projects/{projectId}/promote/{deploymentId}': typeof import("./generated/components").requestPromote;
|
|
158
|
+
'GET /v1/projects/{projectId}/promote/aliases': typeof import("./generated/components").listPromoteAliases;
|
|
159
|
+
'POST /v1/projects/{projectId}/pause': typeof import("./generated/components").pauseProject;
|
|
160
|
+
'POST /v1/projects/{projectId}/unpause': typeof import("./generated/components").unpauseProject;
|
|
161
|
+
'POST /v1/security/attack-mode': typeof import("./generated/components").updateAttackChallengeMode;
|
|
162
|
+
'PUT /v1/security/firewall/config': typeof import("./generated/components").putFirewallConfig;
|
|
163
|
+
'PATCH /v1/security/firewall/config': typeof import("./generated/components").updateFirewallConfig;
|
|
164
|
+
'GET /v1/security/firewall/config/{configVersion}': typeof import("./generated/components").getFirewallConfig;
|
|
165
|
+
'GET /v1/security/firewall/attack-status': typeof import("./generated/components").getActiveAttackStatus;
|
|
166
|
+
'GET /v1/security/firewall/bypass': typeof import("./generated/components").getBypassIp;
|
|
167
|
+
'POST /v1/security/firewall/bypass': typeof import("./generated/components").addBypassIp;
|
|
168
|
+
'DELETE /v1/security/firewall/bypass': typeof import("./generated/components").removeBypassIp;
|
|
169
|
+
'GET /v3/teams/{teamId}/members': typeof import("./generated/components").getTeamMembers;
|
|
170
|
+
'POST /v1/teams/{teamId}/members': typeof import("./generated/components").inviteUserToTeam;
|
|
171
|
+
'POST /v1/teams/{teamId}/request': typeof import("./generated/components").requestAccessToTeam;
|
|
172
|
+
'GET /v1/teams/{teamId}/request/{userId}': typeof import("./generated/components").getTeamAccessRequest;
|
|
173
|
+
'POST /v1/teams/{teamId}/members/teams/join': typeof import("./generated/components").joinTeam;
|
|
174
|
+
'PATCH /v1/teams/{teamId}/members/{uid}': typeof import("./generated/components").updateTeamMember;
|
|
175
|
+
'DELETE /v1/teams/{teamId}/members/{uid}': typeof import("./generated/components").removeTeamMember;
|
|
176
|
+
'GET /v2/teams/{teamId}': typeof import("./generated/components").getTeam;
|
|
177
|
+
'PATCH /v2/teams/{teamId}': typeof import("./generated/components").patchTeam;
|
|
178
|
+
'GET /v2/teams': typeof import("./generated/components").getTeams;
|
|
179
|
+
'POST /v1/teams': typeof import("./generated/components").createTeam;
|
|
180
|
+
'DELETE /v1/teams/{teamId}': typeof import("./generated/components").deleteTeam;
|
|
181
|
+
'DELETE /v1/teams/{teamId}/invites/{inviteId}': typeof import("./generated/components").deleteTeamInviteCode;
|
|
182
|
+
'POST /v2/files': typeof import("./generated/components").uploadFile;
|
|
183
|
+
'GET /v5/user/tokens': typeof import("./generated/components").listAuthTokens;
|
|
184
|
+
'POST /v3/user/tokens': typeof import("./generated/components").createAuthToken;
|
|
185
|
+
'GET /v5/user/tokens/{tokenId}': typeof import("./generated/components").getAuthToken;
|
|
186
|
+
'DELETE /v3/user/tokens/{tokenId}': typeof import("./generated/components").deleteAuthToken;
|
|
187
|
+
'GET /v2/user': typeof import("./generated/components").getAuthUser;
|
|
188
|
+
'DELETE /v1/user': typeof import("./generated/components").requestDelete;
|
|
189
|
+
'POST /v1/webhooks': typeof import("./generated/components").createWebhook;
|
|
190
|
+
'GET /v1/webhooks': typeof import("./generated/components").getWebhooks;
|
|
191
|
+
'GET /v1/webhooks/{id}': typeof import("./generated/components").getWebhook;
|
|
192
|
+
'DELETE /v1/webhooks/{id}': typeof import("./generated/components").deleteWebhook;
|
|
193
|
+
'GET /v2/deployments/{id}/aliases': typeof import("./generated/components").listDeploymentAliases;
|
|
194
|
+
'POST /v2/deployments/{id}/aliases': typeof import("./generated/components").assignAlias;
|
|
195
|
+
'GET /v4/aliases': typeof import("./generated/components").listAliases;
|
|
196
|
+
'GET /v4/aliases/{idOrAlias}': typeof import("./generated/components").getAlias;
|
|
197
|
+
'DELETE /v2/aliases/{aliasId}': typeof import("./generated/components").deleteAlias;
|
|
198
|
+
'PATCH /aliases/{id}/protection-bypass': typeof import("./generated/components").patchUrlProtectionBypass;
|
|
199
|
+
'GET /certs': typeof import("./generated/components").listCerts;
|
|
200
|
+
'GET /v8/certs/{id}': typeof import("./generated/components").getCertById;
|
|
201
|
+
'DELETE /v8/certs/{id}': typeof import("./generated/components").removeCert;
|
|
202
|
+
'POST /v8/certs': typeof import("./generated/components").issueCert;
|
|
203
|
+
'PUT /v8/certs': typeof import("./generated/components").uploadCert;
|
|
204
|
+
'GET /v6/deployments/{id}/files': typeof import("./generated/components").listDeploymentFiles;
|
|
205
|
+
'GET /v8/deployments/{id}/files/{fileId}': typeof import("./generated/components").getDeploymentFileContents;
|
|
206
|
+
'GET /v6/deployments': typeof import("./generated/components").getDeployments;
|
|
207
|
+
'DELETE /v13/deployments/{id}': typeof import("./generated/components").deleteDeployment;
|
|
208
|
+
'GET /v3/secrets': typeof import("./generated/components").getSecrets;
|
|
209
|
+
'POST /v2/secrets/{name}': typeof import("./generated/components").createSecret;
|
|
210
|
+
'PATCH /v2/secrets/{name}': typeof import("./generated/components").renameSecret;
|
|
211
|
+
'GET /v3/secrets/{idOrName}': typeof import("./generated/components").getSecret;
|
|
212
|
+
'DELETE /v2/secrets/{idOrName}': typeof import("./generated/components").deleteSecret;
|
|
213
|
+
}[Endpoint]>>;
|
|
214
|
+
}
|
|
215
|
+
type AccessTokenOptions = {
|
|
216
|
+
redirectUri: string;
|
|
217
|
+
code: string;
|
|
218
|
+
clientId: string;
|
|
219
|
+
clientSecret: string;
|
|
220
|
+
};
|
|
221
|
+
type AccessTokenResult = {
|
|
222
|
+
accessToken: string;
|
|
223
|
+
tokenType: string;
|
|
224
|
+
installationId: string;
|
|
225
|
+
userId: string;
|
|
226
|
+
teamId: string | null;
|
|
227
|
+
};
|
|
228
|
+
export {};
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { type operationsByPath, operationsByTag, type tagDictionary } from "./generated/components.js";
|
|
2
|
+
import { type FetchImpl } from "./utils/fetch.js";
|
|
3
|
+
import { type FetcherConfig } from "./utils/fetcher.js";
|
|
4
|
+
import type { RequiredKeys } from "./utils/types.js";
|
|
5
|
+
export interface VercelApiOptions {
|
|
6
|
+
token: string | null;
|
|
7
|
+
fetch?: FetchImpl;
|
|
8
|
+
}
|
|
9
|
+
export type ApiClient = {
|
|
10
|
+
[Tag in keyof typeof operationsByTag]: {
|
|
11
|
+
[Method in keyof (typeof operationsByTag)[Tag]]: (typeof operationsByTag)[Tag][Method] extends infer Operation extends (...args: any) => any ? Omit<Parameters<Operation>[0], keyof FetcherConfig> extends infer Params ? RequiredKeys<Params> extends never ? (params?: Params) => ReturnType<Operation> : (params: Params) => ReturnType<Operation> : never : never;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
15
|
+
export type ApiOperation = {
|
|
16
|
+
[Tag in keyof typeof operationsByTag]: keyof (typeof operationsByTag)[Tag] extends string ? `${Tag}.${keyof (typeof operationsByTag)[Tag]}` : never;
|
|
17
|
+
}[keyof typeof operationsByTag];
|
|
18
|
+
export type ApiOperationByMethod<Method extends HttpMethod> = {
|
|
19
|
+
[Tag in keyof typeof tagDictionary]: {
|
|
20
|
+
[TagMethod in keyof (typeof tagDictionary)[Tag]]: TagMethod extends Method ? (typeof tagDictionary)[Tag][TagMethod] extends readonly any[] ? `${Tag}.${(typeof tagDictionary)[Tag][TagMethod][number]}` : never : never;
|
|
21
|
+
}[keyof (typeof tagDictionary)[Tag]];
|
|
22
|
+
}[keyof typeof tagDictionary];
|
|
23
|
+
export type ApiOperationParams<T extends ApiOperation> = T extends `${infer Tag}.${infer Operation}` ? Tag extends keyof typeof operationsByTag ? Operation extends keyof (typeof operationsByTag)[Tag] ? (typeof operationsByTag)[Tag][Operation] extends infer Operation extends (...args: any) => any ? Omit<Parameters<Operation>[0], keyof FetcherConfig> : never : never : never : never;
|
|
24
|
+
export type ApiOperationResult<T extends ApiOperation> = T extends `${infer Tag}.${infer Operation}` ? Tag extends keyof typeof operationsByTag ? Operation extends keyof (typeof operationsByTag)[Tag] ? (typeof operationsByTag)[Tag][Operation] extends (...args: any) => any ? Awaited<ReturnType<(typeof operationsByTag)[Tag][Operation]>> : never : never : never : never;
|
|
25
|
+
type RequestEndpointParams<T extends keyof typeof operationsByPath> = Omit<Parameters<(typeof operationsByPath)[T]>[0], keyof FetcherConfig>;
|
|
26
|
+
export declare class XataApi {
|
|
27
|
+
token: string | null;
|
|
28
|
+
fetch: FetchImpl;
|
|
29
|
+
constructor(options: VercelApiOptions);
|
|
30
|
+
get api(): ApiClient;
|
|
31
|
+
get auth(): {
|
|
32
|
+
accessToken: ({ code, redirectUri, clientId, clientSecret }: AccessTokenOptions) => Promise<AccessTokenResult>;
|
|
33
|
+
};
|
|
34
|
+
request<Endpoint extends keyof typeof operationsByPath>(endpoint: Endpoint, params: RequestEndpointParams<Endpoint>): Promise<ReturnType<{
|
|
35
|
+
'GET /v1/access-groups/{idOrName}': typeof import("./generated/components").readAccessGroup;
|
|
36
|
+
'POST /v1/access-groups/{idOrName}': typeof import("./generated/components").updateAccessGroup;
|
|
37
|
+
'DELETE /v1/access-groups/{idOrName}': typeof import("./generated/components").deleteAccessGroup;
|
|
38
|
+
'GET /v1/access-groups/{idOrName}/members': typeof import("./generated/components").listAccessGroupMembers;
|
|
39
|
+
'GET /v1/access-groups': typeof import("./generated/components").listAccessGroups;
|
|
40
|
+
'POST /v1/access-groups': typeof import("./generated/components").createAccessGroup;
|
|
41
|
+
'GET /v1/access-groups/{idOrName}/projects': typeof import("./generated/components").listAccessGroupProjects;
|
|
42
|
+
'POST /v1/access-groups/{accessGroupIdOrName}/projects': typeof import("./generated/components").createAccessGroupProject;
|
|
43
|
+
'GET /v1/access-groups/{accessGroupIdOrName}/projects/{projectId}': typeof import("./generated/components").readAccessGroupProject;
|
|
44
|
+
'PATCH /v1/access-groups/{accessGroupIdOrName}/projects/{projectId}': typeof import("./generated/components").updateAccessGroupProject;
|
|
45
|
+
'DELETE /v1/access-groups/{accessGroupIdOrName}/projects/{projectId}': typeof import("./generated/components").deleteAccessGroupProject;
|
|
46
|
+
'POST /v8/artifacts/events': typeof import("./generated/components").recordEvents;
|
|
47
|
+
'GET /v8/artifacts/status': typeof import("./generated/components").status;
|
|
48
|
+
'PUT /v8/artifacts/{hash}': typeof import("./generated/components").uploadArtifact;
|
|
49
|
+
'GET /v8/artifacts/{hash}': typeof import("./generated/components").downloadArtifact;
|
|
50
|
+
'POST /v8/artifacts': typeof import("./generated/components").artifactQuery;
|
|
51
|
+
'POST /v1/deployments/{deploymentId}/checks': typeof import("./generated/components").createCheck;
|
|
52
|
+
'GET /v1/deployments/{deploymentId}/checks': typeof import("./generated/components").getAllChecks;
|
|
53
|
+
'GET /v1/deployments/{deploymentId}/checks/{checkId}': typeof import("./generated/components").getCheck;
|
|
54
|
+
'PATCH /v1/deployments/{deploymentId}/checks/{checkId}': typeof import("./generated/components").updateCheck;
|
|
55
|
+
'POST /v1/deployments/{deploymentId}/checks/{checkId}/rerequest': typeof import("./generated/components").rerequestCheck;
|
|
56
|
+
'DELETE /data-cache/purge-all': typeof import("./generated/components").purgeAllDataCache;
|
|
57
|
+
'PATCH /data-cache/billing-settings': typeof import("./generated/components").updateDataCacheBillingSettings;
|
|
58
|
+
'PATCH /v1/data-cache/projects/{projectId}': typeof import("./generated/components").updateProjectDataCache;
|
|
59
|
+
'GET /v3/deployments/{idOrUrl}/events': typeof import("./generated/components").getDeploymentEvents;
|
|
60
|
+
'PATCH /v1/deployments/{deploymentId}/integrations/{integrationConfigurationId}/resources/{resourceId}/actions/{action}': typeof import("./generated/components").updateIntegrationDeploymentAction;
|
|
61
|
+
'GET /v13/deployments/{idOrUrl}': typeof import("./generated/components").getDeployment;
|
|
62
|
+
'POST /v13/deployments': typeof import("./generated/components").createDeployment;
|
|
63
|
+
'PATCH /v12/deployments/{id}/cancel': typeof import("./generated/components").cancelDeployment;
|
|
64
|
+
'POST /v5/domains/buy': typeof import("./generated/components").buyDomain;
|
|
65
|
+
'GET /v4/domains/price': typeof import("./generated/components").checkDomainPrice;
|
|
66
|
+
'GET /v4/domains/status': typeof import("./generated/components").checkDomainStatus;
|
|
67
|
+
'GET /v4/domains/{domain}/records': typeof import("./generated/components").getRecords;
|
|
68
|
+
'POST /v2/domains/{domain}/records': typeof import("./generated/components").createRecord;
|
|
69
|
+
'PATCH /v1/domains/records/{recordId}': typeof import("./generated/components").updateRecord;
|
|
70
|
+
'DELETE /v2/domains/{domain}/records/{recordId}': typeof import("./generated/components").removeRecord;
|
|
71
|
+
'GET /v1/domains/{domain}/registry': typeof import("./generated/components").getDomainTransfer;
|
|
72
|
+
'GET /v6/domains/{domain}/config': typeof import("./generated/components").getDomainConfig;
|
|
73
|
+
'GET /v5/domains/{domain}': typeof import("./generated/components").getDomain;
|
|
74
|
+
'GET /v5/domains': typeof import("./generated/components").getDomains;
|
|
75
|
+
'POST /v7/domains': typeof import("./generated/components").createOrTransferDomain;
|
|
76
|
+
'PATCH /v3/domains/{domain}': typeof import("./generated/components").patchDomain;
|
|
77
|
+
'DELETE /v6/domains/{domain}': typeof import("./generated/components").deleteDomain;
|
|
78
|
+
'GET /v1/edge-config': typeof import("./generated/components").getEdgeConfigs;
|
|
79
|
+
'POST /v1/edge-config': typeof import("./generated/components").createEdgeConfig;
|
|
80
|
+
'GET /v1/edge-config/{edgeConfigId}': typeof import("./generated/components").getEdgeConfig;
|
|
81
|
+
'PUT /v1/edge-config/{edgeConfigId}': typeof import("./generated/components").updateEdgeConfig;
|
|
82
|
+
'DELETE /v1/edge-config/{edgeConfigId}': typeof import("./generated/components").deleteEdgeConfig;
|
|
83
|
+
'GET /v1/edge-config/{edgeConfigId}/items': typeof import("./generated/components").getEdgeConfigItems;
|
|
84
|
+
'PATCH /v1/edge-config/{edgeConfigId}/items': typeof import("./generated/components").patchEdgeConfigItems;
|
|
85
|
+
'GET /v1/edge-config/{edgeConfigId}/schema': typeof import("./generated/components").getEdgeConfigSchema;
|
|
86
|
+
'POST /v1/edge-config/{edgeConfigId}/schema': typeof import("./generated/components").patchEdgeConfigSchema;
|
|
87
|
+
'DELETE /v1/edge-config/{edgeConfigId}/schema': typeof import("./generated/components").deleteEdgeConfigSchema;
|
|
88
|
+
'GET /v1/edge-config/{edgeConfigId}/item/{edgeConfigItemKey}': typeof import("./generated/components").getEdgeConfigItem;
|
|
89
|
+
'GET /v1/edge-config/{edgeConfigId}/tokens': typeof import("./generated/components").getEdgeConfigTokens;
|
|
90
|
+
'DELETE /v1/edge-config/{edgeConfigId}/tokens': typeof import("./generated/components").deleteEdgeConfigTokens;
|
|
91
|
+
'GET /v1/edge-config/{edgeConfigId}/token/{token}': typeof import("./generated/components").getEdgeConfigToken;
|
|
92
|
+
'POST /v1/edge-config/{edgeConfigId}/token': typeof import("./generated/components").createEdgeConfigToken;
|
|
93
|
+
'GET /v1/edge-config/{edgeConfigId}/backups/{edgeConfigBackupVersionId}': typeof import("./generated/components").getEdgeConfigBackup;
|
|
94
|
+
'GET /v1/edge-config/{edgeConfigId}/backups': typeof import("./generated/components").getEdgeConfigBackups;
|
|
95
|
+
'GET /v3/events': typeof import("./generated/components").listUserEvents;
|
|
96
|
+
'GET /v1/installations/{integrationConfigurationId}/account': typeof import("./generated/components").getAccountInfo;
|
|
97
|
+
'GET /v1/installations/{integrationConfigurationId}/member/{memberId}': typeof import("./generated/components").getMember;
|
|
98
|
+
'POST /v1/installations/{integrationConfigurationId}/events': typeof import("./generated/components").createEvent;
|
|
99
|
+
'GET /v1/installations/{integrationConfigurationId}/resources': typeof import("./generated/components").getIntegrationResources;
|
|
100
|
+
'GET /v1/installations/{integrationConfigurationId}/resources/{resourceId}': typeof import("./generated/components").getIntegrationResource;
|
|
101
|
+
'DELETE /v1/installations/{integrationConfigurationId}/resources/{resourceId}': typeof import("./generated/components").deleteIntegrationResource;
|
|
102
|
+
'PUT /v1/installations/{integrationConfigurationId}/resources/{resourceId}': typeof import("./generated/components").importResource;
|
|
103
|
+
'POST /v1/installations/{integrationConfigurationId}/billing': typeof import("./generated/components").submitBillingData;
|
|
104
|
+
'POST /v1/installations/{integrationConfigurationId}/billing/invoices': typeof import("./generated/components").submitInvoice;
|
|
105
|
+
'GET /v1/installations/{integrationConfigurationId}/billing/invoices/{invoiceId}': typeof import("./generated/components").getInvoice;
|
|
106
|
+
'POST /v1/installations/{integrationConfigurationId}/billing/invoices/{invoiceId}/actions': typeof import("./generated/components").updateInvoice;
|
|
107
|
+
'POST /v1/installations/{integrationConfigurationId}/billing/balance': typeof import("./generated/components").submitPrepaymentBalances;
|
|
108
|
+
'PUT /v1/installations/{integrationConfigurationId}/products/{integrationProductIdOrSlug}/resources/{resourceId}/secrets': typeof import("./generated/components").updateResourceSecrets;
|
|
109
|
+
'PUT /v1/installations/{integrationConfigurationId}/resources/{resourceId}/secrets': typeof import("./generated/components").updateResourceSecretsById;
|
|
110
|
+
'GET /v1/integrations/configurations': typeof import("./generated/components").getConfigurations;
|
|
111
|
+
'GET /v1/integrations/configuration/{id}': typeof import("./generated/components").getConfiguration;
|
|
112
|
+
'DELETE /v1/integrations/configuration/{id}': typeof import("./generated/components").deleteConfiguration;
|
|
113
|
+
'POST /v1/integrations/sso/token': typeof import("./generated/components").exchangeSsoToken;
|
|
114
|
+
'GET /v2/integrations/log-drains': typeof import("./generated/components").getIntegrationLogDrains;
|
|
115
|
+
'POST /v2/integrations/log-drains': typeof import("./generated/components").createLogDrain;
|
|
116
|
+
'DELETE /v1/integrations/log-drains/{id}': typeof import("./generated/components").deleteIntegrationLogDrain;
|
|
117
|
+
'GET /v1/projects/{projectId}/deployments/{deploymentId}/runtime-logs': typeof import("./generated/components").getRuntimeLogs;
|
|
118
|
+
'POST /v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/items': typeof import("./generated/components").createExperimentationItem;
|
|
119
|
+
'PATCH /v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/items/{itemId}': typeof import("./generated/components").updateExperimentationItem;
|
|
120
|
+
'DELETE /v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/items/{itemId}': typeof import("./generated/components").deleteExperimentationItem;
|
|
121
|
+
'PUT /v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/edge-config': typeof import("./generated/components").updateExperimentationEdgeConfig;
|
|
122
|
+
'GET /v1/projects/{idOrName}/members': typeof import("./generated/components").getProjectMembers;
|
|
123
|
+
'POST /v1/projects/{idOrName}/members': typeof import("./generated/components").addProjectMember;
|
|
124
|
+
'DELETE /v1/projects/{idOrName}/members/{uid}': typeof import("./generated/components").removeProjectMember;
|
|
125
|
+
'GET /v10/projects': typeof import("./generated/components").getProjects;
|
|
126
|
+
'POST /v11/projects': typeof import("./generated/components").createProject;
|
|
127
|
+
'GET /v9/projects/{idOrName}': typeof import("./generated/components").getProject;
|
|
128
|
+
'PATCH /v9/projects/{idOrName}': typeof import("./generated/components").updateProject;
|
|
129
|
+
'DELETE /v9/projects/{idOrName}': typeof import("./generated/components").deleteProject;
|
|
130
|
+
'POST /v9/projects/{idOrName}/custom-environments': typeof import("./generated/components").createCustomEnvironment;
|
|
131
|
+
'GET /v9/projects/{idOrName}/custom-environments': typeof import("./generated/components").listCustomEnvironments;
|
|
132
|
+
'GET /v9/projects/{idOrName}/custom-environments/{environmentSlugOrId}': typeof import("./generated/components").getCustomEnvironment;
|
|
133
|
+
'PATCH /v9/projects/{idOrName}/custom-environments/{environmentSlugOrId}': typeof import("./generated/components").updateCustomEnvironment;
|
|
134
|
+
'DELETE /v9/projects/{idOrName}/custom-environments/{environmentSlugOrId}': typeof import("./generated/components").removeCustomEnvironment;
|
|
135
|
+
'GET /v9/projects/{idOrName}/domains': typeof import("./generated/components").getProjectDomains;
|
|
136
|
+
'GET /v9/projects/{idOrName}/domains/{domain}': typeof import("./generated/components").getProjectDomain;
|
|
137
|
+
'PATCH /v9/projects/{idOrName}/domains/{domain}': typeof import("./generated/components").updateProjectDomain;
|
|
138
|
+
'DELETE /v9/projects/{idOrName}/domains/{domain}': typeof import("./generated/components").removeProjectDomain;
|
|
139
|
+
'POST /v10/projects/{idOrName}/domains': typeof import("./generated/components").addProjectDomain;
|
|
140
|
+
'POST /v1/projects/{idOrName}/domains/{domain}/move': typeof import("./generated/components").moveProjectDomain;
|
|
141
|
+
'POST /v9/projects/{idOrName}/domains/{domain}/verify': typeof import("./generated/components").verifyProjectDomain;
|
|
142
|
+
'GET /v10/projects/{idOrName}/env': typeof import("./generated/components").filterProjectEnvs;
|
|
143
|
+
'POST /v10/projects/{idOrName}/env': typeof import("./generated/components").createProjectEnv;
|
|
144
|
+
'GET /v1/projects/{idOrName}/env/{id}': typeof import("./generated/components").getProjectEnv;
|
|
145
|
+
'DELETE /v9/projects/{idOrName}/env/{id}': typeof import("./generated/components").removeProjectEnv;
|
|
146
|
+
'PATCH /v9/projects/{idOrName}/env/{id}': typeof import("./generated/components").editProjectEnv;
|
|
147
|
+
'GET /v1/projects/{idOrName}/rolling-release/billing': typeof import("./generated/components").getRollingReleaseBillingStatus;
|
|
148
|
+
'GET /v1/projects/{idOrName}/rolling-release/config': typeof import("./generated/components").getRollingReleaseConfig;
|
|
149
|
+
'DELETE /v1/projects/{idOrName}/rolling-release/config': typeof import("./generated/components").deleteRollingReleaseConfig;
|
|
150
|
+
'PATCH /v1/projects/{idOrName}/rolling-release/config': typeof import("./generated/components").updateRollingReleaseConfig;
|
|
151
|
+
'GET /v1/projects/{idOrName}/rolling-release': typeof import("./generated/components").getRollingRelease;
|
|
152
|
+
'POST /v1/projects/{idOrName}/rolling-release/approve-stage': typeof import("./generated/components").approveRollingReleaseStage;
|
|
153
|
+
'POST /v1/projects/{idOrName}/rolling-release/complete': typeof import("./generated/components").completeRollingRelease;
|
|
154
|
+
'POST /projects/{idOrName}/transfer-request': typeof import("./generated/components").createProjectTransferRequest;
|
|
155
|
+
'PUT /projects/transfer-request/{code}': typeof import("./generated/components").acceptProjectTransferRequest;
|
|
156
|
+
'PATCH /v1/projects/{idOrName}/protection-bypass': typeof import("./generated/components").updateProjectProtectionBypass;
|
|
157
|
+
'POST /v10/projects/{projectId}/promote/{deploymentId}': typeof import("./generated/components").requestPromote;
|
|
158
|
+
'GET /v1/projects/{projectId}/promote/aliases': typeof import("./generated/components").listPromoteAliases;
|
|
159
|
+
'POST /v1/projects/{projectId}/pause': typeof import("./generated/components").pauseProject;
|
|
160
|
+
'POST /v1/projects/{projectId}/unpause': typeof import("./generated/components").unpauseProject;
|
|
161
|
+
'POST /v1/security/attack-mode': typeof import("./generated/components").updateAttackChallengeMode;
|
|
162
|
+
'PUT /v1/security/firewall/config': typeof import("./generated/components").putFirewallConfig;
|
|
163
|
+
'PATCH /v1/security/firewall/config': typeof import("./generated/components").updateFirewallConfig;
|
|
164
|
+
'GET /v1/security/firewall/config/{configVersion}': typeof import("./generated/components").getFirewallConfig;
|
|
165
|
+
'GET /v1/security/firewall/attack-status': typeof import("./generated/components").getActiveAttackStatus;
|
|
166
|
+
'GET /v1/security/firewall/bypass': typeof import("./generated/components").getBypassIp;
|
|
167
|
+
'POST /v1/security/firewall/bypass': typeof import("./generated/components").addBypassIp;
|
|
168
|
+
'DELETE /v1/security/firewall/bypass': typeof import("./generated/components").removeBypassIp;
|
|
169
|
+
'GET /v3/teams/{teamId}/members': typeof import("./generated/components").getTeamMembers;
|
|
170
|
+
'POST /v1/teams/{teamId}/members': typeof import("./generated/components").inviteUserToTeam;
|
|
171
|
+
'POST /v1/teams/{teamId}/request': typeof import("./generated/components").requestAccessToTeam;
|
|
172
|
+
'GET /v1/teams/{teamId}/request/{userId}': typeof import("./generated/components").getTeamAccessRequest;
|
|
173
|
+
'POST /v1/teams/{teamId}/members/teams/join': typeof import("./generated/components").joinTeam;
|
|
174
|
+
'PATCH /v1/teams/{teamId}/members/{uid}': typeof import("./generated/components").updateTeamMember;
|
|
175
|
+
'DELETE /v1/teams/{teamId}/members/{uid}': typeof import("./generated/components").removeTeamMember;
|
|
176
|
+
'GET /v2/teams/{teamId}': typeof import("./generated/components").getTeam;
|
|
177
|
+
'PATCH /v2/teams/{teamId}': typeof import("./generated/components").patchTeam;
|
|
178
|
+
'GET /v2/teams': typeof import("./generated/components").getTeams;
|
|
179
|
+
'POST /v1/teams': typeof import("./generated/components").createTeam;
|
|
180
|
+
'DELETE /v1/teams/{teamId}': typeof import("./generated/components").deleteTeam;
|
|
181
|
+
'DELETE /v1/teams/{teamId}/invites/{inviteId}': typeof import("./generated/components").deleteTeamInviteCode;
|
|
182
|
+
'POST /v2/files': typeof import("./generated/components").uploadFile;
|
|
183
|
+
'GET /v5/user/tokens': typeof import("./generated/components").listAuthTokens;
|
|
184
|
+
'POST /v3/user/tokens': typeof import("./generated/components").createAuthToken;
|
|
185
|
+
'GET /v5/user/tokens/{tokenId}': typeof import("./generated/components").getAuthToken;
|
|
186
|
+
'DELETE /v3/user/tokens/{tokenId}': typeof import("./generated/components").deleteAuthToken;
|
|
187
|
+
'GET /v2/user': typeof import("./generated/components").getAuthUser;
|
|
188
|
+
'DELETE /v1/user': typeof import("./generated/components").requestDelete;
|
|
189
|
+
'POST /v1/webhooks': typeof import("./generated/components").createWebhook;
|
|
190
|
+
'GET /v1/webhooks': typeof import("./generated/components").getWebhooks;
|
|
191
|
+
'GET /v1/webhooks/{id}': typeof import("./generated/components").getWebhook;
|
|
192
|
+
'DELETE /v1/webhooks/{id}': typeof import("./generated/components").deleteWebhook;
|
|
193
|
+
'GET /v2/deployments/{id}/aliases': typeof import("./generated/components").listDeploymentAliases;
|
|
194
|
+
'POST /v2/deployments/{id}/aliases': typeof import("./generated/components").assignAlias;
|
|
195
|
+
'GET /v4/aliases': typeof import("./generated/components").listAliases;
|
|
196
|
+
'GET /v4/aliases/{idOrAlias}': typeof import("./generated/components").getAlias;
|
|
197
|
+
'DELETE /v2/aliases/{aliasId}': typeof import("./generated/components").deleteAlias;
|
|
198
|
+
'PATCH /aliases/{id}/protection-bypass': typeof import("./generated/components").patchUrlProtectionBypass;
|
|
199
|
+
'GET /certs': typeof import("./generated/components").listCerts;
|
|
200
|
+
'GET /v8/certs/{id}': typeof import("./generated/components").getCertById;
|
|
201
|
+
'DELETE /v8/certs/{id}': typeof import("./generated/components").removeCert;
|
|
202
|
+
'POST /v8/certs': typeof import("./generated/components").issueCert;
|
|
203
|
+
'PUT /v8/certs': typeof import("./generated/components").uploadCert;
|
|
204
|
+
'GET /v6/deployments/{id}/files': typeof import("./generated/components").listDeploymentFiles;
|
|
205
|
+
'GET /v8/deployments/{id}/files/{fileId}': typeof import("./generated/components").getDeploymentFileContents;
|
|
206
|
+
'GET /v6/deployments': typeof import("./generated/components").getDeployments;
|
|
207
|
+
'DELETE /v13/deployments/{id}': typeof import("./generated/components").deleteDeployment;
|
|
208
|
+
'GET /v3/secrets': typeof import("./generated/components").getSecrets;
|
|
209
|
+
'POST /v2/secrets/{name}': typeof import("./generated/components").createSecret;
|
|
210
|
+
'PATCH /v2/secrets/{name}': typeof import("./generated/components").renameSecret;
|
|
211
|
+
'GET /v3/secrets/{idOrName}': typeof import("./generated/components").getSecret;
|
|
212
|
+
'DELETE /v2/secrets/{idOrName}': typeof import("./generated/components").deleteSecret;
|
|
213
|
+
}[Endpoint]>>;
|
|
214
|
+
}
|
|
215
|
+
type AccessTokenOptions = {
|
|
216
|
+
redirectUri: string;
|
|
217
|
+
code: string;
|
|
218
|
+
clientId: string;
|
|
219
|
+
clientSecret: string;
|
|
220
|
+
};
|
|
221
|
+
type AccessTokenResult = {
|
|
222
|
+
accessToken: string;
|
|
223
|
+
tokenType: string;
|
|
224
|
+
installationId: string;
|
|
225
|
+
userId: string;
|
|
226
|
+
teamId: string | null;
|
|
227
|
+
};
|
|
228
|
+
export {};
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.XataApi = void 0;
|
|
7
|
+
const components_1 = require("./generated/components.js");
|
|
8
|
+
const fetch_1 = require("./utils/fetch.js");
|
|
9
|
+
const fetcher_1 = __importDefault(require("./utils/fetcher.js"));
|
|
10
|
+
class XataApi {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
this.token = options.token;
|
|
13
|
+
this.fetch = options.fetch || fetch;
|
|
14
|
+
if (!this.fetch)
|
|
15
|
+
throw new Error('Fetch is required');
|
|
16
|
+
}
|
|
17
|
+
get api() {
|
|
18
|
+
const getConfig = async () => ({
|
|
19
|
+
token: this.token,
|
|
20
|
+
fetchImpl: this.fetch
|
|
21
|
+
});
|
|
22
|
+
return new Proxy({}, {
|
|
23
|
+
get: (_target, namespace) => {
|
|
24
|
+
if (components_1.operationsByTag[namespace] === undefined) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
return new Proxy({}, {
|
|
28
|
+
get: (_target, operation) => {
|
|
29
|
+
if (components_1.operationsByTag[namespace][operation] === undefined) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const method = components_1.operationsByTag[namespace][operation];
|
|
33
|
+
return async (params) => {
|
|
34
|
+
return await method({ ...params, config: await getConfig() });
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
get auth() {
|
|
42
|
+
return {
|
|
43
|
+
accessToken: async ({ code, redirectUri, clientId, clientSecret }) => {
|
|
44
|
+
const result = await (0, fetcher_1.default)({
|
|
45
|
+
method: 'POST',
|
|
46
|
+
url: `/v2/oauth/access_token`,
|
|
47
|
+
token: null,
|
|
48
|
+
fetchImpl: this.fetch,
|
|
49
|
+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
50
|
+
body: (0, fetch_1.formEncoded)({ code, redirect_uri: redirectUri, client_id: clientId, client_secret: clientSecret })
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
accessToken: result.access_token,
|
|
54
|
+
tokenType: result.token_type,
|
|
55
|
+
installationId: result.installation_id,
|
|
56
|
+
userId: result.user_id,
|
|
57
|
+
teamId: result.team_id
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
async request(endpoint, params) {
|
|
63
|
+
const [method = '', url = ''] = endpoint.split(' ');
|
|
64
|
+
const extraParams = (params || {});
|
|
65
|
+
const result = await (0, fetcher_1.default)({
|
|
66
|
+
...extraParams,
|
|
67
|
+
method,
|
|
68
|
+
url,
|
|
69
|
+
token: this.token,
|
|
70
|
+
fetchImpl: this.fetch
|
|
71
|
+
});
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.XataApi = XataApi;
|