@inneropen/marvin-sdk 2.0.0-next.1 → 2.0.0-next.11

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 CHANGED
@@ -27,14 +27,17 @@ __export(platform_exports, {
27
27
  AssetsModule: () => AssetsModule,
28
28
  AuthModule: () => AuthModule,
29
29
  CollectionsModule: () => CollectionsModule,
30
+ EmailTemplatesClient: () => EmailTemplatesClient,
30
31
  EntriesModule: () => EntriesModule,
31
32
  EntryTypesModule: () => EntryTypesModule,
32
33
  EventLogModule: () => EventLogModule,
33
34
  EventsModule: () => EventsModule,
35
+ FormsModule: () => FormsModule,
34
36
  InvitesModule: () => InvitesModule,
35
37
  NotificationsModule: () => NotificationsModule,
36
38
  PlatformClient: () => PlatformClient,
37
39
  ResourcesModule: () => ResourcesModule,
40
+ ScheduledTasksModule: () => ScheduledTasksModule,
38
41
  ThemeModule: () => ThemeModule,
39
42
  UserModule: () => UserModule,
40
43
  WebhooksModule: () => WebhooksModule,
@@ -1151,6 +1154,191 @@ var ThemeModule = class {
1151
1154
  }
1152
1155
  };
1153
1156
 
1157
+ // src/platform/emailTemplates.ts
1158
+ var EmailTemplatesClient = class {
1159
+ constructor(http) {
1160
+ this.http = http;
1161
+ }
1162
+ http;
1163
+ /**
1164
+ * List all email templates for the workspace
1165
+ * @param groupId - Workspace ID
1166
+ */
1167
+ async list(groupId) {
1168
+ return this.http.get(`/api/platform/workspaces/${groupId}/email-templates`);
1169
+ }
1170
+ /**
1171
+ * Get a specific email template
1172
+ * @param groupId - Workspace ID
1173
+ * @param templateId - Template ID
1174
+ */
1175
+ async get(groupId, templateId) {
1176
+ return this.http.get(`/api/platform/workspaces/${groupId}/email-templates/${templateId}`);
1177
+ }
1178
+ /**
1179
+ * Create a new email template
1180
+ * @param groupId - Workspace ID
1181
+ * @param data - Template data
1182
+ */
1183
+ async create(groupId, data) {
1184
+ return this.http.post(`/api/platform/workspaces/${groupId}/email-templates`, data);
1185
+ }
1186
+ /**
1187
+ * Update an email template
1188
+ * @param groupId - Workspace ID
1189
+ * @param templateId - Template ID
1190
+ * @param data - Updated template data
1191
+ */
1192
+ async update(groupId, templateId, data) {
1193
+ return this.http.patch(`/api/platform/workspaces/${groupId}/email-templates/${templateId}`, data);
1194
+ }
1195
+ /**
1196
+ * Delete an email template
1197
+ * @param groupId - Workspace ID
1198
+ * @param templateId - Template ID
1199
+ */
1200
+ async delete(groupId, templateId) {
1201
+ await this.http.delete(`/api/platform/workspaces/${groupId}/email-templates/${templateId}`);
1202
+ }
1203
+ /**
1204
+ * Send a test email using a template
1205
+ * @param groupId - Workspace ID
1206
+ * @param templateId - Template ID
1207
+ * @param recipientEmail - Test recipient email address
1208
+ */
1209
+ async sendTest(groupId, templateId, recipientEmail) {
1210
+ return this.http.post(`/api/platform/workspaces/${groupId}/email-templates/${templateId}/test`, {
1211
+ recipient_email: recipientEmail
1212
+ });
1213
+ }
1214
+ };
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
+
1154
1342
  // src/platform/client.ts
1155
1343
  var PlatformClient = class extends HttpClient {
1156
1344
  entries;
@@ -1169,6 +1357,9 @@ var PlatformClient = class extends HttpClient {
1169
1357
  eventLog;
1170
1358
  session;
1171
1359
  theme;
1360
+ emailTemplates;
1361
+ scheduledTasks;
1362
+ forms;
1172
1363
  // Admin modules
1173
1364
  adminUsers;
1174
1365
  adminSystem;
@@ -1196,6 +1387,9 @@ var PlatformClient = class extends HttpClient {
1196
1387
  this.eventLog = new EventLogModule(this);
1197
1388
  this.session = new AuthModule(this);
1198
1389
  this.theme = new ThemeModule(this);
1390
+ this.emailTemplates = new EmailTemplatesClient(this);
1391
+ this.scheduledTasks = new ScheduledTasksModule(this);
1392
+ this.forms = new FormsModule(this);
1199
1393
  this.adminUsers = new AdminUsersModule(this);
1200
1394
  this.adminSystem = new AdminSystemModule(this);
1201
1395
  this.adminMaintenance = new AdminMaintenanceModule(this);
@@ -1213,14 +1407,17 @@ function createPlatformClient(config) {
1213
1407
  AssetsModule,
1214
1408
  AuthModule,
1215
1409
  CollectionsModule,
1410
+ EmailTemplatesClient,
1216
1411
  EntriesModule,
1217
1412
  EntryTypesModule,
1218
1413
  EventLogModule,
1219
1414
  EventsModule,
1415
+ FormsModule,
1220
1416
  InvitesModule,
1221
1417
  NotificationsModule,
1222
1418
  PlatformClient,
1223
1419
  ResourcesModule,
1420
+ ScheduledTasksModule,
1224
1421
  ThemeModule,
1225
1422
  UserModule,
1226
1423
  WebhooksModule,