@shipstatic/types 0.7.1 → 0.7.3

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
@@ -388,6 +388,19 @@ export declare const BLOCKED_EXTENSIONS: ReadonlySet<string>;
388
388
  * isBlockedExtension('README') // false
389
389
  */
390
390
  export declare function isBlockedExtension(filename: string): boolean;
391
+ /**
392
+ * Directory names that indicate an unbuilt project was uploaded instead of build output.
393
+ * Used for early detection in CLI, browser, and server validation.
394
+ */
395
+ export declare const UNBUILT_PROJECT_MARKERS: ReadonlySet<string>;
396
+ /**
397
+ * Check if a file path contains an unbuilt project marker directory.
398
+ *
399
+ * @example
400
+ * hasUnbuiltMarker('node_modules/react/index.js') // true
401
+ * hasUnbuiltMarker('dist/index.html') // false
402
+ */
403
+ export declare function hasUnbuiltMarker(filePath: string): boolean;
391
404
  /**
392
405
  * Simple ping response for health checks
393
406
  */
@@ -643,7 +656,7 @@ export interface KeysResource {
643
656
  * All activity event types logged in the system.
644
657
  * Uses dot notation consistently: {resource}.{action}
645
658
  */
646
- 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.labels.update' | 'admin.deployment.delete' | 'admin.domain.delete' | 'admin.billing.sync' | 'admin.billing.terminated' | 'admin.impersonate' | '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';
659
+ 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.labels.update' | 'admin.deployment.delete' | 'admin.domain.delete' | 'admin.billing.sync' | 'admin.billing.terminated' | 'admin.impersonate' | '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' | 'billing.sync' | 'billing.stale' | 'billing.race';
647
660
  /**
648
661
  * Activity events visible to users in the dashboard
649
662
  */
package/dist/index.js CHANGED
@@ -249,6 +249,27 @@ export function isBlockedExtension(filename) {
249
249
  const ext = filename.slice(dotIndex + 1).toLowerCase();
250
250
  return BLOCKED_EXTENSIONS.has(ext);
251
251
  }
252
+ // =============================================================================
253
+ // UNBUILT PROJECT MARKERS
254
+ // =============================================================================
255
+ /**
256
+ * Directory names that indicate an unbuilt project was uploaded instead of build output.
257
+ * Used for early detection in CLI, browser, and server validation.
258
+ */
259
+ export const UNBUILT_PROJECT_MARKERS = new Set([
260
+ 'node_modules',
261
+ ]);
262
+ /**
263
+ * Check if a file path contains an unbuilt project marker directory.
264
+ *
265
+ * @example
266
+ * hasUnbuiltMarker('node_modules/react/index.js') // true
267
+ * hasUnbuiltMarker('dist/index.html') // false
268
+ */
269
+ export function hasUnbuiltMarker(filePath) {
270
+ const segments = filePath.replace(/\\/g, '/').split('/').filter(Boolean);
271
+ return segments.some(s => UNBUILT_PROJECT_MARKERS.has(s));
272
+ }
252
273
  // API Key Configuration
253
274
  export const API_KEY_PREFIX = 'ship-';
254
275
  export const API_KEY_HEX_LENGTH = 64;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipstatic/types",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Shared types for Shipstatic platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -571,6 +571,30 @@ export function isBlockedExtension(filename: string): boolean {
571
571
  return BLOCKED_EXTENSIONS.has(ext);
572
572
  }
573
573
 
574
+ // =============================================================================
575
+ // UNBUILT PROJECT MARKERS
576
+ // =============================================================================
577
+
578
+ /**
579
+ * Directory names that indicate an unbuilt project was uploaded instead of build output.
580
+ * Used for early detection in CLI, browser, and server validation.
581
+ */
582
+ export const UNBUILT_PROJECT_MARKERS: ReadonlySet<string> = new Set([
583
+ 'node_modules',
584
+ ]);
585
+
586
+ /**
587
+ * Check if a file path contains an unbuilt project marker directory.
588
+ *
589
+ * @example
590
+ * hasUnbuiltMarker('node_modules/react/index.js') // true
591
+ * hasUnbuiltMarker('dist/index.html') // false
592
+ */
593
+ export function hasUnbuiltMarker(filePath: string): boolean {
594
+ const segments = filePath.replace(/\\/g, '/').split('/').filter(Boolean);
595
+ return segments.some(s => UNBUILT_PROJECT_MARKERS.has(s));
596
+ }
597
+
574
598
  // =============================================================================
575
599
  // COMMON RESPONSE PATTERNS
576
600
  // =============================================================================
@@ -978,7 +1002,11 @@ export type ActivityEvent =
978
1002
  | 'billing.update'
979
1003
  | 'billing.past_due'
980
1004
  | 'refund.created'
981
- | 'dispute.created';
1005
+ | 'dispute.created'
1006
+ // Billing operational events (admin/debug only, not user-visible)
1007
+ | 'billing.sync' // Outbound: unit count pushed to payment provider
1008
+ | 'billing.stale' // Dropped: webhook predates last known state
1009
+ | 'billing.race'; // Dropped: concurrent webhook already updated state
982
1010
 
983
1011
  /**
984
1012
  * Activity events visible to users in the dashboard