@shipstatic/types 0.4.15 → 0.4.17
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 +29 -0
- package/dist/index.js +30 -1
- package/package.json +1 -1
- package/src/index.ts +32 -1
package/dist/index.d.ts
CHANGED
|
@@ -52,11 +52,17 @@ export interface DeploymentListResponse {
|
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Domain status constants
|
|
55
|
+
*
|
|
56
|
+
* - PENDING: DNS not configured
|
|
57
|
+
* - PARTIAL: DNS partially configured
|
|
58
|
+
* - SUCCESS: DNS fully verified
|
|
59
|
+
* - PAUSED: Domain paused due to plan enforcement (billing)
|
|
55
60
|
*/
|
|
56
61
|
export declare const DomainStatus: {
|
|
57
62
|
readonly PENDING: "pending";
|
|
58
63
|
readonly PARTIAL: "partial";
|
|
59
64
|
readonly SUCCESS: "success";
|
|
65
|
+
readonly PAUSED: "paused";
|
|
60
66
|
};
|
|
61
67
|
export type DomainStatusType = typeof DomainStatus[keyof typeof DomainStatus];
|
|
62
68
|
/**
|
|
@@ -752,6 +758,29 @@ export declare function generateDeploymentUrl(deployment: string, platformDomain
|
|
|
752
758
|
* Domains are stored as FQDNs, so this just prepends https://
|
|
753
759
|
*/
|
|
754
760
|
export declare function generateDomainUrl(domain: string): string;
|
|
761
|
+
/**
|
|
762
|
+
* Tag validation constraints shared across UI and API.
|
|
763
|
+
* These rules define the single source of truth for tag validation.
|
|
764
|
+
*/
|
|
765
|
+
export declare const TAG_CONSTRAINTS: {
|
|
766
|
+
/** Minimum tag length in characters */
|
|
767
|
+
readonly MIN_LENGTH: 3;
|
|
768
|
+
/** Maximum tag length in characters (concise tags, matches Stack Overflow's original limit) */
|
|
769
|
+
readonly MAX_LENGTH: 25;
|
|
770
|
+
/** Maximum number of tags allowed per resource */
|
|
771
|
+
readonly MAX_COUNT: 10;
|
|
772
|
+
/** Allowed separator characters between tag segments */
|
|
773
|
+
readonly SEPARATORS: "._-";
|
|
774
|
+
};
|
|
775
|
+
/**
|
|
776
|
+
* Tag validation pattern.
|
|
777
|
+
* Must start and end with alphanumeric (a-z, 0-9).
|
|
778
|
+
* Can contain separators (. _ -) between segments, but not consecutive.
|
|
779
|
+
*
|
|
780
|
+
* Valid examples: 'production', 'v1.2.3', 'api_v2', 'us-east-1'
|
|
781
|
+
* Invalid examples: 'ab' (too short), '-prod' (starts with separator), 'foo--bar' (consecutive separators)
|
|
782
|
+
*/
|
|
783
|
+
export declare const TAG_PATTERN: RegExp;
|
|
755
784
|
/**
|
|
756
785
|
* Serialize tags array to JSON string for database storage.
|
|
757
786
|
* Returns null for empty or undefined arrays.
|
package/dist/index.js
CHANGED
|
@@ -19,11 +19,17 @@ export const DeploymentStatus = {
|
|
|
19
19
|
// =============================================================================
|
|
20
20
|
/**
|
|
21
21
|
* Domain status constants
|
|
22
|
+
*
|
|
23
|
+
* - PENDING: DNS not configured
|
|
24
|
+
* - PARTIAL: DNS partially configured
|
|
25
|
+
* - SUCCESS: DNS fully verified
|
|
26
|
+
* - PAUSED: Domain paused due to plan enforcement (billing)
|
|
22
27
|
*/
|
|
23
28
|
export const DomainStatus = {
|
|
24
29
|
PENDING: 'pending',
|
|
25
30
|
PARTIAL: 'partial',
|
|
26
|
-
SUCCESS: 'success'
|
|
31
|
+
SUCCESS: 'success',
|
|
32
|
+
PAUSED: 'paused'
|
|
27
33
|
};
|
|
28
34
|
// =============================================================================
|
|
29
35
|
// ACCOUNT TYPES
|
|
@@ -345,6 +351,29 @@ export function generateDomainUrl(domain) {
|
|
|
345
351
|
// =============================================================================
|
|
346
352
|
// TAG UTILITIES
|
|
347
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]+)*$/;
|
|
348
377
|
/**
|
|
349
378
|
* Serialize tags array to JSON string for database storage.
|
|
350
379
|
* Returns null for empty or undefined arrays.
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -66,11 +66,17 @@ export interface DeploymentListResponse {
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* Domain status constants
|
|
69
|
+
*
|
|
70
|
+
* - PENDING: DNS not configured
|
|
71
|
+
* - PARTIAL: DNS partially configured
|
|
72
|
+
* - SUCCESS: DNS fully verified
|
|
73
|
+
* - PAUSED: Domain paused due to plan enforcement (billing)
|
|
69
74
|
*/
|
|
70
75
|
export const DomainStatus = {
|
|
71
76
|
PENDING: 'pending',
|
|
72
77
|
PARTIAL: 'partial',
|
|
73
|
-
SUCCESS: 'success'
|
|
78
|
+
SUCCESS: 'success',
|
|
79
|
+
PAUSED: 'paused'
|
|
74
80
|
} as const;
|
|
75
81
|
|
|
76
82
|
export type DomainStatusType = typeof DomainStatus[keyof typeof DomainStatus];
|
|
@@ -1123,6 +1129,31 @@ export function generateDomainUrl(domain: string): string {
|
|
|
1123
1129
|
// TAG UTILITIES
|
|
1124
1130
|
// =============================================================================
|
|
1125
1131
|
|
|
1132
|
+
/**
|
|
1133
|
+
* Tag validation constraints shared across UI and API.
|
|
1134
|
+
* These rules define the single source of truth for tag validation.
|
|
1135
|
+
*/
|
|
1136
|
+
export const TAG_CONSTRAINTS = {
|
|
1137
|
+
/** Minimum tag length in characters */
|
|
1138
|
+
MIN_LENGTH: 3,
|
|
1139
|
+
/** Maximum tag length in characters (concise tags, matches Stack Overflow's original limit) */
|
|
1140
|
+
MAX_LENGTH: 25,
|
|
1141
|
+
/** Maximum number of tags allowed per resource */
|
|
1142
|
+
MAX_COUNT: 10,
|
|
1143
|
+
/** Allowed separator characters between tag segments */
|
|
1144
|
+
SEPARATORS: '._-',
|
|
1145
|
+
} as const;
|
|
1146
|
+
|
|
1147
|
+
/**
|
|
1148
|
+
* Tag validation pattern.
|
|
1149
|
+
* Must start and end with alphanumeric (a-z, 0-9).
|
|
1150
|
+
* Can contain separators (. _ -) between segments, but not consecutive.
|
|
1151
|
+
*
|
|
1152
|
+
* Valid examples: 'production', 'v1.2.3', 'api_v2', 'us-east-1'
|
|
1153
|
+
* Invalid examples: 'ab' (too short), '-prod' (starts with separator), 'foo--bar' (consecutive separators)
|
|
1154
|
+
*/
|
|
1155
|
+
export const TAG_PATTERN = /^[a-z0-9]+(?:[._-][a-z0-9]+)*$/;
|
|
1156
|
+
|
|
1126
1157
|
/**
|
|
1127
1158
|
* Serialize tags array to JSON string for database storage.
|
|
1128
1159
|
* Returns null for empty or undefined arrays.
|