@shipstatic/types 0.8.6 → 0.8.8
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 +25 -0
- package/dist/index.js +17 -0
- package/package.json +1 -1
- package/src/index.ts +31 -1
package/dist/index.d.ts
CHANGED
|
@@ -585,6 +585,17 @@ export interface DeploymentUploadOptions {
|
|
|
585
585
|
labels?: string[];
|
|
586
586
|
/** Client identifier (e.g., 'cli', 'sdk', 'web') */
|
|
587
587
|
via?: string;
|
|
588
|
+
/**
|
|
589
|
+
* Optional password that gates public access to this deployment.
|
|
590
|
+
*
|
|
591
|
+
* Length: {@link PASSWORD_CONSTRAINTS.MIN_LENGTH} to
|
|
592
|
+
* {@link PASSWORD_CONSTRAINTS.MAX_LENGTH} characters. Plaintext on the wire;
|
|
593
|
+
* the API hashes it once (SHA-256) and stores the hex digest. The Router
|
|
594
|
+
* serves a lock page to visitors who don't present the matching cookie. If
|
|
595
|
+
* the deployment is linked to a custom domain, the same gate applies there
|
|
596
|
+
* too. Revocation is redeployment.
|
|
597
|
+
*/
|
|
598
|
+
password?: string;
|
|
588
599
|
/** @internal Trigger server-side build. Only available via /upload endpoint. */
|
|
589
600
|
build?: boolean;
|
|
590
601
|
/** @internal Trigger server-side prerender. Only available via /upload endpoint. */
|
|
@@ -912,3 +923,17 @@ export declare function serializeLabels(labels: string[] | undefined): string |
|
|
|
912
923
|
* @example deserializeLabels('') → []
|
|
913
924
|
*/
|
|
914
925
|
export declare function deserializeLabels(labelsJson: string | null): string[];
|
|
926
|
+
/**
|
|
927
|
+
* Deployment password validation constraints, shared across UI, SDK, and API.
|
|
928
|
+
* Single source of truth for the length rule applied to the optional
|
|
929
|
+
* `DeploymentUploadOptions.password` field.
|
|
930
|
+
*
|
|
931
|
+
* Plaintext is hashed once server-side (SHA-256) and never persisted in its
|
|
932
|
+
* original form; see `cloudflare/shared/password.ts` for the protocol.
|
|
933
|
+
*/
|
|
934
|
+
export declare const PASSWORD_CONSTRAINTS: {
|
|
935
|
+
/** Minimum password length in characters */
|
|
936
|
+
readonly MIN_LENGTH: 6;
|
|
937
|
+
/** Maximum password length in characters */
|
|
938
|
+
readonly MAX_LENGTH: 128;
|
|
939
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -512,3 +512,20 @@ export function deserializeLabels(labelsJson) {
|
|
|
512
512
|
return [];
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
+
// =============================================================================
|
|
516
|
+
// PASSWORD UTILITIES
|
|
517
|
+
// =============================================================================
|
|
518
|
+
/**
|
|
519
|
+
* Deployment password validation constraints, shared across UI, SDK, and API.
|
|
520
|
+
* Single source of truth for the length rule applied to the optional
|
|
521
|
+
* `DeploymentUploadOptions.password` field.
|
|
522
|
+
*
|
|
523
|
+
* Plaintext is hashed once server-side (SHA-256) and never persisted in its
|
|
524
|
+
* original form; see `cloudflare/shared/password.ts` for the protocol.
|
|
525
|
+
*/
|
|
526
|
+
export const PASSWORD_CONSTRAINTS = {
|
|
527
|
+
/** Minimum password length in characters */
|
|
528
|
+
MIN_LENGTH: 6,
|
|
529
|
+
/** Maximum password length in characters */
|
|
530
|
+
MAX_LENGTH: 128,
|
|
531
|
+
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -888,6 +888,17 @@ export interface DeploymentUploadOptions {
|
|
|
888
888
|
labels?: string[];
|
|
889
889
|
/** Client identifier (e.g., 'cli', 'sdk', 'web') */
|
|
890
890
|
via?: string;
|
|
891
|
+
/**
|
|
892
|
+
* Optional password that gates public access to this deployment.
|
|
893
|
+
*
|
|
894
|
+
* Length: {@link PASSWORD_CONSTRAINTS.MIN_LENGTH} to
|
|
895
|
+
* {@link PASSWORD_CONSTRAINTS.MAX_LENGTH} characters. Plaintext on the wire;
|
|
896
|
+
* the API hashes it once (SHA-256) and stores the hex digest. The Router
|
|
897
|
+
* serves a lock page to visitors who don't present the matching cookie. If
|
|
898
|
+
* the deployment is linked to a custom domain, the same gate applies there
|
|
899
|
+
* too. Revocation is redeployment.
|
|
900
|
+
*/
|
|
901
|
+
password?: string;
|
|
891
902
|
/** @internal Trigger server-side build. Only available via /upload endpoint. */
|
|
892
903
|
build?: boolean;
|
|
893
904
|
/** @internal Trigger server-side prerender. Only available via /upload endpoint. */
|
|
@@ -1351,4 +1362,23 @@ export function deserializeLabels(labelsJson: string | null): string[] {
|
|
|
1351
1362
|
} catch {
|
|
1352
1363
|
return [];
|
|
1353
1364
|
}
|
|
1354
|
-
}
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
// =============================================================================
|
|
1368
|
+
// PASSWORD UTILITIES
|
|
1369
|
+
// =============================================================================
|
|
1370
|
+
|
|
1371
|
+
/**
|
|
1372
|
+
* Deployment password validation constraints, shared across UI, SDK, and API.
|
|
1373
|
+
* Single source of truth for the length rule applied to the optional
|
|
1374
|
+
* `DeploymentUploadOptions.password` field.
|
|
1375
|
+
*
|
|
1376
|
+
* Plaintext is hashed once server-side (SHA-256) and never persisted in its
|
|
1377
|
+
* original form; see `cloudflare/shared/password.ts` for the protocol.
|
|
1378
|
+
*/
|
|
1379
|
+
export const PASSWORD_CONSTRAINTS = {
|
|
1380
|
+
/** Minimum password length in characters */
|
|
1381
|
+
MIN_LENGTH: 6,
|
|
1382
|
+
/** Maximum password length in characters */
|
|
1383
|
+
MAX_LENGTH: 128,
|
|
1384
|
+
} as const;
|