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