@shipstatic/types 0.4.16 → 0.4.18

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
@@ -138,6 +138,8 @@ export interface DomainDnsResponse {
138
138
  export interface DomainRecordsResponse {
139
139
  /** The domain name */
140
140
  domain: string;
141
+ /** The apex (registered) domain where DNS records are managed */
142
+ apex: string;
141
143
  /** Required DNS records for configuration */
142
144
  records: DnsRecord[];
143
145
  }
@@ -758,6 +760,29 @@ export declare function generateDeploymentUrl(deployment: string, platformDomain
758
760
  * Domains are stored as FQDNs, so this just prepends https://
759
761
  */
760
762
  export declare function generateDomainUrl(domain: string): string;
763
+ /**
764
+ * Tag validation constraints shared across UI and API.
765
+ * These rules define the single source of truth for tag validation.
766
+ */
767
+ export declare const TAG_CONSTRAINTS: {
768
+ /** Minimum tag length in characters */
769
+ readonly MIN_LENGTH: 3;
770
+ /** Maximum tag length in characters (concise tags, matches Stack Overflow's original limit) */
771
+ readonly MAX_LENGTH: 25;
772
+ /** Maximum number of tags allowed per resource */
773
+ readonly MAX_COUNT: 10;
774
+ /** Allowed separator characters between tag segments */
775
+ readonly SEPARATORS: "._-";
776
+ };
777
+ /**
778
+ * Tag validation pattern.
779
+ * Must start and end with alphanumeric (a-z, 0-9).
780
+ * Can contain separators (. _ -) between segments, but not consecutive.
781
+ *
782
+ * Valid examples: 'production', 'v1.2.3', 'api_v2', 'us-east-1'
783
+ * Invalid examples: 'ab' (too short), '-prod' (starts with separator), 'foo--bar' (consecutive separators)
784
+ */
785
+ export declare const TAG_PATTERN: RegExp;
761
786
  /**
762
787
  * Serialize tags array to JSON string for database storage.
763
788
  * Returns null for empty or undefined arrays.
package/dist/index.js CHANGED
@@ -351,6 +351,29 @@ export function generateDomainUrl(domain) {
351
351
  // =============================================================================
352
352
  // TAG UTILITIES
353
353
  // =============================================================================
354
+ /**
355
+ * Tag validation constraints shared across UI and API.
356
+ * These rules define the single source of truth for tag validation.
357
+ */
358
+ export const TAG_CONSTRAINTS = {
359
+ /** Minimum tag length in characters */
360
+ MIN_LENGTH: 3,
361
+ /** Maximum tag length in characters (concise tags, matches Stack Overflow's original limit) */
362
+ MAX_LENGTH: 25,
363
+ /** Maximum number of tags allowed per resource */
364
+ MAX_COUNT: 10,
365
+ /** Allowed separator characters between tag segments */
366
+ SEPARATORS: '._-',
367
+ };
368
+ /**
369
+ * Tag validation pattern.
370
+ * Must start and end with alphanumeric (a-z, 0-9).
371
+ * Can contain separators (. _ -) between segments, but not consecutive.
372
+ *
373
+ * Valid examples: 'production', 'v1.2.3', 'api_v2', 'us-east-1'
374
+ * Invalid examples: 'ab' (too short), '-prod' (starts with separator), 'foo--bar' (consecutive separators)
375
+ */
376
+ export const TAG_PATTERN = /^[a-z0-9]+(?:[._-][a-z0-9]+)*$/;
354
377
  /**
355
378
  * Serialize tags array to JSON string for database storage.
356
379
  * Returns null for empty or undefined arrays.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/types",
3
- "version": "0.4.16",
3
+ "version": "0.4.18",
4
4
  "description": "Shared types for Shipstatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -158,6 +158,8 @@ export interface DomainDnsResponse {
158
158
  export interface DomainRecordsResponse {
159
159
  /** The domain name */
160
160
  domain: string;
161
+ /** The apex (registered) domain where DNS records are managed */
162
+ apex: string;
161
163
  /** Required DNS records for configuration */
162
164
  records: DnsRecord[];
163
165
  }
@@ -1129,6 +1131,31 @@ export function generateDomainUrl(domain: string): string {
1129
1131
  // TAG UTILITIES
1130
1132
  // =============================================================================
1131
1133
 
1134
+ /**
1135
+ * Tag validation constraints shared across UI and API.
1136
+ * These rules define the single source of truth for tag validation.
1137
+ */
1138
+ export const TAG_CONSTRAINTS = {
1139
+ /** Minimum tag length in characters */
1140
+ MIN_LENGTH: 3,
1141
+ /** Maximum tag length in characters (concise tags, matches Stack Overflow's original limit) */
1142
+ MAX_LENGTH: 25,
1143
+ /** Maximum number of tags allowed per resource */
1144
+ MAX_COUNT: 10,
1145
+ /** Allowed separator characters between tag segments */
1146
+ SEPARATORS: '._-',
1147
+ } as const;
1148
+
1149
+ /**
1150
+ * Tag validation pattern.
1151
+ * Must start and end with alphanumeric (a-z, 0-9).
1152
+ * Can contain separators (. _ -) between segments, but not consecutive.
1153
+ *
1154
+ * Valid examples: 'production', 'v1.2.3', 'api_v2', 'us-east-1'
1155
+ * Invalid examples: 'ab' (too short), '-prod' (starts with separator), 'foo--bar' (consecutive separators)
1156
+ */
1157
+ export const TAG_PATTERN = /^[a-z0-9]+(?:[._-][a-z0-9]+)*$/;
1158
+
1132
1159
  /**
1133
1160
  * Serialize tags array to JSON string for database storage.
1134
1161
  * Returns null for empty or undefined arrays.