@shipstatic/types 0.7.6 → 0.8.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.ts CHANGED
@@ -16,7 +16,7 @@ export type DeploymentStatusType = typeof DeploymentStatus[keyof typeof Deployme
16
16
  * Core deployment object - used in both API responses and SDK
17
17
  */
18
18
  export interface Deployment {
19
- /** The deployment ID */
19
+ /** The deployment hostname (e.g., 'happy-cat-abc1234.shipstatic.com') */
20
20
  readonly deployment: string;
21
21
  /** Number of files in this deployment */
22
22
  readonly files: number;
@@ -30,8 +30,6 @@ export interface Deployment {
30
30
  labels: string[];
31
31
  /** The client/tool used to create this deployment (e.g., 'web', 'sdk', 'cli'), null if unknown */
32
32
  readonly via: string | null;
33
- /** The deployment URL */
34
- readonly url: string;
35
33
  /** Unix timestamp (seconds) when deployment was created */
36
34
  readonly created: number;
37
35
  /** Unix timestamp (seconds) when deployment expires, null if never */
@@ -69,14 +67,12 @@ export type DomainStatusType = typeof DomainStatus[keyof typeof DomainStatus];
69
67
  export interface Domain {
70
68
  /** The domain name */
71
69
  readonly domain: string;
72
- /** The deployment name this domain points to (null = domain added but not yet linked) */
70
+ /** The deployment hostname this domain points to (null = domain added but not yet linked) */
73
71
  deployment: string | null;
74
72
  /** Current domain status */
75
73
  status: DomainStatusType;
76
74
  /** Labels for categorization and filtering (lowercase, alphanumeric with separators). Always present, empty array when none. */
77
75
  labels: string[];
78
- /** The domain URL - internal (subdomain) or external (custom domain) */
79
- readonly url: string;
80
76
  /** Unix timestamp (seconds) when domain was created */
81
77
  readonly created: number;
82
78
  /** When deployment was last linked (Unix timestamp), null if never linked */
@@ -462,8 +458,8 @@ export declare function validateDeployToken(deployToken: string): void;
462
458
  */
463
459
  export declare function validateApiUrl(apiUrl: string): void;
464
460
  /**
465
- * Check if a string matches the deployment ID pattern (word-word-alphanumeric7)
466
- * Example: "happy-cat-abc1234"
461
+ * Check if a string matches the deployment identifier pattern (word-word-alphanumeric7).
462
+ * Example: "happy-cat-abc1234.shipstatic.com"
467
463
  */
468
464
  export declare function isDeployment(input: string): boolean;
469
465
  /**
@@ -572,6 +568,10 @@ export interface DeploymentUploadOptions {
572
568
  subdomain?: string;
573
569
  /** Client identifier (e.g., 'cli', 'sdk', 'web') */
574
570
  via?: string;
571
+ /** @internal Trigger server-side build. Only available via /upload endpoint. */
572
+ build?: boolean;
573
+ /** @internal Trigger server-side prerender. Only available via /upload endpoint. */
574
+ prerender?: boolean;
575
575
  }
576
576
  /**
577
577
  * Deployment resource interface - the contract all implementations must follow
@@ -845,12 +845,11 @@ export declare function isCustomDomain(domain: string, platformDomain: string):
845
845
  */
846
846
  export declare function extractSubdomain(domain: string, platformDomain: string): string | null;
847
847
  /**
848
- * Generate deployment URL from deployment ID and platform domain
848
+ * Generate HTTPS URL for a deployment hostname.
849
849
  */
850
- export declare function generateDeploymentUrl(deployment: string, platformDomain?: string): string;
850
+ export declare function generateDeploymentUrl(deployment: string): string;
851
851
  /**
852
- * Generate URL for a domain.
853
- * Domains are stored as FQDNs, so this just prepends https://
852
+ * Generate HTTPS URL for a domain.
854
853
  */
855
854
  export declare function generateDomainUrl(domain: string): string;
856
855
  /**
package/dist/index.js CHANGED
@@ -375,11 +375,11 @@ export function validateApiUrl(apiUrl) {
375
375
  }
376
376
  }
377
377
  /**
378
- * Check if a string matches the deployment ID pattern (word-word-alphanumeric7)
379
- * Example: "happy-cat-abc1234"
378
+ * Check if a string matches the deployment identifier pattern (word-word-alphanumeric7).
379
+ * Example: "happy-cat-abc1234.shipstatic.com"
380
380
  */
381
381
  export function isDeployment(input) {
382
- return /^[a-z]+-[a-z]+-[a-z0-9]{7}$/i.test(input);
382
+ return /^[a-z]+-[a-z]+-[a-z0-9]{7}(\.[a-z0-9.-]+)?$/i.test(input);
383
383
  }
384
384
  // =============================================================================
385
385
  // PLATFORM CONSTANTS
@@ -441,15 +441,13 @@ export function extractSubdomain(domain, platformDomain) {
441
441
  return domain.slice(0, -(platformDomain.length + 1)); // +1 for the dot
442
442
  }
443
443
  /**
444
- * Generate deployment URL from deployment ID and platform domain
444
+ * Generate HTTPS URL for a deployment hostname.
445
445
  */
446
- export function generateDeploymentUrl(deployment, platformDomain) {
447
- const domain = platformDomain || 'shipstatic.com';
448
- return `https://${deployment}.${domain}`;
446
+ export function generateDeploymentUrl(deployment) {
447
+ return `https://${deployment}`;
449
448
  }
450
449
  /**
451
- * Generate URL for a domain.
452
- * Domains are stored as FQDNs, so this just prepends https://
450
+ * Generate HTTPS URL for a domain.
453
451
  */
454
452
  export function generateDomainUrl(domain) {
455
453
  return `https://${domain}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/types",
3
- "version": "0.7.6",
3
+ "version": "0.8.0",
4
4
  "description": "Shared types for ShipStatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -23,7 +23,7 @@ export type DeploymentStatusType = typeof DeploymentStatus[keyof typeof Deployme
23
23
  * Core deployment object - used in both API responses and SDK
24
24
  */
25
25
  export interface Deployment {
26
- /** The deployment ID */
26
+ /** The deployment hostname (e.g., 'happy-cat-abc1234.shipstatic.com') */
27
27
  readonly deployment: string;
28
28
  /** Number of files in this deployment */
29
29
  readonly files: number;
@@ -37,8 +37,6 @@ export interface Deployment {
37
37
  labels: string[];
38
38
  /** The client/tool used to create this deployment (e.g., 'web', 'sdk', 'cli'), null if unknown */
39
39
  readonly via: string | null;
40
- /** The deployment URL */
41
- readonly url: string;
42
40
  /** Unix timestamp (seconds) when deployment was created */
43
41
  readonly created: number;
44
42
  /** Unix timestamp (seconds) when deployment expires, null if never */
@@ -85,14 +83,12 @@ export type DomainStatusType = typeof DomainStatus[keyof typeof DomainStatus];
85
83
  export interface Domain {
86
84
  /** The domain name */
87
85
  readonly domain: string;
88
- /** The deployment name this domain points to (null = domain added but not yet linked) */
86
+ /** The deployment hostname this domain points to (null = domain added but not yet linked) */
89
87
  deployment: string | null; // Mutable - can be updated to point to different deployment
90
88
  /** Current domain status */
91
89
  status: DomainStatusType; // Mutable - can be updated
92
90
  /** Labels for categorization and filtering (lowercase, alphanumeric with separators). Always present, empty array when none. */
93
91
  labels: string[];
94
- /** The domain URL - internal (subdomain) or external (custom domain) */
95
- readonly url: string;
96
92
  /** Unix timestamp (seconds) when domain was created */
97
93
  readonly created: number;
98
94
  /** When deployment was last linked (Unix timestamp), null if never linked */
@@ -733,11 +729,11 @@ export function validateApiUrl(apiUrl: string): void {
733
729
  }
734
730
 
735
731
  /**
736
- * Check if a string matches the deployment ID pattern (word-word-alphanumeric7)
737
- * Example: "happy-cat-abc1234"
732
+ * Check if a string matches the deployment identifier pattern (word-word-alphanumeric7).
733
+ * Example: "happy-cat-abc1234.shipstatic.com"
738
734
  */
739
735
  export function isDeployment(input: string): boolean {
740
- return /^[a-z]+-[a-z]+-[a-z0-9]{7}$/i.test(input);
736
+ return /^[a-z]+-[a-z]+-[a-z0-9]{7}(\.[a-z0-9.-]+)?$/i.test(input);
741
737
  }
742
738
 
743
739
  // =============================================================================
@@ -878,6 +874,10 @@ export interface DeploymentUploadOptions {
878
874
  subdomain?: string;
879
875
  /** Client identifier (e.g., 'cli', 'sdk', 'web') */
880
876
  via?: string;
877
+ /** @internal Trigger server-side build. Only available via /upload endpoint. */
878
+ build?: boolean;
879
+ /** @internal Trigger server-side prerender. Only available via /upload endpoint. */
880
+ prerender?: boolean;
881
881
  }
882
882
 
883
883
  /**
@@ -1264,16 +1264,14 @@ export function extractSubdomain(domain: string, platformDomain: string): string
1264
1264
  }
1265
1265
 
1266
1266
  /**
1267
- * Generate deployment URL from deployment ID and platform domain
1267
+ * Generate HTTPS URL for a deployment hostname.
1268
1268
  */
1269
- export function generateDeploymentUrl(deployment: string, platformDomain?: string): string {
1270
- const domain = platformDomain || 'shipstatic.com';
1271
- return `https://${deployment}.${domain}`;
1269
+ export function generateDeploymentUrl(deployment: string): string {
1270
+ return `https://${deployment}`;
1272
1271
  }
1273
1272
 
1274
1273
  /**
1275
- * Generate URL for a domain.
1276
- * Domains are stored as FQDNs, so this just prepends https://
1274
+ * Generate HTTPS URL for a domain.
1277
1275
  */
1278
1276
  export function generateDomainUrl(domain: string): string {
1279
1277
  return `https://${domain}`;