@diffsome/sdk 3.2.5 → 3.2.7
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 +663 -421
- package/dist/index.d.ts +663 -421
- package/dist/index.js +23 -2
- package/dist/index.mjs +23 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -161,9 +161,14 @@ var HttpClient = class {
|
|
|
161
161
|
}
|
|
162
162
|
/**
|
|
163
163
|
* Get the download URL for a digital file
|
|
164
|
+
* Includes auth_token query parameter for authentication
|
|
164
165
|
*/
|
|
165
166
|
getDownloadUrl(token) {
|
|
166
|
-
|
|
167
|
+
const url = `${this.baseUrl}/download/${this.tenantId}/${token}`;
|
|
168
|
+
if (this.token) {
|
|
169
|
+
return `${url}?auth_token=${encodeURIComponent(this.token)}`;
|
|
170
|
+
}
|
|
171
|
+
return url;
|
|
167
172
|
}
|
|
168
173
|
/**
|
|
169
174
|
* Set cart session ID (for guest cart persistence)
|
|
@@ -413,7 +418,7 @@ var AuthResource = class {
|
|
|
413
418
|
* Get available social login providers
|
|
414
419
|
*/
|
|
415
420
|
async getSocialProviders() {
|
|
416
|
-
return this.http.get("/auth/social");
|
|
421
|
+
return this.http.get("/auth/social/providers");
|
|
417
422
|
}
|
|
418
423
|
/**
|
|
419
424
|
* Get social login redirect URL
|
|
@@ -1221,6 +1226,22 @@ var ShopResource = class {
|
|
|
1221
1226
|
async createSetupIntent() {
|
|
1222
1227
|
return this.http.post("/subscriptions/setup-intent");
|
|
1223
1228
|
}
|
|
1229
|
+
/**
|
|
1230
|
+
* Create Stripe Checkout Session for subscription
|
|
1231
|
+
* Redirects to Stripe Checkout page
|
|
1232
|
+
* Requires authentication
|
|
1233
|
+
*/
|
|
1234
|
+
async createSubscriptionCheckout(data) {
|
|
1235
|
+
return this.http.post("/subscriptions/checkout", data);
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Verify Stripe Checkout Session for subscription
|
|
1239
|
+
* Call after returning from Stripe Checkout
|
|
1240
|
+
* Requires authentication
|
|
1241
|
+
*/
|
|
1242
|
+
async verifySubscriptionCheckout(session_id) {
|
|
1243
|
+
return this.http.post("/subscriptions/verify", { session_id });
|
|
1244
|
+
}
|
|
1224
1245
|
// ============================================
|
|
1225
1246
|
// Bundle Products
|
|
1226
1247
|
// ============================================
|
package/dist/index.mjs
CHANGED
|
@@ -131,9 +131,14 @@ var HttpClient = class {
|
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
133
|
* Get the download URL for a digital file
|
|
134
|
+
* Includes auth_token query parameter for authentication
|
|
134
135
|
*/
|
|
135
136
|
getDownloadUrl(token) {
|
|
136
|
-
|
|
137
|
+
const url = `${this.baseUrl}/download/${this.tenantId}/${token}`;
|
|
138
|
+
if (this.token) {
|
|
139
|
+
return `${url}?auth_token=${encodeURIComponent(this.token)}`;
|
|
140
|
+
}
|
|
141
|
+
return url;
|
|
137
142
|
}
|
|
138
143
|
/**
|
|
139
144
|
* Set cart session ID (for guest cart persistence)
|
|
@@ -383,7 +388,7 @@ var AuthResource = class {
|
|
|
383
388
|
* Get available social login providers
|
|
384
389
|
*/
|
|
385
390
|
async getSocialProviders() {
|
|
386
|
-
return this.http.get("/auth/social");
|
|
391
|
+
return this.http.get("/auth/social/providers");
|
|
387
392
|
}
|
|
388
393
|
/**
|
|
389
394
|
* Get social login redirect URL
|
|
@@ -1191,6 +1196,22 @@ var ShopResource = class {
|
|
|
1191
1196
|
async createSetupIntent() {
|
|
1192
1197
|
return this.http.post("/subscriptions/setup-intent");
|
|
1193
1198
|
}
|
|
1199
|
+
/**
|
|
1200
|
+
* Create Stripe Checkout Session for subscription
|
|
1201
|
+
* Redirects to Stripe Checkout page
|
|
1202
|
+
* Requires authentication
|
|
1203
|
+
*/
|
|
1204
|
+
async createSubscriptionCheckout(data) {
|
|
1205
|
+
return this.http.post("/subscriptions/checkout", data);
|
|
1206
|
+
}
|
|
1207
|
+
/**
|
|
1208
|
+
* Verify Stripe Checkout Session for subscription
|
|
1209
|
+
* Call after returning from Stripe Checkout
|
|
1210
|
+
* Requires authentication
|
|
1211
|
+
*/
|
|
1212
|
+
async verifySubscriptionCheckout(session_id) {
|
|
1213
|
+
return this.http.post("/subscriptions/verify", { session_id });
|
|
1214
|
+
}
|
|
1194
1215
|
// ============================================
|
|
1195
1216
|
// Bundle Products
|
|
1196
1217
|
// ============================================
|