@shipstatic/ship 2.6.0-beta.2 → 2.6.0-beta.3

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.
@@ -5,7 +5,7 @@ Their copyright notices travel with that copy, and are reproduced here in
5
5
  full. This file is GENERATED from the build's own metafile — edit the
6
6
  bundle, not this list.
7
7
 
8
- ## @shipstatic/types 2.16.0-beta.1
8
+ ## @shipstatic/types 2.17.0-beta.1
9
9
 
10
10
  License: MIT
11
11
 
package/dist/browser.d.ts CHANGED
@@ -655,6 +655,20 @@ interface Account {
655
655
  * must never be sent to Checkout.
656
656
  */
657
657
  readonly upgrade: AccountPlanType | null;
658
+ /**
659
+ * The live Subscription's billing interval — Stripe's
660
+ * `Price.recurring.interval`, mirrored — or `null` when no Subscription
661
+ * bills the account (free and granted plans). It is what lets the console
662
+ * offer the current plan's OTHER interval as a switch.
663
+ */
664
+ readonly interval: BillingInterval | null;
665
+ /**
666
+ * The pending plan change, or `null`. *Up is now, down is at period end*:
667
+ * a downgrade is a Stripe Subscription Schedule that applies at `at`, and
668
+ * until then the account keeps everything it paid for. Reversible —
669
+ * `DELETE /billing/change` releases it.
670
+ */
671
+ readonly scheduled: ScheduledChange | null;
658
672
  }
659
673
  /**
660
674
  * Account as returned by `GET /account` — the entity plus how the request
@@ -1843,46 +1857,52 @@ interface PlansResponse {
1843
1857
  readonly plans: readonly Plan[];
1844
1858
  }
1845
1859
  /**
1846
- * The body of `POST /billing/checkout` — which plan, at which interval. Both
1847
- * required: with more than one billed plan there is no honest default, and
1848
- * the console always knows which card was clicked. Only a free account
1849
- * checks out, and only onto a plan the menu sells; a billed account changes
1850
- * plan through the Portal ({@link BillingPortalRequest}), because Stripe
1851
- * changes a Subscription in place rather than selling a second one.
1860
+ * The body of `POST /billing/change` — the one door for "get me onto this
1861
+ * plan". Both fields required: with more than one billed plan there is no
1862
+ * honest default, and the console always knows which card was clicked.
1863
+ *
1864
+ * The SERVER decides what the change means — the rule is *up is now, down is
1865
+ * at period end* so the client holds no copy of the ladder: a free account
1866
+ * is sent to Stripe Checkout, a billed account moving up is sent to the
1867
+ * Portal's confirmation page (money moves now, so Stripe's page takes the
1868
+ * consent), and a billed account moving down gets a Stripe Subscription
1869
+ * Schedule that applies the change at period end. The answer says which
1870
+ * happened ({@link PlanChangeResponse}).
1852
1871
  */
