vercel-api-js 0.1.4 → 0.1.6
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/.turbo/turbo-build.log +9 -3
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +19 -2
- package/dist/index.d.ts +14 -5
- package/dist/index.mjs +19 -2
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
> vercel-api-js@0.1.
|
|
2
|
+
> vercel-api-js@0.1.6 build /home/runner/work/openapi-clients/openapi-clients/packages/vercel-api-js
|
|
3
3
|
> rimraf dist && rollup -c
|
|
4
4
|
|
|
5
5
|
[36m
|
|
6
6
|
[1m./src/index.ts[22m → [1mdist/index.cjs, dist/index.mjs[22m...[39m
|
|
7
|
-
[
|
|
7
|
+
[1m[33m(!) Plugin typescript: @rollup/plugin-typescript TS6133: 'key' is declared but its value is never read.[39m[22m
|
|
8
|
+
[1mopenapi-codegen.config.ts: (106:67)[22m
|
|
9
|
+
[90m
|
|
10
|
+
[7m106[0m const updatedOpenAPIDocument = JSON.stringify(openAPIDocument, (key, value) => {
|
|
11
|
+
[7m [0m [91m ~~~[0m
|
|
12
|
+
[39m
|
|
13
|
+
[32mcreated [1mdist/index.cjs, dist/index.mjs[22m in [1m4.3s[22m[39m
|
|
8
14
|
[36m
|
|
9
15
|
[1m./src/index.ts[22m → [1mdist/index.d.ts[22m...[39m
|
|
10
|
-
[32mcreated [1mdist/index.d.ts[22m in [1m4.
|
|
16
|
+
[32mcreated [1mdist/index.d.ts[22m in [1m4.7s[22m[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -922,6 +922,12 @@ const operationsByTag = {
|
|
|
922
922
|
}
|
|
923
923
|
};
|
|
924
924
|
|
|
925
|
+
function formEncoded(data) {
|
|
926
|
+
return Object.entries(data)
|
|
927
|
+
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
|
928
|
+
.join('&');
|
|
929
|
+
}
|
|
930
|
+
|
|
925
931
|
var _VercelApi_token, _VercelApi_fetch;
|
|
926
932
|
class VercelApi {
|
|
927
933
|
constructor(options) {
|
|
@@ -948,14 +954,25 @@ class VercelApi {
|
|
|
948
954
|
return undefined;
|
|
949
955
|
}
|
|
950
956
|
const method = operationsByTag[namespace][operation];
|
|
951
|
-
return (params) => {
|
|
952
|
-
return method({ ...params, token, fetchImpl });
|
|
957
|
+
return async (params) => {
|
|
958
|
+
return await method({ ...params, token, fetchImpl });
|
|
953
959
|
};
|
|
954
960
|
}
|
|
955
961
|
});
|
|
956
962
|
}
|
|
957
963
|
});
|
|
958
964
|
}
|
|
965
|
+
get auth() {
|
|
966
|
+
return {
|
|
967
|
+
accessToken: async ({ code, redirectUri, clientId, clientSecret }) => {
|
|
968
|
+
return await __classPrivateFieldGet(this, _VercelApi_fetch, "f").call(this, `${baseUrl}/v2/oauth/access_token`, {
|
|
969
|
+
method: 'POST',
|
|
970
|
+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
971
|
+
body: formEncoded({ code, redirect_uri: redirectUri, client_id: clientId, client_secret: clientSecret })
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
};
|
|
975
|
+
}
|
|
959
976
|
async request(endpoint, params) {
|
|
960
977
|
const [method = '', url = ''] = endpoint.split(' ');
|
|
961
978
|
const extraParams = (params || {});
|
package/dist/index.d.ts
CHANGED
|
@@ -6972,7 +6972,7 @@ type CreateProjectRequestBody = {
|
|
|
6972
6972
|
/**
|
|
6973
6973
|
* Deployment Target or Targets in which the ENV variable will be used
|
|
6974
6974
|
*/
|
|
6975
|
-
target: ('
|
|
6975
|
+
target: ('production' | 'preview' | 'development') | ('production' | 'preview' | 'development')[];
|
|
6976
6976
|
/**
|
|
6977
6977
|
* The git branch of the environment variable
|
|
6978
6978
|
*
|
|
@@ -8488,7 +8488,7 @@ type CreateProjectEnvVariables = {
|
|
|
8488
8488
|
* @example production
|
|
8489
8489
|
* @example preview
|
|
8490
8490
|
*/
|
|
8491
|
-
target: ('
|
|
8491
|
+
target: ('production' | 'preview' | 'development')[];
|
|
8492
8492
|
/**
|
|
8493
8493
|
* The git branch of the environment variable
|
|
8494
8494
|
*
|
|
@@ -8521,7 +8521,7 @@ type CreateProjectEnvVariables = {
|
|
|
8521
8521
|
* @example production
|
|
8522
8522
|
* @example preview
|
|
8523
8523
|
*/
|
|
8524
|
-
target: ('
|
|
8524
|
+
target: ('production' | 'preview' | 'development')[];
|
|
8525
8525
|
/**
|
|
8526
8526
|
* The git branch of the environment variable
|
|
8527
8527
|
*
|
|
@@ -8673,7 +8673,7 @@ type EditProjectEnvRequestBody = {
|
|
|
8673
8673
|
*
|
|
8674
8674
|
* @example preview
|
|
8675
8675
|
*/
|
|
8676
|
-
target?: ('
|
|
8676
|
+
target?: ('production' | 'preview' | 'development')[];
|
|
8677
8677
|
/**
|
|
8678
8678
|
* The git branch of the environment variable
|
|
8679
8679
|
*
|
|
@@ -9679,7 +9679,7 @@ type CreateWebhookRequestBody = {
|
|
|
9679
9679
|
/**
|
|
9680
9680
|
* @minItems 1
|
|
9681
9681
|
*/
|
|
9682
|
-
events: ('
|
|
9682
|
+
events: ('domain.created' | 'deployment.created' | 'deployment.error' | 'deployment.canceled' | 'deployment.succeeded' | 'deployment.ready' | 'deployment.check-rerequested' | 'integration-configuration.permission-upgraded' | 'integration-configuration.removed' | 'integration-configuration.scope-change-confirmed' | 'project.created' | 'project.removed' | 'deployment-checks-completed' | 'deployment-ready' | 'deployment-prepared' | 'deployment-error' | 'deployment-check-rerequested' | 'deployment-canceled' | 'project-created' | 'project-removed' | 'domain-created' | 'deployment' | 'integration-configuration-permission-updated' | 'integration-configuration-removed' | 'integration-configuration-scope-change-confirmed')[];
|
|
9683
9683
|
/**
|
|
9684
9684
|
* @minItems 1
|
|
9685
9685
|
* @maxItems 50
|
|
@@ -15285,6 +15285,9 @@ declare class VercelApi {
|
|
|
15285
15285
|
#private;
|
|
15286
15286
|
constructor(options: VercelApiOptions);
|
|
15287
15287
|
get api(): ApiProxy;
|
|
15288
|
+
get auth(): {
|
|
15289
|
+
accessToken: ({ code, redirectUri, clientId, clientSecret }: AccessTokenOptions) => Promise<Response>;
|
|
15290
|
+
};
|
|
15288
15291
|
request<Endpoint extends keyof typeof operationsByPath>(endpoint: Endpoint, params: RequestEndpointParams<Endpoint>): Promise<ReturnType<{
|
|
15289
15292
|
'POST /v8/artifacts/events': (variables: RecordEventsVariables, signal?: AbortSignal | undefined) => Promise<undefined>;
|
|
15290
15293
|
'GET /v8/artifacts/status': (variables: StatusVariables, signal?: AbortSignal | undefined) => Promise<StatusResponse>;
|
|
@@ -16018,5 +16021,11 @@ declare class VercelApi {
|
|
|
16018
16021
|
'POST /v1/edge-config/{edgeConfigId}/token': (variables: CreateEdgeConfigTokenVariables, signal?: AbortSignal | undefined) => Promise<CreateEdgeConfigTokenResponse>;
|
|
16019
16022
|
}[Endpoint]>>;
|
|
16020
16023
|
}
|
|
16024
|
+
type AccessTokenOptions = {
|
|
16025
|
+
redirectUri: string;
|
|
16026
|
+
code: string;
|
|
16027
|
+
clientId: string;
|
|
16028
|
+
clientSecret: string;
|
|
16029
|
+
};
|
|
16021
16030
|
|
|
16022
16031
|
export { components as Components, schemas as Schemas, VercelApi, VercelApiOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -920,6 +920,12 @@ const operationsByTag = {
|
|
|
920
920
|
}
|
|
921
921
|
};
|
|
922
922
|
|
|
923
|
+
function formEncoded(data) {
|
|
924
|
+
return Object.entries(data)
|
|
925
|
+
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
|
|
926
|
+
.join('&');
|
|
927
|
+
}
|
|
928
|
+
|
|
923
929
|
var _VercelApi_token, _VercelApi_fetch;
|
|
924
930
|
class VercelApi {
|
|
925
931
|
constructor(options) {
|
|
@@ -946,14 +952,25 @@ class VercelApi {
|
|
|
946
952
|
return undefined;
|
|
947
953
|
}
|
|
948
954
|
const method = operationsByTag[namespace][operation];
|
|
949
|
-
return (params) => {
|
|
950
|
-
return method({ ...params, token, fetchImpl });
|
|
955
|
+
return async (params) => {
|
|
956
|
+
return await method({ ...params, token, fetchImpl });
|
|
951
957
|
};
|
|
952
958
|
}
|
|
953
959
|
});
|
|
954
960
|
}
|
|
955
961
|
});
|
|
956
962
|
}
|
|
963
|
+
get auth() {
|
|
964
|
+
return {
|
|
965
|
+
accessToken: async ({ code, redirectUri, clientId, clientSecret }) => {
|
|
966
|
+
return await __classPrivateFieldGet(this, _VercelApi_fetch, "f").call(this, `${baseUrl}/v2/oauth/access_token`, {
|
|
967
|
+
method: 'POST',
|
|
968
|
+
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
969
|
+
body: formEncoded({ code, redirect_uri: redirectUri, client_id: clientId, client_secret: clientSecret })
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
};
|
|
973
|
+
}
|
|
957
974
|
async request(endpoint, params) {
|
|
958
975
|
const [method = '', url = ''] = endpoint.split(' ');
|
|
959
976
|
const extraParams = (params || {});
|