@shipstatic/types 0.4.9 → 0.4.11
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 +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/src/index.ts +59 -59
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,
|
|
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
|
-
*
|
|
367
|
+
* Check if a string matches the deployment ID pattern (word-word-alphanumeric7)
|
|
368
|
+
* Example: "happy-cat-abc1234"
|
|
368
369
|
*/
|
|
369
|
-
export declare function
|
|
370
|
+
export declare function isDeployment(input: string): boolean;
|
|
370
371
|
/**
|
|
371
372
|
* Request payload for SPA check endpoint
|
|
372
373
|
*/
|
|
@@ -578,13 +579,14 @@ export interface KeysResource {
|
|
|
578
579
|
}>;
|
|
579
580
|
}
|
|
580
581
|
/**
|
|
581
|
-
* All activity event types logged in the system
|
|
582
|
+
* All activity event types logged in the system.
|
|
583
|
+
* Uses dot notation consistently: {resource}.{action}
|
|
582
584
|
*/
|
|
583
|
-
export type ActivityEvent = '
|
|
585
|
+
export type ActivityEvent = 'account.create' | 'account.update' | 'account.delete' | 'account.key.generate' | 'account.plan.paid' | 'account.plan.transition' | 'account.suspended' | 'deployment.create' | 'deployment.update' | 'deployment.delete' | 'deployment.claim' | 'domain.create' | 'domain.update' | 'domain.delete' | 'domain.verify' | 'token.create' | 'token.consume' | 'admin.account.plan.update' | 'admin.account.ref.update' | 'admin.account.billing.update' | 'admin.account.tags.update' | 'admin.deployment.delete' | 'admin.domain.delete' | 'admin.billing.sync' | 'admin.billing.terminated' | 'billing.active' | 'billing.canceled' | 'billing.paused' | 'billing.expired' | 'billing.paid' | 'billing.trialing' | 'billing.scheduled_cancel' | 'billing.unpaid' | 'billing.update' | 'billing.past_due' | 'refund.created' | 'dispute.created';
|
|
584
586
|
/**
|
|
585
587
|
* Activity events visible to users in the dashboard
|
|
586
588
|
*/
|
|
587
|
-
export type UserVisibleActivityEvent = '
|
|
589
|
+
export type UserVisibleActivityEvent = 'account.create' | 'account.update' | 'account.delete' | 'account.key.generate' | 'account.plan.transition' | 'deployment.create' | 'deployment.update' | 'deployment.delete' | 'deployment.claim' | 'domain.create' | 'domain.update' | 'domain.delete' | 'domain.verify' | 'token.create' | 'token.consume';
|
|
588
590
|
/**
|
|
589
591
|
* Activity record returned from the API
|
|
590
592
|
*/
|
package/dist/index.js
CHANGED
|
@@ -253,10 +253,10 @@ export function validateApiUrl(apiUrl) {
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
/**
|
|
256
|
-
*
|
|
256
|
+
* Check if a string matches the deployment ID pattern (word-word-alphanumeric7)
|
|
257
|
+
* Example: "happy-cat-abc1234"
|
|
257
258
|
*/
|
|
258
|
-
export function
|
|
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
package/src/index.ts
CHANGED
|
@@ -580,10 +580,10 @@ export function validateApiUrl(apiUrl: string): void {
|
|
|
580
580
|
}
|
|
581
581
|
|
|
582
582
|
/**
|
|
583
|
-
*
|
|
583
|
+
* Check if a string matches the deployment ID pattern (word-word-alphanumeric7)
|
|
584
|
+
* Example: "happy-cat-abc1234"
|
|
584
585
|
*/
|
|
585
|
-
export function
|
|
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
|
|
|
@@ -835,73 +835,73 @@ export interface KeysResource {
|
|
|
835
835
|
// =============================================================================
|
|
836
836
|
|
|
837
837
|
/**
|
|
838
|
-
* All activity event types logged in the system
|
|
838
|
+
* All activity event types logged in the system.
|
|
839
|
+
* Uses dot notation consistently: {resource}.{action}
|
|
839
840
|
*/
|
|
840
841
|
export type ActivityEvent =
|
|
841
842
|
// Account events
|
|
842
|
-
| '
|
|
843
|
-
| '
|
|
844
|
-
| '
|
|
845
|
-
| '
|
|
846
|
-
| '
|
|
847
|
-
| '
|
|
848
|
-
| '
|
|
843
|
+
| 'account.create'
|
|
844
|
+
| 'account.update'
|
|
845
|
+
| 'account.delete'
|
|
846
|
+
| 'account.key.generate'
|
|
847
|
+
| 'account.plan.paid'
|
|
848
|
+
| 'account.plan.transition'
|
|
849
|
+
| 'account.suspended'
|
|
849
850
|
// Deployment events
|
|
850
|
-
| '
|
|
851
|
-
| '
|
|
852
|
-
| '
|
|
853
|
-
| '
|
|
851
|
+
| 'deployment.create'
|
|
852
|
+
| 'deployment.update'
|
|
853
|
+
| 'deployment.delete'
|
|
854
|
+
| 'deployment.claim'
|
|
854
855
|
// Domain events
|
|
855
|
-
| '
|
|
856
|
-
| '
|
|
857
|
-
| '
|
|
858
|
-
| '
|
|
856
|
+
| 'domain.create'
|
|
857
|
+
| 'domain.update'
|
|
858
|
+
| 'domain.delete'
|
|
859
|
+
| 'domain.verify'
|
|
859
860
|
// Token events
|
|
860
|
-
| '
|
|
861
|
-
| '
|
|
862
|
-
//
|
|
863
|
-
| '
|
|
864
|
-
| '
|
|
865
|
-
| '
|
|
866
|
-
| '
|
|
867
|
-
| '
|
|
868
|
-
| '
|
|
869
|
-
|
|
870
|
-
| '
|
|
871
|
-
|
|
872
|
-
| '
|
|
873
|
-
| '
|
|
874
|
-
| '
|
|
875
|
-
| '
|
|
876
|
-
| '
|
|
877
|
-
| '
|
|
878
|
-
| '
|
|
879
|
-
| '
|
|
880
|
-
| '
|
|
881
|
-
| '
|
|
882
|
-
| '
|
|
883
|
-
| '
|
|
884
|
-
| 'dispute_create';
|
|
861
|
+
| 'token.create'
|
|
862
|
+
| 'token.consume'
|
|
863
|
+
// Admin events (not user-visible)
|
|
864
|
+
| 'admin.account.plan.update'
|
|
865
|
+
| 'admin.account.ref.update'
|
|
866
|
+
| 'admin.account.billing.update'
|
|
867
|
+
| 'admin.account.tags.update'
|
|
868
|
+
| 'admin.deployment.delete'
|
|
869
|
+
| 'admin.domain.delete'
|
|
870
|
+
| 'admin.billing.sync'
|
|
871
|
+
| 'admin.billing.terminated'
|
|
872
|
+
// Webhook events (logged directly from payment provider)
|
|
873
|
+
| 'billing.active'
|
|
874
|
+
| 'billing.canceled'
|
|
875
|
+
| 'billing.paused'
|
|
876
|
+
| 'billing.expired'
|
|
877
|
+
| 'billing.paid'
|
|
878
|
+
| 'billing.trialing'
|
|
879
|
+
| 'billing.scheduled_cancel'
|
|
880
|
+
| 'billing.unpaid'
|
|
881
|
+
| 'billing.update'
|
|
882
|
+
| 'billing.past_due'
|
|
883
|
+
| 'refund.created'
|
|
884
|
+
| 'dispute.created';
|
|
885
885
|
|
|
886
886
|
/**
|
|
887
887
|
* Activity events visible to users in the dashboard
|
|
888
888
|
*/
|
|
889
889
|
export type UserVisibleActivityEvent =
|
|
890
|
-
| '
|
|
891
|
-
| '
|
|
892
|
-
| '
|
|
893
|
-
| '
|
|
894
|
-
| '
|
|
895
|
-
| '
|
|
896
|
-
| '
|
|
897
|
-
| '
|
|
898
|
-
| '
|
|
899
|
-
| '
|
|
900
|
-
| '
|
|
901
|
-
| '
|
|
902
|
-
| '
|
|
903
|
-
| '
|
|
904
|
-
| '
|
|
890
|
+
| 'account.create'
|
|
891
|
+
| 'account.update'
|
|
892
|
+
| 'account.delete'
|
|
893
|
+
| 'account.key.generate'
|
|
894
|
+
| 'account.plan.transition'
|
|
895
|
+
| 'deployment.create'
|
|
896
|
+
| 'deployment.update'
|
|
897
|
+
| 'deployment.delete'
|
|
898
|
+
| 'deployment.claim'
|
|
899
|
+
| 'domain.create'
|
|
900
|
+
| 'domain.update'
|
|
901
|
+
| 'domain.delete'
|
|
902
|
+
| 'domain.verify'
|
|
903
|
+
| 'token.create'
|
|
904
|
+
| 'token.consume';
|
|
905
905
|
|
|
906
906
|
/**
|
|
907
907
|
* Activity record returned from the API
|