@shipstatic/types 0.2.9 → 0.3.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/index.d.ts CHANGED
@@ -51,45 +51,45 @@ export interface DeploymentListResponse {
51
51
  total?: number;
52
52
  }
53
53
  /**
54
- * Alias status constants
54
+ * Domain status constants
55
55
  */
56
- export declare const AliasStatus: {
56
+ export declare const DomainStatus: {
57
57
  readonly PENDING: "pending";
58
58
  readonly PARTIAL: "partial";
59
59
  readonly CONFIRMED: "confirmed";
60
60
  readonly FAILED: "failed";
61
61
  };
62
- export type AliasStatusType = typeof AliasStatus[keyof typeof AliasStatus];
62
+ export type DomainStatusType = typeof DomainStatus[keyof typeof DomainStatus];
63
63
  /**
64
- * Core alias object - used in both API responses and SDK
64
+ * Core domain object - used in both API responses and SDK
65
65
  */
66
- export interface Alias {
67
- /** The alias name */
68
- readonly alias: string;
69
- /** The deployment name this alias points to */
66
+ export interface Domain {
67
+ /** The domain name */
68
+ readonly domain: string;
69
+ /** The deployment name this domain points to */
70
70
  deployment: string;
71
- /** Current alias status */
72
- status: AliasStatusType;
71
+ /** Current domain status */
72
+ status: DomainStatusType;
73
73
  /** Optional array of tags for categorization and filtering (lowercase, alphanumeric with separators) */
74
74
  tags?: string[];
75
- /** The alias URL - internal (subdomain) or external (custom domain) */
75
+ /** The domain URL - internal (subdomain) or external (custom domain) */
76
76
  readonly url: string;
77
- /** Unix timestamp (seconds) when alias was created */
77
+ /** Unix timestamp (seconds) when domain was created */
78
78
  readonly created: number;
79
79
  /** Whether this was a create (201) or update (200) operation */
80
80
  readonly isCreate?: boolean;
81
- /** Unix timestamp (seconds) when alias was confirmed */
81
+ /** Unix timestamp (seconds) when domain was confirmed */
82
82
  confirmed?: number;
83
83
  }
84
84
  /**
85
- * Response for listing aliases
85
+ * Response for listing domains
86
86
  */
87
- export interface AliasListResponse {
88
- /** Array of aliases */
89
- aliases: Alias[];
87
+ export interface DomainListResponse {
88
+ /** Array of domains */
89
+ domains: Domain[];
90
90
  /** Optional cursor for pagination */
91
91
  cursor?: string;
92
- /** Total number of aliases if available */
92
+ /** Total number of domains if available */
93
93
  total?: number;
94
94
  }
95
95
  /**
@@ -382,26 +382,26 @@ export interface DeploymentResource {
382
382
  get: (id: string) => Promise<Deployment>;
383
383
  }
384
384
  /**
385
- * Alias resource interface - the contract all implementations must follow
385
+ * Domain resource interface - the contract all implementations must follow
386
386
  */
387
- export interface AliasResource {
388
- set: (aliasName: string, deployment: string, tags?: string[]) => Promise<Alias>;
389
- get: (aliasName: string) => Promise<Alias>;
390
- list: () => Promise<AliasListResponse>;
391
- remove: (aliasName: string) => Promise<void>;
392
- confirm: (aliasName: string) => Promise<{
387
+ export interface DomainResource {
388
+ set: (domainName: string, deployment: string, tags?: string[]) => Promise<Domain>;
389
+ get: (domainName: string) => Promise<Domain>;
390
+ list: () => Promise<DomainListResponse>;
391
+ remove: (domainName: string) => Promise<void>;
392
+ confirm: (domainName: string) => Promise<{
393
393
  message: string;
394
394
  }>;
395
- dns: (aliasName: string) => Promise<{
396
- alias: string;
395
+ dns: (domainName: string) => Promise<{
396
+ domain: string;
397
397
  dns: any;
398
398
  }>;
399
- records: (aliasName: string) => Promise<{
400
- alias: string;
399
+ records: (domainName: string) => Promise<{
400
+ domain: string;
401
401
  records: any[];
402
402
  }>;
403
- share: (aliasName: string) => Promise<{
404
- alias: string;
403
+ share: (domainName: string) => Promise<{
404
+ domain: string;
405
405
  hash: string;
406
406
  }>;
407
407
  }
@@ -448,6 +448,6 @@ export interface RateLimitData {
448
448
  */
449
449
  export declare function generateDeploymentUrl(deployment: string, sitesDomain?: string): string;
450
450
  /**
451
- * Generate alias URL based on whether it's internal (subdomain) or external (custom domain)
451
+ * Generate domain URL based on whether it's internal (subdomain) or external (custom domain)
452
452
  */
453
- export declare function generateAliasUrl(alias: string, sitesDomain?: string): string;
453
+ export declare function generateDomainUrl(domain: string, sitesDomain?: string): string;
package/dist/index.js CHANGED
@@ -15,12 +15,12 @@ export const DeploymentStatus = {
15
15
  DELETING: 'deleting'
16
16
  };
17
17
  // =============================================================================
18
- // ALIAS TYPES
18
+ // DOMAIN TYPES
19
19
  // =============================================================================
20
20
  /**
21
- * Alias status constants
21
+ * Domain status constants
22
22
  */
23
- export const AliasStatus = {
23
+ export const DomainStatus = {
24
24
  PENDING: 'pending',
25
25
  PARTIAL: 'partial',
26
26
  CONFIRMED: 'confirmed',
@@ -275,14 +275,14 @@ export function generateDeploymentUrl(deployment, sitesDomain) {
275
275
  return `https://${deployment}.${domain}`;
276
276
  }
277
277
  /**
278
- * Generate alias URL based on whether it's internal (subdomain) or external (custom domain)
278
+ * Generate domain URL based on whether it's internal (subdomain) or external (custom domain)
279
279
  */
280
- export function generateAliasUrl(alias, sitesDomain) {
281
- // If alias contains dots, it's an external domain
282
- if (alias.includes('.')) {
283
- return `https://${alias}`;
280
+ export function generateDomainUrl(domain, sitesDomain) {
281
+ // If domain contains dots, it's an external domain
282
+ if (domain.includes('.')) {
283
+ return `https://${domain}`;
284
284
  }
285
285
  // Otherwise it's an internal subdomain
286
- const domain = sitesDomain || 'statichost.dev';
287
- return `https://${alias}.${domain}`;
286
+ const siteDomain = sitesDomain || 'statichost.dev';
287
+ return `https://${domain}.${siteDomain}`;
288
288
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/types",
3
- "version": "0.2.9",
3
+ "version": "0.3.1",
4
4
  "description": "Shared types for Shipstatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -61,52 +61,52 @@ export interface DeploymentListResponse {
61
61
  }
62
62
 
63
63
  // =============================================================================
64
- // ALIAS TYPES
64
+ // DOMAIN TYPES
65
65
  // =============================================================================
66
66
 
67
67
  /**
68
- * Alias status constants
68
+ * Domain status constants
69
69
  */
70
- export const AliasStatus = {
70
+ export const DomainStatus = {
71
71
  PENDING: 'pending',
72
72
  PARTIAL: 'partial',
73
73
  CONFIRMED: 'confirmed',
74
74
  FAILED: 'failed'
75
75
  } as const;
76
76
 
77
- export type AliasStatusType = typeof AliasStatus[keyof typeof AliasStatus];
77
+ export type DomainStatusType = typeof DomainStatus[keyof typeof DomainStatus];
78
78
 
79
79
  /**
80
- * Core alias object - used in both API responses and SDK
80
+ * Core domain object - used in both API responses and SDK
81
81
  */
82
- export interface Alias {
83
- /** The alias name */
84
- readonly alias: string;
85
- /** The deployment name this alias points to */
82
+ export interface Domain {
83
+ /** The domain name */
84
+ readonly domain: string;
85
+ /** The deployment name this domain points to */
86
86
  deployment: string; // Mutable - can be updated to point to different deployment
87
- /** Current alias status */
88
- status: AliasStatusType; // Mutable - can be updated
87
+ /** Current domain status */
88
+ status: DomainStatusType; // Mutable - can be updated
89
89
  /** Optional array of tags for categorization and filtering (lowercase, alphanumeric with separators) */
90
90
  tags?: string[];
91
- /** The alias URL - internal (subdomain) or external (custom domain) */
91
+ /** The domain URL - internal (subdomain) or external (custom domain) */
92
92
  readonly url: string;
93
- /** Unix timestamp (seconds) when alias was created */
93
+ /** Unix timestamp (seconds) when domain was created */
94
94
  readonly created: number;
95
95
  /** Whether this was a create (201) or update (200) operation */
96
96
  readonly isCreate?: boolean;
97
- /** Unix timestamp (seconds) when alias was confirmed */
97
+ /** Unix timestamp (seconds) when domain was confirmed */
98
98
  confirmed?: number; // Mutable - can be updated
99
99
  }
100
100
 
101
101
  /**
102
- * Response for listing aliases
102
+ * Response for listing domains
103
103
  */
104
- export interface AliasListResponse {
105
- /** Array of aliases */
106
- aliases: Alias[];
104
+ export interface DomainListResponse {
105
+ /** Array of domains */
106
+ domains: Domain[];
107
107
  /** Optional cursor for pagination */
108
108
  cursor?: string;
109
- /** Total number of aliases if available */
109
+ /** Total number of domains if available */
110
110
  total?: number;
111
111
  }
112
112
 
@@ -635,17 +635,17 @@ export interface DeploymentResource {
635
635
  }
636
636
 
637
637
  /**
638
- * Alias resource interface - the contract all implementations must follow
638
+ * Domain resource interface - the contract all implementations must follow
639
639
  */
640
- export interface AliasResource {
641
- set: (aliasName: string, deployment: string, tags?: string[]) => Promise<Alias>;
642
- get: (aliasName: string) => Promise<Alias>;
643
- list: () => Promise<AliasListResponse>;
644
- remove: (aliasName: string) => Promise<void>;
645
- confirm: (aliasName: string) => Promise<{ message: string }>;
646
- dns: (aliasName: string) => Promise<{ alias: string; dns: any }>;
647
- records: (aliasName: string) => Promise<{ alias: string; records: any[] }>;
648
- share: (aliasName: string) => Promise<{ alias: string; hash: string }>;
640
+ export interface DomainResource {
641
+ set: (domainName: string, deployment: string, tags?: string[]) => Promise<Domain>;
642
+ get: (domainName: string) => Promise<Domain>;
643
+ list: () => Promise<DomainListResponse>;
644
+ remove: (domainName: string) => Promise<void>;
645
+ confirm: (domainName: string) => Promise<{ message: string }>;
646
+ dns: (domainName: string) => Promise<{ domain: string; dns: any }>;
647
+ records: (domainName: string) => Promise<{ domain: string; records: any[] }>;
648
+ share: (domainName: string) => Promise<{ domain: string; hash: string }>;
649
649
  }
650
650
 
651
651
  /**
@@ -706,15 +706,15 @@ export function generateDeploymentUrl(deployment: string, sitesDomain?: string):
706
706
  }
707
707
 
708
708
  /**
709
- * Generate alias URL based on whether it's internal (subdomain) or external (custom domain)
709
+ * Generate domain URL based on whether it's internal (subdomain) or external (custom domain)
710
710
  */
711
- export function generateAliasUrl(alias: string, sitesDomain?: string): string {
712
- // If alias contains dots, it's an external domain
713
- if (alias.includes('.')) {
714
- return `https://${alias}`;
711
+ export function generateDomainUrl(domain: string, sitesDomain?: string): string {
712
+ // If domain contains dots, it's an external domain
713
+ if (domain.includes('.')) {
714
+ return `https://${domain}`;
715
715
  }
716
-
716
+
717
717
  // Otherwise it's an internal subdomain
718
- const domain = sitesDomain || 'statichost.dev';
719
- return `https://${alias}.${domain}`;
718
+ const siteDomain = sitesDomain || 'statichost.dev';
719
+ return `https://${domain}.${siteDomain}`;
720
720
  }