@sesamy/sesamy-js 1.120.2 → 1.121.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.
@@ -5,6 +5,7 @@ import { Contract } from '@sesamy/sdk';
5
5
  import { CreateCheckoutParams } from '@sesamy/sdk';
6
6
  import { Entitlement } from '@sesamy/sdk';
7
7
  import { Fulfillment } from '@sesamy/sdk';
8
+ import { PaywallAccessCheckResult } from '@sesamy/sdk';
8
9
  import { PaywallAccessResult } from '@sesamy/sdk';
9
10
  import { Profile } from '@sesamy/sdk';
10
11
  import { Subscription } from '@sesamy/sdk';
@@ -145,6 +146,18 @@ export declare interface AuthPlugin {
145
146
  * are expected to rely on page reloads or their own event wiring.
146
147
  */
147
148
  refresh?(): Promise<boolean>;
149
+ /**
150
+ * The base URL under which the API proxy's `/auth/*` routes live (mirrors the
151
+ * plugin's own configured `baseUrl`). Implemented by BFF/cookie plugins, where
152
+ * the access token sits in an HttpOnly cookie that only the proxy can read.
153
+ *
154
+ * sesamy-js uses this to route flows that need the access token on a *different*
155
+ * Sesamy origin (e.g. Spotify linking) through a server-side proxy redirect, so
156
+ * the token never enters client JS. Returns `null` (or is unimplemented) for
157
+ * plugins that expose the token to JS directly (e.g. Auth0), where the caller
158
+ * builds the cross-origin redirect itself.
159
+ */
160
+ getProxyAuthBaseUrl?(): string | null;
148
161
  }
149
162
 
150
163
  declare interface BaseContentNode {
@@ -643,6 +656,7 @@ declare function registerAPI(config: ApiConfig): {
643
656
  bills: {
644
657
  list: () => Promise<{
645
658
  id: string;
659
+ contractId: string;
646
660
  items: {
647
661
  sku: string;
648
662
  title: string;
@@ -659,6 +673,7 @@ declare function registerAPI(config: ApiConfig): {
659
673
  }[]>;
660
674
  get: (id: string) => Promise<{
661
675
  id: string;
676
+ contractId: string;
662
677
  items: {
663
678
  sku: string;
664
679
  title: string;
@@ -944,7 +959,9 @@ declare function registerAPI(config: ApiConfig): {
944
959
  purchaseOptionName?: string;
945
960
  name: string;
946
961
  cover?: string;
962
+ productType: "article" | "audiobook" | "ebook" | "bundle" | "podcast" | "pass" | "publication" | "physical_issue" | "license";
947
963
  purchaseType?: string;
964
+ isMultiseat: boolean;
948
965
  }[];
949
966
  status: string;
950
967
  isActive: boolean;
@@ -952,11 +969,13 @@ declare function registerAPI(config: ApiConfig): {
952
969
  recurringTime?: number;
953
970
  willCancelAt: string | null;
954
971
  cancelRequestedAt: string | null;
972
+ cancelReason: string | null;
955
973
  expiresAt?: string;
956
974
  paymentData?: {
957
975
  method?: string;
958
976
  description?: string;
959
977
  brand?: string;
978
+ walletType?: string;
960
979
  };
961
980
  appliedDiscounts: {
962
981
  code: string;
@@ -985,7 +1004,9 @@ declare function registerAPI(config: ApiConfig): {
985
1004
  purchaseOptionName?: string;
986
1005
  name: string;
987
1006
  cover?: string;
1007
+ productType: "article" | "audiobook" | "ebook" | "bundle" | "podcast" | "pass" | "publication" | "physical_issue" | "license";
988
1008
  purchaseType?: string;
1009
+ isMultiseat: boolean;
989
1010
  }[];
990
1011
  status: string;
991
1012
  isActive: boolean;
@@ -993,11 +1014,13 @@ declare function registerAPI(config: ApiConfig): {
993
1014
  recurringTime?: number;
994
1015
  willCancelAt: string | null;
995
1016
  cancelRequestedAt: string | null;
1017
+ cancelReason: string | null;
996
1018
  expiresAt?: string;
997
1019
  paymentData?: {
998
1020
  method?: string;
999
1021
  description?: string;
1000
1022
  brand?: string;
1023
+ walletType?: string;
1001
1024
  };
1002
1025
  appliedDiscounts: {
1003
1026
  code: string;
@@ -1059,7 +1082,7 @@ declare function registerAPI(config: ApiConfig): {
1059
1082
  url?: string;
1060
1083
  presentationUrl?: string;
1061
1084
  publisherContentId?: string;
1062
- type: "article" | "pass" | "audiobook" | "ebook" | "bundle" | "podcast" | "publication" | "physical_issue";
1085
+ type: "article" | "audiobook" | "ebook" | "bundle" | "podcast" | "pass" | "publication" | "physical_issue";
1063
1086
  origin?: {
1064
1087
  type: "EXTERNAL";
1065
1088
  id: string;
@@ -1108,7 +1131,13 @@ declare function registerAPI(config: ApiConfig): {
1108
1131
  id: string;
1109
1132
  vendorId: string;
1110
1133
  currency: string;
1111
- version: number;
1134
+ version?: number;
1135
+ name?: string;
1136
+ entity?: string;
1137
+ status?: string;
1138
+ createdAt?: string;
1139
+ modifiedAt?: string;
1140
+ previewUrl?: string;
1112
1141
  settings: {
1113
1142
  template: "LOGIN" | "BOXES" | "ARTICLE";
1114
1143
  useDefaultLogo: boolean;
@@ -1119,12 +1148,17 @@ declare function registerAPI(config: ApiConfig): {
1119
1148
  backgroundColor: string;
1120
1149
  showBackground: boolean;
1121
1150
  };
1151
+ displayOptions?: {
1152
+ enableGift?: boolean;
1153
+ enableCompany?: boolean;
1154
+ enableLoginButton?: boolean;
1155
+ };
1122
1156
  };
1123
1157
  showLoginButton: boolean;
1124
1158
  subscriptions: {
1125
1159
  id: string;
1126
- sku: string;
1127
- poId: string;
1160
+ sku?: string;
1161
+ poId?: string;
1128
1162
  title: string;
1129
1163
  description: string;
1130
1164
  price?: number;
@@ -1143,7 +1177,7 @@ declare function registerAPI(config: ApiConfig): {
1143
1177
  mainColor?: string;
1144
1178
  headline?: string;
1145
1179
  logoUrl?: string;
1146
- footerPaymentMethods: string[];
1180
+ footerPaymentMethods?: string[];
1147
1181
  singlePurchase?: {
1148
1182
  enabled: boolean;
1149
1183
  title: string;
@@ -1154,6 +1188,10 @@ declare function registerAPI(config: ApiConfig): {
1154
1188
  checkAccess: (paywallId: string, body: {
1155
1189
  publisherContentId: string;
1156
1190
  url?: string;
1191
+ }) => Promise<PaywallAccessCheckResult>;
1192
+ registerAccess: (paywallId: string, body: {
1193
+ publisherContentId: string;
1194
+ url: string;
1157
1195
  }) => Promise<PaywallAccessResult>;
1158
1196
  };
1159
1197
  paymentIssues: {