@shipstatic/types 0.7.5 → 0.7.6
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 +8 -8
- package/dist/index.js +8 -8
- package/package.json +2 -2
- package/src/index.ts +8 -8
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Shared TypeScript types, constants, and utilities for the
|
|
2
|
+
* @file Shared TypeScript types, constants, and utilities for the ShipStatic platform.
|
|
3
3
|
* This package is the single source of truth for all shared data structures.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
@@ -272,7 +272,7 @@ export interface AccountOverrides {
|
|
|
272
272
|
totalSize?: number;
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
|
-
* All possible error types in the
|
|
275
|
+
* All possible error types in the ShipStatic platform
|
|
276
276
|
* Names are developer-friendly while wire format stays consistent
|
|
277
277
|
*/
|
|
278
278
|
export declare enum ErrorType {
|
|
@@ -824,24 +824,24 @@ export interface UploadedFile {
|
|
|
824
824
|
* Check if a domain is a platform domain (subdomain of our platform).
|
|
825
825
|
* Platform domains are free and don't require DNS verification.
|
|
826
826
|
*
|
|
827
|
-
* @example isPlatformDomain("www.shipstatic.
|
|
828
|
-
* @example isPlatformDomain("example.com", "shipstatic.
|
|
827
|
+
* @example isPlatformDomain("www.shipstatic.com", "shipstatic.com") → true
|
|
828
|
+
* @example isPlatformDomain("example.com", "shipstatic.com") → false
|
|
829
829
|
*/
|
|
830
830
|
export declare function isPlatformDomain(domain: string, platformDomain: string): boolean;
|
|
831
831
|
/**
|
|
832
832
|
* Check if a domain is a custom domain (not a platform subdomain).
|
|
833
833
|
* Custom domains are billable and require DNS verification.
|
|
834
834
|
*
|
|
835
|
-
* @example isCustomDomain("example.com", "shipstatic.
|
|
836
|
-
* @example isCustomDomain("www.shipstatic.
|
|
835
|
+
* @example isCustomDomain("example.com", "shipstatic.com") → true
|
|
836
|
+
* @example isCustomDomain("www.shipstatic.com", "shipstatic.com") → false
|
|
837
837
|
*/
|
|
838
838
|
export declare function isCustomDomain(domain: string, platformDomain: string): boolean;
|
|
839
839
|
/**
|
|
840
840
|
* Extract subdomain from a platform domain.
|
|
841
841
|
* Returns null if not a platform domain.
|
|
842
842
|
*
|
|
843
|
-
* @example extractSubdomain("www.shipstatic.
|
|
844
|
-
* @example extractSubdomain("example.com", "shipstatic.
|
|
843
|
+
* @example extractSubdomain("www.shipstatic.com", "shipstatic.com") → "www"
|
|
844
|
+
* @example extractSubdomain("example.com", "shipstatic.com") → null
|
|
845
845
|
*/
|
|
846
846
|
export declare function extractSubdomain(domain: string, platformDomain: string): string | null;
|
|
847
847
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Shared TypeScript types, constants, and utilities for the
|
|
2
|
+
* @file Shared TypeScript types, constants, and utilities for the ShipStatic platform.
|
|
3
3
|
* This package is the single source of truth for all shared data structures.
|
|
4
4
|
*/
|
|
5
5
|
// =============================================================================
|
|
@@ -50,7 +50,7 @@ export const AccountPlan = {
|
|
|
50
50
|
// ERROR SYSTEM
|
|
51
51
|
// =============================================================================
|
|
52
52
|
/**
|
|
53
|
-
* All possible error types in the
|
|
53
|
+
* All possible error types in the ShipStatic platform
|
|
54
54
|
* Names are developer-friendly while wire format stays consistent
|
|
55
55
|
*/
|
|
56
56
|
export var ErrorType;
|
|
@@ -411,8 +411,8 @@ export const FileValidationStatus = {
|
|
|
411
411
|
* Check if a domain is a platform domain (subdomain of our platform).
|
|
412
412
|
* Platform domains are free and don't require DNS verification.
|
|
413
413
|
*
|
|
414
|
-
* @example isPlatformDomain("www.shipstatic.
|
|
415
|
-
* @example isPlatformDomain("example.com", "shipstatic.
|
|
414
|
+
* @example isPlatformDomain("www.shipstatic.com", "shipstatic.com") → true
|
|
415
|
+
* @example isPlatformDomain("example.com", "shipstatic.com") → false
|
|
416
416
|
*/
|
|
417
417
|
export function isPlatformDomain(domain, platformDomain) {
|
|
418
418
|
return domain.endsWith(`.${platformDomain}`);
|
|
@@ -421,8 +421,8 @@ export function isPlatformDomain(domain, platformDomain) {
|
|
|
421
421
|
* Check if a domain is a custom domain (not a platform subdomain).
|
|
422
422
|
* Custom domains are billable and require DNS verification.
|
|
423
423
|
*
|
|
424
|
-
* @example isCustomDomain("example.com", "shipstatic.
|
|
425
|
-
* @example isCustomDomain("www.shipstatic.
|
|
424
|
+
* @example isCustomDomain("example.com", "shipstatic.com") → true
|
|
425
|
+
* @example isCustomDomain("www.shipstatic.com", "shipstatic.com") → false
|
|
426
426
|
*/
|
|
427
427
|
export function isCustomDomain(domain, platformDomain) {
|
|
428
428
|
return !isPlatformDomain(domain, platformDomain);
|
|
@@ -431,8 +431,8 @@ export function isCustomDomain(domain, platformDomain) {
|
|
|
431
431
|
* Extract subdomain from a platform domain.
|
|
432
432
|
* Returns null if not a platform domain.
|
|
433
433
|
*
|
|
434
|
-
* @example extractSubdomain("www.shipstatic.
|
|
435
|
-
* @example extractSubdomain("example.com", "shipstatic.
|
|
434
|
+
* @example extractSubdomain("www.shipstatic.com", "shipstatic.com") → "www"
|
|
435
|
+
* @example extractSubdomain("example.com", "shipstatic.com") → null
|
|
436
436
|
*/
|
|
437
437
|
export function extractSubdomain(domain, platformDomain) {
|
|
438
438
|
if (!isPlatformDomain(domain, platformDomain)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipstatic/types",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"description": "Shared types for
|
|
3
|
+
"version": "0.7.6",
|
|
4
|
+
"description": "Shared types for ShipStatic platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Shared TypeScript types, constants, and utilities for the
|
|
2
|
+
* @file Shared TypeScript types, constants, and utilities for the ShipStatic platform.
|
|
3
3
|
* This package is the single source of truth for all shared data structures.
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -315,7 +315,7 @@ export interface AccountOverrides {
|
|
|
315
315
|
// =============================================================================
|
|
316
316
|
|
|
317
317
|
/**
|
|
318
|
-
* All possible error types in the
|
|
318
|
+
* All possible error types in the ShipStatic platform
|
|
319
319
|
* Names are developer-friendly while wire format stays consistent
|
|
320
320
|
*/
|
|
321
321
|
export enum ErrorType {
|
|
@@ -1231,8 +1231,8 @@ export interface UploadedFile {
|
|
|
1231
1231
|
* Check if a domain is a platform domain (subdomain of our platform).
|
|
1232
1232
|
* Platform domains are free and don't require DNS verification.
|
|
1233
1233
|
*
|
|
1234
|
-
* @example isPlatformDomain("www.shipstatic.
|
|
1235
|
-
* @example isPlatformDomain("example.com", "shipstatic.
|
|
1234
|
+
* @example isPlatformDomain("www.shipstatic.com", "shipstatic.com") → true
|
|
1235
|
+
* @example isPlatformDomain("example.com", "shipstatic.com") → false
|
|
1236
1236
|
*/
|
|
1237
1237
|
export function isPlatformDomain(domain: string, platformDomain: string): boolean {
|
|
1238
1238
|
return domain.endsWith(`.${platformDomain}`);
|
|
@@ -1242,8 +1242,8 @@ export function isPlatformDomain(domain: string, platformDomain: string): boolea
|
|
|
1242
1242
|
* Check if a domain is a custom domain (not a platform subdomain).
|
|
1243
1243
|
* Custom domains are billable and require DNS verification.
|
|
1244
1244
|
*
|
|
1245
|
-
* @example isCustomDomain("example.com", "shipstatic.
|
|
1246
|
-
* @example isCustomDomain("www.shipstatic.
|
|
1245
|
+
* @example isCustomDomain("example.com", "shipstatic.com") → true
|
|
1246
|
+
* @example isCustomDomain("www.shipstatic.com", "shipstatic.com") → false
|
|
1247
1247
|
*/
|
|
1248
1248
|
export function isCustomDomain(domain: string, platformDomain: string): boolean {
|
|
1249
1249
|
return !isPlatformDomain(domain, platformDomain);
|
|
@@ -1253,8 +1253,8 @@ export function isCustomDomain(domain: string, platformDomain: string): boolean
|
|
|
1253
1253
|
* Extract subdomain from a platform domain.
|
|
1254
1254
|
* Returns null if not a platform domain.
|
|
1255
1255
|
*
|
|
1256
|
-
* @example extractSubdomain("www.shipstatic.
|
|
1257
|
-
* @example extractSubdomain("example.com", "shipstatic.
|
|
1256
|
+
* @example extractSubdomain("www.shipstatic.com", "shipstatic.com") → "www"
|
|
1257
|
+
* @example extractSubdomain("example.com", "shipstatic.com") → null
|
|
1258
1258
|
*/
|
|
1259
1259
|
export function extractSubdomain(domain: string, platformDomain: string): string | null {
|
|
1260
1260
|
if (!isPlatformDomain(domain, platformDomain)) {
|