@shipstatic/types 0.4.9 → 0.4.10

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/README.md CHANGED
@@ -55,7 +55,7 @@ import type { DeploymentResource, DomainResource, AccountResource } from '@ships
55
55
  ### Validation Utilities
56
56
 
57
57
  ```typescript
58
- import { validateApiKey, validateDeployToken, validateSubdomain } from '@shipstatic/types';
58
+ import { validateApiKey, validateDeployToken, isDeployment } from '@shipstatic/types';
59
59
  ```
60
60
 
61
61
  ### Constants
package/dist/index.d.ts CHANGED
@@ -364,9 +364,10 @@ export declare function validateDeployToken(deployToken: string): void;
364
364
  */
365
365
  export declare function validateApiUrl(apiUrl: string): void;
366
366
  /**
367
- * Validate subdomain format (deployment pattern)
367
+ * Check if a string matches the deployment ID pattern (word-word-alphanumeric7)
368
+ * Example: "happy-cat-abc1234"
368
369
  */
369
- export declare function validateSubdomain(input: string): boolean;
370
+ export declare function isDeployment(input: string): boolean;
370
371
  /**
371
372
  * Request payload for SPA check endpoint
372
373
  */
package/dist/index.js CHANGED
@@ -253,10 +253,10 @@ export function validateApiUrl(apiUrl) {
253
253
  }
254
254
  }
255
255
  /**
256
- * Validate subdomain format (deployment pattern)
256
+ * Check if a string matches the deployment ID pattern (word-word-alphanumeric7)
257
+ * Example: "happy-cat-abc1234"
257
258
  */
258
- export function validateSubdomain(input) {
259
- // Deployment subdomain format: word-word-7chars (e.g. "happy-cat-abc1234")
259
+ export function isDeployment(input) {
260
260
  return /^[a-z]+-[a-z]+-[a-z0-9]{7}$/i.test(input);
261
261
  }
262
262
  // =============================================================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/types",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "description": "Shared types for Shipstatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -580,10 +580,10 @@ export function validateApiUrl(apiUrl: string): void {
580
580
  }
581
581
 
582
582
  /**
583
- * Validate subdomain format (deployment pattern)
583
+ * Check if a string matches the deployment ID pattern (word-word-alphanumeric7)
584
+ * Example: "happy-cat-abc1234"
584
585
  */
585
- export function validateSubdomain(input: string): boolean {
586
- // Deployment subdomain format: word-word-7chars (e.g. "happy-cat-abc1234")
586
+ export function isDeployment(input: string): boolean {
587
587
  return /^[a-z]+-[a-z]+-[a-z0-9]{7}$/i.test(input);
588
588
  }
589
589