1853
- interface CheckoutRequest {
1872
+ interface PlanChangeRequest {
1854
1873
  readonly plan: AccountPlanType;
1855
1874
  readonly interval: BillingInterval;
1856
1875
  }
1857
1876
  /**
1858
- * The body of `POST /billing/portal` optional, and when present a
1859
- * DESTINATION: the plan and interval the account wants, which opens the
1860
- * Portal on Stripe's own confirmation page for that Price rather than on its
1861
- * home page. Absent, the Portal opens where it always did: cards, invoices,
1862
- * cancellation, and Stripe's own plan picker.
1877
+ * The pending plan changea Stripe Subscription Schedule the platform
1878
+ * minted, mirrored onto the account. `at` is when it applies (the current
1879
+ * period's end, Unix seconds). Reversible until then: `DELETE
1880
+ * /billing/change` releases it.
1863
1881
  */
1864
- interface BillingPortalRequest {
1865
- readonly plan?: AccountPlanType;
1866
- readonly interval?: BillingInterval;
1882
+ interface ScheduledChange {
1883
+ readonly plan: AccountPlanType;
1884
+ readonly interval: BillingInterval;
1885
+ readonly at: number;
1867
1886
  }
1868
1887
  /**
1869
- * The answer of `POST /billing/checkout` — Stripe's `Checkout.Session`,
1870
- * projected to the one field a client needs.
1888
+ * The answer of `POST /billing/change` — exactly one field is set.
1871
1889
  *
1872
- * There is nothing else to return: the outcome arrives later, as a Stripe
1873
- * webhook. It is its own type rather than a shape shared with
1874
- * {@link BillingPortalSession} because Stripe has two distinct objects here,
1875
- * and naming one of them for both would be the reader's translation to make.
1890
+ * `url` means GO: a Stripe page (Checkout, or the Portal's confirmation page)
1891
+ * finishes the change and the browser must be redirected to it. `scheduled`
1892
+ * means DONE: the downgrade is booked for period end, nothing to visit, and
1893
+ * the account's `scheduled` field now carries it.
1876
1894
  */
1877
- interface CheckoutSession {
1895
+ interface PlanChangeResponse {
1878
1896
  /** Absolute URL to redirect the browser to. Single use, short-lived. */
1879
- readonly url: string;
1897
+ readonly url?: string;
1898
+ /** The pending change, when the platform scheduled it instead. */
1899
+ readonly scheduled?: ScheduledChange;
1880
1900
  }
1881
1901
  /**
1882
1902
  * The answer of `POST /billing/portal` — Stripe's `BillingPortal.Session`,
1883
- * projected the same way. Identical in shape to {@link CheckoutSession} and
1884
- * deliberately not merged with it: they are two Stripe objects, and either may
1885
- * gain a field the other never has.
1903
+ * projected to the one field a client needs. The Portal home: cards,
1904
+ * invoices, cancellation. Plan changes have their own door
1905
+ * ({@link PlanChangeRequest}).
1886
1906
  */
1887
1907
  interface BillingPortalSession {
1888
1908
  /** Absolute URL to redirect the browser to. Single use, short-lived. */
@@ -3081,4 +3101,4 @@ declare class Ship extends Ship$1 {
3081
3101
  protected processInput(input: DeployInput, options: DeploymentOptions): Promise<StaticFile[]>;
3082
3102
  }
3083
3103
 
3084
- export { API_KEY, API_PATHS, AUTH_BASE_PATH, type Account, type AccountDeleteResponse, type AccountGetResponse, type AccountKeyResponse, AccountPlan, type AccountPlanType, type AccountResource, type Activity, type ActivityEvent, type ActivityListResponse, type ActivityMeta, type ApiDeployOptions, ApiHttp, type ApiHttpOptions, AuthMethod, type AuthMethodType, type BillingInterval, type BillingPortalRequest, type BillingPortalSession, type BillingSyncResponse, CALLER, type Caps, type CheckoutRequest, type CheckoutSession, DEFAULT_API, DEPLOYMENT_CONFIG_FILENAME, DEPLOY_FIELDS, DEPLOY_TOKEN, type DeployBodyContext, type DeployFile, 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, 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 PlansResponse, type PlatformLimits, type RequestResult, type ResourceContext, SHIP_ENV, SIGN_IN_RETURN_PARAM, type SPACheckDebug, type SPACheckRequest, type SPACheckResponse, SPA_CHECK_CONSTRAINTS, SPA_DEFAULT_CONFIG, 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, type UploadedFile, type UserVisibleActivityEvent, type ValidatableFile, type ValidationIssue, WEB_FILE_ACCEPT, __setTestEnvironment, allValidFilesReady, assertShipJsonSyntax, calculateMD5, classifyToken, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, Ship as default, deserializeLabels, extractSubdomain, filterJunk, formatFileSize, generateDeploymentUrl, generateDomainUrl, getENV, getValidFiles, hasUnbuiltMarker, hasUnsafeChars, isBlockedExtension, isCustomDomain, isDeployment, isPlatformDomain, isShipError, normalizeVia, optimizeDeployPaths, pluralize, processFilesForBrowser, readBearerValue, serializeLabels, validateApiKey, validateApiUrl, validateCaller, validateDeployFile, validateDeployPath, validateDeployToken, validateFileName, validateFiles, validateIdempotencyKey, validateOAuthToken, validatePassword, validateToken, validateTtl };
3104
+ export { API_KEY, API_PATHS, AUTH_BASE_PATH, type Account, type AccountDeleteResponse, type AccountGetResponse, type AccountKeyResponse, AccountPlan, type AccountPlanType, type AccountResource, type Activity, type ActivityEvent, type ActivityListResponse, type ActivityMeta, type ApiDeployOptions, ApiHttp, type ApiHttpOptions, AuthMethod, type AuthMethodType, type BillingInterval, type BillingPortalSession, type BillingSyncResponse, CALLER, type Caps, DEFAULT_API, DEPLOYMENT_CONFIG_FILENAME, DEPLOY_FIELDS, DEPLOY_TOKEN, type DeployBodyContext, type DeployFile, 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, 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 PlanChangeRequest, type PlanChangeResponse, type PlansResponse, type PlatformLimits, type RequestResult, type ResourceContext, SHIP_ENV, SIGN_IN_RETURN_PARAM, type SPACheckDebug, type SPACheckRequest, type SPACheckResponse, SPA_CHECK_CONSTRAINTS, SPA_DEFAULT_CONFIG, type ScheduledChange, 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, type UploadedFile, type UserVisibleActivityEvent, type ValidatableFile, type ValidationIssue, WEB_FILE_ACCEPT, __setTestEnvironment, allValidFilesReady, assertShipJsonSyntax, calculateMD5, classifyToken, createAccountResource, createDeploymentResource, createDomainResource, createTokenResource, Ship as default, deserializeLabels, extractSubdomain, filterJunk, formatFileSize, generateDeploymentUrl, generateDomainUrl, getENV, getValidFiles, hasUnbuiltMarker, hasUnsafeChars, isBlockedExtension, isCustomDomain, isDeployment, isPlatformDomain, isShipError, normalizeVia, optimizeDeployPaths, pluralize, processFilesForBrowser, readBearerValue, serializeLabels, validateApiKey, validateApiUrl, validateCaller, validateDeployFile, validateDeployPath, validateDeployToken, validateFileName, validateFiles, validateIdempotencyKey, validateOAuthToken, validatePassword, validateToken, validateTtl };