@memberjunction/actions-bizapps-formbuilders 2.112.0-beta
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/IMPLEMENTATION_PLAN.md +311 -0
- package/README.md +498 -0
- package/dist/base/base-form-builder.action.d.ts +153 -0
- package/dist/base/base-form-builder.action.d.ts.map +1 -0
- package/dist/base/base-form-builder.action.js +301 -0
- package/dist/base/base-form-builder.action.js.map +1 -0
- package/dist/base/index.d.ts +2 -0
- package/dist/base/index.d.ts.map +1 -0
- package/dist/base/index.js +18 -0
- package/dist/base/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/google-forms/actions/export-csv.action.d.ts +31 -0
- package/dist/providers/google-forms/actions/export-csv.action.d.ts.map +1 -0
- package/dist/providers/google-forms/actions/export-csv.action.js +165 -0
- package/dist/providers/google-forms/actions/export-csv.action.js.map +1 -0
- package/dist/providers/google-forms/actions/get-form.action.d.ts +28 -0
- package/dist/providers/google-forms/actions/get-form.action.d.ts.map +1 -0
- package/dist/providers/google-forms/actions/get-form.action.js +151 -0
- package/dist/providers/google-forms/actions/get-form.action.js.map +1 -0
- package/dist/providers/google-forms/actions/get-single-response.action.d.ts +31 -0
- package/dist/providers/google-forms/actions/get-single-response.action.d.ts.map +1 -0
- package/dist/providers/google-forms/actions/get-single-response.action.js +150 -0
- package/dist/providers/google-forms/actions/get-single-response.action.js.map +1 -0
- package/dist/providers/google-forms/actions/get-statistics.action.d.ts +36 -0
- package/dist/providers/google-forms/actions/get-statistics.action.d.ts.map +1 -0
- package/dist/providers/google-forms/actions/get-statistics.action.js +254 -0
- package/dist/providers/google-forms/actions/get-statistics.action.js.map +1 -0
- package/dist/providers/google-forms/actions/index.d.ts +5 -0
- package/dist/providers/google-forms/actions/index.d.ts.map +1 -0
- package/dist/providers/google-forms/actions/index.js +23 -0
- package/dist/providers/google-forms/actions/index.js.map +1 -0
- package/dist/providers/google-forms/googleforms-base.action.d.ts +197 -0
- package/dist/providers/google-forms/googleforms-base.action.d.ts.map +1 -0
- package/dist/providers/google-forms/googleforms-base.action.js +352 -0
- package/dist/providers/google-forms/googleforms-base.action.js.map +1 -0
- package/dist/providers/google-forms/index.d.ts +3 -0
- package/dist/providers/google-forms/index.d.ts.map +1 -0
- package/dist/providers/google-forms/index.js +21 -0
- package/dist/providers/google-forms/index.js.map +1 -0
- package/dist/providers/jotform/actions/create-form.action.d.ts +61 -0
- package/dist/providers/jotform/actions/create-form.action.d.ts.map +1 -0
- package/dist/providers/jotform/actions/create-form.action.js +259 -0
- package/dist/providers/jotform/actions/create-form.action.js.map +1 -0
- package/dist/providers/jotform/actions/export-csv.action.d.ts +31 -0
- package/dist/providers/jotform/actions/export-csv.action.d.ts.map +1 -0
- package/dist/providers/jotform/actions/export-csv.action.js +187 -0
- package/dist/providers/jotform/actions/export-csv.action.js.map +1 -0
- package/dist/providers/jotform/actions/get-form.action.d.ts +31 -0
- package/dist/providers/jotform/actions/get-form.action.d.ts.map +1 -0
- package/dist/providers/jotform/actions/get-form.action.js +188 -0
- package/dist/providers/jotform/actions/get-form.action.js.map +1 -0
- package/dist/providers/jotform/actions/get-single-submission.action.d.ts +31 -0
- package/dist/providers/jotform/actions/get-single-submission.action.d.ts.map +1 -0
- package/dist/providers/jotform/actions/get-single-submission.action.js +138 -0
- package/dist/providers/jotform/actions/get-single-submission.action.js.map +1 -0
- package/dist/providers/jotform/actions/get-statistics.action.d.ts +39 -0
- package/dist/providers/jotform/actions/get-statistics.action.d.ts.map +1 -0
- package/dist/providers/jotform/actions/get-statistics.action.js +290 -0
- package/dist/providers/jotform/actions/get-statistics.action.js.map +1 -0
- package/dist/providers/jotform/actions/get-submissions.action.d.ts +34 -0
- package/dist/providers/jotform/actions/get-submissions.action.d.ts.map +1 -0
- package/dist/providers/jotform/actions/get-submissions.action.js +218 -0
- package/dist/providers/jotform/actions/get-submissions.action.js.map +1 -0
- package/dist/providers/jotform/actions/index.d.ts +9 -0
- package/dist/providers/jotform/actions/index.d.ts.map +1 -0
- package/dist/providers/jotform/actions/index.js +27 -0
- package/dist/providers/jotform/actions/index.js.map +1 -0
- package/dist/providers/jotform/actions/update-form.action.d.ts +38 -0
- package/dist/providers/jotform/actions/update-form.action.d.ts.map +1 -0
- package/dist/providers/jotform/actions/update-form.action.js +232 -0
- package/dist/providers/jotform/actions/update-form.action.js.map +1 -0
- package/dist/providers/jotform/actions/watch-new-submissions.action.d.ts +32 -0
- package/dist/providers/jotform/actions/watch-new-submissions.action.d.ts.map +1 -0
- package/dist/providers/jotform/actions/watch-new-submissions.action.js +229 -0
- package/dist/providers/jotform/actions/watch-new-submissions.action.js.map +1 -0
- package/dist/providers/jotform/index.d.ts +3 -0
- package/dist/providers/jotform/index.d.ts.map +1 -0
- package/dist/providers/jotform/index.js +21 -0
- package/dist/providers/jotform/index.js.map +1 -0
- package/dist/providers/jotform/jotform-base.action.d.ts +96 -0
- package/dist/providers/jotform/jotform-base.action.d.ts.map +1 -0
- package/dist/providers/jotform/jotform-base.action.js +269 -0
- package/dist/providers/jotform/jotform-base.action.js.map +1 -0
- package/dist/providers/surveymonkey/actions/create-survey.action.d.ts +48 -0
- package/dist/providers/surveymonkey/actions/create-survey.action.d.ts.map +1 -0
- package/dist/providers/surveymonkey/actions/create-survey.action.js +192 -0
- package/dist/providers/surveymonkey/actions/create-survey.action.js.map +1 -0
- package/dist/providers/surveymonkey/actions/export-csv.action.d.ts +30 -0
- package/dist/providers/surveymonkey/actions/export-csv.action.d.ts.map +1 -0
- package/dist/providers/surveymonkey/actions/export-csv.action.js +173 -0
- package/dist/providers/surveymonkey/actions/export-csv.action.js.map +1 -0
- package/dist/providers/surveymonkey/actions/get-responses.action.d.ts +33 -0
- package/dist/providers/surveymonkey/actions/get-responses.action.d.ts.map +1 -0
- package/dist/providers/surveymonkey/actions/get-responses.action.js +243 -0
- package/dist/providers/surveymonkey/actions/get-responses.action.js.map +1 -0
- package/dist/providers/surveymonkey/actions/get-single-response.action.d.ts +30 -0
- package/dist/providers/surveymonkey/actions/get-single-response.action.d.ts.map +1 -0
- package/dist/providers/surveymonkey/actions/get-single-response.action.js +149 -0
- package/dist/providers/surveymonkey/actions/get-single-response.action.js.map +1 -0
- package/dist/providers/surveymonkey/actions/get-statistics.action.d.ts +38 -0
- package/dist/providers/surveymonkey/actions/get-statistics.action.d.ts.map +1 -0
- package/dist/providers/surveymonkey/actions/get-statistics.action.js +261 -0
- package/dist/providers/surveymonkey/actions/get-statistics.action.js.map +1 -0
- package/dist/providers/surveymonkey/actions/get-survey.action.d.ts +27 -0
- package/dist/providers/surveymonkey/actions/get-survey.action.d.ts.map +1 -0
- package/dist/providers/surveymonkey/actions/get-survey.action.js +180 -0
- package/dist/providers/surveymonkey/actions/get-survey.action.js.map +1 -0
- package/dist/providers/surveymonkey/actions/index.d.ts +9 -0
- package/dist/providers/surveymonkey/actions/index.d.ts.map +1 -0
- package/dist/providers/surveymonkey/actions/index.js +27 -0
- package/dist/providers/surveymonkey/actions/index.js.map +1 -0
- package/dist/providers/surveymonkey/actions/update-survey.action.d.ts +39 -0
- package/dist/providers/surveymonkey/actions/update-survey.action.d.ts.map +1 -0
- package/dist/providers/surveymonkey/actions/update-survey.action.js +217 -0
- package/dist/providers/surveymonkey/actions/update-survey.action.js.map +1 -0
- package/dist/providers/surveymonkey/actions/watch-new-responses.action.d.ts +31 -0
- package/dist/providers/surveymonkey/actions/watch-new-responses.action.d.ts.map +1 -0
- package/dist/providers/surveymonkey/actions/watch-new-responses.action.js +214 -0
- package/dist/providers/surveymonkey/actions/watch-new-responses.action.js.map +1 -0
- package/dist/providers/surveymonkey/index.d.ts +3 -0
- package/dist/providers/surveymonkey/index.d.ts.map +1 -0
- package/dist/providers/surveymonkey/index.js +21 -0
- package/dist/providers/surveymonkey/index.js.map +1 -0
- package/dist/providers/surveymonkey/surveymonkey-base.action.d.ts +193 -0
- package/dist/providers/surveymonkey/surveymonkey-base.action.d.ts.map +1 -0
- package/dist/providers/surveymonkey/surveymonkey-base.action.js +329 -0
- package/dist/providers/surveymonkey/surveymonkey-base.action.js.map +1 -0
- package/dist/providers/typeform/actions/create-form.action.d.ts +40 -0
- package/dist/providers/typeform/actions/create-form.action.d.ts.map +1 -0
- package/dist/providers/typeform/actions/create-form.action.js +205 -0
- package/dist/providers/typeform/actions/create-form.action.js.map +1 -0
- package/dist/providers/typeform/actions/export-csv.action.d.ts +31 -0
- package/dist/providers/typeform/actions/export-csv.action.d.ts.map +1 -0
- package/dist/providers/typeform/actions/export-csv.action.js +182 -0
- package/dist/providers/typeform/actions/export-csv.action.js.map +1 -0
- package/dist/providers/typeform/actions/get-form.action.d.ts +28 -0
- package/dist/providers/typeform/actions/get-form.action.d.ts.map +1 -0
- package/dist/providers/typeform/actions/get-form.action.js +172 -0
- package/dist/providers/typeform/actions/get-form.action.js.map +1 -0
- package/dist/providers/typeform/actions/get-responses.action.d.ts +34 -0
- package/dist/providers/typeform/actions/get-responses.action.d.ts.map +1 -0
- package/dist/providers/typeform/actions/get-responses.action.js +238 -0
- package/dist/providers/typeform/actions/get-responses.action.js.map +1 -0
- package/dist/providers/typeform/actions/get-single-response.action.d.ts +31 -0
- package/dist/providers/typeform/actions/get-single-response.action.d.ts.map +1 -0
- package/dist/providers/typeform/actions/get-single-response.action.js +161 -0
- package/dist/providers/typeform/actions/get-single-response.action.js.map +1 -0
- package/dist/providers/typeform/actions/get-statistics.action.d.ts +33 -0
- package/dist/providers/typeform/actions/get-statistics.action.d.ts.map +1 -0
- package/dist/providers/typeform/actions/get-statistics.action.js +257 -0
- package/dist/providers/typeform/actions/get-statistics.action.js.map +1 -0
- package/dist/providers/typeform/actions/index.d.ts +9 -0
- package/dist/providers/typeform/actions/index.d.ts.map +1 -0
- package/dist/providers/typeform/actions/index.js +27 -0
- package/dist/providers/typeform/actions/index.js.map +1 -0
- package/dist/providers/typeform/actions/update-form.action.d.ts +38 -0
- package/dist/providers/typeform/actions/update-form.action.d.ts.map +1 -0
- package/dist/providers/typeform/actions/update-form.action.js +228 -0
- package/dist/providers/typeform/actions/update-form.action.js.map +1 -0
- package/dist/providers/typeform/actions/watch-new-responses.action.d.ts +32 -0
- package/dist/providers/typeform/actions/watch-new-responses.action.d.ts.map +1 -0
- package/dist/providers/typeform/actions/watch-new-responses.action.js +215 -0
- package/dist/providers/typeform/actions/watch-new-responses.action.js.map +1 -0
- package/dist/providers/typeform/index.d.ts +3 -0
- package/dist/providers/typeform/index.d.ts.map +1 -0
- package/dist/providers/typeform/index.js +21 -0
- package/dist/providers/typeform/index.js.map +1 -0
- package/dist/providers/typeform/typeform-base.action.d.ts +121 -0
- package/dist/providers/typeform/typeform-base.action.d.ts.map +1 -0
- package/dist/providers/typeform/typeform-base.action.js +292 -0
- package/dist/providers/typeform/typeform-base.action.js.map +1 -0
- package/package.json +41 -0
- package/src/base/base-form-builder.action.ts +403 -0
- package/src/base/index.ts +1 -0
- package/src/index.ts +18 -0
- package/src/providers/google-forms/actions/export-csv.action.ts +167 -0
- package/src/providers/google-forms/actions/get-form.action.ts +151 -0
- package/src/providers/google-forms/actions/get-single-response.action.ts +150 -0
- package/src/providers/google-forms/actions/get-statistics.action.ts +273 -0
- package/src/providers/google-forms/actions/index.ts +7 -0
- package/src/providers/google-forms/googleforms-base.action.ts +517 -0
- package/src/providers/google-forms/index.ts +5 -0
- package/src/providers/jotform/actions/create-form.action.ts +281 -0
- package/src/providers/jotform/actions/export-csv.action.ts +189 -0
- package/src/providers/jotform/actions/get-form.action.ts +189 -0
- package/src/providers/jotform/actions/get-single-submission.action.ts +137 -0
- package/src/providers/jotform/actions/get-statistics.action.ts +308 -0
- package/src/providers/jotform/actions/get-submissions.action.ts +220 -0
- package/src/providers/jotform/actions/index.ts +11 -0
- package/src/providers/jotform/actions/update-form.action.ts +254 -0
- package/src/providers/jotform/actions/watch-new-submissions.action.ts +238 -0
- package/src/providers/jotform/index.ts +5 -0
- package/src/providers/jotform/jotform-base.action.ts +365 -0
- package/src/providers/surveymonkey/actions/create-survey.action.ts +196 -0
- package/src/providers/surveymonkey/actions/export-csv.action.ts +175 -0
- package/src/providers/surveymonkey/actions/get-responses.action.ts +245 -0
- package/src/providers/surveymonkey/actions/get-single-response.action.ts +148 -0
- package/src/providers/surveymonkey/actions/get-statistics.action.ts +280 -0
- package/src/providers/surveymonkey/actions/get-survey.action.ts +181 -0
- package/src/providers/surveymonkey/actions/index.ts +11 -0
- package/src/providers/surveymonkey/actions/update-survey.action.ts +234 -0
- package/src/providers/surveymonkey/actions/watch-new-responses.action.ts +221 -0
- package/src/providers/surveymonkey/index.ts +5 -0
- package/src/providers/surveymonkey/surveymonkey-base.action.ts +505 -0
- package/src/providers/typeform/actions/create-form.action.ts +211 -0
- package/src/providers/typeform/actions/export-csv.action.ts +184 -0
- package/src/providers/typeform/actions/get-form.action.ts +173 -0
- package/src/providers/typeform/actions/get-responses.action.ts +242 -0
- package/src/providers/typeform/actions/get-single-response.action.ts +160 -0
- package/src/providers/typeform/actions/get-statistics.action.ts +276 -0
- package/src/providers/typeform/actions/index.ts +11 -0
- package/src/providers/typeform/actions/update-form.action.ts +235 -0
- package/src/providers/typeform/actions/watch-new-responses.action.ts +222 -0
- package/src/providers/typeform/index.ts +5 -0
- package/src/providers/typeform/typeform-base.action.ts +387 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.GetJotFormStatisticsAction = void 0;
|
|
10
|
+
const global_1 = require("@memberjunction/global");
|
|
11
|
+
const jotform_base_action_1 = require("../jotform-base.action");
|
|
12
|
+
const actions_1 = require("@memberjunction/actions");
|
|
13
|
+
/**
|
|
14
|
+
* Action to calculate aggregate statistics from JotForm submissions
|
|
15
|
+
*
|
|
16
|
+
* Security: API credentials are retrieved securely from Company Integrations
|
|
17
|
+
* instead of being passed as parameters.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* await runAction({
|
|
22
|
+
* ActionName: 'Get JotForm Submission Statistics',
|
|
23
|
+
* Params: [{
|
|
24
|
+
* Name: 'CompanyID',
|
|
25
|
+
* Value: 'your-company-id'
|
|
26
|
+
* }, {
|
|
27
|
+
* Name: 'FormID',
|
|
28
|
+
* Value: '123456789'
|
|
29
|
+
* }, {
|
|
30
|
+
* Name: 'Region',
|
|
31
|
+
* Value: 'us'
|
|
32
|
+
* }]
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
let GetJotFormStatisticsAction = class GetJotFormStatisticsAction extends jotform_base_action_1.JotFormBaseAction {
|
|
37
|
+
get Description() {
|
|
38
|
+
return 'Calculates comprehensive statistics from JotForm submissions including completion rates, submission trends, popular answers, and time-based analytics. Useful for dashboards and reporting.';
|
|
39
|
+
}
|
|
40
|
+
async InternalRunAction(params) {
|
|
41
|
+
try {
|
|
42
|
+
const contextUser = params.ContextUser;
|
|
43
|
+
if (!contextUser) {
|
|
44
|
+
return {
|
|
45
|
+
Success: false,
|
|
46
|
+
ResultCode: 'MISSING_CONTEXT_USER',
|
|
47
|
+
Message: 'Context user is required for JotForm API calls'
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const companyId = this.getParamValue(params.Params, 'CompanyID');
|
|
51
|
+
const formId = this.getParamValue(params.Params, 'FormID');
|
|
52
|
+
if (!formId) {
|
|
53
|
+
return {
|
|
54
|
+
Success: false,
|
|
55
|
+
ResultCode: 'MISSING_FORM_ID',
|
|
56
|
+
Message: 'FormID parameter is required'
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const apiKey = await this.getSecureAPIToken(companyId, contextUser);
|
|
60
|
+
const region = this.getParamValue(params.Params, 'Region');
|
|
61
|
+
const filterParam = this.getParamValue(params.Params, 'Filter');
|
|
62
|
+
const maxSubmissions = this.getParamValue(params.Params, 'MaxSubmissions') || 10000;
|
|
63
|
+
const includeTopAnswers = this.getParamValue(params.Params, 'IncludeTopAnswers') !== false;
|
|
64
|
+
const topAnswersLimit = this.getParamValue(params.Params, 'TopAnswersLimit') || 10;
|
|
65
|
+
// Parse filter if provided as string
|
|
66
|
+
let filter;
|
|
67
|
+
if (filterParam) {
|
|
68
|
+
if (typeof filterParam === 'string') {
|
|
69
|
+
try {
|
|
70
|
+
filter = JSON.parse(filterParam);
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
return {
|
|
74
|
+
Success: false,
|
|
75
|
+
ResultCode: 'INVALID_FILTER',
|
|
76
|
+
Message: 'Filter parameter must be a valid JSON object'
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
filter = filterParam;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Get all submissions from JotForm
|
|
85
|
+
const jfSubmissions = await this.getAllJotFormSubmissions(formId, apiKey, {
|
|
86
|
+
filter,
|
|
87
|
+
maxSubmissions,
|
|
88
|
+
region
|
|
89
|
+
});
|
|
90
|
+
// Normalize submissions to common format
|
|
91
|
+
const submissions = jfSubmissions.map(s => this.normalizeJotFormSubmission(s));
|
|
92
|
+
// Calculate statistics
|
|
93
|
+
const completedSubmissions = submissions.filter(s => s.completed);
|
|
94
|
+
const partialSubmissions = submissions.filter(s => !s.completed);
|
|
95
|
+
const completionRate = this.calculateCompletionRate(completedSubmissions.length, submissions.length);
|
|
96
|
+
const responsesByDate = this.groupResponsesByDate(submissions);
|
|
97
|
+
const statistics = {
|
|
98
|
+
totalResponses: submissions.length,
|
|
99
|
+
completedResponses: completedSubmissions.length,
|
|
100
|
+
partialResponses: partialSubmissions.length,
|
|
101
|
+
completionRate,
|
|
102
|
+
averageCompletionTime: this.calculateAverageCompletionTime(submissions),
|
|
103
|
+
responsesByDate
|
|
104
|
+
};
|
|
105
|
+
// Calculate top answers if requested
|
|
106
|
+
if (includeTopAnswers && submissions.length > 0) {
|
|
107
|
+
const topAnswers = {};
|
|
108
|
+
const allFieldIds = new Set();
|
|
109
|
+
for (const submission of submissions) {
|
|
110
|
+
for (const answer of submission.answers) {
|
|
111
|
+
allFieldIds.add(answer.fieldId);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
for (const fieldId of allFieldIds) {
|
|
115
|
+
const fieldTopAnswers = this.findTopAnswers(submissions, fieldId, topAnswersLimit);
|
|
116
|
+
if (fieldTopAnswers.length > 0) {
|
|
117
|
+
topAnswers[fieldId] = fieldTopAnswers;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
statistics.topAnswers = topAnswers;
|
|
121
|
+
}
|
|
122
|
+
// Calculate time-based breakdowns
|
|
123
|
+
const dailyBreakdown = this.calculateDailyBreakdown(submissions);
|
|
124
|
+
const hourlyDistribution = this.calculateHourlyDistribution(submissions);
|
|
125
|
+
// Build output parameters
|
|
126
|
+
const outputParams = [
|
|
127
|
+
{
|
|
128
|
+
Name: 'Statistics',
|
|
129
|
+
Type: 'Output',
|
|
130
|
+
Value: statistics
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
Name: 'TotalSubmissions',
|
|
134
|
+
Type: 'Output',
|
|
135
|
+
Value: statistics.totalResponses
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
Name: 'CompletedSubmissions',
|
|
139
|
+
Type: 'Output',
|
|
140
|
+
Value: statistics.completedResponses
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
Name: 'PartialSubmissions',
|
|
144
|
+
Type: 'Output',
|
|
145
|
+
Value: statistics.partialResponses
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
Name: 'CompletionRate',
|
|
149
|
+
Type: 'Output',
|
|
150
|
+
Value: statistics.completionRate
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
Name: 'AverageCompletionTime',
|
|
154
|
+
Type: 'Output',
|
|
155
|
+
Value: statistics.averageCompletionTime
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
Name: 'ResponsesByDate',
|
|
159
|
+
Type: 'Output',
|
|
160
|
+
Value: statistics.responsesByDate
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
Name: 'DailyBreakdown',
|
|
164
|
+
Type: 'Output',
|
|
165
|
+
Value: dailyBreakdown
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
Name: 'HourlyDistribution',
|
|
169
|
+
Type: 'Output',
|
|
170
|
+
Value: hourlyDistribution
|
|
171
|
+
}
|
|
172
|
+
];
|
|
173
|
+
if (includeTopAnswers) {
|
|
174
|
+
outputParams.push({
|
|
175
|
+
Name: 'TopAnswers',
|
|
176
|
+
Type: 'Output',
|
|
177
|
+
Value: statistics.topAnswers
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
// Update params with output values
|
|
181
|
+
for (const outputParam of outputParams) {
|
|
182
|
+
const existingParam = params.Params.find(p => p.Name === outputParam.Name);
|
|
183
|
+
if (existingParam) {
|
|
184
|
+
existingParam.Value = outputParam.Value;
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
params.Params.push(outputParam);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
Success: true,
|
|
192
|
+
ResultCode: 'SUCCESS',
|
|
193
|
+
Message: `Successfully calculated statistics from ${submissions.length} JotForm submissions (${completionRate}% completion rate)`
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
198
|
+
return {
|
|
199
|
+
Success: false,
|
|
200
|
+
ResultCode: 'ERROR',
|
|
201
|
+
Message: this.buildFormErrorMessage('Get JotForm Statistics', errorMessage, error)
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Calculate daily breakdown of submissions
|
|
207
|
+
*/
|
|
208
|
+
calculateDailyBreakdown(submissions) {
|
|
209
|
+
const daily = {};
|
|
210
|
+
for (const submission of submissions) {
|
|
211
|
+
const dateKey = submission.submittedAt.toISOString().split('T')[0];
|
|
212
|
+
if (!daily[dateKey]) {
|
|
213
|
+
daily[dateKey] = { count: 0, completed: 0, partial: 0 };
|
|
214
|
+
}
|
|
215
|
+
daily[dateKey].count++;
|
|
216
|
+
if (submission.completed) {
|
|
217
|
+
daily[dateKey].completed++;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
daily[dateKey].partial++;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return Object.entries(daily)
|
|
224
|
+
.map(([date, stats]) => ({ date, ...stats }))
|
|
225
|
+
.sort((a, b) => a.date.localeCompare(b.date));
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Calculate hourly distribution of submissions
|
|
229
|
+
*/
|
|
230
|
+
calculateHourlyDistribution(submissions) {
|
|
231
|
+
const hourly = {};
|
|
232
|
+
// Initialize all hours
|
|
233
|
+
for (let i = 0; i < 24; i++) {
|
|
234
|
+
hourly[i] = 0;
|
|
235
|
+
}
|
|
236
|
+
// Count submissions by hour
|
|
237
|
+
for (const submission of submissions) {
|
|
238
|
+
const hour = submission.submittedAt.getHours();
|
|
239
|
+
hourly[hour]++;
|
|
240
|
+
}
|
|
241
|
+
return Object.entries(hourly).map(([hour, count]) => ({
|
|
242
|
+
hour: parseInt(hour),
|
|
243
|
+
count
|
|
244
|
+
}));
|
|
245
|
+
}
|
|
246
|
+
get Params() {
|
|
247
|
+
return [
|
|
248
|
+
{
|
|
249
|
+
Name: 'CompanyID',
|
|
250
|
+
Type: 'Input',
|
|
251
|
+
Value: null
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
Name: 'FormID',
|
|
255
|
+
Type: 'Input',
|
|
256
|
+
Value: null
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
Name: 'Region',
|
|
260
|
+
Type: 'Input',
|
|
261
|
+
Value: 'us'
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
Name: 'Filter',
|
|
265
|
+
Type: 'Input',
|
|
266
|
+
Value: null
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
Name: 'MaxSubmissions',
|
|
270
|
+
Type: 'Input',
|
|
271
|
+
Value: 10000
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
Name: 'IncludeTopAnswers',
|
|
275
|
+
Type: 'Input',
|
|
276
|
+
Value: true
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
Name: 'TopAnswersLimit',
|
|
280
|
+
Type: 'Input',
|
|
281
|
+
Value: 10
|
|
282
|
+
}
|
|
283
|
+
];
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
exports.GetJotFormStatisticsAction = GetJotFormStatisticsAction;
|
|
287
|
+
exports.GetJotFormStatisticsAction = GetJotFormStatisticsAction = __decorate([
|
|
288
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, 'Get JotForm Submission Statistics')
|
|
289
|
+
], GetJotFormStatisticsAction);
|
|
290
|
+
//# sourceMappingURL=get-statistics.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-statistics.action.js","sourceRoot":"","sources":["../../../../src/providers/jotform/actions/get-statistics.action.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAuD;AACvD,gEAA2D;AAE3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,OAAO;gBACb,KAAK,EAAE,IAAI;aACd;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,IAAI;aACd;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,IAAI;aACd;YACD;gBACI,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,KAAK;aACf;YACD;gBACI,IAAI,EAAE,mBAAmB;gBACzB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,IAAI;aACd;YACD;gBACI,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE;aACZ;SACJ,CAAC;IACN,CAAC;CACJ,CAAA;AArRY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,sBAAa,EAAC,oBAAU,EAAE,mCAAmC,CAAC;GAClD,0BAA0B,CAqRtC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { JotFormBaseAction } from '../jotform-base.action';
|
|
2
|
+
import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
3
|
+
/**
|
|
4
|
+
* Action to retrieve submissions from a JotForm with comprehensive filtering options
|
|
5
|
+
*
|
|
6
|
+
* Security: API credentials are retrieved securely from Company Integrations
|
|
7
|
+
* instead of being passed as parameters.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* await runAction({
|
|
12
|
+
* ActionName: 'Get JotForm Submissions',
|
|
13
|
+
* Params: [{
|
|
14
|
+
* Name: 'CompanyID',
|
|
15
|
+
* Value: 'your-company-id'
|
|
16
|
+
* }, {
|
|
17
|
+
* Name: 'FormID',
|
|
18
|
+
* Value: '123456789'
|
|
19
|
+
* }, {
|
|
20
|
+
* Name: 'Filter',
|
|
21
|
+
* Value: JSON.stringify({ status: 'ACTIVE', created_at: 'gt:2024-01-01' })
|
|
22
|
+
* }, {
|
|
23
|
+
* Name: 'GetAllPages',
|
|
24
|
+
* Value: true
|
|
25
|
+
* }]
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class GetJotFormSubmissionsAction extends JotFormBaseAction {
|
|
30
|
+
get Description(): string;
|
|
31
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
32
|
+
get Params(): ActionParam[];
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=get-submissions.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-submissions.action.d.ts","sourceRoot":"","sources":["../../../../src/providers/jotform/actions/get-submissions.action.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAIhG;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBACa,2BAA4B,SAAQ,iBAAiB;IAE9D,IAAW,WAAW,IAAI,MAAM,CAE/B;cAEe,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAmIvF,IAAW,MAAM,IAAI,WAAW,EAAE,CAgDjC;CACJ"}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.GetJotFormSubmissionsAction = void 0;
|
|
10
|
+
const global_1 = require("@memberjunction/global");
|
|
11
|
+
const jotform_base_action_1 = require("../jotform-base.action");
|
|
12
|
+
const actions_1 = require("@memberjunction/actions");
|
|
13
|
+
/**
|
|
14
|
+
* Action to retrieve submissions from a JotForm with comprehensive filtering options
|
|
15
|
+
*
|
|
16
|
+
* Security: API credentials are retrieved securely from Company Integrations
|
|
17
|
+
* instead of being passed as parameters.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* await runAction({
|
|
22
|
+
* ActionName: 'Get JotForm Submissions',
|
|
23
|
+
* Params: [{
|
|
24
|
+
* Name: 'CompanyID',
|
|
25
|
+
* Value: 'your-company-id'
|
|
26
|
+
* }, {
|
|
27
|
+
* Name: 'FormID',
|
|
28
|
+
* Value: '123456789'
|
|
29
|
+
* }, {
|
|
30
|
+
* Name: 'Filter',
|
|
31
|
+
* Value: JSON.stringify({ status: 'ACTIVE', created_at: 'gt:2024-01-01' })
|
|
32
|
+
* }, {
|
|
33
|
+
* Name: 'GetAllPages',
|
|
34
|
+
* Value: true
|
|
35
|
+
* }]
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
let GetJotFormSubmissionsAction = class GetJotFormSubmissionsAction extends jotform_base_action_1.JotFormBaseAction {
|
|
40
|
+
get Description() {
|
|
41
|
+
return 'Retrieves submissions from a JotForm with filtering, pagination, and ordering capabilities. Supports date ranges, status filtering, and custom field filters.';
|
|
42
|
+
}
|
|
43
|
+
async InternalRunAction(params) {
|
|
44
|
+
try {
|
|
45
|
+
const contextUser = params.ContextUser;
|
|
46
|
+
if (!contextUser) {
|
|
47
|
+
return {
|
|
48
|
+
Success: false,
|
|
49
|
+
ResultCode: 'MISSING_CONTEXT_USER',
|
|
50
|
+
Message: 'Context user is required for JotForm API calls'
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const companyId = this.getParamValue(params.Params, 'CompanyID');
|
|
54
|
+
const formId = this.getParamValue(params.Params, 'FormID');
|
|
55
|
+
if (!formId) {
|
|
56
|
+
return {
|
|
57
|
+
Success: false,
|
|
58
|
+
ResultCode: 'MISSING_FORM_ID',
|
|
59
|
+
Message: 'FormID parameter is required'
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const apiKey = await this.getSecureAPIToken(companyId, contextUser);
|
|
63
|
+
const limit = this.getParamValue(params.Params, 'Limit') || 100;
|
|
64
|
+
const offset = this.getParamValue(params.Params, 'Offset') || 0;
|
|
65
|
+
const filterParam = this.getParamValue(params.Params, 'Filter');
|
|
66
|
+
const orderby = this.getParamValue(params.Params, 'OrderBy');
|
|
67
|
+
const region = this.getParamValue(params.Params, 'Region');
|
|
68
|
+
const getAllPages = this.getParamValue(params.Params, 'GetAllPages') === true;
|
|
69
|
+
// Parse filter if provided (expects JSON string)
|
|
70
|
+
let filter;
|
|
71
|
+
if (filterParam) {
|
|
72
|
+
try {
|
|
73
|
+
filter = typeof filterParam === 'string' ? JSON.parse(filterParam) : filterParam;
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
return {
|
|
77
|
+
Success: false,
|
|
78
|
+
ResultCode: 'INVALID_FILTER',
|
|
79
|
+
Message: 'Filter parameter must be a valid JSON object'
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
let submissions;
|
|
84
|
+
let totalCount;
|
|
85
|
+
let actualLimit;
|
|
86
|
+
let actualOffset;
|
|
87
|
+
if (getAllPages) {
|
|
88
|
+
const maxSubmissions = this.getParamValue(params.Params, 'MaxSubmissions') || 10000;
|
|
89
|
+
const jfSubmissions = await this.getAllJotFormSubmissions(formId, apiKey, {
|
|
90
|
+
filter,
|
|
91
|
+
orderby,
|
|
92
|
+
maxSubmissions,
|
|
93
|
+
region
|
|
94
|
+
});
|
|
95
|
+
submissions = jfSubmissions.map(s => this.normalizeJotFormSubmission(s));
|
|
96
|
+
totalCount = submissions.length;
|
|
97
|
+
actualLimit = submissions.length;
|
|
98
|
+
actualOffset = 0;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
const result = await this.getJotFormSubmissions(formId, apiKey, {
|
|
102
|
+
limit: Math.min(limit, 1000),
|
|
103
|
+
offset,
|
|
104
|
+
filter,
|
|
105
|
+
orderby,
|
|
106
|
+
region
|
|
107
|
+
});
|
|
108
|
+
submissions = result.content.map(s => this.normalizeJotFormSubmission(s));
|
|
109
|
+
totalCount = submissions.length; // JotForm doesn't return total count in API
|
|
110
|
+
actualLimit = result.limit;
|
|
111
|
+
actualOffset = result.offset;
|
|
112
|
+
}
|
|
113
|
+
const outputParams = [
|
|
114
|
+
{
|
|
115
|
+
Name: 'Submissions',
|
|
116
|
+
Type: 'Output',
|
|
117
|
+
Value: submissions
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
Name: 'TotalCount',
|
|
121
|
+
Type: 'Output',
|
|
122
|
+
Value: totalCount
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
Name: 'Limit',
|
|
126
|
+
Type: 'Output',
|
|
127
|
+
Value: actualLimit
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
Name: 'Offset',
|
|
131
|
+
Type: 'Output',
|
|
132
|
+
Value: actualOffset
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
Name: 'Count',
|
|
136
|
+
Type: 'Output',
|
|
137
|
+
Value: submissions.length
|
|
138
|
+
}
|
|
139
|
+
];
|
|
140
|
+
for (const outputParam of outputParams) {
|
|
141
|
+
const existingParam = params.Params.find(p => p.Name === outputParam.Name);
|
|
142
|
+
if (existingParam) {
|
|
143
|
+
existingParam.Value = outputParam.Value;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
params.Params.push(outputParam);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
Success: true,
|
|
151
|
+
ResultCode: 'SUCCESS',
|
|
152
|
+
Message: `Successfully retrieved ${submissions.length} submissions from JotForm${getAllPages ? '' : ` (offset: ${actualOffset}, limit: ${actualLimit})`}`
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
157
|
+
return {
|
|
158
|
+
Success: false,
|
|
159
|
+
ResultCode: 'ERROR',
|
|
160
|
+
Message: this.buildFormErrorMessage('Get JotForm Submissions', errorMessage, error)
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
get Params() {
|
|
165
|
+
return [
|
|
166
|
+
{
|
|
167
|
+
Name: 'CompanyID',
|
|
168
|
+
Type: 'Input',
|
|
169
|
+
Value: null
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
Name: 'FormID',
|
|
173
|
+
Type: 'Input',
|
|
174
|
+
Value: null
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
Name: 'Region',
|
|
178
|
+
Type: 'Input',
|
|
179
|
+
Value: 'us'
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
Name: 'Limit',
|
|
183
|
+
Type: 'Input',
|
|
184
|
+
Value: 100
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
Name: 'Offset',
|
|
188
|
+
Type: 'Input',
|
|
189
|
+
Value: 0
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
Name: 'Filter',
|
|
193
|
+
Type: 'Input',
|
|
194
|
+
Value: null
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
Name: 'OrderBy',
|
|
198
|
+
Type: 'Input',
|
|
199
|
+
Value: null
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
Name: 'GetAllPages',
|
|
203
|
+
Type: 'Input',
|
|
204
|
+
Value: false
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
Name: 'MaxSubmissions',
|
|
208
|
+
Type: 'Input',
|
|
209
|
+
Value: 10000
|
|
210
|
+
}
|
|
211
|
+
];
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
exports.GetJotFormSubmissionsAction = GetJotFormSubmissionsAction;
|
|
215
|
+
exports.GetJotFormSubmissionsAction = GetJotFormSubmissionsAction = __decorate([
|
|
216
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, 'Get JotForm Submissions')
|
|
217
|
+
], GetJotFormSubmissionsAction);
|
|
218
|
+
//# sourceMappingURL=get-submissions.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-submissions.action.js","sourceRoot":"","sources":["../../../../src/providers/jotform/actions/get-submissions.action.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAuD;AACvD,gEAA2D;AAE3D,qDAAqD;AAGrD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEI,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,uCAAiB;IAE9D,IAAW,WAAW;QAClB,OAAO,+JAA+J,CAAC;IAC3K,CAAC;IAES,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,IAAI,CAAC;YACD,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;YACvC,IAAI,CAAC,WAAW,EAAE,CAAC;gBACf,OAAO;oBACH,OAAO,EAAE,KAAK;oBACd,UAAU,EAAE,sBAAsB;oBAClC,OAAO,EAAE,gDAAgD;iBAC5D,CAAC;YACN,CAAC;YAED,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;YAEjE,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YAC3D,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,OAAO;oBACH,OAAO,EAAE,KAAK;oBACd,UAA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,CAAC;IAED,IAAW,MAAM;QACb,OAAO;YACH;gBACI,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,IAAI;aACd;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,IAAI;aACd;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,IAAI;aACd;YACD;gBACI,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,GAAG;aACb;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,CAAC;aACX;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,IAAI;aACd;YACD;gBACI,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,IAAI;aACd;YACD;gBACI,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,KAAK;aACf;YACD;gBACI,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,KAAK;aACf;SACJ,CAAC;IACN,CAAC;CACJ,CAAA;AA1LY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,sBAAa,EAAC,oBAAU,EAAE,yBAAyB,CAAC;GACxC,2BAA2B,CA0LvC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './create-form.action';
|
|
2
|
+
export * from './get-form.action';
|
|
3
|
+
export * from './update-form.action';
|
|
4
|
+
export * from './get-submissions.action';
|
|
5
|
+
export * from './get-single-submission.action';
|
|
6
|
+
export * from './get-statistics.action';
|
|
7
|
+
export * from './export-csv.action';
|
|
8
|
+
export * from './watch-new-submissions.action';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/providers/jotform/actions/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// JotForm Form Actions
|
|
18
|
+
__exportStar(require("./create-form.action"), exports);
|
|
19
|
+
__exportStar(require("./get-form.action"), exports);
|
|
20
|
+
__exportStar(require("./update-form.action"), exports);
|
|
21
|
+
// JotForm Submission Actions
|
|
22
|
+
__exportStar(require("./get-submissions.action"), exports);
|
|
23
|
+
__exportStar(require("./get-single-submission.action"), exports);
|
|
24
|
+
__exportStar(require("./get-statistics.action"), exports);
|
|
25
|
+
__exportStar(require("./export-csv.action"), exports);
|
|
26
|
+
__exportStar(require("./watch-new-submissions.action"), exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/providers/jotform/actions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uBAAuB;AACvB,uDAAqC;AACrC,oDAAkC;AAClC,uDAAqC;AAErC,6BAA6B;AAC7B,2DAAyC;AACzC,iEAA+C;AAC/C,0DAAwC;AACxC,sDAAoC;AACpC,iEAA+C"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { JotFormBaseAction } from '../jotform-base.action';
|
|
2
|
+
import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
3
|
+
/**
|
|
4
|
+
* Action to update an existing JotForm
|
|
5
|
+
*
|
|
6
|
+
* IMPORTANT: JotForm uses separate endpoints for properties and questions.
|
|
7
|
+
* Use the MergeWithExisting parameter to safely update only specified properties
|
|
8
|
+
* while preserving existing ones.
|
|
9
|
+
*
|
|
10
|
+
* Security: API credentials are retrieved securely from Company Integrations
|
|
11
|
+
* instead of being passed as parameters.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* await runAction({
|
|
16
|
+
* ActionName: 'Update JotForm',
|
|
17
|
+
* Params: [{
|
|
18
|
+
* Name: 'CompanyID',
|
|
19
|
+
* Value: 'your-company-id'
|
|
20
|
+
* }, {
|
|
21
|
+
* Name: 'FormID',
|
|
22
|
+
* Value: '123456789'
|
|
23
|
+
* }, {
|
|
24
|
+
* Name: 'Title',
|
|
25
|
+
* Value: 'Updated Survey Title'
|
|
26
|
+
* }, {
|
|
27
|
+
* Name: 'MergeWithExisting',
|
|
28
|
+
* Value: true
|
|
29
|
+
* }]
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class UpdateJotFormAction extends JotFormBaseAction {
|
|
34
|
+
get Description(): string;
|
|
35
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
36
|
+
get Params(): ActionParam[];
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=update-form.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-form.action.d.ts","sourceRoot":"","sources":["../../../../src/providers/jotform/actions/update-form.action.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBACa,mBAAoB,SAAQ,iBAAiB;IAEtD,IAAW,WAAW,IAAI,MAAM,CAE/B;cAEe,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA4KvF,IAAW,MAAM,IAAI,WAAW,EAAE,CAsCjC;CACJ"}
|