@witnium/witniumchain 0.28.1 → 0.28.2

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.mts CHANGED
@@ -9132,7 +9132,7 @@ interface paths$1 {
9132
9132
  put?: never;
9133
9133
  /**
9134
9134
  * Check whether an accounts-minted access token is still active
9135
- * @description For resource servers (MCP, chain API). Verifies the signature, then checks the security epoch, the grant or session the token came from, and the membership, uncached. Answers 200 `{active:false}` for any token that is not active. Callers MUST treat any non-200 answer or network failure as inactive. See docs/token-introspection.md.
9135
+ * @description For resource servers (MCP, chain API, Witnium Vault). Verifies the signature, then checks the security epoch, the grant or session the token came from, the membership and, for a Witnium Vault token, the org's Witnium Vault entitlement, uncached. Answers 200 `{active:false}` for any token that is not active. Callers MUST treat any non-200 answer or network failure as inactive. See docs/token-introspection.md.
9136
9136
  */
9137
9137
  post: {
9138
9138
  parameters: {
@@ -9185,6 +9185,28 @@ interface paths$1 {
9185
9185
  sepoch: number;
9186
9186
  grant_id: string | null;
9187
9187
  session_id: string | null;
9188
+ /**
9189
+ * IntrospectEntitlement
9190
+ * @description For a Witnium Vault token (aud is https://api.witniumvault.com or …/admin): the org's live Witnium Vault entitlement, read now. A Witnium Vault token whose org no longer holds one is inactive. null for every other token.
9191
+ */
9192
+ entitlement: {
9193
+ /** @enum {string} */
9194
+ product: "witnium-vault";
9195
+ /**
9196
+ * @description How the org holds Witnium Vault: a trial, a Stripe subscription, or free (granted by Witnium).
9197
+ * @enum {string}
9198
+ */
9199
+ access: "trial" | "paid" | "complimentary";
9200
+ /** @enum {string} */
9201
+ plan: "personal" | "plus" | "team";
9202
+ /**
9203
+ * Format: date-time
9204
+ * @description When the entitlement stops (ISO 8601): the end of a trial or free period, or when a canceled or unpaid subscription ends or ended. null = no time limit.
9205
+ */
9206
+ expiresAt: string | null;
9207
+ /** @description True while the entitlement is active and not past expiresAt. False: the org still signs in and reads, and the product decides what else an expired entitlement allows (Witnium Vault: no new uploads). */
9208
+ current: boolean;
9209
+ } | null;
9188
9210
  } | {
9189
9211
  /** @enum {boolean} */
9190
9212
  active: false;
@@ -13882,8 +13904,11 @@ interface paths$1 {
13882
13904
  content: {
13883
13905
  "application/json": {
13884
13906
  uid: string;
13885
- /** @enum {string} */
13886
- prompt: "login" | "consent";
13907
+ /**
13908
+ * @description `product_access`: the person's organization doesn't have the client's product (`client.product`; today only Witnium Vault) yet. `access` says which page: `start_trial` (an org admin: confirm the trial with /start-trial) or `ask_admin` (a member: ask the admins with /access-request). Cancel / Back is /abort, which ends the sign-in with access_denied. Shown on the consent route.
13909
+ * @enum {string}
13910
+ */
13911
+ prompt: "login" | "consent" | "product_access";
13887
13912
  client: {
13888
13913
  id: string;
13889
13914
  name: string;
@@ -13892,7 +13917,7 @@ interface paths$1 {
13892
13917
  * @description The product the app belongs to, for branding; null shows neutral Witnium.
13893
13918
  */
13894
13919
  product: {
13895
- /** @description Product slug, e.g. `chain` or `vault`. */
13920
+ /** @description Product slug, e.g. `chain` or `witnium-vault`. */
13896
13921
  id: string;
13897
13922
  name: string;
13898
13923
  /** ProductBranding */
@@ -13936,6 +13961,19 @@ interface paths$1 {
13936
13961
  reauth?: true;
13937
13962
  /** @description The signed-in account: with `reauth`, the account of the current session; in a consent prompt (always), the account consent is asked of. Show it with a way to switch account (`/switch-account`). */
13938
13963
  email?: string;
13964
+ /** @description `product_access` only (always): the organization that doesn't have the product yet. */
13965
+ organization?: {
13966
+ name: string;
13967
+ };
13968
+ /**
13969
+ * @description `product_access` only (always): which page to show. `enable_witnessing`: the app asked to turn witnessing on its behalf back on (`witnium_witnessing=enable`); offer /witnessing-authorization (Allow) and /witnessing-authorization/decline (Not now: the sign-in goes on without it).
13970
+ * @enum {string}
13971
+ */
13972
+ access?: "start_trial" | "ask_admin" | "enable_witnessing";
13973
+ /** @description `product_access` with `start_trial` only (always): the trial's length in days. */
13974
+ trialDays?: number;
13975
+ /** @description `product_access` with `ask_admin` only (always): the person already asked this organization's admins, and the organization hasn't got the product yet. */
13976
+ accessRequested?: boolean;
13939
13977
  };
13940
13978
  };
13941
13979
  };
@@ -14191,7 +14229,7 @@ interface paths$1 {
14191
14229
  put?: never;
14192
14230
  /**
14193
14231
  * Deny
14194
- * @description Finishes the interaction with `access_denied` (and ends a signing key it was adding). Navigate to `redirectTo`. Allowed Origin only. Needs the provider's `_interaction` cookie (path `/interaction/<uid>`), which the browser holds from /auth.
14232
+ * @description Finishes the interaction with `access_denied` (and ends a signing key it was adding); from the `product_access` prompt, with the description that an admin can start Witnium Vault. Navigate to `redirectTo`. Allowed Origin only. Needs the provider's `_interaction` cookie (path `/interaction/<uid>`), which the browser holds from /auth.
14195
14233
  */
14196
14234
  post: {
14197
14235
  parameters: {
@@ -14454,6 +14492,1115 @@ interface paths$1 {
14454
14492
  patch?: never;
14455
14493
  trace?: never;
14456
14494
  };
14495
+ "/interaction/{uid}/start-trial": {
14496
+ parameters: {
14497
+ query?: never;
14498
+ header?: never;
14499
+ path?: never;
14500
+ cookie?: never;
14501
+ };
14502
+ get?: never;
14503
+ put?: never;
14504
+ /**
14505
+ * Start the organization's Witnium Vault trial
14506
+ * @description `product_access` prompt with `access: start_trial` only (an org admin). The only way a self-service trial is created: it starts for the interaction's organization, for `trialDays` days, audited, and closes the members' open requests. Navigate to `redirectTo` (the provider's resume): the sign-in goes on. Allowed Origin only. Needs the provider's `_interaction` cookie (path `/interaction/<uid>`), which the browser holds from /auth.
14507
+ */
14508
+ post: {
14509
+ parameters: {
14510
+ query?: never;
14511
+ header?: never;
14512
+ path: {
14513
+ uid: string;
14514
+ };
14515
+ cookie?: never;
14516
+ };
14517
+ requestBody?: never;
14518
+ responses: {
14519
+ /** @description Success */
14520
+ 200: {
14521
+ headers: {
14522
+ [name: string]: unknown;
14523
+ };
14524
+ content: {
14525
+ "application/json": {
14526
+ /**
14527
+ * Format: uri
14528
+ * @description Navigate the browser here (the provider's resume).
14529
+ */
14530
+ redirectTo: string;
14531
+ };
14532
+ };
14533
+ };
14534
+ /** @description Bad Request — validation failed */
14535
+ 400: {
14536
+ headers: {
14537
+ [name: string]: unknown;
14538
+ };
14539
+ content: {
14540
+ "application/json": {
14541
+ /**
14542
+ * @description HTTP status code
14543
+ * @example 400
14544
+ */
14545
+ statusCode?: number;
14546
+ /**
14547
+ * @description Short error label
14548
+ * @example Bad Request
14549
+ */
14550
+ error?: string;
14551
+ /**
14552
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14553
+ * @example Validation failed
14554
+ */
14555
+ message: string | string[];
14556
+ };
14557
+ };
14558
+ };
14559
+ /** @description Forbidden — insufficient permissions or scope */
14560
+ 403: {
14561
+ headers: {
14562
+ [name: string]: unknown;
14563
+ };
14564
+ content: {
14565
+ "application/json": {
14566
+ /**
14567
+ * @description HTTP status code
14568
+ * @example 400
14569
+ */
14570
+ statusCode?: number;
14571
+ /**
14572
+ * @description Short error label
14573
+ * @example Bad Request
14574
+ */
14575
+ error?: string;
14576
+ /**
14577
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14578
+ * @example Validation failed
14579
+ */
14580
+ message: string | string[];
14581
+ };
14582
+ };
14583
+ };
14584
+ /** @description Gone */
14585
+ 410: {
14586
+ headers: {
14587
+ [name: string]: unknown;
14588
+ };
14589
+ content: {
14590
+ "application/json": {
14591
+ /**
14592
+ * @description HTTP status code
14593
+ * @example 400
14594
+ */
14595
+ statusCode?: number;
14596
+ /**
14597
+ * @description Short error label
14598
+ * @example Bad Request
14599
+ */
14600
+ error?: string;
14601
+ /**
14602
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14603
+ * @example Validation failed
14604
+ */
14605
+ message: string | string[];
14606
+ };
14607
+ };
14608
+ };
14609
+ };
14610
+ };
14611
+ delete?: never;
14612
+ options?: never;
14613
+ head?: never;
14614
+ patch?: never;
14615
+ trace?: never;
14616
+ };
14617
+ "/interaction/{uid}/access-request": {
14618
+ parameters: {
14619
+ query?: never;
14620
+ header?: never;
14621
+ path?: never;
14622
+ cookie?: never;
14623
+ };
14624
+ get?: never;
14625
+ put?: never;
14626
+ /**
14627
+ * Ask the organization's admins for the client's product (Witnium Vault)
14628
+ * @description `product_access` prompt with `access: ask_admin` only. Records one open request per person, organization and product (audited), and emails the organization's active, accepted admins a link to Witnium Vault. When the organization's Witnium Vault starts, the request closes and the person is emailed. 429 after 5 asks an hour per person; 502 when the admins could not be emailed (nothing recorded; ask again). Allowed Origin only. Needs the provider's `_interaction` cookie (path `/interaction/<uid>`), which the browser holds from /auth.
14629
+ */
14630
+ post: {
14631
+ parameters: {
14632
+ query?: never;
14633
+ header?: never;
14634
+ path: {
14635
+ uid: string;
14636
+ };
14637
+ cookie?: never;
14638
+ };
14639
+ requestBody?: never;
14640
+ responses: {
14641
+ /** @description Success */
14642
+ 200: {
14643
+ headers: {
14644
+ [name: string]: unknown;
14645
+ };
14646
+ content: {
14647
+ "application/json": {
14648
+ /**
14649
+ * @description `requested`: the organization's admins were emailed. `already_requested`: this person's request is still open; nobody was emailed again. `no_admin`: the organization has no admin who could get the email; nothing was recorded.
14650
+ * @enum {string}
14651
+ */
14652
+ state: "requested" | "already_requested" | "no_admin";
14653
+ organization: {
14654
+ name: string;
14655
+ };
14656
+ } | {
14657
+ /** @enum {string} */
14658
+ state: "continue";
14659
+ /**
14660
+ * Format: uri
14661
+ * @description Navigate here (the provider's resume): the sign-in goes on.
14662
+ */
14663
+ redirectTo: string;
14664
+ };
14665
+ };
14666
+ };
14667
+ /** @description Bad Request — validation failed */
14668
+ 400: {
14669
+ headers: {
14670
+ [name: string]: unknown;
14671
+ };
14672
+ content: {
14673
+ "application/json": {
14674
+ /**
14675
+ * @description HTTP status code
14676
+ * @example 400
14677
+ */
14678
+ statusCode?: number;
14679
+ /**
14680
+ * @description Short error label
14681
+ * @example Bad Request
14682
+ */
14683
+ error?: string;
14684
+ /**
14685
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14686
+ * @example Validation failed
14687
+ */
14688
+ message: string | string[];
14689
+ };
14690
+ };
14691
+ };
14692
+ /** @description Forbidden — insufficient permissions or scope */
14693
+ 403: {
14694
+ headers: {
14695
+ [name: string]: unknown;
14696
+ };
14697
+ content: {
14698
+ "application/json": {
14699
+ /**
14700
+ * @description HTTP status code
14701
+ * @example 400
14702
+ */
14703
+ statusCode?: number;
14704
+ /**
14705
+ * @description Short error label
14706
+ * @example Bad Request
14707
+ */
14708
+ error?: string;
14709
+ /**
14710
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14711
+ * @example Validation failed
14712
+ */
14713
+ message: string | string[];
14714
+ };
14715
+ };
14716
+ };
14717
+ /** @description Gone */
14718
+ 410: {
14719
+ headers: {
14720
+ [name: string]: unknown;
14721
+ };
14722
+ content: {
14723
+ "application/json": {
14724
+ /**
14725
+ * @description HTTP status code
14726
+ * @example 400
14727
+ */
14728
+ statusCode?: number;
14729
+ /**
14730
+ * @description Short error label
14731
+ * @example Bad Request
14732
+ */
14733
+ error?: string;
14734
+ /**
14735
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14736
+ * @example Validation failed
14737
+ */
14738
+ message: string | string[];
14739
+ };
14740
+ };
14741
+ };
14742
+ /** @description Too Many Requests */
14743
+ 429: {
14744
+ headers: {
14745
+ [name: string]: unknown;
14746
+ };
14747
+ content: {
14748
+ "application/json": {
14749
+ /**
14750
+ * @description HTTP status code
14751
+ * @example 400
14752
+ */
14753
+ statusCode?: number;
14754
+ /**
14755
+ * @description Short error label
14756
+ * @example Bad Request
14757
+ */
14758
+ error?: string;
14759
+ /**
14760
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14761
+ * @example Validation failed
14762
+ */
14763
+ message: string | string[];
14764
+ };
14765
+ };
14766
+ };
14767
+ /** @description Bad Gateway */
14768
+ 502: {
14769
+ headers: {
14770
+ [name: string]: unknown;
14771
+ };
14772
+ content: {
14773
+ "application/json": {
14774
+ /**
14775
+ * @description HTTP status code
14776
+ * @example 400
14777
+ */
14778
+ statusCode?: number;
14779
+ /**
14780
+ * @description Short error label
14781
+ * @example Bad Request
14782
+ */
14783
+ error?: string;
14784
+ /**
14785
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14786
+ * @example Validation failed
14787
+ */
14788
+ message: string | string[];
14789
+ };
14790
+ };
14791
+ };
14792
+ };
14793
+ };
14794
+ delete?: never;
14795
+ options?: never;
14796
+ head?: never;
14797
+ patch?: never;
14798
+ trace?: never;
14799
+ };
14800
+ "/interaction/{uid}/witnessing-authorization": {
14801
+ parameters: {
14802
+ query?: never;
14803
+ header?: never;
14804
+ path?: never;
14805
+ cookie?: never;
14806
+ };
14807
+ get?: never;
14808
+ put?: never;
14809
+ /**
14810
+ * Let Witnium Vault witness your files again ([Allow])
14811
+ * @description `product_access` prompt with `access: enable_witnessing` only (the app sent `witnium_witnessing=enable`). Creates a new witnessing authorization for the interaction's person and organization (audited `witnessing_authorization.enable`); earlier ended ones stay as history. Navigate to `redirectTo`: the sign-in goes on. Allowed Origin only. Needs the provider's `_interaction` cookie (path `/interaction/<uid>`), which the browser holds from /auth.
14812
+ */
14813
+ post: {
14814
+ parameters: {
14815
+ query?: never;
14816
+ header?: never;
14817
+ path: {
14818
+ uid: string;
14819
+ };
14820
+ cookie?: never;
14821
+ };
14822
+ requestBody?: never;
14823
+ responses: {
14824
+ /** @description Success */
14825
+ 200: {
14826
+ headers: {
14827
+ [name: string]: unknown;
14828
+ };
14829
+ content: {
14830
+ "application/json": {
14831
+ /**
14832
+ * Format: uri
14833
+ * @description Navigate the browser here (the provider's resume).
14834
+ */
14835
+ redirectTo: string;
14836
+ };
14837
+ };
14838
+ };
14839
+ /** @description Bad Request — validation failed */
14840
+ 400: {
14841
+ headers: {
14842
+ [name: string]: unknown;
14843
+ };
14844
+ content: {
14845
+ "application/json": {
14846
+ /**
14847
+ * @description HTTP status code
14848
+ * @example 400
14849
+ */
14850
+ statusCode?: number;
14851
+ /**
14852
+ * @description Short error label
14853
+ * @example Bad Request
14854
+ */
14855
+ error?: string;
14856
+ /**
14857
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14858
+ * @example Validation failed
14859
+ */
14860
+ message: string | string[];
14861
+ };
14862
+ };
14863
+ };
14864
+ /** @description Forbidden — insufficient permissions or scope */
14865
+ 403: {
14866
+ headers: {
14867
+ [name: string]: unknown;
14868
+ };
14869
+ content: {
14870
+ "application/json": {
14871
+ /**
14872
+ * @description HTTP status code
14873
+ * @example 400
14874
+ */
14875
+ statusCode?: number;
14876
+ /**
14877
+ * @description Short error label
14878
+ * @example Bad Request
14879
+ */
14880
+ error?: string;
14881
+ /**
14882
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14883
+ * @example Validation failed
14884
+ */
14885
+ message: string | string[];
14886
+ };
14887
+ };
14888
+ };
14889
+ /** @description Gone */
14890
+ 410: {
14891
+ headers: {
14892
+ [name: string]: unknown;
14893
+ };
14894
+ content: {
14895
+ "application/json": {
14896
+ /**
14897
+ * @description HTTP status code
14898
+ * @example 400
14899
+ */
14900
+ statusCode?: number;
14901
+ /**
14902
+ * @description Short error label
14903
+ * @example Bad Request
14904
+ */
14905
+ error?: string;
14906
+ /**
14907
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14908
+ * @example Validation failed
14909
+ */
14910
+ message: string | string[];
14911
+ };
14912
+ };
14913
+ };
14914
+ };
14915
+ };
14916
+ delete?: never;
14917
+ options?: never;
14918
+ head?: never;
14919
+ patch?: never;
14920
+ trace?: never;
14921
+ };
14922
+ "/interaction/{uid}/witnessing-authorization/decline": {
14923
+ parameters: {
14924
+ query?: never;
14925
+ header?: never;
14926
+ path?: never;
14927
+ cookie?: never;
14928
+ };
14929
+ get?: never;
14930
+ put?: never;
14931
+ /**
14932
+ * Keep witnessing off ([Not now]): continue the sign-in without it
14933
+ * @description `product_access` prompt with `access: enable_witnessing` only. Creates nothing; the sign-in goes on without witnessing (not `access_denied`: the person can still read). Navigate to `redirectTo`. Allowed Origin only. Needs the provider's `_interaction` cookie (path `/interaction/<uid>`), which the browser holds from /auth.
14934
+ */
14935
+ post: {
14936
+ parameters: {
14937
+ query?: never;
14938
+ header?: never;
14939
+ path: {
14940
+ uid: string;
14941
+ };
14942
+ cookie?: never;
14943
+ };
14944
+ requestBody?: never;
14945
+ responses: {
14946
+ /** @description Success */
14947
+ 200: {
14948
+ headers: {
14949
+ [name: string]: unknown;
14950
+ };
14951
+ content: {
14952
+ "application/json": {
14953
+ /**
14954
+ * Format: uri
14955
+ * @description Navigate the browser here (the provider's resume).
14956
+ */
14957
+ redirectTo: string;
14958
+ };
14959
+ };
14960
+ };
14961
+ /** @description Bad Request — validation failed */
14962
+ 400: {
14963
+ headers: {
14964
+ [name: string]: unknown;
14965
+ };
14966
+ content: {
14967
+ "application/json": {
14968
+ /**
14969
+ * @description HTTP status code
14970
+ * @example 400
14971
+ */
14972
+ statusCode?: number;
14973
+ /**
14974
+ * @description Short error label
14975
+ * @example Bad Request
14976
+ */
14977
+ error?: string;
14978
+ /**
14979
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
14980
+ * @example Validation failed
14981
+ */
14982
+ message: string | string[];
14983
+ };
14984
+ };
14985
+ };
14986
+ /** @description Forbidden — insufficient permissions or scope */
14987
+ 403: {
14988
+ headers: {
14989
+ [name: string]: unknown;
14990
+ };
14991
+ content: {
14992
+ "application/json": {
14993
+ /**
14994
+ * @description HTTP status code
14995
+ * @example 400
14996
+ */
14997
+ statusCode?: number;
14998
+ /**
14999
+ * @description Short error label
15000
+ * @example Bad Request
15001
+ */
15002
+ error?: string;
15003
+ /**
15004
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15005
+ * @example Validation failed
15006
+ */
15007
+ message: string | string[];
15008
+ };
15009
+ };
15010
+ };
15011
+ /** @description Gone */
15012
+ 410: {
15013
+ headers: {
15014
+ [name: string]: unknown;
15015
+ };
15016
+ content: {
15017
+ "application/json": {
15018
+ /**
15019
+ * @description HTTP status code
15020
+ * @example 400
15021
+ */
15022
+ statusCode?: number;
15023
+ /**
15024
+ * @description Short error label
15025
+ * @example Bad Request
15026
+ */
15027
+ error?: string;
15028
+ /**
15029
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15030
+ * @example Validation failed
15031
+ */
15032
+ message: string | string[];
15033
+ };
15034
+ };
15035
+ };
15036
+ };
15037
+ };
15038
+ delete?: never;
15039
+ options?: never;
15040
+ head?: never;
15041
+ patch?: never;
15042
+ trace?: never;
15043
+ };
15044
+ "/v1/account/billing": {
15045
+ parameters: {
15046
+ query?: never;
15047
+ header?: never;
15048
+ path?: never;
15049
+ cookie?: never;
15050
+ };
15051
+ /**
15052
+ * The organization's plans, per product
15053
+ * @description Any member. The account site's session cookie (`wac_session`); POSTs from the account site's origin (the cookie Origin rule). The caller's home organization; any active membership may read.
15054
+ */
15055
+ get: {
15056
+ parameters: {
15057
+ query?: never;
15058
+ header?: never;
15059
+ path?: never;
15060
+ cookie?: never;
15061
+ };
15062
+ requestBody?: never;
15063
+ responses: {
15064
+ /** @description Success */
15065
+ 200: {
15066
+ headers: {
15067
+ [name: string]: unknown;
15068
+ };
15069
+ content: {
15070
+ "application/json": {
15071
+ organization: {
15072
+ /** Format: uuid */
15073
+ id: string;
15074
+ name: string;
15075
+ };
15076
+ /** @description True for an active, unsuspended org admin: only they may call checkout and portal (403 for anyone else). */
15077
+ canManageBilling: boolean;
15078
+ products: {
15079
+ product: {
15080
+ id: string;
15081
+ name: string;
15082
+ /**
15083
+ * Format: uri
15084
+ * @description The product's app, where the Billing page links back to (server configuration).
15085
+ */
15086
+ appUrl: string;
15087
+ };
15088
+ /** @description False while the product's billing is switched off: nothing can be bought or changed. */
15089
+ available: boolean;
15090
+ /**
15091
+ * BillingEntitlement
15092
+ * @description null: the org does not hold the product (it starts in the product).
15093
+ */
15094
+ entitlement: {
15095
+ /**
15096
+ * @description How the org holds the product: a trial, a Stripe subscription, or free (granted by Witnium).
15097
+ * @enum {string}
15098
+ */
15099
+ access: "trial" | "paid" | "complimentary";
15100
+ plan: string;
15101
+ /**
15102
+ * Format: date-time
15103
+ * @description When the entitlement stops (ISO 8601): the end of a trial or free period, or when a canceled or unpaid subscription ends or ended. null = no time limit.
15104
+ */
15105
+ expiresAt: string | null;
15106
+ /** @description True while the entitlement is active and not past expiresAt. */
15107
+ current: boolean;
15108
+ } | null;
15109
+ /**
15110
+ * BillingSubscription
15111
+ * @description The Stripe subscription behind a paid entitlement, read from Stripe now; null when the entitlement isn't paid.
15112
+ */
15113
+ subscription: {
15114
+ /**
15115
+ * @description Stripe's subscription status. `past_due`: a payment failed and Stripe is retrying (the entitlement stays current).
15116
+ * @enum {string}
15117
+ */
15118
+ status: "trialing" | "active" | "past_due" | "unpaid" | "paused" | "canceled" | "incomplete" | "incomplete_expired";
15119
+ plan: string;
15120
+ /** @enum {string} */
15121
+ interval: "monthly" | "yearly";
15122
+ /**
15123
+ * Format: date-time
15124
+ * @description The next renewal (or, when canceling, the end).
15125
+ */
15126
+ currentPeriodEnd: string;
15127
+ /** @description True when the subscription is set to end at currentPeriodEnd. */
15128
+ cancelAtPeriodEnd: boolean;
15129
+ /**
15130
+ * Format: date-time
15131
+ * @description The first charge, while in the trial Checkout set from the product's trial.
15132
+ */
15133
+ trialEnd: string | null;
15134
+ } | null;
15135
+ /** @description Every plan and interval checkout accepts, also while billing is switched off; the entitlement's and the subscription's plan are among them. */
15136
+ plans: {
15137
+ id: string;
15138
+ /** @description Short name, e.g. "Plus". */
15139
+ name: string;
15140
+ /** @description What the plan includes. */
15141
+ description: string;
15142
+ /** @description Exactly one price per interval: one monthly and one yearly. */
15143
+ prices: {
15144
+ /** @enum {string} */
15145
+ interval: "monthly" | "yearly";
15146
+ /** @description In minor units (öre), VAT included. 4900 = 49 kr. */
15147
+ amount: number;
15148
+ /** @enum {string} */
15149
+ currency: "sek";
15150
+ }[];
15151
+ }[];
15152
+ /** @description Offered (to org admins) while the org holds the product without a running subscription; null otherwise. */
15153
+ checkout: {
15154
+ /**
15155
+ * Format: date-time
15156
+ * @description When the first payment is taken: the end of a current trial (at least 48 hours ahead). null = at checkout.
15157
+ */
15158
+ firstChargeAt: string | null;
15159
+ } | null;
15160
+ /** @description The Stripe customer portal is offered (to org admins): the org pays, or paid, for the product. */
15161
+ portal: boolean;
15162
+ }[];
15163
+ };
15164
+ };
15165
+ };
15166
+ /** @description Unauthorized — authentication required or invalid */
15167
+ 401: {
15168
+ headers: {
15169
+ [name: string]: unknown;
15170
+ };
15171
+ content: {
15172
+ "application/json": {
15173
+ /**
15174
+ * @description HTTP status code
15175
+ * @example 400
15176
+ */
15177
+ statusCode?: number;
15178
+ /**
15179
+ * @description Short error label
15180
+ * @example Bad Request
15181
+ */
15182
+ error?: string;
15183
+ /**
15184
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15185
+ * @example Validation failed
15186
+ */
15187
+ message: string | string[];
15188
+ };
15189
+ };
15190
+ };
15191
+ /** @description Forbidden — insufficient permissions or scope */
15192
+ 403: {
15193
+ headers: {
15194
+ [name: string]: unknown;
15195
+ };
15196
+ content: {
15197
+ "application/json": {
15198
+ /**
15199
+ * @description HTTP status code
15200
+ * @example 400
15201
+ */
15202
+ statusCode?: number;
15203
+ /**
15204
+ * @description Short error label
15205
+ * @example Bad Request
15206
+ */
15207
+ error?: string;
15208
+ /**
15209
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15210
+ * @example Validation failed
15211
+ */
15212
+ message: string | string[];
15213
+ };
15214
+ };
15215
+ };
15216
+ };
15217
+ };
15218
+ put?: never;
15219
+ post?: never;
15220
+ delete?: never;
15221
+ options?: never;
15222
+ head?: never;
15223
+ patch?: never;
15224
+ trace?: never;
15225
+ };
15226
+ "/v1/account/billing/{product}/checkout": {
15227
+ parameters: {
15228
+ query?: never;
15229
+ header?: never;
15230
+ path?: never;
15231
+ cookie?: never;
15232
+ };
15233
+ get?: never;
15234
+ put?: never;
15235
+ /**
15236
+ * Start a Stripe Checkout for a product's plan
15237
+ * @description Org admins only. During a current trial (or a complimentary period with an end) the card is collected now and the first charge is when that period ends (at least 48 hours ahead, as Stripe requires); otherwise the first charge is at checkout. Prices include VAT (Stripe Tax); businesses may enter a VAT id. Stripe sends the person back to the Billing page (`/billing?product=<id>&checkout=success|canceled`). 409 `already_subscribed` while the org has a running subscription (change the plan or cancel through the portal); 409 `no_entitlement` when the org does not hold the product. 404 for a product without billing. 503 while the product's billing is switched off. The account site's session cookie (`wac_session`); POSTs from the account site's origin (the cookie Origin rule). The caller's home organization; any active membership may read.
15238
+ */
15239
+ post: {
15240
+ parameters: {
15241
+ query?: never;
15242
+ header?: never;
15243
+ path: {
15244
+ product: string;
15245
+ };
15246
+ cookie?: never;
15247
+ };
15248
+ requestBody?: {
15249
+ content: {
15250
+ "application/json": {
15251
+ /** @description One of the product's plans (`plans[].id`). */
15252
+ plan: string;
15253
+ /** @enum {string} */
15254
+ interval: "monthly" | "yearly";
15255
+ };
15256
+ };
15257
+ };
15258
+ responses: {
15259
+ /** @description Created */
15260
+ 201: {
15261
+ headers: {
15262
+ [name: string]: unknown;
15263
+ };
15264
+ content: {
15265
+ "application/json": {
15266
+ /**
15267
+ * Format: uri
15268
+ * @description The Stripe-hosted page. Send the browser there.
15269
+ */
15270
+ url: string;
15271
+ };
15272
+ };
15273
+ };
15274
+ /** @description Bad Request — validation failed */
15275
+ 400: {
15276
+ headers: {
15277
+ [name: string]: unknown;
15278
+ };
15279
+ content: {
15280
+ "application/json": {
15281
+ /**
15282
+ * @description HTTP status code
15283
+ * @example 400
15284
+ */
15285
+ statusCode?: number;
15286
+ /**
15287
+ * @description Short error label
15288
+ * @example Bad Request
15289
+ */
15290
+ error?: string;
15291
+ /**
15292
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15293
+ * @example Validation failed
15294
+ */
15295
+ message: string | string[];
15296
+ };
15297
+ };
15298
+ };
15299
+ /** @description Unauthorized — authentication required or invalid */
15300
+ 401: {
15301
+ headers: {
15302
+ [name: string]: unknown;
15303
+ };
15304
+ content: {
15305
+ "application/json": {
15306
+ /**
15307
+ * @description HTTP status code
15308
+ * @example 400
15309
+ */
15310
+ statusCode?: number;
15311
+ /**
15312
+ * @description Short error label
15313
+ * @example Bad Request
15314
+ */
15315
+ error?: string;
15316
+ /**
15317
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15318
+ * @example Validation failed
15319
+ */
15320
+ message: string | string[];
15321
+ };
15322
+ };
15323
+ };
15324
+ /** @description Forbidden — insufficient permissions or scope */
15325
+ 403: {
15326
+ headers: {
15327
+ [name: string]: unknown;
15328
+ };
15329
+ content: {
15330
+ "application/json": {
15331
+ /**
15332
+ * @description HTTP status code
15333
+ * @example 400
15334
+ */
15335
+ statusCode?: number;
15336
+ /**
15337
+ * @description Short error label
15338
+ * @example Bad Request
15339
+ */
15340
+ error?: string;
15341
+ /**
15342
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15343
+ * @example Validation failed
15344
+ */
15345
+ message: string | string[];
15346
+ };
15347
+ };
15348
+ };
15349
+ /** @description Not Found */
15350
+ 404: {
15351
+ headers: {
15352
+ [name: string]: unknown;
15353
+ };
15354
+ content: {
15355
+ "application/json": {
15356
+ /**
15357
+ * @description HTTP status code
15358
+ * @example 400
15359
+ */
15360
+ statusCode?: number;
15361
+ /**
15362
+ * @description Short error label
15363
+ * @example Bad Request
15364
+ */
15365
+ error?: string;
15366
+ /**
15367
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15368
+ * @example Validation failed
15369
+ */
15370
+ message: string | string[];
15371
+ };
15372
+ };
15373
+ };
15374
+ /** @description Conflict */
15375
+ 409: {
15376
+ headers: {
15377
+ [name: string]: unknown;
15378
+ };
15379
+ content: {
15380
+ "application/json": {
15381
+ /**
15382
+ * @description HTTP status code
15383
+ * @example 400
15384
+ */
15385
+ statusCode?: number;
15386
+ /**
15387
+ * @description Short error label
15388
+ * @example Bad Request
15389
+ */
15390
+ error?: string;
15391
+ /**
15392
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15393
+ * @example Validation failed
15394
+ */
15395
+ message: string | string[];
15396
+ };
15397
+ };
15398
+ };
15399
+ /** @description Service Unavailable */
15400
+ 503: {
15401
+ headers: {
15402
+ [name: string]: unknown;
15403
+ };
15404
+ content: {
15405
+ "application/json": {
15406
+ /**
15407
+ * @description HTTP status code
15408
+ * @example 400
15409
+ */
15410
+ statusCode?: number;
15411
+ /**
15412
+ * @description Short error label
15413
+ * @example Bad Request
15414
+ */
15415
+ error?: string;
15416
+ /**
15417
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15418
+ * @example Validation failed
15419
+ */
15420
+ message: string | string[];
15421
+ };
15422
+ };
15423
+ };
15424
+ };
15425
+ };
15426
+ delete?: never;
15427
+ options?: never;
15428
+ head?: never;
15429
+ patch?: never;
15430
+ trace?: never;
15431
+ };
15432
+ "/v1/account/billing/{product}/portal": {
15433
+ parameters: {
15434
+ query?: never;
15435
+ header?: never;
15436
+ path?: never;
15437
+ cookie?: never;
15438
+ };
15439
+ get?: never;
15440
+ put?: never;
15441
+ /**
15442
+ * Open the Stripe customer portal for a product
15443
+ * @description Org admins only. Change plan or interval, cancel (at the end of the period), update the payment method and billing details, download invoices. The portal's back link returns to the Billing page (`/billing?product=<id>`). Stripe's portal shows every subscription of the org's Stripe customer: a WitniumChain subscription appears there too, and can be canceled there. 409 `no_subscription` when the org has never paid for the product. 404 for a product without billing. 503 while its billing is switched off. The account site's session cookie (`wac_session`); POSTs from the account site's origin (the cookie Origin rule). The caller's home organization; any active membership may read.
15444
+ */
15445
+ post: {
15446
+ parameters: {
15447
+ query?: never;
15448
+ header?: never;
15449
+ path: {
15450
+ product: string;
15451
+ };
15452
+ cookie?: never;
15453
+ };
15454
+ requestBody?: never;
15455
+ responses: {
15456
+ /** @description Created */
15457
+ 201: {
15458
+ headers: {
15459
+ [name: string]: unknown;
15460
+ };
15461
+ content: {
15462
+ "application/json": {
15463
+ /**
15464
+ * Format: uri
15465
+ * @description The Stripe-hosted page. Send the browser there.
15466
+ */
15467
+ url: string;
15468
+ };
15469
+ };
15470
+ };
15471
+ /** @description Unauthorized — authentication required or invalid */
15472
+ 401: {
15473
+ headers: {
15474
+ [name: string]: unknown;
15475
+ };
15476
+ content: {
15477
+ "application/json": {
15478
+ /**
15479
+ * @description HTTP status code
15480
+ * @example 400
15481
+ */
15482
+ statusCode?: number;
15483
+ /**
15484
+ * @description Short error label
15485
+ * @example Bad Request
15486
+ */
15487
+ error?: string;
15488
+ /**
15489
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15490
+ * @example Validation failed
15491
+ */
15492
+ message: string | string[];
15493
+ };
15494
+ };
15495
+ };
15496
+ /** @description Forbidden — insufficient permissions or scope */
15497
+ 403: {
15498
+ headers: {
15499
+ [name: string]: unknown;
15500
+ };
15501
+ content: {
15502
+ "application/json": {
15503
+ /**
15504
+ * @description HTTP status code
15505
+ * @example 400
15506
+ */
15507
+ statusCode?: number;
15508
+ /**
15509
+ * @description Short error label
15510
+ * @example Bad Request
15511
+ */
15512
+ error?: string;
15513
+ /**
15514
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15515
+ * @example Validation failed
15516
+ */
15517
+ message: string | string[];
15518
+ };
15519
+ };
15520
+ };
15521
+ /** @description Not Found */
15522
+ 404: {
15523
+ headers: {
15524
+ [name: string]: unknown;
15525
+ };
15526
+ content: {
15527
+ "application/json": {
15528
+ /**
15529
+ * @description HTTP status code
15530
+ * @example 400
15531
+ */
15532
+ statusCode?: number;
15533
+ /**
15534
+ * @description Short error label
15535
+ * @example Bad Request
15536
+ */
15537
+ error?: string;
15538
+ /**
15539
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15540
+ * @example Validation failed
15541
+ */
15542
+ message: string | string[];
15543
+ };
15544
+ };
15545
+ };
15546
+ /** @description Conflict */
15547
+ 409: {
15548
+ headers: {
15549
+ [name: string]: unknown;
15550
+ };
15551
+ content: {
15552
+ "application/json": {
15553
+ /**
15554
+ * @description HTTP status code
15555
+ * @example 400
15556
+ */
15557
+ statusCode?: number;
15558
+ /**
15559
+ * @description Short error label
15560
+ * @example Bad Request
15561
+ */
15562
+ error?: string;
15563
+ /**
15564
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15565
+ * @example Validation failed
15566
+ */
15567
+ message: string | string[];
15568
+ };
15569
+ };
15570
+ };
15571
+ /** @description Service Unavailable */
15572
+ 503: {
15573
+ headers: {
15574
+ [name: string]: unknown;
15575
+ };
15576
+ content: {
15577
+ "application/json": {
15578
+ /**
15579
+ * @description HTTP status code
15580
+ * @example 400
15581
+ */
15582
+ statusCode?: number;
15583
+ /**
15584
+ * @description Short error label
15585
+ * @example Bad Request
15586
+ */
15587
+ error?: string;
15588
+ /**
15589
+ * @description Human-readable error message. Validation errors from `ZodError.flatten()` may be returned as an array.
15590
+ * @example Validation failed
15591
+ */
15592
+ message: string | string[];
15593
+ };
15594
+ };
15595
+ };
15596
+ };
15597
+ };
15598
+ delete?: never;
15599
+ options?: never;
15600
+ head?: never;
15601
+ patch?: never;
15602
+ trace?: never;
15603
+ };
14457
15604
  }
14458
15605
 
14459
15606
  /**