@inneropen/marvin-sdk 2.0.0-next.6 → 2.0.0-next.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/platform.js CHANGED
@@ -941,7 +941,7 @@ var EmailTemplatesClient = class {
941
941
  * @param groupId - Workspace ID
942
942
  */
943
943
  async list(groupId) {
944
- return this.http.get(`/groups/${groupId}/email-templates`);
944
+ return this.http.get(`/platform/workspaces/${groupId}/email-templates`);
945
945
  }
946
946
  /**
947
947
  * Get a specific email template
@@ -949,7 +949,7 @@ var EmailTemplatesClient = class {
949
949
  * @param templateId - Template ID
950
950
  */
951
951
  async get(groupId, templateId) {
952
- return this.http.get(`/groups/${groupId}/email-templates/${templateId}`);
952
+ return this.http.get(`/platform/workspaces/${groupId}/email-templates/${templateId}`);
953
953
  }
954
954
  /**
955
955
  * Create a new email template
@@ -957,7 +957,7 @@ var EmailTemplatesClient = class {
957
957
  * @param data - Template data
958
958
  */
959
959
  async create(groupId, data) {
960
- return this.http.post(`/groups/${groupId}/email-templates`, data);
960
+ return this.http.post(`/platform/workspaces/${groupId}/email-templates`, data);
961
961
  }
962
962
  /**
963
963
  * Update an email template
@@ -966,7 +966,7 @@ var EmailTemplatesClient = class {
966
966
  * @param data - Updated template data
967
967
  */
968
968
  async update(groupId, templateId, data) {
969
- return this.http.patch(`/groups/${groupId}/email-templates/${templateId}`, data);
969
+ return this.http.patch(`/platform/workspaces/${groupId}/email-templates/${templateId}`, data);
970
970
  }
971
971
  /**
972
972
  * Delete an email template
@@ -974,7 +974,7 @@ var EmailTemplatesClient = class {
974
974
  * @param templateId - Template ID
975
975
  */
976
976
  async delete(groupId, templateId) {
977
- await this.http.delete(`/groups/${groupId}/email-templates/${templateId}`);
977
+ await this.http.delete(`/platform/workspaces/${groupId}/email-templates/${templateId}`);
978
978
  }
979
979
  /**
980
980
  * Send a test email using a template
@@ -983,12 +983,138 @@ var EmailTemplatesClient = class {
983
983
  * @param recipientEmail - Test recipient email address
984
984
  */
985
985
  async sendTest(groupId, templateId, recipientEmail) {
986
- return this.http.post(`/groups/${groupId}/email-templates/${templateId}/test`, {
986
+ return this.http.post(`/platform/workspaces/${groupId}/email-templates/${templateId}/test`, {
987
987
  recipient_email: recipientEmail
988
988
  });
989
989
  }
990
990
  };
991
991
 
992
+ // src/platform/scheduledTasks.ts
993
+ var ScheduledTasksModule = class {
994
+ constructor(http) {
995
+ this.http = http;
996
+ }
997
+ http;
998
+ /**
999
+ * List all scheduled tasks for the current workspace
1000
+ */
1001
+ async list() {
1002
+ return this.http.get("/api/platform/scheduled-tasks");
1003
+ }
1004
+ /**
1005
+ * Get a scheduled task by ID or slug
1006
+ */
1007
+ async get(idOrSlug) {
1008
+ return this.http.get(`/api/platform/scheduled-tasks/${idOrSlug}`);
1009
+ }
1010
+ /**
1011
+ * Create a new scheduled task
1012
+ */
1013
+ async create(data) {
1014
+ return this.http.post("/api/platform/scheduled-tasks", data);
1015
+ }
1016
+ /**
1017
+ * Update a scheduled task
1018
+ */
1019
+ async update(idOrSlug, data) {
1020
+ return this.http.patch(`/api/platform/scheduled-tasks/${idOrSlug}`, data);
1021
+ }
1022
+ /**
1023
+ * Delete a scheduled task
1024
+ */
1025
+ async delete(idOrSlug) {
1026
+ await this.http.delete(`/api/platform/scheduled-tasks/${idOrSlug}`);
1027
+ }
1028
+ /**
1029
+ * Manually trigger task execution (bypass schedule)
1030
+ */
1031
+ async execute(idOrSlug) {
1032
+ await this.http.post(`/api/platform/scheduled-tasks/${idOrSlug}/execute`, {});
1033
+ }
1034
+ /**
1035
+ * Get task execution history
1036
+ */
1037
+ async history(idOrSlug, options) {
1038
+ const params = new URLSearchParams();
1039
+ if (options?.limit) {
1040
+ params.set("limit", options.limit.toString());
1041
+ }
1042
+ const query = params.toString() ? `?${params.toString()}` : "";
1043
+ return this.http.get(
1044
+ `/api/platform/scheduled-tasks/${idOrSlug}/history${query}`
1045
+ );
1046
+ }
1047
+ /**
1048
+ * Get available task types
1049
+ */
1050
+ async taskTypes(options) {
1051
+ const params = new URLSearchParams();
1052
+ if (options?.detailed) {
1053
+ params.set("detailed", "true");
1054
+ }
1055
+ const query = params.toString() ? `?${params.toString()}` : "";
1056
+ return this.http.get(`/api/platform/scheduled-tasks/task-types${query}`);
1057
+ }
1058
+ };
1059
+
1060
+ // src/platform/forms.ts
1061
+ var FormsModule = class {
1062
+ constructor(http) {
1063
+ this.http = http;
1064
+ }
1065
+ http;
1066
+ /**
1067
+ * List all forms
1068
+ */
1069
+ async list() {
1070
+ return this.http.get("/api/platform/forms");
1071
+ }
1072
+ /**
1073
+ * Get a single form by ID
1074
+ */
1075
+ async get(id) {
1076
+ return this.http.get(`/api/platform/forms/${id}`);
1077
+ }
1078
+ /**
1079
+ * Create a new form
1080
+ */
1081
+ async create(data) {
1082
+ return this.http.post("/api/platform/forms", data);
1083
+ }
1084
+ /**
1085
+ * Update a form
1086
+ */
1087
+ async update(id, data) {
1088
+ return this.http.patch(`/api/platform/forms/${id}`, data);
1089
+ }
1090
+ /**
1091
+ * Delete a form
1092
+ */
1093
+ async delete(id) {
1094
+ return this.http.delete(`/api/platform/forms/${id}`);
1095
+ }
1096
+ /**
1097
+ * Get submissions for a form
1098
+ */
1099
+ async getSubmissions(formId) {
1100
+ return this.http.get(`/api/platform/forms/${formId}/submissions`);
1101
+ }
1102
+ /**
1103
+ * Get a published form by slug (Publishing API - public access)
1104
+ */
1105
+ async getPublishedForm(slug) {
1106
+ return this.http.get(`/api/publish/forms/${slug}`);
1107
+ }
1108
+ /**
1109
+ * Submit data to a published form (Publishing API - public access)
1110
+ */
1111
+ async submitForm(slug, data) {
1112
+ return this.http.post(`/api/publish/forms/${slug}/submit`, {
1113
+ dataJson: data
1114
+ });
1115
+ }
1116
+ };
1117
+
992
1118
  // src/platform/client.ts
993
1119
  var PlatformClient = class extends HttpClient {
994
1120
  entries;
@@ -1008,6 +1134,8 @@ var PlatformClient = class extends HttpClient {
1008
1134
  session;
1009
1135
  theme;
1010
1136
  emailTemplates;
1137
+ scheduledTasks;
1138
+ forms;
1011
1139
  // Admin modules
1012
1140
  adminUsers;
1013
1141
  adminSystem;
@@ -1036,6 +1164,8 @@ var PlatformClient = class extends HttpClient {
1036
1164
  this.session = new AuthModule(this);
1037
1165
  this.theme = new ThemeModule(this);
1038
1166
  this.emailTemplates = new EmailTemplatesClient(this);
1167
+ this.scheduledTasks = new ScheduledTasksModule(this);
1168
+ this.forms = new FormsModule(this);
1039
1169
  this.adminUsers = new AdminUsersModule(this);
1040
1170
  this.adminSystem = new AdminSystemModule(this);
1041
1171
  this.adminMaintenance = new AdminMaintenanceModule(this);
@@ -1057,10 +1187,12 @@ export {
1057
1187
  EntryTypesModule,
1058
1188
  EventLogModule,
1059
1189
  EventsModule,
1190
+ FormsModule,
1060
1191
  InvitesModule,
1061
1192
  NotificationsModule,
1062
1193
  PlatformClient,
1063
1194
  ResourcesModule,
1195
+ ScheduledTasksModule,
1064
1196
  ThemeModule,
1065
1197
  UserModule,
1066
1198
  WebhooksModule,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneropen/marvin-sdk",
3
- "version": "2.0.0-next.6",
3
+ "version": "2.0.0-next.7",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",