vercel-api-js 0.1.17 → 0.1.19

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/index.mjs CHANGED
@@ -12,7 +12,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
14
  ***************************************************************************** */
15
- /* global Reflect, Promise */
15
+ /* global Reflect, Promise, SuppressedError, Symbol */
16
16
 
17
17
 
18
18
  function __classPrivateFieldGet(receiver, state, kind, f) {
@@ -26,7 +26,12 @@ function __classPrivateFieldSet(receiver, state, value, kind, f) {
26
26
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
27
27
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
28
28
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
29
- }
29
+ }
30
+
31
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
32
+ var e = new Error(message);
33
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
34
+ };
30
35
 
31
36
  function notEmpty(value) {
32
37
  return value !== null && value !== undefined;
@@ -135,6 +140,10 @@ const artifactQuery = (variables, signal) => fetch$1({
135
140
  ...variables,
136
141
  signal
137
142
  });
143
+ /**
144
+ * Creates a new check. This endpoint must be called with an OAuth2 or it will produce a 400 error.
145
+ */
146
+ const createCheck = (variables, signal) => fetch$1({ url: '/v1/deployments/{deploymentId}/checks', method: 'post', ...variables, signal });
138
147
  /**
139
148
  * List all of the checks created for a deployment.
140
149
  */
@@ -144,10 +153,6 @@ const getAllChecks = (variables, signal) => fetch$1({
144
153
  ...variables,
145
154
  signal
146
155
  });
147
- /**
148
- * Creates a new check. This endpoint must be called with an OAuth2 or it will produce a 400 error.
149
- */
150
- const createCheck = (variables, signal) => fetch$1({ url: '/v1/deployments/{deploymentId}/checks', method: 'post', ...variables, signal });
151
156
  /**
152
157
  * Return a detailed response for a single check.
153
158
  */
@@ -170,6 +175,10 @@ const rerequestCheck = (variables, signal) => fetch$1({
170
175
  ...variables,
171
176
  signal
172
177
  });
178
+ /**
179
+ * Update the cron job feature on a project.
180
+ */
181
+ const updateProjectDataCache = (variables, signal) => fetch$1({ url: '/v1/data-cache/projects/{projectId}', method: 'patch', ...variables, signal });
173
182
  /**
174
183
  * Get the build logs of a deployment by deployment ID and build ID. It can work as an infinite stream of logs or as a JSON endpoint depending on the input parameters.
175
184
  */
@@ -204,14 +213,14 @@ const checkDomainPrice = (variables, signal) => fetch$1({
204
213
  ...variables,
205
214
  signal
206
215
  });
207
- /**
208
- * Creates a DNS record for a domain.
209
- */
210
- const createRecord = (variables, signal) => fetch$1({ url: '/v2/domains/{domain}/records', method: 'post', ...variables, signal });
211
216
  /**
212
217
  * Retrieves a list of DNS records created for a domain name. By default it returns 20 records if no limit is provided. The rest can be retrieved using the pagination options.
213
218
  */
214
219
  const getRecords = (variables, signal) => fetch$1({ url: '/v4/domains/{domain}/records', method: 'get', ...variables, signal });
220
+ /**
221
+ * Creates a DNS record for a domain.
222
+ */
223
+ const createRecord = (variables, signal) => fetch$1({ url: '/v2/domains/{domain}/records', method: 'post', ...variables, signal });
215
224
  /**
216
225
  * Updates an existing DNS record for a domain name.
217
226
  */
@@ -505,7 +514,12 @@ const getTeamMembers = (variables, signal) => fetch$1({
505
514
  /**
506
515
  * Invite a user to join the team specified in the URL. The authenticated user needs to be an `OWNER` in order to successfully invoke this endpoint. The user can be specified with an email or an ID. If both email and ID are provided, ID will take priority.
507
516
  */
508
- const inviteUserToTeam = (variables, signal) => fetch$1({ url: '/v1/teams/{teamId}/members', method: 'post', ...variables, signal });
517
+ const inviteUserToTeam = (variables, signal) => fetch$1({
518
+ url: '/v1/teams/{teamId}/members',
519
+ method: 'post',
520
+ ...variables,
521
+ signal
522
+ });
509
523
  /**
510
524
  * Request access to a team as a member. An owner has to approve the request. Only 10 users can request access to a team at the same time.
511
525
  */
@@ -605,20 +619,20 @@ const deleteTeamInviteCode = (variables, signal) => fetch$1({
605
619
  */
606
620
  const uploadFile = (variables, signal) => fetch$1({ url: '/v2/files', method: 'post', ...variables, signal });
607
621
  /**
608
- * Initiates the deletion process for the currently authenticated User, by sending a deletion confirmation email. The email contains a link that the user needs to visit in order to proceed with the deletion process.
622
+ * Retrieves information related to the currently authenticated User.
609
623
  */
610
- const requestDelete = (variables, signal) => fetch$1({
611
- url: '/v1/user',
612
- method: 'delete',
624
+ const getAuthUser = (variables, signal) => fetch$1({
625
+ url: '/v2/user',
626
+ method: 'get',
613
627
  ...variables,
614
628
  signal
615
629
  });
616
630
  /**
617
- * Retrieves information related to the currently authenticated User.
631
+ * Initiates the deletion process for the currently authenticated User, by sending a deletion confirmation email. The email contains a link that the user needs to visit in order to proceed with the deletion process.
618
632
  */
619
- const getAuthUser = (variables, signal) => fetch$1({
620
- url: '/v2/user',
621
- method: 'get',
633
+ const requestDelete = (variables, signal) => fetch$1({
634
+ url: '/v1/user',
635
+ method: 'delete',
622
636
  ...variables,
623
637
  signal
624
638
  });
@@ -685,19 +699,19 @@ const deleteWebhook = (variables, signal) => fetch$1({
685
699
  signal
686
700
  });
687
701
  /**
688
- * Retrieves an Alias for the given host name or alias ID.
702
+ * Retrieves a list of aliases for the authenticated User or Team. When `domain` is provided, only aliases for that domain will be returned. When `projectId` is provided, it will only return the given project aliases.
689
703
  */
690
- const getAlias = (variables, signal) => fetch$1({
691
- url: '/v4/aliases/{idOrAlias}',
704
+ const listAliases = (variables, signal) => fetch$1({
705
+ url: '/v4/aliases',
692
706
  method: 'get',
693
707
  ...variables,
694
708
  signal
695
709
  });
696
710
  /**
697
- * Retrieves a list of aliases for the authenticated User or Team. When `domain` is provided, only aliases for that domain will be returned. When `projectId` is provided, it will only return the given project aliases.
711
+ * Retrieves an Alias for the given host name or alias ID.
698
712
  */
699
- const listAliases = (variables, signal) => fetch$1({
700
- url: '/v4/aliases',
713
+ const getAlias = (variables, signal) => fetch$1({
714
+ url: '/v4/aliases/{idOrAlias}',
701
715
  method: 'get',
702
716
  ...variables,
703
717
  signal
@@ -772,6 +786,15 @@ const getDeployments = (variables, signal) => fetch$1({
772
786
  ...variables,
773
787
  signal
774
788
  });
789
+ /**
790
+ * Verify the user accepted the login request and get a authentication token. The user email address and the token received after requesting the login must be added to the URL as a query string with the names `email` and `token`.
791
+ */
792
+ const verifyToken = (variables, signal) => fetch$1({
793
+ url: '/registration/verify',
794
+ method: 'get',
795
+ ...variables,
796
+ signal
797
+ });
775
798
  /**
776
799
  * Request a new login for a user to get a token. This will respond with a verification token and send an email to confirm the request. Once confirmed you can use the verification token to get an authentication token.
777
800
  */
@@ -782,18 +805,18 @@ const emailLogin = (variables, signal) => fetch$1({
782
805
  signal
783
806
  });
784
807
  /**
785
- * Verify the user accepted the login request and get a authentication token. The user email address and the token received after requesting the login must be added to the URL as a query string with the names `email` and `token`.
808
+ * This API allows you to delete a deployment, either by supplying its `id` in the URL or the `url` of the deployment as a query parameter. You can obtain the ID, for example, by listing all deployments.
786
809
  */
787
- const verifyToken = (variables, signal) => fetch$1({
788
- url: '/registration/verify',
810
+ const deleteDeployment = (variables, signal) => fetch$1({ url: '/v13/deployments/{id}', method: 'delete', ...variables, signal });
811
+ /**
812
+ * Retrieves the active Vercel secrets for the authenticated user. By default it returns 20 secrets. The rest can be retrieved using the pagination options. The body will contain an entry for each secret.
813
+ */
814
+ const getSecrets = (variables, signal) => fetch$1({
815
+ url: '/v3/secrets',
789
816
  method: 'get',
790
817
  ...variables,
791
818
  signal
792
819
  });
793
- /**
794
- * This API allows you to delete a deployment, either by supplying its `id` in the URL or the `url` of the deployment as a query parameter. You can obtain the ID, for example, by listing all deployments.
795
- */
796
- const deleteDeployment = (variables, signal) => fetch$1({ url: '/v13/deployments/{id}', method: 'delete', ...variables, signal });
797
820
  /**
798
821
  * Allows to create a new secret.
799
822
  */
@@ -807,15 +830,6 @@ const createSecret = (variables, signal) => fetch$1({
807
830
  * Enables to edit the name of a user's secret. The name has to be unique to that user's secrets.
808
831
  */
809
832
  const renameSecret = (variables, signal) => fetch$1({ url: '/v2/secrets/{name}', method: 'patch', ...variables, signal });
810
- /**
811
- * Retrieves the active Vercel secrets for the authenticated user. By default it returns 20 secrets. The rest can be retrieved using the pagination options. The body will contain an entry for each secret.
812
- */
813
- const getSecrets = (variables, signal) => fetch$1({
814
- url: '/v3/secrets',
815
- method: 'get',
816
- ...variables,
817
- signal
818
- });
819
833
  /**
820
834
  * Retrieves the information for a specific secret by passing either the secret id or name in the URL.
821
835
  */
@@ -836,7 +850,26 @@ const deleteSecret = (variables, signal) => fetch$1({
836
850
  });
837
851
  const operationsByTag = {
838
852
  artifacts: { recordEvents, status, uploadArtifact, downloadArtifact, artifactQuery },
839
- checks: { getAllChecks, createCheck, getCheck, updateCheck, rerequestCheck },
853
+ checks: { createCheck, getAllChecks, getCheck, updateCheck, rerequestCheck },
854
+ projects: {
855
+ updateProjectDataCache,
856
+ getProjects,
857
+ createProject,
858
+ getProject,
859
+ updateProject,
860
+ deleteProject,
861
+ getProjectDomains,
862
+ getProjectDomain,
863
+ updateProjectDomain,
864
+ removeProjectDomain,
865
+ addProjectDomain,
866
+ verifyProjectDomain,
867
+ filterProjectEnvs,
868
+ getProjectEnv,
869
+ createProjectEnv,
870
+ removeProjectEnv,
871
+ editProjectEnv
872
+ },
840
873
  deployments: {
841
874
  getDeploymentEvents,
842
875
  getDeployment,
@@ -858,7 +891,7 @@ const operationsByTag = {
858
891
  createOrTransferDomain,
859
892
  deleteDomain
860
893
  },
861
- dns: { createRecord, getRecords, updateRecord, removeRecord },
894
+ dns: { getRecords, createRecord, updateRecord, removeRecord },
862
895
  edgeConfig: {
863
896
  getEdgeConfigs,
864
897
  createEdgeConfig,
@@ -873,7 +906,7 @@ const operationsByTag = {
873
906
  getEdgeConfigToken,
874
907
  createEdgeConfigToken
875
908
  },
876
- user: { listUserEvents, requestDelete, getAuthUser },
909
+ user: { listUserEvents, getAuthUser, requestDelete },
877
910
  integrations: { getConfigurations, getConfiguration, deleteConfiguration, gitNamespaces, searchRepo },
878
911
  logDrains: {
879
912
  getIntegrationLogDrains,
@@ -884,24 +917,6 @@ const operationsByTag = {
884
917
  getConfigurableLogDrains,
885
918
  createConfigurableLogDrain
886
919
  },
887
- projects: {
888
- getProjects,
889
- createProject,
890
- getProject,
891
- updateProject,
892
- deleteProject,
893
- getProjectDomains,
894
- getProjectDomain,
895
- updateProjectDomain,
896
- removeProjectDomain,
897
- addProjectDomain,
898
- verifyProjectDomain,
899
- filterProjectEnvs,
900
- getProjectEnv,
901
- createProjectEnv,
902
- removeProjectEnv,
903
- editProjectEnv
904
- },
905
920
  teams: {
906
921
  getTeamMembers,
907
922
  inviteUserToTeam,
@@ -917,11 +932,11 @@ const operationsByTag = {
917
932
  deleteTeam,
918
933
  deleteTeamInviteCode
919
934
  },
920
- authentication: { listAuthTokens, createAuthToken, getAuthToken, deleteAuthToken, emailLogin, verifyToken },
935
+ authentication: { listAuthTokens, createAuthToken, getAuthToken, deleteAuthToken, verifyToken, emailLogin },
921
936
  webhooks: { createWebhook, getWebhooks, getWebhook, deleteWebhook },
922
- aliases: { getAlias, listAliases, deleteAlias, listDeploymentAliases, assignAlias },
937
+ aliases: { listAliases, getAlias, deleteAlias, listDeploymentAliases, assignAlias },
923
938
  certs: { getCertById, removeCert, issueCert, uploadCert },
924
- secrets: { createSecret, renameSecret, getSecrets, getSecret, deleteSecret }
939
+ secrets: { getSecrets, createSecret, renameSecret, getSecret, deleteSecret }
925
940
  };
926
941
 
927
942
  function formEncoded(data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel-api-js",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "Vercel API client for Node.js",
5
5
  "author": "SferaDev",
6
6
  "license": "ISC",