@shipstatic/types 2.5.0-beta.20 → 2.5.0-beta.21
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 +84 -0
- package/dist/index.js +84 -0
- package/package.json +1 -1
- package/src/index.ts +88 -0
package/dist/index.d.ts
CHANGED
|
@@ -135,6 +135,41 @@ export declare const API_PATHS: {
|
|
|
135
135
|
readonly SPA_CHECK: "/spa-check";
|
|
136
136
|
readonly UPLOAD: "/upload";
|
|
137
137
|
};
|
|
138
|
+
/**
|
|
139
|
+
* The deploy request's multipart field names — the other half of the wire
|
|
140
|
+
* surface beside {@link API_PATHS}. `POST /deployments` (and the first-party
|
|
141
|
+
* `/upload`) is multipart/form-data, and these are the names the API reads.
|
|
142
|
+
*
|
|
143
|
+
* Declared once because the body has three independent WRITERS — the SDK's
|
|
144
|
+
* Node and browser body builders, and the n8n community node's hand-rolled
|
|
145
|
+
* client (which cannot import this under n8n Cloud's zero-dependency rule,
|
|
146
|
+
* and fences its restated copy instead) — and until this export every writer
|
|
147
|
+
* restated the strings the API parses, with nothing comparing them.
|
|
148
|
+
*
|
|
149
|
+
* `FILES` carries one entry per file (the API reads it with `getAll`); every
|
|
150
|
+
* other field is single. The `@internal` flags are serialized as the literal
|
|
151
|
+
* string `'true'` and belong to first-party surfaces only.
|
|
152
|
+
*/
|
|
153
|
+
export declare const DEPLOY_FIELDS: {
|
|
154
|
+
/** One entry per file — read with `getAll`. */
|
|
155
|
+
readonly FILES: "files[]";
|
|
156
|
+
/** JSON array of MD5 hex digests, index-aligned with `FILES`. */
|
|
157
|
+
readonly CHECKSUMS: "checksums";
|
|
158
|
+
/** JSON array of label strings. */
|
|
159
|
+
readonly LABELS: "labels";
|
|
160
|
+
/** The deploying surface's {@link DeploymentVia} member. */
|
|
161
|
+
readonly VIA: "via";
|
|
162
|
+
/** Plaintext password — the API hashes it server-side. */
|
|
163
|
+
readonly PASSWORD: "password";
|
|
164
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
165
|
+
readonly BUILD: "build";
|
|
166
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
167
|
+
readonly PRERENDER: "prerender";
|
|
168
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
169
|
+
readonly SPA: "spa";
|
|
170
|
+
/** @internal reCAPTCHA proof — `web/www`'s public uploader only. */
|
|
171
|
+
readonly CAPTCHA: "captcha";
|
|
172
|
+
};
|
|
138
173
|
/**
|
|
139
174
|
* The half of a list response that is identical on every list.
|
|
140
175
|
*
|
|
@@ -1023,6 +1058,26 @@ export declare const SPA_DEFAULT_CONFIG: {
|
|
|
1023
1058
|
readonly destination: "/index.html";
|
|
1024
1059
|
}];
|
|
1025
1060
|
};
|
|
1061
|
+
/**
|
|
1062
|
+
* The `/spa-check` pre-flight's client-side envelope: which file is the
|
|
1063
|
+
* check's subject, and how large it may be before a client skips the call.
|
|
1064
|
+
*
|
|
1065
|
+
* One fact with three holders until this export — the API's config declared
|
|
1066
|
+
* the cap, the SDK's `checkSPA` hardcoded `100 * 1024`, and prose restated
|
|
1067
|
+
* "100KB". `INDEX_FILE` is the selection rule (the file whose content rides
|
|
1068
|
+
* `SPACheckRequest.index`), restated by every client that builds the request.
|
|
1069
|
+
*
|
|
1070
|
+
* Neither member is a validation boundary: a client over the cap simply
|
|
1071
|
+
* skips the pre-flight, because the server answers an oversized index
|
|
1072
|
+
* `isSPA: false` anyway. A consumer that cannot import this (n8n) needs no
|
|
1073
|
+
* size copy at all — outcome parity is the server's, not the client's.
|
|
1074
|
+
*/
|
|
1075
|
+
export declare const SPA_CHECK_CONSTRAINTS: {
|
|
1076
|
+
/** The file whose content is the check's subject. */
|
|
1077
|
+
readonly INDEX_FILE: "index.html";
|
|
1078
|
+
/** Skip the pre-flight above this size — the server would answer false. */
|
|
1079
|
+
readonly MAX_INDEX_BYTES: number;
|
|
1080
|
+
};
|
|
1026
1081
|
/**
|
|
1027
1082
|
* Assert that a ship.json file is *syntactically* loadable. Syntax only —
|
|
1028
1083
|
* never schema.
|
|
@@ -1147,6 +1202,35 @@ export interface StaticFile {
|
|
|
1147
1202
|
}
|
|
1148
1203
|
/** Default API URL if not otherwise configured. */
|
|
1149
1204
|
export declare const DEFAULT_API = "https://api.shipstatic.com";
|
|
1205
|
+
/**
|
|
1206
|
+
* The Node SDK's ambient configuration pair — the ONLY environment variables
|
|
1207
|
+
* the SDK reads, and therefore the COMPLETE list an embedding host must
|
|
1208
|
+
* scrub (per `npm/ship`'s strict-isolation contract, scrubbing is the host's
|
|
1209
|
+
* job, not the SDK's). A host that derives its scrub from this object's
|
|
1210
|
+
* values — as the VS Code extension's child-process env block does — picks
|
|
1211
|
+
* up a grown contract at the next pin bump instead of by remembered prose.
|
|
1212
|
+
*
|
|
1213
|
+
* Browser builds read no environment at all, and the CLI-only variables
|
|
1214
|
+
* (`SHIP_PASSWORD`, `SHIP_VIA`) are deliberately NOT here: they are the
|
|
1215
|
+
* CLI's operational levers, not the SDK's ambient contract — see
|
|
1216
|
+
* `npm/ship/CLAUDE.md`, "CLI-only env vars".
|
|
1217
|
+
*/
|
|
1218
|
+
export declare const SHIP_ENV: {
|
|
1219
|
+
/** The one credential slot — any platform token. */
|
|
1220
|
+
readonly TOKEN: "SHIP_TOKEN";
|
|
1221
|
+
/** The API endpoint override. */
|
|
1222
|
+
readonly API_URL: "SHIP_API_URL";
|
|
1223
|
+
};
|
|
1224
|
+
/**
|
|
1225
|
+
* Where a human creates an API key — the console deep link quoted by every
|
|
1226
|
+
* surface that teaches authentication (the CLI's config wizard, the VS Code
|
|
1227
|
+
* and n8n listings, the n8n rate-limit hint and credential copy). Written
|
|
1228
|
+
* out in five files across three repos until this export.
|
|
1229
|
+
*
|
|
1230
|
+
* Production-branded by design: published artifacts name the product, never
|
|
1231
|
+
* an environment (root `CLAUDE.md`, "Environment-Aware URLs").
|
|
1232
|
+
*/
|
|
1233
|
+
export declare const MY_API_KEY_URL = "https://my.shipstatic.com/api-key";
|
|
1150
1234
|
/**
|
|
1151
1235
|
* How long an anonymous deployment lives before it expires.
|
|
1152
1236
|
*
|
package/dist/index.js
CHANGED
|
@@ -91,6 +91,41 @@ export const API_PATHS = {
|
|
|
91
91
|
SPA_CHECK: '/spa-check',
|
|
92
92
|
UPLOAD: '/upload',
|
|
93
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* The deploy request's multipart field names — the other half of the wire
|
|
96
|
+
* surface beside {@link API_PATHS}. `POST /deployments` (and the first-party
|
|
97
|
+
* `/upload`) is multipart/form-data, and these are the names the API reads.
|
|
98
|
+
*
|
|
99
|
+
* Declared once because the body has three independent WRITERS — the SDK's
|
|
100
|
+
* Node and browser body builders, and the n8n community node's hand-rolled
|
|
101
|
+
* client (which cannot import this under n8n Cloud's zero-dependency rule,
|
|
102
|
+
* and fences its restated copy instead) — and until this export every writer
|
|
103
|
+
* restated the strings the API parses, with nothing comparing them.
|
|
104
|
+
*
|
|
105
|
+
* `FILES` carries one entry per file (the API reads it with `getAll`); every
|
|
106
|
+
* other field is single. The `@internal` flags are serialized as the literal
|
|
107
|
+
* string `'true'` and belong to first-party surfaces only.
|
|
108
|
+
*/
|
|
109
|
+
export const DEPLOY_FIELDS = {
|
|
110
|
+
/** One entry per file — read with `getAll`. */
|
|
111
|
+
FILES: 'files[]',
|
|
112
|
+
/** JSON array of MD5 hex digests, index-aligned with `FILES`. */
|
|
113
|
+
CHECKSUMS: 'checksums',
|
|
114
|
+
/** JSON array of label strings. */
|
|
115
|
+
LABELS: 'labels',
|
|
116
|
+
/** The deploying surface's {@link DeploymentVia} member. */
|
|
117
|
+
VIA: 'via',
|
|
118
|
+
/** Plaintext password — the API hashes it server-side. */
|
|
119
|
+
PASSWORD: 'password',
|
|
120
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
121
|
+
BUILD: 'build',
|
|
122
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
123
|
+
PRERENDER: 'prerender',
|
|
124
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
125
|
+
SPA: 'spa',
|
|
126
|
+
/** @internal reCAPTCHA proof — `web/www`'s public uploader only. */
|
|
127
|
+
CAPTCHA: 'captcha',
|
|
128
|
+
};
|
|
94
129
|
// =============================================================================
|
|
95
130
|
// DOMAIN TYPES
|
|
96
131
|
// =============================================================================
|
|
@@ -948,6 +983,26 @@ export const DEPLOYMENT_CONFIG_FILENAME = 'ship.json';
|
|
|
948
983
|
export const SPA_DEFAULT_CONFIG = {
|
|
949
984
|
rewrites: [{ source: '/(.*)', destination: '/index.html' }],
|
|
950
985
|
};
|
|
986
|
+
/**
|
|
987
|
+
* The `/spa-check` pre-flight's client-side envelope: which file is the
|
|
988
|
+
* check's subject, and how large it may be before a client skips the call.
|
|
989
|
+
*
|
|
990
|
+
* One fact with three holders until this export — the API's config declared
|
|
991
|
+
* the cap, the SDK's `checkSPA` hardcoded `100 * 1024`, and prose restated
|
|
992
|
+
* "100KB". `INDEX_FILE` is the selection rule (the file whose content rides
|
|
993
|
+
* `SPACheckRequest.index`), restated by every client that builds the request.
|
|
994
|
+
*
|
|
995
|
+
* Neither member is a validation boundary: a client over the cap simply
|
|
996
|
+
* skips the pre-flight, because the server answers an oversized index
|
|
997
|
+
* `isSPA: false` anyway. A consumer that cannot import this (n8n) needs no
|
|
998
|
+
* size copy at all — outcome parity is the server's, not the client's.
|
|
999
|
+
*/
|
|
1000
|
+
export const SPA_CHECK_CONSTRAINTS = {
|
|
1001
|
+
/** The file whose content is the check's subject. */
|
|
1002
|
+
INDEX_FILE: 'index.html',
|
|
1003
|
+
/** Skip the pre-flight above this size — the server would answer false. */
|
|
1004
|
+
MAX_INDEX_BYTES: 100 * 1024,
|
|
1005
|
+
};
|
|
951
1006
|
/**
|
|
952
1007
|
* Assert that a ship.json file is *syntactically* loadable. Syntax only —
|
|
953
1008
|
* never schema.
|
|
@@ -1090,6 +1145,35 @@ export function isDeployment(input) {
|
|
|
1090
1145
|
// =============================================================================
|
|
1091
1146
|
/** Default API URL if not otherwise configured. */
|
|
1092
1147
|
export const DEFAULT_API = 'https://api.shipstatic.com';
|
|
1148
|
+
/**
|
|
1149
|
+
* The Node SDK's ambient configuration pair — the ONLY environment variables
|
|
1150
|
+
* the SDK reads, and therefore the COMPLETE list an embedding host must
|
|
1151
|
+
* scrub (per `npm/ship`'s strict-isolation contract, scrubbing is the host's
|
|
1152
|
+
* job, not the SDK's). A host that derives its scrub from this object's
|
|
1153
|
+
* values — as the VS Code extension's child-process env block does — picks
|
|
1154
|
+
* up a grown contract at the next pin bump instead of by remembered prose.
|
|
1155
|
+
*
|
|
1156
|
+
* Browser builds read no environment at all, and the CLI-only variables
|
|
1157
|
+
* (`SHIP_PASSWORD`, `SHIP_VIA`) are deliberately NOT here: they are the
|
|
1158
|
+
* CLI's operational levers, not the SDK's ambient contract — see
|
|
1159
|
+
* `npm/ship/CLAUDE.md`, "CLI-only env vars".
|
|
1160
|
+
*/
|
|
1161
|
+
export const SHIP_ENV = {
|
|
1162
|
+
/** The one credential slot — any platform token. */
|
|
1163
|
+
TOKEN: 'SHIP_TOKEN',
|
|
1164
|
+
/** The API endpoint override. */
|
|
1165
|
+
API_URL: 'SHIP_API_URL',
|
|
1166
|
+
};
|
|
1167
|
+
/**
|
|
1168
|
+
* Where a human creates an API key — the console deep link quoted by every
|
|
1169
|
+
* surface that teaches authentication (the CLI's config wizard, the VS Code
|
|
1170
|
+
* and n8n listings, the n8n rate-limit hint and credential copy). Written
|
|
1171
|
+
* out in five files across three repos until this export.
|
|
1172
|
+
*
|
|
1173
|
+
* Production-branded by design: published artifacts name the product, never
|
|
1174
|
+
* an environment (root `CLAUDE.md`, "Environment-Aware URLs").
|
|
1175
|
+
*/
|
|
1176
|
+
export const MY_API_KEY_URL = 'https://my.shipstatic.com/api-key';
|
|
1093
1177
|
/**
|
|
1094
1178
|
* How long an anonymous deployment lives before it expires.
|
|
1095
1179
|
*
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -147,6 +147,42 @@ export const API_PATHS = {
|
|
|
147
147
|
UPLOAD: '/upload',
|
|
148
148
|
} as const;
|
|
149
149
|
|
|
150
|
+
/**
|
|
151
|
+
* The deploy request's multipart field names — the other half of the wire
|
|
152
|
+
* surface beside {@link API_PATHS}. `POST /deployments` (and the first-party
|
|
153
|
+
* `/upload`) is multipart/form-data, and these are the names the API reads.
|
|
154
|
+
*
|
|
155
|
+
* Declared once because the body has three independent WRITERS — the SDK's
|
|
156
|
+
* Node and browser body builders, and the n8n community node's hand-rolled
|
|
157
|
+
* client (which cannot import this under n8n Cloud's zero-dependency rule,
|
|
158
|
+
* and fences its restated copy instead) — and until this export every writer
|
|
159
|
+
* restated the strings the API parses, with nothing comparing them.
|
|
160
|
+
*
|
|
161
|
+
* `FILES` carries one entry per file (the API reads it with `getAll`); every
|
|
162
|
+
* other field is single. The `@internal` flags are serialized as the literal
|
|
163
|
+
* string `'true'` and belong to first-party surfaces only.
|
|
164
|
+
*/
|
|
165
|
+
export const DEPLOY_FIELDS = {
|
|
166
|
+
/** One entry per file — read with `getAll`. */
|
|
167
|
+
FILES: 'files[]',
|
|
168
|
+
/** JSON array of MD5 hex digests, index-aligned with `FILES`. */
|
|
169
|
+
CHECKSUMS: 'checksums',
|
|
170
|
+
/** JSON array of label strings. */
|
|
171
|
+
LABELS: 'labels',
|
|
172
|
+
/** The deploying surface's {@link DeploymentVia} member. */
|
|
173
|
+
VIA: 'via',
|
|
174
|
+
/** Plaintext password — the API hashes it server-side. */
|
|
175
|
+
PASSWORD: 'password',
|
|
176
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
177
|
+
BUILD: 'build',
|
|
178
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
179
|
+
PRERENDER: 'prerender',
|
|
180
|
+
/** @internal Server-processing flag — first-party `/upload` only. */
|
|
181
|
+
SPA: 'spa',
|
|
182
|
+
/** @internal reCAPTCHA proof — `web/www`'s public uploader only. */
|
|
183
|
+
CAPTCHA: 'captcha',
|
|
184
|
+
} as const;
|
|
185
|
+
|
|
150
186
|
/**
|
|
151
187
|
* The half of a list response that is identical on every list.
|
|
152
188
|
*
|
|
@@ -1593,6 +1629,27 @@ export const SPA_DEFAULT_CONFIG = {
|
|
|
1593
1629
|
rewrites: [{ source: '/(.*)', destination: '/index.html' }],
|
|
1594
1630
|
} as const;
|
|
1595
1631
|
|
|
1632
|
+
/**
|
|
1633
|
+
* The `/spa-check` pre-flight's client-side envelope: which file is the
|
|
1634
|
+
* check's subject, and how large it may be before a client skips the call.
|
|
1635
|
+
*
|
|
1636
|
+
* One fact with three holders until this export — the API's config declared
|
|
1637
|
+
* the cap, the SDK's `checkSPA` hardcoded `100 * 1024`, and prose restated
|
|
1638
|
+
* "100KB". `INDEX_FILE` is the selection rule (the file whose content rides
|
|
1639
|
+
* `SPACheckRequest.index`), restated by every client that builds the request.
|
|
1640
|
+
*
|
|
1641
|
+
* Neither member is a validation boundary: a client over the cap simply
|
|
1642
|
+
* skips the pre-flight, because the server answers an oversized index
|
|
1643
|
+
* `isSPA: false` anyway. A consumer that cannot import this (n8n) needs no
|
|
1644
|
+
* size copy at all — outcome parity is the server's, not the client's.
|
|
1645
|
+
*/
|
|
1646
|
+
export const SPA_CHECK_CONSTRAINTS = {
|
|
1647
|
+
/** The file whose content is the check's subject. */
|
|
1648
|
+
INDEX_FILE: 'index.html',
|
|
1649
|
+
/** Skip the pre-flight above this size — the server would answer false. */
|
|
1650
|
+
MAX_INDEX_BYTES: 100 * 1024,
|
|
1651
|
+
} as const;
|
|
1652
|
+
|
|
1596
1653
|
/**
|
|
1597
1654
|
* Assert that a ship.json file is *syntactically* loadable. Syntax only —
|
|
1598
1655
|
* never schema.
|
|
@@ -1834,6 +1891,37 @@ export interface StaticFile {
|
|
|
1834
1891
|
/** Default API URL if not otherwise configured. */
|
|
1835
1892
|
export const DEFAULT_API = 'https://api.shipstatic.com';
|
|
1836
1893
|
|
|
1894
|
+
/**
|
|
1895
|
+
* The Node SDK's ambient configuration pair — the ONLY environment variables
|
|
1896
|
+
* the SDK reads, and therefore the COMPLETE list an embedding host must
|
|
1897
|
+
* scrub (per `npm/ship`'s strict-isolation contract, scrubbing is the host's
|
|
1898
|
+
* job, not the SDK's). A host that derives its scrub from this object's
|
|
1899
|
+
* values — as the VS Code extension's child-process env block does — picks
|
|
1900
|
+
* up a grown contract at the next pin bump instead of by remembered prose.
|
|
1901
|
+
*
|
|
1902
|
+
* Browser builds read no environment at all, and the CLI-only variables
|
|
1903
|
+
* (`SHIP_PASSWORD`, `SHIP_VIA`) are deliberately NOT here: they are the
|
|
1904
|
+
* CLI's operational levers, not the SDK's ambient contract — see
|
|
1905
|
+
* `npm/ship/CLAUDE.md`, "CLI-only env vars".
|
|
1906
|
+
*/
|
|
1907
|
+
export const SHIP_ENV = {
|
|
1908
|
+
/** The one credential slot — any platform token. */
|
|
1909
|
+
TOKEN: 'SHIP_TOKEN',
|
|
1910
|
+
/** The API endpoint override. */
|
|
1911
|
+
API_URL: 'SHIP_API_URL',
|
|
1912
|
+
} as const;
|
|
1913
|
+
|
|
1914
|
+
/**
|
|
1915
|
+
* Where a human creates an API key — the console deep link quoted by every
|
|
1916
|
+
* surface that teaches authentication (the CLI's config wizard, the VS Code
|
|
1917
|
+
* and n8n listings, the n8n rate-limit hint and credential copy). Written
|
|
1918
|
+
* out in five files across three repos until this export.
|
|
1919
|
+
*
|
|
1920
|
+
* Production-branded by design: published artifacts name the product, never
|
|
1921
|
+
* an environment (root `CLAUDE.md`, "Environment-Aware URLs").
|
|
1922
|
+
*/
|
|
1923
|
+
export const MY_API_KEY_URL = 'https://my.shipstatic.com/api-key';
|
|
1924
|
+
|
|
1837
1925
|
/**
|
|
1838
1926
|
* How long an anonymous deployment lives before it expires.
|
|
1839
1927
|
*
|