@theholocron/vercel-client 1.23.0 → 1.25.0

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.d.mts CHANGED
@@ -83,6 +83,30 @@ interface VercelAddDomainResult {
83
83
  verified: boolean;
84
84
  verification?: VercelDomainVerification[];
85
85
  }
86
+ /** One ranked CNAME/IPv4 recommendation — `rank: 1` is the preferred value. */
87
+ interface VercelDomainConfigRecommendation<T> {
88
+ rank: number;
89
+ value: T;
90
+ }
91
+ /**
92
+ * DNS *routing* status for a domain — distinct from ownership (`verified`
93
+ * on `VercelDomain`/`VercelAddDomainResult`). A domain can be verified
94
+ * (Vercel trusts you own it) with no record actually pointing traffic at
95
+ * Vercel yet, e.g. re-adding a domain whose apex is already verified on
96
+ * this team short-circuits to `verified: true` with no `verification`
97
+ * challenge (`domains.add` returns 409, not a fresh challenge) — this is
98
+ * the only source for that domain's CNAME target in that case.
99
+ */
100
+ interface VercelDomainConfig {
101
+ /** How Vercel currently sees the domain resolving. `null` = not resolving to Vercel at all. */
102
+ configuredBy: "A" | "CNAME" | "http" | "dns-01" | null;
103
+ /** `false` once DNS is correctly configured and a TLS cert can be issued. */
104
+ misconfigured: boolean;
105
+ /** Recommended CNAME target(s) for a subdomain, ranked; `[0]` is preferred. Per-project, never a fixed host. */
106
+ recommendedCNAME: VercelDomainConfigRecommendation<string>[];
107
+ /** Recommended A-record IPv4(s) for an apex domain, ranked. */
108
+ recommendedIPv4: VercelDomainConfigRecommendation<string[]>[];
109
+ }
86
110
  //#endregion
87
111
  //#region src/env/env.d.ts
88
112
  type VercelEnvTarget = "production" | "preview" | "development";
@@ -146,6 +170,7 @@ declare function createVercelClient(opts: VercelClientOptions): {
146
170
  domains: {
147
171
  list: (projectId: string) => Promise<VercelDomainsResponse>;
148
172
  add: (projectId: string, name: string) => Promise<VercelAddDomainResult>;
173
+ config: (domain: string, projectIdOrName?: string) => Promise<VercelDomainConfig>;
149
174
  };
150
175
  env: {
151
176
  list: (projectId: string) => Promise<VercelEnvVarsResponse>;
@@ -163,4 +188,4 @@ declare function createVercelClient(opts: VercelClientOptions): {
163
188
  };
164
189
  type VercelClient = ReturnType<typeof createVercelClient>;
165
190
  //#endregion
166
- export { type VercelAddDomainResult, VercelClient, type VercelClientOptions, type VercelCreateDeploymentInput, type VercelCreateProjectInput, type VercelDeployFile, type VercelDeployment, type VercelDeploymentState, type VercelDeploymentTarget, type VercelDomain, type VercelDomainVerification, type VercelDomainsResponse, type VercelEnvTarget, type VercelEnvVar, type VercelEnvVarsResponse, type VercelProject, type VercelProjectLink, type VercelProjectsResponse, type VercelTriggerDeploymentInput, type VercelUpdateProjectInput, type VercelUser, type VercelUserResponse, createVercelClient };
191
+ export { type VercelAddDomainResult, VercelClient, type VercelClientOptions, type VercelCreateDeploymentInput, type VercelCreateProjectInput, type VercelDeployFile, type VercelDeployment, type VercelDeploymentState, type VercelDeploymentTarget, type VercelDomain, type VercelDomainConfig, type VercelDomainConfigRecommendation, type VercelDomainVerification, type VercelDomainsResponse, type VercelEnvTarget, type VercelEnvVar, type VercelEnvVarsResponse, type VercelProject, type VercelProjectLink, type VercelProjectsResponse, type VercelTriggerDeploymentInput, type VercelUpdateProjectInput, type VercelUser, type VercelUserResponse, createVercelClient };
package/dist/index.mjs CHANGED
@@ -44,7 +44,15 @@ function domains(rest) {
44
44
  add: (projectId, name) => rest.request(`/v10/projects/${encodeURIComponent(projectId)}/domains`, {
45
45
  method: "POST",
46
46
  body: { name }
47
- })
47
+ }),
48
+ /**
49
+ * DNS routing status for `domain` — works regardless of whether the
50
+ * domain is already attached/verified on a project. `projectIdOrName`
51
+ * is optional per Vercel's docs ("use this when the domain is not yet
52
+ * associated with a project") but passed through when known to scope
53
+ * the recommendation to that project.
54
+ */
55
+ config: (domain, projectIdOrName) => rest.request(`/v6/domains/${encodeURIComponent(domain)}/config`, { query: projectIdOrName ? { projectIdOrName } : void 0 })
48
56
  };
49
57
  }
50
58
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/vercel-client",
3
- "version": "1.23.0",
3
+ "version": "1.25.0",
4
4
  "description": "A TypeScript client for the Vercel API",
5
5
  "keywords": [
6
6
  "vercel",
@@ -33,11 +33,11 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@theholocron/observability": "^0.3.0",
36
- "@theholocron/http-client": "^1.23.0"
36
+ "@theholocron/http-client": "^1.25.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@theholocron/cli": "5.0.0-alpha.3",
40
- "@theholocron/eslint-config": "^8.2.0",
39
+ "@theholocron/cli": "5.0.0-alpha.33",
40
+ "@theholocron/eslint-config": "^8.4.3",
41
41
  "@theholocron/tsconfig": "^8.2.0",
42
42
  "@theholocron/tsdown-config": "^8.2.0",
43
43
  "@theholocron/vitest-config": "^8.2.0",