@shipstatic/types 0.4.2 → 0.4.4

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
@@ -580,11 +580,11 @@ export interface KeysResource {
580
580
  /**
581
581
  * All activity event types logged in the system
582
582
  */
583
- export type ActivityEvent = 'account_create' | 'account_update' | 'account_delete' | 'account_key_generate' | 'account_plan_paid' | 'account_plan_transition' | 'account_suspended' | 'deployment_create' | 'deployment_delete' | 'deployment_claim' | 'domain_create' | 'domain_update' | 'domain_delete' | 'domain_set' | '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_created' | 'dispute_created';
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';
584
584
  /**
585
585
  * Activity events visible to users in the dashboard
586
586
  */
587
- export type UserVisibleActivityEvent = 'account_create' | 'account_update' | 'account_delete' | 'account_key_generate' | 'account_plan_transition' | 'deployment_create' | 'deployment_delete' | 'deployment_claim' | 'domain_create' | 'domain_update' | 'domain_delete' | 'domain_set' | 'domain_verify' | 'token_create' | 'token_consume';
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';
588
588
  /**
589
589
  * Activity record returned from the API
590
590
  */
@@ -600,6 +600,38 @@ export interface Activity {
600
600
  /** JSON-encoded metadata (parse with JSON.parse) */
601
601
  meta?: string;
602
602
  }
603
+ /**
604
+ * Parsed activity metadata.
605
+ * Different events populate different fields.
606
+ */
607
+ export interface ActivityMeta {
608
+ /** Number of files in deployment */
609
+ files?: number;
610
+ /** Total size in bytes */
611
+ size?: number;
612
+ /** Whether deployment has config */
613
+ hasConfig?: boolean;
614
+ /** Whether this was an update (vs create) */
615
+ isUpdate?: boolean;
616
+ /** Whether domain was already verified */
617
+ wasVerified?: boolean;
618
+ /** Previous deployment ID before rebinding */
619
+ previousDeployment?: string;
620
+ /** Tags that were set/updated */
621
+ tags?: string[];
622
+ /** OAuth provider name */
623
+ provider?: string;
624
+ /** Account email */
625
+ email?: string;
626
+ /** Account display name */
627
+ name?: string;
628
+ /** Previous plan */
629
+ from?: string;
630
+ /** New plan */
631
+ to?: string;
632
+ /** Allow additional fields for future use */
633
+ [key: string]: unknown;
634
+ }
603
635
  /**
604
636
  * Response from GET /activities endpoint
605
637
  */
@@ -668,10 +700,10 @@ export interface RateLimitData {
668
700
  timestamp: number;
669
701
  }
670
702
  /**
671
- * Generate deployment URL from deployment ID and sites domain
703
+ * Generate deployment URL from deployment ID and base domain
672
704
  */
673
- export declare function generateDeploymentUrl(deployment: string, sitesDomain?: string): string;
705
+ export declare function generateDeploymentUrl(deployment: string, baseDomain?: string): string;
674
706
  /**
675
707
  * Generate domain URL based on whether it's internal (subdomain) or external (custom domain)
676
708
  */
677
- export declare function generateDomainUrl(domain: string, sitesDomain?: string): string;
709
+ export declare function generateDomainUrl(domainName: string, baseDomain?: string): string;
package/dist/index.js CHANGED
@@ -281,21 +281,21 @@ export const FileValidationStatus = {
281
281
  // URL GENERATION UTILITIES
282
282
  // =============================================================================
283
283
  /**
284
- * Generate deployment URL from deployment ID and sites domain
284
+ * Generate deployment URL from deployment ID and base domain
285
285
  */
286
- export function generateDeploymentUrl(deployment, sitesDomain) {
287
- const domain = sitesDomain || 'statichost.com';
286
+ export function generateDeploymentUrl(deployment, baseDomain) {
287
+ const domain = baseDomain || 'shipstatic.com';
288
288
  return `https://${deployment}.${domain}`;
289
289
  }
290
290
  /**
291
291
  * Generate domain URL based on whether it's internal (subdomain) or external (custom domain)
292
292
  */
293
- export function generateDomainUrl(domain, sitesDomain) {
293
+ export function generateDomainUrl(domainName, baseDomain) {
294
294
  // If domain contains dots, it's an external domain
295
- if (domain.includes('.')) {
296
- return `https://${domain}`;
295
+ if (domainName.includes('.')) {
296
+ return `https://${domainName}`;
297
297
  }
298
298
  // Otherwise it's an internal subdomain
299
- const siteDomain = sitesDomain || 'statichost.dev';
300
- return `https://${domain}.${siteDomain}`;
299
+ const domain = baseDomain || 'shipstatic.com';
300
+ return `https://${domainName}.${domain}`;
301
301
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/types",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Shared types for Shipstatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -848,13 +848,13 @@ export type ActivityEvent =
848
848
  | 'account_suspended'
849
849
  // Deployment events
850
850
  | 'deployment_create'
851
+ | 'deployment_update'
851
852
  | 'deployment_delete'
852
853
  | 'deployment_claim'
853
854
  // Domain events
854
855
  | 'domain_create'
855
856
  | 'domain_update'
856
857
  | 'domain_delete'
857
- | 'domain_set'
858
858
  | 'domain_verify'
859
859
  // Token events
860
860
  | 'token_create'
@@ -880,8 +880,8 @@ export type ActivityEvent =
880
880
  | 'billing_past_due'
881
881
  | 'billing_terminated'
882
882
  | 'billing_manual_sync'
883
- | 'refund_created'
884
- | 'dispute_created';
883
+ | 'refund_create'
884
+ | 'dispute_create';
885
885
 
886
886
  /**
887
887
  * Activity events visible to users in the dashboard
@@ -893,12 +893,12 @@ export type UserVisibleActivityEvent =
893
893
  | 'account_key_generate'
894
894
  | 'account_plan_transition'
895
895
  | 'deployment_create'
896
+ | 'deployment_update'
896
897
  | 'deployment_delete'
897
898
  | 'deployment_claim'
898
899
  | 'domain_create'
899
900
  | 'domain_update'
900
901
  | 'domain_delete'
901
- | 'domain_set'
902
902
  | 'domain_verify'
903
903
  | 'token_create'
904
904
  | 'token_consume';
@@ -919,6 +919,47 @@ export interface Activity {
919
919
  meta?: string;
920
920
  }
921
921
 
922
+ /**
923
+ * Parsed activity metadata.
924
+ * Different events populate different fields.
925
+ */
926
+ export interface ActivityMeta {
927
+ // Deployment events
928
+ /** Number of files in deployment */
929
+ files?: number;
930
+ /** Total size in bytes */
931
+ size?: number;
932
+ /** Whether deployment has config */
933
+ hasConfig?: boolean;
934
+
935
+ // Domain events
936
+ /** Whether this was an update (vs create) */
937
+ isUpdate?: boolean;
938
+ /** Whether domain was already verified */
939
+ wasVerified?: boolean;
940
+ /** Previous deployment ID before rebinding */
941
+ previousDeployment?: string;
942
+ /** Tags that were set/updated */
943
+ tags?: string[];
944
+
945
+ // Account events
946
+ /** OAuth provider name */
947
+ provider?: string;
948
+ /** Account email */
949
+ email?: string;
950
+ /** Account display name */
951
+ name?: string;
952
+
953
+ // Plan transition events
954
+ /** Previous plan */
955
+ from?: string;
956
+ /** New plan */
957
+ to?: string;
958
+
959
+ /** Allow additional fields for future use */
960
+ [key: string]: unknown;
961
+ }
962
+
922
963
  /**
923
964
  * Response from GET /activities endpoint
924
965
  */
@@ -1003,23 +1044,23 @@ export interface RateLimitData {
1003
1044
  // =============================================================================
1004
1045
 
1005
1046
  /**
1006
- * Generate deployment URL from deployment ID and sites domain
1047
+ * Generate deployment URL from deployment ID and base domain
1007
1048
  */
1008
- export function generateDeploymentUrl(deployment: string, sitesDomain?: string): string {
1009
- const domain = sitesDomain || 'statichost.com';
1049
+ export function generateDeploymentUrl(deployment: string, baseDomain?: string): string {
1050
+ const domain = baseDomain || 'shipstatic.com';
1010
1051
  return `https://${deployment}.${domain}`;
1011
1052
  }
1012
1053
 
1013
1054
  /**
1014
1055
  * Generate domain URL based on whether it's internal (subdomain) or external (custom domain)
1015
1056
  */
1016
- export function generateDomainUrl(domain: string, sitesDomain?: string): string {
1057
+ export function generateDomainUrl(domainName: string, baseDomain?: string): string {
1017
1058
  // If domain contains dots, it's an external domain
1018
- if (domain.includes('.')) {
1019
- return `https://${domain}`;
1059
+ if (domainName.includes('.')) {
1060
+ return `https://${domainName}`;
1020
1061
  }
1021
1062
 
1022
1063
  // Otherwise it's an internal subdomain
1023
- const siteDomain = sitesDomain || 'statichost.dev';
1024
- return `https://${domain}.${siteDomain}`;
1064
+ const domain = baseDomain || 'shipstatic.com';
1065
+ return `https://${domainName}.${domain}`;
1025
1066
  }