@inneropen/marvin-sdk 2.0.0-next.6 → 2.0.0-next.8
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/platform.cjs +140 -6
- package/dist/platform.d.cts +464 -2
- package/dist/platform.d.ts +464 -2
- package/dist/platform.js +138 -6
- package/package.json +1 -1
package/dist/platform.cjs
CHANGED
|
@@ -32,10 +32,12 @@ __export(platform_exports, {
|
|
|
32
32
|
EntryTypesModule: () => EntryTypesModule,
|
|
33
33
|
EventLogModule: () => EventLogModule,
|
|
34
34
|
EventsModule: () => EventsModule,
|
|
35
|
+
FormsModule: () => FormsModule,
|
|
35
36
|
InvitesModule: () => InvitesModule,
|
|
36
37
|
NotificationsModule: () => NotificationsModule,
|
|
37
38
|
PlatformClient: () => PlatformClient,
|
|
38
39
|
ResourcesModule: () => ResourcesModule,
|
|
40
|
+
ScheduledTasksModule: () => ScheduledTasksModule,
|
|
39
41
|
ThemeModule: () => ThemeModule,
|
|
40
42
|
UserModule: () => UserModule,
|
|
41
43
|
WebhooksModule: () => WebhooksModule,
|
|
@@ -1163,7 +1165,7 @@ var EmailTemplatesClient = class {
|
|
|
1163
1165
|
* @param groupId - Workspace ID
|
|
1164
1166
|
*/
|
|
1165
1167
|
async list(groupId) {
|
|
1166
|
-
return this.http.get(`/
|
|
1168
|
+
return this.http.get(`/api/platform/workspaces/${groupId}/email-templates`);
|
|
1167
1169
|
}
|
|
1168
1170
|
/**
|
|
1169
1171
|
* Get a specific email template
|
|
@@ -1171,7 +1173,7 @@ var EmailTemplatesClient = class {
|
|
|
1171
1173
|
* @param templateId - Template ID
|
|
1172
1174
|
*/
|
|
1173
1175
|
async get(groupId, templateId) {
|
|
1174
|
-
return this.http.get(`/
|
|
1176
|
+
return this.http.get(`/api/platform/workspaces/${groupId}/email-templates/${templateId}`);
|
|
1175
1177
|
}
|
|
1176
1178
|
/**
|
|
1177
1179
|
* Create a new email template
|
|
@@ -1179,7 +1181,7 @@ var EmailTemplatesClient = class {
|
|
|
1179
1181
|
* @param data - Template data
|
|
1180
1182
|
*/
|
|
1181
1183
|
async create(groupId, data) {
|
|
1182
|
-
return this.http.post(`/
|
|
1184
|
+
return this.http.post(`/api/platform/workspaces/${groupId}/email-templates`, data);
|
|
1183
1185
|
}
|
|
1184
1186
|
/**
|
|
1185
1187
|
* Update an email template
|
|
@@ -1188,7 +1190,7 @@ var EmailTemplatesClient = class {
|
|
|
1188
1190
|
* @param data - Updated template data
|
|
1189
1191
|
*/
|
|
1190
1192
|
async update(groupId, templateId, data) {
|
|
1191
|
-
return this.http.patch(`/
|
|
1193
|
+
return this.http.patch(`/api/platform/workspaces/${groupId}/email-templates/${templateId}`, data);
|
|
1192
1194
|
}
|
|
1193
1195
|
/**
|
|
1194
1196
|
* Delete an email template
|
|
@@ -1196,7 +1198,7 @@ var EmailTemplatesClient = class {
|
|
|
1196
1198
|
* @param templateId - Template ID
|
|
1197
1199
|
*/
|
|
1198
1200
|
async delete(groupId, templateId) {
|
|
1199
|
-
await this.http.delete(`/
|
|
1201
|
+
await this.http.delete(`/api/platform/workspaces/${groupId}/email-templates/${templateId}`);
|
|
1200
1202
|
}
|
|
1201
1203
|
/**
|
|
1202
1204
|
* Send a test email using a template
|
|
@@ -1205,12 +1207,138 @@ var EmailTemplatesClient = class {
|
|
|
1205
1207
|
* @param recipientEmail - Test recipient email address
|
|
1206
1208
|
*/
|
|
1207
1209
|
async sendTest(groupId, templateId, recipientEmail) {
|
|
1208
|
-
return this.http.post(`/
|
|
1210
|
+
return this.http.post(`/api/platform/workspaces/${groupId}/email-templates/${templateId}/test`, {
|
|
1209
1211
|
recipient_email: recipientEmail
|
|
1210
1212
|
});
|
|
1211
1213
|
}
|
|
1212
1214
|
};
|
|
1213
1215
|
|
|
1216
|
+
// src/platform/scheduledTasks.ts
|
|
1217
|
+
var ScheduledTasksModule = class {
|
|
1218
|
+
constructor(http) {
|
|
1219
|
+
this.http = http;
|
|
1220
|
+
}
|
|
1221
|
+
http;
|
|
1222
|
+
/**
|
|
1223
|
+
* List all scheduled tasks for the current workspace
|
|
1224
|
+
*/
|
|
1225
|
+
async list() {
|
|
1226
|
+
return this.http.get("/api/platform/scheduled-tasks");
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* Get a scheduled task by ID or slug
|
|
1230
|
+
*/
|
|
1231
|
+
async get(idOrSlug) {
|
|
1232
|
+
return this.http.get(`/api/platform/scheduled-tasks/${idOrSlug}`);
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Create a new scheduled task
|
|
1236
|
+
*/
|
|
1237
|
+
async create(data) {
|
|
1238
|
+
return this.http.post("/api/platform/scheduled-tasks", data);
|
|
1239
|
+
}
|
|
1240
|
+
/**
|
|
1241
|
+
* Update a scheduled task
|
|
1242
|
+
*/
|
|
1243
|
+
async update(idOrSlug, data) {
|
|
1244
|
+
return this.http.patch(`/api/platform/scheduled-tasks/${idOrSlug}`, data);
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* Delete a scheduled task
|
|
1248
|
+
*/
|
|
1249
|
+
async delete(idOrSlug) {
|
|
1250
|
+
await this.http.delete(`/api/platform/scheduled-tasks/${idOrSlug}`);
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* Manually trigger task execution (bypass schedule)
|
|
1254
|
+
*/
|
|
1255
|
+
async execute(idOrSlug) {
|
|
1256
|
+
await this.http.post(`/api/platform/scheduled-tasks/${idOrSlug}/execute`, {});
|
|
1257
|
+
}
|
|
1258
|
+
/**
|
|
1259
|
+
* Get task execution history
|
|
1260
|
+
*/
|
|
1261
|
+
async history(idOrSlug, options) {
|
|
1262
|
+
const params = new URLSearchParams();
|
|
1263
|
+
if (options?.limit) {
|
|
1264
|
+
params.set("limit", options.limit.toString());
|
|
1265
|
+
}
|
|
1266
|
+
const query = params.toString() ? `?${params.toString()}` : "";
|
|
1267
|
+
return this.http.get(
|
|
1268
|
+
`/api/platform/scheduled-tasks/${idOrSlug}/history${query}`
|
|
1269
|
+
);
|
|
1270
|
+
}
|
|
1271
|
+
/**
|
|
1272
|
+
* Get available task types
|
|
1273
|
+
*/
|
|
1274
|
+
async taskTypes(options) {
|
|
1275
|
+
const params = new URLSearchParams();
|
|
1276
|
+
if (options?.detailed) {
|
|
1277
|
+
params.set("detailed", "true");
|
|
1278
|
+
}
|
|
1279
|
+
const query = params.toString() ? `?${params.toString()}` : "";
|
|
1280
|
+
return this.http.get(`/api/platform/scheduled-tasks/task-types${query}`);
|
|
1281
|
+
}
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1284
|
+
// src/platform/forms.ts
|
|
1285
|
+
var FormsModule = class {
|
|
1286
|
+
constructor(http) {
|
|
1287
|
+
this.http = http;
|
|
1288
|
+
}
|
|
1289
|
+
http;
|
|
1290
|
+
/**
|
|
1291
|
+
* List all forms
|
|
1292
|
+
*/
|
|
1293
|
+
async list() {
|
|
1294
|
+
return this.http.get("/api/platform/forms");
|
|
1295
|
+
}
|
|
1296
|
+
/**
|
|
1297
|
+
* Get a single form by ID
|
|
1298
|
+
*/
|
|
1299
|
+
async get(id) {
|
|
1300
|
+
return this.http.get(`/api/platform/forms/${id}`);
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* Create a new form
|
|
1304
|
+
*/
|
|
1305
|
+
async create(data) {
|
|
1306
|
+
return this.http.post("/api/platform/forms", data);
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Update a form
|
|
1310
|
+
*/
|
|
1311
|
+
async update(id, data) {
|
|
1312
|
+
return this.http.patch(`/api/platform/forms/${id}`, data);
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Delete a form
|
|
1316
|
+
*/
|
|
1317
|
+
async delete(id) {
|
|
1318
|
+
return this.http.delete(`/api/platform/forms/${id}`);
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* Get submissions for a form
|
|
1322
|
+
*/
|
|
1323
|
+
async getSubmissions(formId) {
|
|
1324
|
+
return this.http.get(`/api/platform/forms/${formId}/submissions`);
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Get a published form by slug (Publishing API - public access)
|
|
1328
|
+
*/
|
|
1329
|
+
async getPublishedForm(slug) {
|
|
1330
|
+
return this.http.get(`/api/publish/forms/${slug}`);
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* Submit data to a published form (Publishing API - public access)
|
|
1334
|
+
*/
|
|
1335
|
+
async submitForm(slug, data) {
|
|
1336
|
+
return this.http.post(`/api/publish/forms/${slug}/submit`, {
|
|
1337
|
+
dataJson: data
|
|
1338
|
+
});
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1214
1342
|
// src/platform/client.ts
|
|
1215
1343
|
var PlatformClient = class extends HttpClient {
|
|
1216
1344
|
entries;
|
|
@@ -1230,6 +1358,8 @@ var PlatformClient = class extends HttpClient {
|
|
|
1230
1358
|
session;
|
|
1231
1359
|
theme;
|
|
1232
1360
|
emailTemplates;
|
|
1361
|
+
scheduledTasks;
|
|
1362
|
+
forms;
|
|
1233
1363
|
// Admin modules
|
|
1234
1364
|
adminUsers;
|
|
1235
1365
|
adminSystem;
|
|
@@ -1258,6 +1388,8 @@ var PlatformClient = class extends HttpClient {
|
|
|
1258
1388
|
this.session = new AuthModule(this);
|
|
1259
1389
|
this.theme = new ThemeModule(this);
|
|
1260
1390
|
this.emailTemplates = new EmailTemplatesClient(this);
|
|
1391
|
+
this.scheduledTasks = new ScheduledTasksModule(this);
|
|
1392
|
+
this.forms = new FormsModule(this);
|
|
1261
1393
|
this.adminUsers = new AdminUsersModule(this);
|
|
1262
1394
|
this.adminSystem = new AdminSystemModule(this);
|
|
1263
1395
|
this.adminMaintenance = new AdminMaintenanceModule(this);
|
|
@@ -1280,10 +1412,12 @@ function createPlatformClient(config) {
|
|
|
1280
1412
|
EntryTypesModule,
|
|
1281
1413
|
EventLogModule,
|
|
1282
1414
|
EventsModule,
|
|
1415
|
+
FormsModule,
|
|
1283
1416
|
InvitesModule,
|
|
1284
1417
|
NotificationsModule,
|
|
1285
1418
|
PlatformClient,
|
|
1286
1419
|
ResourcesModule,
|
|
1420
|
+
ScheduledTasksModule,
|
|
1287
1421
|
ThemeModule,
|
|
1288
1422
|
UserModule,
|
|
1289
1423
|
WebhooksModule,
|