@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 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
  */
@@ -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 = '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' | 'billing_suspended' | 'billing_active' | 'billing_canceled' | 'billing_paused' | 'billing_expired' | 'billing_paid' | 'billing_trialing' | 'billing_scheduled_cancel' | 'billing_unpaid' | 'billing_update' | 'billing_past_due' | 'billing_terminated' | 'billing_manual_sync' | 'refund_create' | 'dispute_create';
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 = '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';
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
- * 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.11",
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
 
@@ -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
- | 'account_create'
843
- | 'account_update'
844
- | 'account_delete'
845
- | 'account_key_generate'
846
- | 'account_plan_paid'
847
- | 'account_plan_transition'
848
- | 'account_suspended'
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
- | 'deployment_create'
851
- | 'deployment_update'
852
- | 'deployment_delete'
853
- | 'deployment_claim'
851
+ | 'deployment.create'
852
+ | 'deployment.update'
853
+ | 'deployment.delete'
854
+ | 'deployment.claim'
854
855
  // Domain events
855
- | 'domain_create'
856
- | 'domain_update'
857
- | 'domain_delete'
858
- | 'domain_verify'
856
+ | 'domain.create'
857
+ | 'domain.update'
858
+ | 'domain.delete'
859
+ | 'domain.verify'
859
860
  // Token events
860
- | 'token_create'
861
- | 'token_consume'
862
- // System events (not user-visible)
863
- | 'admin_account_plan_update'
864
- | 'admin_account_ref_update'
865
- | 'admin_account_billing_update'
866
- | 'admin_account_tags_update'
867
- | 'admin_deployment_delete'
868
- | 'admin_domain_delete'
869
- // Billing events (internal, not shown to users except account_plan_transition)
870
- | 'billing_suspended'
871
- | 'billing_active'
872
- | 'billing_canceled'
873
- | 'billing_paused'
874
- | 'billing_expired'
875
- | 'billing_paid'
876
- | 'billing_trialing'
877
- | 'billing_scheduled_cancel'
878
- | 'billing_unpaid'
879
- | 'billing_update'
880
- | 'billing_past_due'
881
- | 'billing_terminated'
882
- | 'billing_manual_sync'
883
- | 'refund_create'
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
- | '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';
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