@shipstatic/types 2.21.1 → 2.22.0-beta.1
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 +9 -9
- package/dist/index.d.ts +23 -6
- package/package.json +1 -1
- package/src/index.ts +23 -6
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ npm install @shipstatic/types
|
|
|
16
16
|
|
|
17
17
|
## What's included
|
|
18
18
|
|
|
19
|
-
### Core
|
|
19
|
+
### Core entities
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
import type {
|
|
@@ -38,7 +38,7 @@ survives, otherwise the `*DeleteResponse` shape: the resource noun carrying
|
|
|
38
38
|
the canonical key, plus the resource's own state field where the resource is
|
|
39
39
|
mid-transition. No `message`, no `success`, no constant flags.
|
|
40
40
|
|
|
41
|
-
### Error
|
|
41
|
+
### Error system
|
|
42
42
|
|
|
43
43
|
```typescript
|
|
44
44
|
import { ShipError, ErrorType, isShipError } from '@shipstatic/types';
|
|
@@ -84,7 +84,7 @@ catch (cause) { throw ShipError.fromFetchError(cause, 'Get account'); }
|
|
|
84
84
|
|
|
85
85
|
Both helpers accept an optional operation-name string for contextual messages (`"Get account was cancelled"`, `"Get account failed: ..."`).
|
|
86
86
|
|
|
87
|
-
### Status
|
|
87
|
+
### Status constants
|
|
88
88
|
|
|
89
89
|
```typescript
|
|
90
90
|
import {
|
|
@@ -109,7 +109,7 @@ import type {
|
|
|
109
109
|
} from '@shipstatic/types';
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
### Resource
|
|
112
|
+
### Resource contracts
|
|
113
113
|
|
|
114
114
|
SDK interface definitions:
|
|
115
115
|
|
|
@@ -122,7 +122,7 @@ import type {
|
|
|
122
122
|
} from '@shipstatic/types';
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
### Validation
|
|
125
|
+
### Validation utilities
|
|
126
126
|
|
|
127
127
|
```typescript
|
|
128
128
|
import {
|
|
@@ -146,7 +146,7 @@ const limits = await ship.getLimits();
|
|
|
146
146
|
isBlockedExtension('virus.exe', limits.blockedExtensions ?? []);
|
|
147
147
|
```
|
|
148
148
|
|
|
149
|
-
### File
|
|
149
|
+
### File upload types
|
|
150
150
|
|
|
151
151
|
```typescript
|
|
152
152
|
import type {
|
|
@@ -157,7 +157,7 @@ import type {
|
|
|
157
157
|
} from '@shipstatic/types';
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
### Domain
|
|
160
|
+
### Domain utilities
|
|
161
161
|
|
|
162
162
|
```typescript
|
|
163
163
|
import {
|
|
@@ -169,7 +169,7 @@ import {
|
|
|
169
169
|
} from '@shipstatic/types';
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
### Label
|
|
172
|
+
### Label utilities
|
|
173
173
|
|
|
174
174
|
```typescript
|
|
175
175
|
import {
|
|
@@ -180,7 +180,7 @@ import {
|
|
|
180
180
|
} from '@shipstatic/types';
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
### Password
|
|
183
|
+
### Password utilities
|
|
184
184
|
|
|
185
185
|
```typescript
|
|
186
186
|
import {
|
package/dist/index.d.ts
CHANGED
|
@@ -326,6 +326,12 @@ export interface DnsRecord {
|
|
|
326
326
|
export interface DnsProvider {
|
|
327
327
|
/** Provider name (e.g., "Cloudflare", "GoDaddy"), null if unknown */
|
|
328
328
|
name: string | null;
|
|
329
|
+
/**
|
|
330
|
+
* The provider's DNS dashboard, where the records get added, null where the
|
|
331
|
+
* provider is unknown or has no known console. Optional on the type by the
|
|
332
|
+
* additive-evolution law: published API versions may predate the field.
|
|
333
|
+
*/
|
|
334
|
+
url?: string | null;
|
|
329
335
|
}
|
|
330
336
|
/**
|
|
331
337
|
* Response for domain DNS provider lookup
|
|
@@ -616,8 +622,18 @@ export interface Account {
|
|
|
616
622
|
readonly name: string | null;
|
|
617
623
|
/** User profile picture URL, null if not set */
|
|
618
624
|
readonly picture: string | null;
|
|
619
|
-
/** The account's
|
|
625
|
+
/** The account's plan: the row it is on. */
|
|
620
626
|
readonly plan: AccountPlanType;
|
|
627
|
+
/**
|
|
628
|
+
* The billed tier the account STANDS AT: its plan for a billed or free
|
|
629
|
+
* account, and the plan a gift copies for a sponsored one (`sponsored`
|
|
630
|
+
* stands at `pro`). Every question of position, which row is "current",
|
|
631
|
+
* which rows are above, is asked of this rather than of `plan`, so a
|
|
632
|
+
* sponsored account sees exactly what a Pro account sees. Optional on the
|
|
633
|
+
* type by the additive-evolution law: published SDK versions may predate
|
|
634
|
+
* the field, so consumers read it when present and fall back to `plan`.
|
|
635
|
+
*/
|
|
636
|
+
readonly tier?: AccountPlanType;
|
|
621
637
|
/**
|
|
622
638
|
* True while the operator has suspended the account: reads and deletes
|
|
623
639
|
* still work, every write is refused. The plan is unchanged underneath.
|
|
@@ -666,11 +682,12 @@ export interface Account {
|
|
|
666
682
|
readonly billed: boolean;
|
|
667
683
|
/**
|
|
668
684
|
* The next plan up the ladder this account could move to, or `null` when
|
|
669
|
-
* there is none: the top billed tier,
|
|
670
|
-
* on the menu answer `null`.
|
|
671
|
-
*
|
|
672
|
-
*
|
|
673
|
-
*
|
|
685
|
+
* there is none: the top billed tier, a plan sold by conversation, and any
|
|
686
|
+
* plan not on the menu answer `null`. Asked from where the account stands
|
|
687
|
+
* ({@link tier}), so a sponsored account is offered Team as a Pro account
|
|
688
|
+
* is. One server-side fact so that no surface derives "can this account
|
|
689
|
+
* upgrade, and to what" from the menu — a grandfathered row has no menu
|
|
690
|
+
* price to compare, and a conversation plan must never be sent to Checkout.
|
|
674
691
|
*/
|
|
675
692
|
readonly upgrade: AccountPlanType | null;
|
|
676
693
|
/**
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -354,6 +354,12 @@ export interface DnsRecord {
|
|
|
354
354
|
export interface DnsProvider {
|
|
355
355
|
/** Provider name (e.g., "Cloudflare", "GoDaddy"), null if unknown */
|
|
356
356
|
name: string | null;
|
|
357
|
+
/**
|
|
358
|
+
* The provider's DNS dashboard, where the records get added, null where the
|
|
359
|
+
* provider is unknown or has no known console. Optional on the type by the
|
|
360
|
+
* additive-evolution law: published API versions may predate the field.
|
|
361
|
+
*/
|
|
362
|
+
url?: string | null;
|
|
357
363
|
}
|
|
358
364
|
|
|
359
365
|
/**
|
|
@@ -691,8 +697,18 @@ export interface Account {
|
|
|
691
697
|
readonly name: string | null;
|
|
692
698
|
/** User profile picture URL, null if not set */
|
|
693
699
|
readonly picture: string | null;
|
|
694
|
-
/** The account's
|
|
700
|
+
/** The account's plan: the row it is on. */
|
|
695
701
|
readonly plan: AccountPlanType;
|
|
702
|
+
/**
|
|
703
|
+
* The billed tier the account STANDS AT: its plan for a billed or free
|
|
704
|
+
* account, and the plan a gift copies for a sponsored one (`sponsored`
|
|
705
|
+
* stands at `pro`). Every question of position, which row is "current",
|
|
706
|
+
* which rows are above, is asked of this rather than of `plan`, so a
|
|
707
|
+
* sponsored account sees exactly what a Pro account sees. Optional on the
|
|
708
|
+
* type by the additive-evolution law: published SDK versions may predate
|
|
709
|
+
* the field, so consumers read it when present and fall back to `plan`.
|
|
710
|
+
*/
|
|
711
|
+
readonly tier?: AccountPlanType;
|
|
696
712
|
/**
|
|
697
713
|
* True while the operator has suspended the account: reads and deletes
|
|
698
714
|
* still work, every write is refused. The plan is unchanged underneath.
|
|
@@ -741,11 +757,12 @@ export interface Account {
|
|
|
741
757
|
readonly billed: boolean;
|
|
742
758
|
/**
|
|
743
759
|
* The next plan up the ladder this account could move to, or `null` when
|
|
744
|
-
* there is none: the top billed tier,
|
|
745
|
-
* on the menu answer `null`.
|
|
746
|
-
*
|
|
747
|
-
*
|
|
748
|
-
*
|
|
760
|
+
* there is none: the top billed tier, a plan sold by conversation, and any
|
|
761
|
+
* plan not on the menu answer `null`. Asked from where the account stands
|
|
762
|
+
* ({@link tier}), so a sponsored account is offered Team as a Pro account
|
|
763
|
+
* is. One server-side fact so that no surface derives "can this account
|
|
764
|
+
* upgrade, and to what" from the menu — a grandfathered row has no menu
|
|
765
|
+
* price to compare, and a conversation plan must never be sent to Checkout.
|
|
749
766
|
*/
|
|
750
767
|
readonly upgrade: AccountPlanType | null;
|
|
751
768
|
/**
|