@shipstatic/ship 3.4.0 → 3.6.0-beta.0
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 +3 -3
- package/SKILL.md +3 -3
- package/THIRD-PARTY-LICENSES.md +1 -1
- package/dist/browser.d.ts +210 -90
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/cli.cjs +44 -44
- package/dist/cli.cjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +210 -90
- package/dist/index.d.ts +210 -90
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ const ship = new Ship({ token: 'ship-your-api-key' });
|
|
|
49
49
|
ship ./dist # Deploy (shortcut)
|
|
50
50
|
ship ./dist --domain www.example.com # Deploy and serve it there
|
|
51
51
|
ship ./dist --ttl 1h # Expires in an hour
|
|
52
|
-
ship ./dist --label production --label v1.0.0
|
|
52
|
+
ship ./dist --label env:production --label v1.0.0 # Deploy with labels
|
|
53
53
|
ship deployments list
|
|
54
54
|
ship deployments list --limit 20 # Page size; a hint shows the next cursor
|
|
55
55
|
ship deployments list --cursor <cursor> # Continue from a previous page
|
|
@@ -212,7 +212,7 @@ Available on `ship <path>` and `ship deployments upload`:
|
|
|
212
212
|
| Flag | Description |
|
|
213
213
|
|------|-------------|
|
|
214
214
|
| `--domain <domain>` | Serve this deployment at that domain — creates or repoints it. Needs a token |
|
|
215
|
-
| `--label <label>` | Add label (repeatable) |
|
|
215
|
+
| `--label <label>` | Add label, a word or `key:value` (repeatable) |
|
|
216
216
|
| `--password <password>` | Password-protect this deployment (6–128 chars) |
|
|
217
217
|
| `--ttl <duration>` | Expire this deployment after that long — `3600`, `90s`, `30m`, `1h`, `7d`. Needs a token; cannot be combined with `--domain` |
|
|
218
218
|
| `--no-path-detect` | Disable automatic path optimization |
|
|
@@ -433,7 +433,7 @@ This package includes a [SKILL.md](./SKILL.md) file, a portable skill definition
|
|
|
433
433
|
| **[VS Code](https://marketplace.visualstudio.com/items?itemName=shipstatic.shipstatic)** | Search "ShipStatic" in the Marketplace |
|
|
434
434
|
| **[Gemini CLI](https://github.com/shipstatic/plugin)** | `gemini extensions install https://github.com/shipstatic/plugin` |
|
|
435
435
|
| **[n8n](https://www.npmjs.com/package/n8n-nodes-shipstatic)** | Search "ShipStatic" in n8n's node panel |
|
|
436
|
-
| **[GitHub Action](https://github.com/shipstatic/action)** | `shipstatic/action@
|
|
436
|
+
| **[GitHub Action](https://github.com/shipstatic/action)** | `shipstatic/action@v3` |
|
|
437
437
|
| **[Agent Skill](https://www.shipstatic.com/SKILL.md)** | One file, for any skills-aware tool |
|
|
438
438
|
|
|
439
439
|
## License
|
package/SKILL.md
CHANGED
|
@@ -100,10 +100,10 @@ ship ./dist -q # → happy-cat-abc1234.shipstatic.com
|
|
|
100
100
|
### Labels
|
|
101
101
|
|
|
102
102
|
```bash
|
|
103
|
-
ship ./dist --label v1.0 --label production
|
|
103
|
+
ship ./dist --label v1.0 --label env:production
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
Labels **replace all existing**, not append. Include current labels to keep them.
|
|
106
|
+
Labels **replace all existing**, not append. Include current labels to keep them. A label is a word (`production`) or a key and a value split by one `:` (`env:production`), stored in lowercase.
|
|
107
107
|
|
|
108
108
|
### Password protection
|
|
109
109
|
|
|
@@ -320,7 +320,7 @@ ship tokens delete <token> # Delete (revokes immediately)
|
|
|
320
320
|
| `-q, --quiet` | Identifier only |
|
|
321
321
|
| `--token <token>` | Any ship token: API key or deploy token |
|
|
322
322
|
| `--domain <domain>` | Deploy and serve it there — creates or repoints. Needs a token |
|
|
323
|
-
| `--label <label>` | Set label (repeatable, replaces all) |
|
|
323
|
+
| `--label <label>` | Set label, a word or `key:value` (repeatable, replaces all) |
|
|
324
324
|
| `--password <pwd>` | Password-protect deployment (6–128 chars) |
|
|
325
325
|
| `--ttl <duration>` | Expire after that long — `3600`, `90s`, `1h`, `7d`. Needs a token; not with `--domain` |
|
|
326
326
|
| `--no-path-detect` | Skip build output auto-detection |
|
package/THIRD-PARTY-LICENSES.md
CHANGED
package/dist/browser.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ declare const DeploymentVia: {
|
|
|
72
72
|
readonly GIT: "git";
|
|
73
73
|
/** The n8n community node. */
|
|
74
74
|
readonly N8N: "n8n";
|
|
75
|
-
/** Channel: the ChatGPT
|
|
75
|
+
/** Channel: the ChatGPT plugin → `mcp.<domain>/gpt`. */
|
|
76
76
|
readonly GPT: "gpt";
|
|
77
77
|
/** The VS Code extension. */
|
|
78
78
|
readonly VSC: "vsc";
|
|
@@ -116,7 +116,7 @@ interface Deployment {
|
|
|
116
116
|
readonly config: boolean;
|
|
117
117
|
/** Whether deployment has a password set */
|
|
118
118
|
readonly password: boolean;
|
|
119
|
-
/** Labels for categorization and filtering (
|
|
119
|
+
/** Labels for categorization and filtering (a word like `production`, or a key and a value like `env:production`). Always present, empty array when none. */
|
|
120
120
|
labels: string[];
|
|
121
121
|
/**
|
|
122
122
|
* The client/tool that created this deployment. Every deployment created
|
|
@@ -380,7 +380,7 @@ interface Domain {
|
|
|
380
380
|
verifications: number;
|
|
381
381
|
/** Unix timestamp (seconds) when plan enforcement paused serving, null while the plan has room for it */
|
|
382
382
|
paused: number | null;
|
|
383
|
-
/** Labels for categorization and filtering (
|
|
383
|
+
/** Labels for categorization and filtering (a word like `production`, or a key and a value like `env:production`). Always present, empty array when none. */
|
|
384
384
|
labels: string[];
|
|
385
385
|
/** Unix timestamp (seconds) when domain was created */
|
|
386
386
|
readonly created: number;
|
|
@@ -511,8 +511,7 @@ interface DomainShareResponse {
|
|
|
511
511
|
* the console sends a stuck reader to it rather than to the general docs. If
|
|
512
512
|
* the spellings ever diverged, nothing would fail: the link would open the page
|
|
513
513
|
* at its top and nobody would be told, the silent-drift class this
|
|
514
|
-
* constitution exists to delete
|
|
515
|
-
* one domain over).
|
|
514
|
+
* constitution exists to delete.
|
|
516
515
|
*/
|
|
517
516
|
declare const SETUP_TROUBLESHOOTING_ANCHOR = "troubleshooting";
|
|
518
517
|
/**
|
|
@@ -717,13 +716,13 @@ declare const AccountPlan: {
|
|
|
717
716
|
};
|
|
718
717
|
type AccountPlanType = (typeof AccountPlan)[keyof typeof AccountPlan];
|
|
719
718
|
/**
|
|
720
|
-
* The
|
|
719
|
+
* The four things an account ACCUMULATES, and therefore the four things a
|
|
721
720
|
* plan caps. One word for the count and for the ceiling: `Account.usage` and
|
|
722
721
|
* `Account.caps` are the same shape, so a surface renders "2 of 3" by
|
|
723
722
|
* dividing one by the other and can never divide by a different denominator
|
|
724
723
|
* than the 403 uses.
|
|
725
724
|
*
|
|
726
|
-
* All
|
|
725
|
+
* All four are counts plans SELL, and every plan publishes a number for each.
|
|
727
726
|
* A platform domain (`my-app.shipstatic.com`) is among them: the namespace
|
|
728
727
|
* is the platform's, so every plan bounds how many names one account may take
|
|
729
728
|
* from it — which is not the address every deployment gets by construction
|
|
@@ -763,12 +762,81 @@ interface Caps {
|
|
|
763
762
|
*/
|
|
764
763
|
readonly customDomains: number;
|
|
765
764
|
/**
|
|
766
|
-
*
|
|
767
|
-
*
|
|
768
|
-
*
|
|
765
|
+
* Member places. As `caps` it is how many people the plan allows in the
|
|
766
|
+
* account, the owner included. As `usage` it is the members the account
|
|
767
|
+
* has: one membership row each. A pending invitation holds a place too,
|
|
768
|
+
* counted beside it as {@link AccountUsage.invitations}, so what stands
|
|
769
|
+
* against this cap is {@link placesTaken}, members and invitations
|
|
770
|
+
* together.
|
|
769
771
|
*/
|
|
770
772
|
readonly members: number;
|
|
771
773
|
}
|
|
774
|
+
/**
|
|
775
|
+
* What the account holds: every cap's count, and the pending invitations.
|
|
776
|
+
*
|
|
777
|
+
* A member place is taken by a member or by a pending invitation, and an
|
|
778
|
+
* account never holds more of the two together than its plan's `members`
|
|
779
|
+
* cap: the invite door refuses a new invitation when the places are taken,
|
|
780
|
+
* and a move down a tier is booked only when the places fit the destination.
|
|
781
|
+
* The count has no cap of its own, which is why it is a field of the usage
|
|
782
|
+
* and not of {@link Caps}: the place it takes is a member's.
|
|
783
|
+
*
|
|
784
|
+
* Only a member pauses, though. An account over its members cap pauses every
|
|
785
|
+
* member while it does not fit; a pending invitation pauses nobody and
|
|
786
|
+
* counts toward no pause.
|
|
787
|
+
*/
|
|
788
|
+
interface AccountUsage extends Caps {
|
|
789
|
+
/**
|
|
790
|
+
* Invitations still open: pending, and not yet expired. An expired one
|
|
791
|
+
* holds nothing, whether or not a sweep has removed its row.
|
|
792
|
+
*/
|
|
793
|
+
readonly invitations: number;
|
|
794
|
+
}
|
|
795
|
+
/** The member places an account has taken: its members, and its pending invitations. */
|
|
796
|
+
declare function placesTaken(usage: Pick<AccountUsage, 'members' | 'invitations'>): number;
|
|
797
|
+
/**
|
|
798
|
+
* The kind each count of {@link AccountUsage} names, as a person reads it:
|
|
799
|
+
* one and many. The one vocabulary every surface that says a count uses, the
|
|
800
|
+
* api's cap refusals and the console's room notes alike, so "custom domain"
|
|
801
|
+
* is one word wherever it is met. A person reads "ShipStatic domain" where
|
|
802
|
+
* the code says platform domain; the code's word never reaches them.
|
|
803
|
+
*/
|
|
804
|
+
declare const USAGE_KIND: Record<keyof AccountUsage, {
|
|
805
|
+
readonly one: string;
|
|
806
|
+
readonly many: string;
|
|
807
|
+
}>;
|
|
808
|
+
/**
|
|
809
|
+
* What an account holds beyond a set of caps, per kind, only the kinds that
|
|
810
|
+
* are over: what a move down a tier must shed before it is booked, and what
|
|
811
|
+
* the console notes on a cheaper card.
|
|
812
|
+
*
|
|
813
|
+
* Member places are read against `caps.members`: the places over the cap are
|
|
814
|
+
* counted once ({@link placesTaken} less the cap), members are named first,
|
|
815
|
+
* because a member over the cap has to go whatever else the account holds,
|
|
816
|
+
* and what is over after them is the invitations to cancel. So two members
|
|
817
|
+
* and one invitation against a cap of one is one member and one invitation,
|
|
818
|
+
* and five members against the same cap is four members and no invitation.
|
|
819
|
+
* The two domain kinds are read against their own caps. Deployments are not
|
|
820
|
+
* read at all: nothing pauses them, and above their cap they only block
|
|
821
|
+
* creation (see {@link Caps}).
|
|
822
|
+
*/
|
|
823
|
+
declare function excessOver(usage: AccountUsage, caps: Caps): Partial<AccountUsage>;
|
|
824
|
+
/**
|
|
825
|
+
* Counts of kinds in words, people first: "4 members and 2 custom domains",
|
|
826
|
+
* or nothing. The order is {@link USAGE_KIND}'s minus the two kinds a count never
|
|
827
|
+
* names here, deployments and invitations, which have their own sentence
|
|
828
|
+
* ({@link fitPhrase}).
|
|
829
|
+
*/
|
|
830
|
+
declare function countPhrase(excess: Partial<AccountUsage>): string;
|
|
831
|
+
/**
|
|
832
|
+
* What to do before an account fits a set of caps, in words: "remove 1
|
|
833
|
+
* member and cancel 1 invitation", "remove 2 custom domains", "cancel 2
|
|
834
|
+
* invitations", or nothing when it fits. Two verbs, because a member place is
|
|
835
|
+
* freed two ways: a member is removed, a pending invitation is cancelled. The
|
|
836
|
+
* api's change door and the console's room notes say this one phrase, so a
|
|
837
|
+
* refusal and the note that preceded it cannot differ.
|
|
838
|
+
*/
|
|
839
|
+
declare function fitPhrase(excess: Partial<AccountUsage>): string;
|
|
772
840
|
/**
|
|
773
841
|
* A person's standing in an account. `owner` founded it and alone manages
|
|
774
842
|
* billing, credentials, members and deletion; `member` uses its resources
|
|
@@ -836,13 +904,17 @@ interface Account {
|
|
|
836
904
|
* still work, every write is refused. The plan is unchanged underneath.
|
|
837
905
|
*/
|
|
838
906
|
readonly suspended: boolean;
|
|
839
|
-
/** What the account currently holds — see {@link Caps}. */
|
|
840
|
-
readonly usage: Caps;
|
|
841
907
|
/**
|
|
842
|
-
* What the account
|
|
843
|
-
* {@link
|
|
844
|
-
|
|
845
|
-
|
|
908
|
+
* What the account currently holds: every cap's count, and the pending
|
|
909
|
+
* invitations beside them — see {@link AccountUsage}.
|
|
910
|
+
*/
|
|
911
|
+
readonly usage: AccountUsage;
|
|
912
|
+
/**
|
|
913
|
+
* What the account is allowed to hold, under {@link usage}'s cap keys, so
|
|
914
|
+
* the pair divides. These are the account's EFFECTIVE caps: its plan's
|
|
915
|
+
* numbers, plus whatever the operator granted it individually. The one key
|
|
916
|
+
* of `usage` absent here is `invitations`, which has no cap of its own: a
|
|
917
|
+
* pending invitation takes a member place, so it counts against `members`.
|
|
846
918
|
*/
|
|
847
919
|
readonly caps: Caps;
|
|
848
920
|
/**
|
|
@@ -862,15 +934,16 @@ interface Account {
|
|
|
862
934
|
*/
|
|
863
935
|
readonly access?: AccountAccess;
|
|
864
936
|
/**
|
|
865
|
-
*
|
|
866
|
-
*
|
|
867
|
-
* members
|
|
868
|
-
*
|
|
869
|
-
*
|
|
870
|
-
*
|
|
871
|
-
*
|
|
937
|
+
* The account's own standing, beside the credential's ({@link access}):
|
|
938
|
+
* whether its MEMBERS are admitted today, `paused` while it holds more
|
|
939
|
+
* members than its plan allows, until the owner upgrades or removes
|
|
940
|
+
* members. It is {@link access} for everyone who is not the owner,
|
|
941
|
+
* published for the account so the one person it never pauses can be told;
|
|
942
|
+
* the API derives both from one rule, so a console reads the pause here
|
|
943
|
+
* rather than re-deriving it from the member counts. Optional by the
|
|
944
|
+
* additive-evolution law: a response that predates it is `active`.
|
|
872
945
|
*/
|
|
873
|
-
readonly
|
|
946
|
+
readonly membership?: AccountAccess;
|
|
874
947
|
/** Unix timestamp (seconds) when account was created */
|
|
875
948
|
readonly created: number;
|
|
876
949
|
/** Unix timestamp (seconds) when account was activated (first deployment), null if not yet activated */
|
|
@@ -1077,9 +1150,9 @@ declare const API_PATHS: {
|
|
|
1077
1150
|
readonly UPLOAD: "/upload";
|
|
1078
1151
|
};
|
|
1079
1152
|
/**
|
|
1080
|
-
* The deploy request's multipart field names
|
|
1081
|
-
* surface beside {@link API_PATHS}.
|
|
1082
|
-
*
|
|
1153
|
+
* The deploy request's multipart field names: the other half of the wire
|
|
1154
|
+
* surface beside {@link API_PATHS}. These are the names the API reads from a
|
|
1155
|
+
* multipart body on `POST /deployments` and the first-party `/upload`.
|
|
1083
1156
|
*
|
|
1084
1157
|
* Declared once because the body has three independent WRITERS — the SDK's
|
|
1085
1158
|
* Node and browser body builders, and the n8n community node's hand-rolled
|
|
@@ -1126,10 +1199,10 @@ declare const DEPLOY_FIELDS: {
|
|
|
1126
1199
|
readonly CAPTCHA: "captcha";
|
|
1127
1200
|
};
|
|
1128
1201
|
/**
|
|
1129
|
-
* The JSON deploy body's file grammar: the OTHER body
|
|
1130
|
-
* beside the multipart one {@link DEPLOY_FIELDS} names. A JSON caller
|
|
1131
|
-
* `{ files: [{ path, content, encoding? }] }`, and this is the whole
|
|
1132
|
-
* one entry may say: three field names, two encodings, one default.
|
|
1202
|
+
* The JSON deploy body's file grammar: the OTHER body both deploy doors
|
|
1203
|
+
* accept, beside the multipart one {@link DEPLOY_FIELDS} names. A JSON caller
|
|
1204
|
+
* sends `{ files: [{ path, content, encoding? }] }`, and this is the whole
|
|
1205
|
+
* of what one entry may say: three field names, two encodings, one default.
|
|
1133
1206
|
*
|
|
1134
1207
|
* Declared once because the grammar has three independent holders that the
|
|
1135
1208
|
* wire forces to restate it: the API's zod schema (the original), the hosted
|
|
@@ -1613,20 +1686,6 @@ interface PingResponse {
|
|
|
1613
1686
|
* already share the credential prefixes below.
|
|
1614
1687
|
*/
|
|
1615
1688
|
declare const AUTH_BASE_PATH = "/auth";
|
|
1616
|
-
/**
|
|
1617
|
-
* The query marker a completed sign-in LANDS with.
|
|
1618
|
-
*
|
|
1619
|
-
* The API's magic-link verify leg stamps `?signing-in=1` onto its success
|
|
1620
|
-
* redirect, and the console boots into its wait screen on seeing it — two
|
|
1621
|
-
* repos, one spelling, which is why it lives here. Success is marked and the
|
|
1622
|
-
* error leg deliberately is NOT: the console gives the marker precedence, so
|
|
1623
|
-
* a marked error would render a wait that resolves to bare doors with the
|
|
1624
|
-
* error's sentence lost. If the spellings ever diverged the failure would be
|
|
1625
|
-
* invisible to every suite — email landings would flash the doors for one
|
|
1626
|
-
* round trip instead of waiting — which is exactly the silent-drift class
|
|
1627
|
-
* this constitution exists to delete.
|
|
1628
|
-
*/
|
|
1629
|
-
declare const SIGN_IN_RETURN_PARAM = "signing-in";
|
|
1630
1689
|
/**
|
|
1631
1690
|
* How a request (or recorded activity) was authorized.
|
|
1632
1691
|
*
|
|
@@ -2049,6 +2108,9 @@ declare const SECTIONS: {
|
|
|
2049
2108
|
readonly settings: {
|
|
2050
2109
|
readonly owner: false;
|
|
2051
2110
|
};
|
|
2111
|
+
readonly claim: {
|
|
2112
|
+
readonly owner: false;
|
|
2113
|
+
};
|
|
2052
2114
|
readonly upgrade: {
|
|
2053
2115
|
readonly owner: true;
|
|
2054
2116
|
};
|
|
@@ -2061,6 +2123,10 @@ declare const SECTIONS: {
|
|
|
2061
2123
|
};
|
|
2062
2124
|
/** A section's first segment. */
|
|
2063
2125
|
type ConsoleSection = keyof typeof SECTIONS;
|
|
2126
|
+
/** The pages that exist before an account is known, by first segment. */
|
|
2127
|
+
declare const DOOR_SEGMENTS: readonly ["login", "register", "logout", "invitation", "consent"];
|
|
2128
|
+
/** A door's first segment. */
|
|
2129
|
+
type DoorSegment = (typeof DOOR_SEGMENTS)[number];
|
|
2064
2130
|
/** The two fragments of the settings page a link may name. */
|
|
2065
2131
|
type SettingsFragment = 'members' | 'api-key';
|
|
2066
2132
|
/**
|
|
@@ -2094,6 +2160,8 @@ declare function consolePaths(account?: string): {
|
|
|
2094
2160
|
deployment: (domain: string) => string;
|
|
2095
2161
|
};
|
|
2096
2162
|
settings: (fragment?: SettingsFragment) => string;
|
|
2163
|
+
/** The claim of an anonymous deployment into this account; the API mails the bare form. */
|
|
2164
|
+
claim: (code: string) => string;
|
|
2097
2165
|
/** Settings, marked as the landing of a Stripe Customer Portal return. */
|
|
2098
2166
|
settingsAfterBilling: () => string;
|
|
2099
2167
|
upgrade: (plan?: AccountPlanType) => string;
|
|
@@ -2104,13 +2172,31 @@ declare function consolePaths(account?: string): {
|
|
|
2104
2172
|
};
|
|
2105
2173
|
/** The builders `consolePaths` returns. */
|
|
2106
2174
|
type ConsolePaths = ReturnType<typeof consolePaths>;
|
|
2107
|
-
/**
|
|
2175
|
+
/** Where a sign-in door's journey goes on: the console path a `?next` carries. */
|
|
2176
|
+
interface Journey {
|
|
2177
|
+
readonly next?: string;
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2180
|
+
* The doors: the pages a PERSON stands on before an account is known, one
|
|
2181
|
+
* builder per door segment and named for it: signing in and out, joining an
|
|
2182
|
+
* account, granting an app access. A door's object rides its path (the
|
|
2183
|
+
* sign-in link's token, the invitation's id), and the journey rides the
|
|
2184
|
+
* query, so the three doors a sign-in moves through take it by name. What a
|
|
2185
|
+
* person does IN an account is a section (`consolePaths`), the claim among
|
|
2186
|
+
* them.
|
|
2187
|
+
*
|
|
2188
|
+
* ```ts
|
|
2189
|
+
* doors.login({ token, next: '/claim/abc' })
|
|
2190
|
+
* // '/login/<token>?next=%2Fclaim%2Fabc'
|
|
2191
|
+
* ```
|
|
2192
|
+
*/
|
|
2108
2193
|
declare const doors: {
|
|
2109
|
-
readonly login: (next?:
|
|
2110
|
-
|
|
2111
|
-
|
|
2194
|
+
readonly login: ({ token, next }?: Journey & {
|
|
2195
|
+
readonly token?: string;
|
|
2196
|
+
}) => string;
|
|
2197
|
+
readonly register: ({ next }?: Journey) => string;
|
|
2198
|
+
readonly logout: ({ next }?: Journey) => string;
|
|
2112
2199
|
readonly invitation: (invitation: string) => string;
|
|
2113
|
-
readonly claim: (code: string) => string;
|
|
2114
2200
|
readonly consent: () => string;
|
|
2115
2201
|
};
|
|
2116
2202
|
/**
|
|
@@ -2125,10 +2211,21 @@ declare function billingReturnOf(search: string): BillingReturn | null;
|
|
|
2125
2211
|
* the account exists is the server's answer, never the path's.
|
|
2126
2212
|
*/
|
|
2127
2213
|
declare function accountOfPath(path: string): string | null;
|
|
2128
|
-
/**
|
|
2214
|
+
/**
|
|
2215
|
+
* The door a path names, or null for an account place or the operator
|
|
2216
|
+
* partition. Every question about doors reads this one answer: which page is
|
|
2217
|
+
* an auth page, which errand a destination carries, what a vendor must not
|
|
2218
|
+
* see. `/login/<token>` is the login door, as `/invitation/<id>` is the
|
|
2219
|
+
* invitation door: a door's object is the rest of its path.
|
|
2220
|
+
*/
|
|
2221
|
+
declare function doorOf(path: string): DoorSegment | null;
|
|
2222
|
+
/**
|
|
2223
|
+
* Whether a path names the claim section, in either form: `/claim/:code`, and
|
|
2224
|
+
* the same under `/<account>/`. The code is a bearer credential, which is why
|
|
2225
|
+
* a reader asks about this section by name: the doors title their visitor by
|
|
2226
|
+
* it, and analytics elides it.
|
|
2227
|
+
*/
|
|
2129
2228
|
declare const isClaimPath: (path: string) => boolean;
|
|
2130
|
-
/** Whether a path names an invitation (`/invitations/:invitation`). */
|
|
2131
|
-
declare const isInvitationPath: (path: string) => boolean;
|
|
2132
2229
|
/**
|
|
2133
2230
|
* Whether a path names the upgrade section, in either form: `/upgrade`,
|
|
2134
2231
|
* `/upgrade/:plan`, and the same under `/<account>/`.
|
|
@@ -2461,20 +2558,6 @@ interface Plan {
|
|
|
2461
2558
|
* nothing (a plan sold by conversation publishes no numbers).
|
|
2462
2559
|
*/
|
|
2463
2560
|
readonly caps: Caps | null;
|
|
2464
|
-
/**
|
|
2465
|
-
* Why this row cannot be ordered right now — the closed door's own sentence,
|
|
2466
|
-
* verbatim — or absent when the way is open. A menu lists what can be
|
|
2467
|
-
* ordered, and a row that is sold but not yet orderable (its door is closed:
|
|
2468
|
-
* checkout unbuilt, a feature unfinished) SAYS SO on the menu instead of
|
|
2469
|
-
* only at the order.
|
|
2470
|
-
*
|
|
2471
|
-
* Clients branch on PRESENCE and render the sentence unchanged — they know
|
|
2472
|
-
* *that* the row is closed, never *which* door or *when it lifts*; the
|
|
2473
|
-
* vocabulary of doors stays server-side. The same rule the refusal follows:
|
|
2474
|
-
* `POST /billing/change` onto a closed row answers 400 with
|
|
2475
|
-
* `details.closed`, and its `message` is this sentence.
|
|
2476
|
-
*/
|
|
2477
|
-
readonly closed?: string;
|
|
2478
2561
|
}
|
|
2479
2562
|
/**
|
|
2480
2563
|
* Response for `GET /plans` — the whole public menu, in display order.
|
|
@@ -2512,17 +2595,18 @@ interface PlanChangeRequest {
|
|
|
2512
2595
|
}
|
|
2513
2596
|
/**
|
|
2514
2597
|
* `details` of the change door's refusal of a move down a tier the account
|
|
2515
|
-
* does not fit: the account holds more members,
|
|
2516
|
-
* domains than the destination allows.
|
|
2598
|
+
* does not fit: the account holds more members, pending invitations, custom
|
|
2599
|
+
* domains or platform domains than the destination allows.
|
|
2517
2600
|
*
|
|
2518
2601
|
* `excess` counts what to REMOVE before asking again, per kind, keyed like
|
|
2519
|
-
* {@link
|
|
2520
|
-
*
|
|
2521
|
-
*
|
|
2522
|
-
*
|
|
2602
|
+
* {@link AccountUsage}; only the kinds over the destination's caps appear
|
|
2603
|
+
* ({@link excessOver}). Members and invitations are counted apart, since one
|
|
2604
|
+
* is removed and the other cancelled. The door's `message` names the same
|
|
2605
|
+
* counts in a sentence, and that sentence is what a surface shows; the
|
|
2606
|
+
* counts are for a client that acts on the refusal.
|
|
2523
2607
|
*/
|
|
2524
2608
|
interface PlanChangeRefusalDetails {
|
|
2525
|
-
readonly excess: Partial<
|
|
2609
|
+
readonly excess: Partial<AccountUsage>;
|
|
2526
2610
|
}
|
|
2527
2611
|
/**
|
|
2528
2612
|
* The pending plan change — a Stripe Subscription Schedule, mirrored onto the
|
|
@@ -2814,28 +2898,64 @@ declare function generateDeploymentUrl(deployment: string): string;
|
|
|
2814
2898
|
*/
|
|
2815
2899
|
declare function generateDomainUrl(domain: string): string;
|
|
2816
2900
|
/**
|
|
2817
|
-
*
|
|
2818
|
-
*
|
|
2901
|
+
* A label is a short identifier attached to a deployment, a domain or a token.
|
|
2902
|
+
* It has one of two forms:
|
|
2903
|
+
*
|
|
2904
|
+
* - a word: `production`, `v1.2.3`, `us-east-1`
|
|
2905
|
+
* - a key and a value, split by one `:`: `env:production`, `team:web`
|
|
2906
|
+
*
|
|
2907
|
+
* Each side is lowercase letters and digits, with single `.`, `_` or `-`
|
|
2908
|
+
* between them. The whole label, the key and the `:` and the value together,
|
|
2909
|
+
* counts toward {@link LABEL_CONSTRAINTS.MAX_LENGTH}.
|
|
2910
|
+
*
|
|
2911
|
+
* The platform stores a label and shows it as written. It reads nothing from
|
|
2912
|
+
* a key or a value and changes no behaviour because of one: a label describes
|
|
2913
|
+
* a resource and lets its owner find it. So a resource may carry several
|
|
2914
|
+
* values for one key (`team:web` and `team:api`), and only the same label
|
|
2915
|
+
* twice is refused.
|
|
2916
|
+
*
|
|
2917
|
+
* Labels stay a list of strings on the wire and in storage. A caller that
|
|
2918
|
+
* wants a key's value splits on the `:` itself.
|
|
2819
2919
|
*/
|
|
2820
2920
|
declare const LABEL_CONSTRAINTS: {
|
|
2821
|
-
/** Minimum label length in characters */
|
|
2921
|
+
/** Minimum label length in characters. */
|
|
2822
2922
|
readonly MIN_LENGTH: 3;
|
|
2823
|
-
/** Maximum label length in characters
|
|
2824
|
-
readonly MAX_LENGTH:
|
|
2825
|
-
/** Maximum number of labels
|
|
2923
|
+
/** Maximum label length in characters. A key, its `:` and its value share it. */
|
|
2924
|
+
readonly MAX_LENGTH: 63;
|
|
2925
|
+
/** Maximum number of labels on one resource. */
|
|
2826
2926
|
readonly MAX_COUNT: 10;
|
|
2827
|
-
/** Allowed separator characters between label segments */
|
|
2828
|
-
readonly SEPARATORS: "._-";
|
|
2829
2927
|
};
|
|
2830
2928
|
/**
|
|
2831
|
-
*
|
|
2832
|
-
*
|
|
2833
|
-
* Can contain separators (. _ -) between segments, but not consecutive.
|
|
2929
|
+
* The shape of a label: one segment, or two with a `:` between them. Length
|
|
2930
|
+
* is {@link LABEL_CONSTRAINTS}' rule, and {@link validateLabel} applies both.
|
|
2834
2931
|
*
|
|
2835
|
-
*
|
|
2836
|
-
*
|
|
2932
|
+
* Matches: `production`, `v1.2.3`, `env:production`, `commit:3f9c2ab`
|
|
2933
|
+
* Refuses: `-prod`, `foo--bar`, `:production`, `env:`, `a:b:c`, `Env:Prod`
|
|
2837
2934
|
*/
|
|
2838
2935
|
declare const LABEL_PATTERN: RegExp;
|
|
2936
|
+
/**
|
|
2937
|
+
* Validate one label and return it normalized: trimmed and lowercased, then
|
|
2938
|
+
* held to {@link LABEL_CONSTRAINTS}' length and to {@link LABEL_PATTERN}.
|
|
2939
|
+
* Throws `ShipError.validation` when it does not fit.
|
|
2940
|
+
*
|
|
2941
|
+
* Lowercasing is the one normalization and it applies to both sides of a
|
|
2942
|
+
* `:`, so `Env:Prod` is stored as `env:prod`. A value that must keep its
|
|
2943
|
+
* case does not belong in a label.
|
|
2944
|
+
*
|
|
2945
|
+
* The one label check on the platform: the SDK and the console call it for
|
|
2946
|
+
* fast feedback and the API calls it as the boundary, so all three refuse
|
|
2947
|
+
* the same strings in the same words.
|
|
2948
|
+
*/
|
|
2949
|
+
declare function validateLabel(value: unknown): string;
|
|
2950
|
+
/**
|
|
2951
|
+
* Validate a resource's labels and return them normalized, each through
|
|
2952
|
+
* {@link validateLabel}. Absent (`undefined` / `null`) returns `undefined`;
|
|
2953
|
+
* an empty array returns as is, which is how an update clears every label.
|
|
2954
|
+
* At most {@link LABEL_CONSTRAINTS.MAX_COUNT}, and no label twice after
|
|
2955
|
+
* normalization.
|
|
2956
|
+
*/
|
|
2957
|
+
declare function validateLabels(labels: string[]): string[];
|
|
2958
|
+
declare function validateLabels(labels: string[] | undefined | null): string[] | undefined;
|
|
2839
2959
|
/**
|
|
2840
2960
|
* Serialize labels array to JSON string for database storage.
|
|
2841
2961
|
* Returns null for empty or undefined arrays.
|
|
@@ -2956,8 +3076,8 @@ type ApiDeployOptions = Omit<DeploymentOptions, 'pathDetect'>;
|
|
|
2956
3076
|
*/
|
|
2957
3077
|
interface DeployBodyContext {
|
|
2958
3078
|
/**
|
|
2959
|
-
* Deployment labels
|
|
2960
|
-
* `
|
|
3079
|
+
* Deployment labels, each a word (`production`) or a key and a value
|
|
3080
|
+
* (`env:production`), already through `validateLabels`.
|
|
2961
3081
|
*/
|
|
2962
3082
|
labels?: string[];
|
|
2963
3083
|
/**
|
|
@@ -3850,4 +3970,4 @@ declare class Ship extends Ship$1 {
|
|
|
3850
3970
|
protected processInput(input: DeployInput, options: DeploymentOptions, limits: PlatformLimits): Promise<StaticFile[]>;
|
|
3851
3971
|
}
|
|
3852
3972
|
|
|
3853
|
-
export { ACCOUNT_HEADER, API_KEY, API_PATHS, AUTH_BASE_PATH, type Account, type AccountAccess, type AccountDeleteResponse, type AccountKeyResponse, AccountPlan, type AccountPlanType, AccountRefusal, type AccountRefusalType, type AccountResource, type AccountRole, type Activity, type ActivityEvent, type ActivityListResponse, type ActivityMeta, type ApiDeployOptions, ApiHttp, type ApiHttpOptions, AuthMethod, type AuthMethodType, BUILD_SETTINGS, type BillingInterval, type BillingPortalSession, type BillingSyncResponse, type BuildFailureDetails, CALLER, type Caps, type ConsoleErrand, type ConsolePaths, type ConsoleSection, DEFAULT_API, DEPLOYMENT_CONFIG_FILENAME, DEPLOY_FIELDS, DEPLOY_FILE_GRAMMAR, DEPLOY_TOKEN, type DeployBodyContext, type DeployFile, type DeployFileEncoding, type DeployFileSpec, type DeployInput, type DeployTransport, type Deployment, type DeploymentCreateResponse, type DeploymentDeleteResponse, type DeploymentListResponse, type DeploymentOptions, type DeploymentResource, type DeploymentResourceContext, type DeploymentSetOptions, DeploymentStatus, type DeploymentStatusType, type DeploymentUploadOptions, DeploymentVia, type DeploymentViaType, type DnsLookup, type DnsProvider, type DnsRecord, type DnsRecordType, type Domain, type DomainDeleteResponse, type DomainDnsResponse, type DomainListResponse, type DomainRecordsResponse, type DomainResource, type DomainSetOptions, type DomainSetResult, type DomainShareResponse, DomainStatus, type DomainStatusType, type DomainValidateResponse, DomainVerification, type DomainVerificationType, type DomainVerifyResponse, type ErrorResponse, ErrorType, type ExecutionEnvironment, FileValidationStatus as FILE_VALIDATION_STATUS, type Fetch, type FileValidationResult, FileValidationStatus, type FileValidationStatusType, IDEMPOTENCY_KEY_CONSTRAINTS, JUNK_DIRECTORIES, LABEL_CONSTRAINTS, LABEL_PATTERN, type LabelsResponse, type ListOptions, type ListResponse, type MD5Result, MY_API_KEY_URL, OAUTH_TOKEN, OAuthScope, type OAuthScopeType, PASSWORD_CONSTRAINTS, PUBLIC_DEPLOYMENT_TTL_SECONDS, type PingResponse, type Plan, type PlanChangeRefusalDetails, type PlanChangeRequest, type PlanChangeResponse, type PlanDestination, type PlansResponse, type PlatformLimitKey, type PlatformLimits, type RequestResult, type ResourceContext, SECTIONS, SETUP_TROUBLESHOOTING_ANCHOR, SHIP_ENV, SHIP_VIA_ENV,
|
|
3973
|
+
export { ACCOUNT_HEADER, API_KEY, API_PATHS, AUTH_BASE_PATH, type Account, type AccountAccess, type AccountDeleteResponse, type AccountKeyResponse, AccountPlan, type AccountPlanType, AccountRefusal, type AccountRefusalType, type AccountResource, type AccountRole, type AccountUsage, type Activity, type ActivityEvent, type ActivityListResponse, type ActivityMeta, type ApiDeployOptions, ApiHttp, type ApiHttpOptions, AuthMethod, type AuthMethodType, BUILD_SETTINGS, type BillingInterval, type BillingPortalSession, type BillingSyncResponse, type BuildFailureDetails, CALLER, type Caps, type ConsoleErrand, type ConsolePaths, type ConsoleSection, DEFAULT_API, DEPLOYMENT_CONFIG_FILENAME, DEPLOY_FIELDS, DEPLOY_FILE_GRAMMAR, DEPLOY_TOKEN, type DeployBodyContext, type DeployFile, type DeployFileEncoding, type DeployFileSpec, type DeployInput, type DeployTransport, type Deployment, type DeploymentCreateResponse, type DeploymentDeleteResponse, type DeploymentListResponse, type DeploymentOptions, type DeploymentResource, type DeploymentResourceContext, type DeploymentSetOptions, DeploymentStatus, type DeploymentStatusType, type DeploymentUploadOptions, DeploymentVia, type DeploymentViaType, type DnsLookup, type DnsProvider, type DnsRecord, type DnsRecordType, type Domain, type DomainDeleteResponse, type DomainDnsResponse, type DomainListResponse, type DomainRecordsResponse, type DomainResource, type DomainSetOptions, type DomainSetResult, type DomainShareResponse, DomainStatus, type DomainStatusType, type DomainValidateResponse, DomainVerification, type DomainVerificationType, type DomainVerifyResponse, type DoorSegment, type ErrorResponse, ErrorType, type ExecutionEnvironment, FileValidationStatus as FILE_VALIDATION_STATUS, type Fetch, type FileValidationResult, FileValidationStatus, type FileValidationStatusType, IDEMPOTENCY_KEY_CONSTRAINTS, JUNK_DIRECTORIES, LABEL_CONSTRAINTS, LABEL_PATTERN, type LabelsResponse, type ListOptions, type ListResponse, type MD5Result, MY_API_KEY_URL, OAUTH_TOKEN, OAuthScope, type OAuthScopeType, PASSWORD_CONSTRAINTS, PUBLIC_DEPLOYMENT_TTL_SECONDS, type PingResponse, type Plan, type PlanChangeRefusalDetails, type PlanChangeRequest, type PlanChangeResponse, type PlanDestination, type PlansResponse, type PlatformLimitKey, type PlatformLimits, type RequestResult, type ResourceContext, SECTIONS, SETUP_TROUBLESHOOTING_ANCHOR, SHIP_ENV, SHIP_VIA_ENV, type SPACheckRequest, type SPACheckResponse, SPA_CHECK_CONSTRAINTS, SPA_DEFAULT_CONFIG, type ScheduledChange, type SettingsFragment, type SetupInstructionsResponse, Ship, type ShipClientOptions, ShipError, type ShipEvents, type ShipRequestInit, type StaticFile, TTL_CONSTRAINTS, type Token, type TokenCreateOptions, type TokenCreateResponse, type TokenDeleteResponse, TokenKind, type TokenKindType, type TokenListResponse, type TokenProvider, type TokenResource, type Transport, UNBUILT_PROJECT_MARKERS, UNSAFE_FILENAME_CHARS, USAGE_KIND, USER_VISIBLE_EVENTS, type UploadedFile, type UserVisibleActivityEvent, type ValidatableFile, type ValidationIssue, WEB_FILE_ACCEPT, __setTestEnvironment, accountOfPath, allValidFilesReady, assertShipJsonSyntax, billingReturnOf, calculateMD5, classifyToken, consolePaths, countPhrase, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, Ship as default, deserializeLabels, doorOf, doors, errandOf, excessOver, extractSubdomain, filterJunk, fitPhrase, formatDuration, formatFileSize, formatTimeRemaining, generateDeploymentUrl, generateDomainUrl, getENV, getValidFiles, hasUnbuiltMarker, hasUnsafeChars, isBlockedExtension, isClaimPath, isCustomDomain, isDeployment, isPlatformDomain, isShipError, isUpgradePath, normalizeVia, optimizeDeployPaths, personName, personShortName, placesTaken, pluralize, processFilesForBrowser, readBearerValue, serializeLabels, validateApiKey, validateApiUrl, validateBuildCommand, validateCaller, validateDeployCount, validateDeployFile, validateDeployPath, validateDeployToken, validateFileName, validateFiles, validateIdempotencyKey, validateLabel, validateLabels, validateOAuthToken, validateOutputDir, validatePassword, validateToken, validateTtl };
|