@techzunction/sdk 0.9.1 → 0.9.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.cjs +112 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +247 -1
- package/dist/index.d.ts +247 -1
- package/dist/index.js +112 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1244,6 +1244,116 @@ function createStorefrontBanking(c) {
|
|
|
1244
1244
|
};
|
|
1245
1245
|
}
|
|
1246
1246
|
|
|
1247
|
+
// src/storefront/sub-radar.ts
|
|
1248
|
+
function createStorefrontSubRadar(c) {
|
|
1249
|
+
return {
|
|
1250
|
+
// ─── Gmail Accounts ────────────────────────────────────────────────
|
|
1251
|
+
gmail: {
|
|
1252
|
+
/** List all connected Gmail accounts (no tokens). */
|
|
1253
|
+
list() {
|
|
1254
|
+
return c.get("/gmail-accounts", "enduser");
|
|
1255
|
+
},
|
|
1256
|
+
/** Get the Google OAuth URL to connect a Gmail account. */
|
|
1257
|
+
getConnectUrl() {
|
|
1258
|
+
return c.get("/gmail-accounts/connect", "enduser");
|
|
1259
|
+
},
|
|
1260
|
+
/** Exchange OAuth code and connect a Gmail account. */
|
|
1261
|
+
callback(data) {
|
|
1262
|
+
return c.post("/gmail-accounts/callback", data, "enduser");
|
|
1263
|
+
},
|
|
1264
|
+
/** Trigger a Gmail scan for a connected account. */
|
|
1265
|
+
triggerScan(accountId) {
|
|
1266
|
+
return c.post(
|
|
1267
|
+
`/gmail-accounts/${accountId}/scan`,
|
|
1268
|
+
void 0,
|
|
1269
|
+
"enduser"
|
|
1270
|
+
);
|
|
1271
|
+
},
|
|
1272
|
+
/** Disconnect a Gmail account. */
|
|
1273
|
+
disconnect(accountId) {
|
|
1274
|
+
return c.del(`/gmail-accounts/${accountId}`, "enduser");
|
|
1275
|
+
}
|
|
1276
|
+
},
|
|
1277
|
+
// ─── Tracked Subscriptions ─────────────────────────────────────────
|
|
1278
|
+
subscriptions: {
|
|
1279
|
+
/** List tracked subscriptions with optional filters. */
|
|
1280
|
+
list(params) {
|
|
1281
|
+
return c.paginated("/tracked-subscriptions", params);
|
|
1282
|
+
},
|
|
1283
|
+
/** Get a single tracked subscription. */
|
|
1284
|
+
get(id) {
|
|
1285
|
+
return c.get(`/tracked-subscriptions/${id}`, "enduser");
|
|
1286
|
+
},
|
|
1287
|
+
/** Monthly spending summary (totals + category breakdown). */
|
|
1288
|
+
summary() {
|
|
1289
|
+
return c.get("/tracked-subscriptions/summary", "enduser");
|
|
1290
|
+
},
|
|
1291
|
+
/** Manually add a subscription. */
|
|
1292
|
+
add(data) {
|
|
1293
|
+
return c.post("/tracked-subscriptions", data, "enduser");
|
|
1294
|
+
},
|
|
1295
|
+
/** Update a tracked subscription. */
|
|
1296
|
+
update(id, data) {
|
|
1297
|
+
return c.patch(`/tracked-subscriptions/${id}`, data, "enduser");
|
|
1298
|
+
},
|
|
1299
|
+
/** Remove a tracked subscription (soft delete). */
|
|
1300
|
+
remove(id) {
|
|
1301
|
+
return c.del(`/tracked-subscriptions/${id}`, "enduser");
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
// ─── Alerts ────────────────────────────────────────────────────────
|
|
1305
|
+
alerts: {
|
|
1306
|
+
/** List subscription alerts. */
|
|
1307
|
+
list(params) {
|
|
1308
|
+
return c.paginated("/subscription-alerts", params);
|
|
1309
|
+
},
|
|
1310
|
+
/** Dismiss a single alert. */
|
|
1311
|
+
dismiss(alertId) {
|
|
1312
|
+
return c.post(
|
|
1313
|
+
`/subscription-alerts/${alertId}/dismiss`,
|
|
1314
|
+
void 0,
|
|
1315
|
+
"enduser"
|
|
1316
|
+
);
|
|
1317
|
+
},
|
|
1318
|
+
/** Dismiss all alerts. */
|
|
1319
|
+
dismissAll() {
|
|
1320
|
+
return c.post(
|
|
1321
|
+
"/subscription-alerts/dismiss-all",
|
|
1322
|
+
void 0,
|
|
1323
|
+
"enduser"
|
|
1324
|
+
);
|
|
1325
|
+
}
|
|
1326
|
+
},
|
|
1327
|
+
// ─── Suggestions ───────────────────────────────────────────────────
|
|
1328
|
+
suggestions: {
|
|
1329
|
+
/** List pending money-saving suggestions. */
|
|
1330
|
+
list(params) {
|
|
1331
|
+
return c.paginated("/subscription-suggestions", params);
|
|
1332
|
+
},
|
|
1333
|
+
/** Act on a suggestion: accept / dismiss / not_interested. */
|
|
1334
|
+
action(suggestionId, data) {
|
|
1335
|
+
return c.post(
|
|
1336
|
+
`/subscription-suggestions/${suggestionId}/action`,
|
|
1337
|
+
data,
|
|
1338
|
+
"enduser"
|
|
1339
|
+
);
|
|
1340
|
+
}
|
|
1341
|
+
},
|
|
1342
|
+
// ─── Analytics ─────────────────────────────────────────────────────
|
|
1343
|
+
analytics: {
|
|
1344
|
+
/** Full spending summary with category breakdown, low-usage counts, etc. */
|
|
1345
|
+
summary() {
|
|
1346
|
+
return c.get("/subscription-analytics/summary", "enduser");
|
|
1347
|
+
},
|
|
1348
|
+
/** Month-by-month spending trend for the last N months. */
|
|
1349
|
+
trends(months) {
|
|
1350
|
+
const qs = months ? `?months=${months}` : "";
|
|
1351
|
+
return c.get(`/subscription-analytics/trends${qs}`, "enduser");
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1247
1357
|
// src/storefront/index.ts
|
|
1248
1358
|
function createStorefront(c) {
|
|
1249
1359
|
return {
|
|
@@ -1278,7 +1388,8 @@ function createStorefront(c) {
|
|
|
1278
1388
|
rooms: createStorefrontRooms(c),
|
|
1279
1389
|
earnings: createStorefrontEarnings(c),
|
|
1280
1390
|
connectedSources: createStorefrontConnectedSources(c),
|
|
1281
|
-
banking: createStorefrontBanking(c)
|
|
1391
|
+
banking: createStorefrontBanking(c),
|
|
1392
|
+
subRadar: createStorefrontSubRadar(c)
|
|
1282
1393
|
};
|
|
1283
1394
|
}
|
|
1284
1395
|
|