@inneropen/marvin-sdk 2.0.0-next.5 → 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.cjs +197 -0
- package/dist/platform.d.cts +567 -2
- package/dist/platform.d.ts +567 -2
- package/dist/platform.js +194 -0
- package/package.json +1 -1
package/dist/platform.js
CHANGED
|
@@ -930,6 +930,191 @@ var ThemeModule = class {
|
|
|
930
930
|
}
|
|
931
931
|
};
|
|
932
932
|
|
|
933
|
+
// src/platform/emailTemplates.ts
|
|
934
|
+
var EmailTemplatesClient = class {
|
|
935
|
+
constructor(http) {
|
|
936
|
+
this.http = http;
|
|
937
|
+
}
|
|
938
|
+
http;
|
|
939
|
+
/**
|
|
940
|
+
* List all email templates for the workspace
|
|
941
|
+
* @param groupId - Workspace ID
|
|
942
|
+
*/
|
|
943
|
+
async list(groupId) {
|
|
944
|
+
return this.http.get(`/platform/workspaces/${groupId}/email-templates`);
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Get a specific email template
|
|
948
|
+
* @param groupId - Workspace ID
|
|
949
|
+
* @param templateId - Template ID
|
|
950
|
+
*/
|
|
951
|
+
async get(groupId, templateId) {
|
|
952
|
+
return this.http.get(`/platform/workspaces/${groupId}/email-templates/${templateId}`);
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* Create a new email template
|
|
956
|
+
* @param groupId - Workspace ID
|
|
957
|
+
* @param data - Template data
|
|
958
|
+
*/
|
|
959
|
+
async create(groupId, data) {
|
|
960
|
+
return this.http.post(`/platform/workspaces/${groupId}/email-templates`, data);
|
|
961
|
+
}
|
|
962
|
+
/**
|
|
963
|
+
* Update an email template
|
|
964
|
+
* @param groupId - Workspace ID
|
|
965
|
+
* @param templateId - Template ID
|
|
966
|
+
* @param data - Updated template data
|
|
967
|
+
*/
|
|
968
|
+
async update(groupId, templateId, data) {
|
|
969
|
+
return this.http.patch(`/platform/workspaces/${groupId}/email-templates/${templateId}`, data);
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Delete an email template
|
|
973
|
+
* @param groupId - Workspace ID
|
|
974
|
+
* @param templateId - Template ID
|
|
975
|
+
*/
|
|
976
|
+
async delete(groupId, templateId) {
|
|
977
|
+
await this.http.delete(`/platform/workspaces/${groupId}/email-templates/${templateId}`);
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Send a test email using a template
|
|
981
|
+
* @param groupId - Workspace ID
|
|
982
|
+
* @param templateId - Template ID
|
|
983
|
+
* @param recipientEmail - Test recipient email address
|
|
984
|
+
*/
|
|
985
|
+
async sendTest(groupId, templateId, recipientEmail) {
|
|
986
|
+
return this.http.post(`/platform/workspaces/${groupId}/email-templates/${templateId}/test`, {
|
|
987
|
+
recipient_email: recipientEmail
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
};
|
|
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
|
+
|
|
933
1118
|
// src/platform/client.ts
|
|
934
1119
|
var PlatformClient = class extends HttpClient {
|
|
935
1120
|
entries;
|
|
@@ -948,6 +1133,9 @@ var PlatformClient = class extends HttpClient {
|
|
|
948
1133
|
eventLog;
|
|
949
1134
|
session;
|
|
950
1135
|
theme;
|
|
1136
|
+
emailTemplates;
|
|
1137
|
+
scheduledTasks;
|
|
1138
|
+
forms;
|
|
951
1139
|
// Admin modules
|
|
952
1140
|
adminUsers;
|
|
953
1141
|
adminSystem;
|
|
@@ -975,6 +1163,9 @@ var PlatformClient = class extends HttpClient {
|
|
|
975
1163
|
this.eventLog = new EventLogModule(this);
|
|
976
1164
|
this.session = new AuthModule(this);
|
|
977
1165
|
this.theme = new ThemeModule(this);
|
|
1166
|
+
this.emailTemplates = new EmailTemplatesClient(this);
|
|
1167
|
+
this.scheduledTasks = new ScheduledTasksModule(this);
|
|
1168
|
+
this.forms = new FormsModule(this);
|
|
978
1169
|
this.adminUsers = new AdminUsersModule(this);
|
|
979
1170
|
this.adminSystem = new AdminSystemModule(this);
|
|
980
1171
|
this.adminMaintenance = new AdminMaintenanceModule(this);
|
|
@@ -991,14 +1182,17 @@ export {
|
|
|
991
1182
|
AssetsModule,
|
|
992
1183
|
AuthModule,
|
|
993
1184
|
CollectionsModule,
|
|
1185
|
+
EmailTemplatesClient,
|
|
994
1186
|
EntriesModule,
|
|
995
1187
|
EntryTypesModule,
|
|
996
1188
|
EventLogModule,
|
|
997
1189
|
EventsModule,
|
|
1190
|
+
FormsModule,
|
|
998
1191
|
InvitesModule,
|
|
999
1192
|
NotificationsModule,
|
|
1000
1193
|
PlatformClient,
|
|
1001
1194
|
ResourcesModule,
|
|
1195
|
+
ScheduledTasksModule,
|
|
1002
1196
|
ThemeModule,
|
|
1003
1197
|
UserModule,
|
|
1004
1198
|
WebhooksModule,
|