@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,232 @@
|
|
|
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.UpdateJotFormAction = 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 update an existing JotForm
|
|
15
|
+
*
|
|
16
|
+
* IMPORTANT: JotForm uses separate endpoints for properties and questions.
|
|
17
|
+
* Use the MergeWithExisting parameter to safely update only specified properties
|
|
18
|
+
* while preserving existing ones.
|
|
19
|
+
*
|
|
20
|
+
* Security: API credentials are retrieved securely from Company Integrations
|
|
21
|
+
* instead of being passed as parameters.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* await runAction({
|
|
26
|
+
* ActionName: 'Update JotForm',
|
|
27
|
+
* Params: [{
|
|
28
|
+
* Name: 'CompanyID',
|
|
29
|
+
* Value: 'your-company-id'
|
|
30
|
+
* }, {
|
|
31
|
+
* Name: 'FormID',
|
|
32
|
+
* Value: '123456789'
|
|
33
|
+
* }, {
|
|
34
|
+
* Name: 'Title',
|
|
35
|
+
* Value: 'Updated Survey Title'
|
|
36
|
+
* }, {
|
|
37
|
+
* Name: 'MergeWithExisting',
|
|
38
|
+
* Value: true
|
|
39
|
+
* }]
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
let UpdateJotFormAction = class UpdateJotFormAction extends jotform_base_action_1.JotFormBaseAction {
|
|
44
|
+
get Description() {
|
|
45
|
+
return 'Updates an existing JotForm. Set MergeWithExisting=true (default) to safely update only specified properties while preserving others. Set to false to replace entire form data (not recommended).';
|
|
46
|
+
}
|
|
47
|
+
async InternalRunAction(params) {
|
|
48
|
+
try {
|
|
49
|
+
const contextUser = params.ContextUser;
|
|
50
|
+
if (!contextUser) {
|
|
51
|
+
return {
|
|
52
|
+
Success: false,
|
|
53
|
+
ResultCode: 'MISSING_CONTEXT_USER',
|
|
54
|
+
Message: 'Context user is required for JotForm API calls'
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
const companyId = this.getParamValue(params.Params, 'CompanyID');
|
|
58
|
+
const formId = this.getParamValue(params.Params, 'FormID');
|
|
59
|
+
if (!formId) {
|
|
60
|
+
return {
|
|
61
|
+
Success: false,
|
|
62
|
+
ResultCode: 'MISSING_FORM_ID',
|
|
63
|
+
Message: 'FormID parameter is required'
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const apiToken = await this.getSecureAPIToken(companyId, contextUser);
|
|
67
|
+
const mergeWithExisting = this.getParamValue(params.Params, 'MergeWithExisting') !== false;
|
|
68
|
+
const region = this.getParamValue(params.Params, 'Region');
|
|
69
|
+
const title = this.getParamValue(params.Params, 'Title');
|
|
70
|
+
const questions = this.getParamValue(params.Params, 'Questions');
|
|
71
|
+
const properties = this.getParamValue(params.Params, 'Properties');
|
|
72
|
+
// Check if any updates are provided
|
|
73
|
+
if (!title && !questions && !properties) {
|
|
74
|
+
return {
|
|
75
|
+
Success: false,
|
|
76
|
+
ResultCode: 'NO_CHANGES_PROVIDED',
|
|
77
|
+
Message: 'At least one of Title, Questions, or Properties must be provided'
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const updatedFields = [];
|
|
81
|
+
let existingForm = null;
|
|
82
|
+
// Get existing form if merging
|
|
83
|
+
if (mergeWithExisting) {
|
|
84
|
+
existingForm = await this.getJotFormDetails(formId, apiToken, region);
|
|
85
|
+
}
|
|
86
|
+
const axiosInstance = this.getAxiosInstance(apiToken, region);
|
|
87
|
+
// Update properties (including title)
|
|
88
|
+
if (title || properties) {
|
|
89
|
+
let propertiesToUpdate = {};
|
|
90
|
+
// Start with existing properties if merging
|
|
91
|
+
if (mergeWithExisting && existingForm?.properties) {
|
|
92
|
+
propertiesToUpdate = { ...existingForm.properties };
|
|
93
|
+
}
|
|
94
|
+
// Add title if provided
|
|
95
|
+
if (title) {
|
|
96
|
+
propertiesToUpdate.title = title;
|
|
97
|
+
updatedFields.push('title');
|
|
98
|
+
}
|
|
99
|
+
// Merge additional properties if provided
|
|
100
|
+
if (properties) {
|
|
101
|
+
const propsToMerge = typeof properties === 'string' ? JSON.parse(properties) : properties;
|
|
102
|
+
propertiesToUpdate = { ...propertiesToUpdate, ...propsToMerge };
|
|
103
|
+
updatedFields.push('properties');
|
|
104
|
+
}
|
|
105
|
+
// Update properties via PUT endpoint
|
|
106
|
+
await axiosInstance.put(`/form/${formId}/properties`, { properties: propertiesToUpdate });
|
|
107
|
+
}
|
|
108
|
+
// Update questions if provided
|
|
109
|
+
if (questions) {
|
|
110
|
+
let questionsToUpdate = Array.isArray(questions) ? questions :
|
|
111
|
+
typeof questions === 'string' ? JSON.parse(questions) : questions;
|
|
112
|
+
// If merging, get existing questions and merge
|
|
113
|
+
if (mergeWithExisting) {
|
|
114
|
+
const existingQuestions = await this.getJotFormQuestions(formId, apiToken, region);
|
|
115
|
+
// Merge questions by ID or order
|
|
116
|
+
const mergedQuestions = { ...existingQuestions };
|
|
117
|
+
if (Array.isArray(questionsToUpdate)) {
|
|
118
|
+
// If questions array is provided, update by index/ID
|
|
119
|
+
questionsToUpdate.forEach((question, index) => {
|
|
120
|
+
const questionId = question.qid || Object.keys(existingQuestions)[index];
|
|
121
|
+
if (questionId) {
|
|
122
|
+
mergedQuestions[questionId] = { ...mergedQuestions[questionId], ...question };
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
// If questions object is provided, merge directly
|
|
128
|
+
Object.assign(mergedQuestions, questionsToUpdate);
|
|
129
|
+
}
|
|
130
|
+
questionsToUpdate = mergedQuestions;
|
|
131
|
+
}
|
|
132
|
+
// Update questions via POST endpoint
|
|
133
|
+
await axiosInstance.post(`/form/${formId}/questions`, { questions: questionsToUpdate });
|
|
134
|
+
updatedFields.push('questions');
|
|
135
|
+
}
|
|
136
|
+
// Get updated form details
|
|
137
|
+
const updatedForm = await this.getJotFormDetails(formId, apiToken, region);
|
|
138
|
+
// Construct form URL
|
|
139
|
+
const formUrl = updatedForm.url || `https://form.jotform.com/${formId}`;
|
|
140
|
+
// Build output parameters
|
|
141
|
+
const outputParams = [
|
|
142
|
+
{
|
|
143
|
+
Name: 'FormID',
|
|
144
|
+
Type: 'Output',
|
|
145
|
+
Value: formId
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
Name: 'FormURL',
|
|
149
|
+
Type: 'Output',
|
|
150
|
+
Value: formUrl
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
Name: 'UpdatedFields',
|
|
154
|
+
Type: 'Output',
|
|
155
|
+
Value: updatedFields
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
Name: 'FormDetails',
|
|
159
|
+
Type: 'Output',
|
|
160
|
+
Value: updatedForm
|
|
161
|
+
}
|
|
162
|
+
];
|
|
163
|
+
// Add output params to result
|
|
164
|
+
for (const outputParam of outputParams) {
|
|
165
|
+
const existingParam = params.Params.find(p => p.Name === outputParam.Name);
|
|
166
|
+
if (existingParam) {
|
|
167
|
+
existingParam.Value = outputParam.Value;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
params.Params.push(outputParam);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
Success: true,
|
|
175
|
+
ResultCode: 'SUCCESS',
|
|
176
|
+
Message: `Successfully updated JotForm "${updatedForm.title || formId}". Updated fields: ${updatedFields.join(', ')}`
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
catch (error) {
|
|
180
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
181
|
+
return {
|
|
182
|
+
Success: false,
|
|
183
|
+
ResultCode: 'ERROR',
|
|
184
|
+
Message: this.buildFormErrorMessage('Update JotForm', errorMessage, error)
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
get Params() {
|
|
189
|
+
return [
|
|
190
|
+
{
|
|
191
|
+
Name: 'CompanyID',
|
|
192
|
+
Type: 'Input',
|
|
193
|
+
Value: null
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
Name: 'FormID',
|
|
197
|
+
Type: 'Input',
|
|
198
|
+
Value: null
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
Name: 'MergeWithExisting',
|
|
202
|
+
Type: 'Input',
|
|
203
|
+
Value: true
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
Name: 'Title',
|
|
207
|
+
Type: 'Input',
|
|
208
|
+
Value: null
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
Name: 'Questions',
|
|
212
|
+
Type: 'Input',
|
|
213
|
+
Value: null
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
Name: 'Properties',
|
|
217
|
+
Type: 'Input',
|
|
218
|
+
Value: null
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
Name: 'Region',
|
|
222
|
+
Type: 'Input',
|
|
223
|
+
Value: 'us'
|
|
224
|
+
}
|
|
225
|
+
];
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
exports.UpdateJotFormAction = UpdateJotFormAction;
|
|
229
|
+
exports.UpdateJotFormAction = UpdateJotFormAction = __decorate([
|
|
230
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, 'Update JotForm')
|
|
231
|
+
], UpdateJotFormAction);
|
|
232
|
+
//# sourceMappingURL=update-form.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-form.action.js","sourceRoot":"","sources":["../../../../src/providers/jotform/actions/update-form.action.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAuD;AACvD,gEAA2D;AAE3D,qDAAqD;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mB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@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { JotFormBaseAction } from '../jotform-base.action';
|
|
2
|
+
import { ActionParam, ActionResultSimple, RunActionParams } from '@memberjunction/actions-base';
|
|
3
|
+
/**
|
|
4
|
+
* Action to watch for new JotForm submissions since last check
|
|
5
|
+
* Useful for workflow automation and real-time notifications
|
|
6
|
+
*
|
|
7
|
+
* Security: API credentials are retrieved securely from Company Integrations
|
|
8
|
+
* instead of being passed as parameters.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* await runAction({
|
|
13
|
+
* ActionName: 'Watch for New JotForm Submissions',
|
|
14
|
+
* Params: [{
|
|
15
|
+
* Name: 'CompanyID',
|
|
16
|
+
* Value: 'your-company-id'
|
|
17
|
+
* }, {
|
|
18
|
+
* Name: 'FormID',
|
|
19
|
+
* Value: '123456789'
|
|
20
|
+
* }, {
|
|
21
|
+
* Name: 'LastCheckedTimestamp',
|
|
22
|
+
* Value: '2024-01-01T12:00:00Z'
|
|
23
|
+
* }]
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class WatchNewJotFormSubmissionsAction extends JotFormBaseAction {
|
|
28
|
+
get Description(): string;
|
|
29
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
30
|
+
get Params(): ActionParam[];
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=watch-new-submissions.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-new-submissions.action.d.ts","sourceRoot":"","sources":["../../../../src/providers/jotform/actions/watch-new-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;AAGhG;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBACa,gCAAiC,SAAQ,iBAAiB;IAEnE,IAAW,WAAW,IAAI,MAAM,CAE/B;cAEe,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkKvF,IAAW,MAAM,IAAI,WAAW,EAAE,CAsCjC;CACJ"}
|
|
@@ -0,0 +1,229 @@
|
|
|
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.WatchNewJotFormSubmissionsAction = 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 watch for new JotForm submissions since last check
|
|
15
|
+
* Useful for workflow automation and real-time notifications
|
|
16
|
+
*
|
|
17
|
+
* Security: API credentials are retrieved securely from Company Integrations
|
|
18
|
+
* instead of being passed as parameters.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* await runAction({
|
|
23
|
+
* ActionName: 'Watch for New JotForm Submissions',
|
|
24
|
+
* Params: [{
|
|
25
|
+
* Name: 'CompanyID',
|
|
26
|
+
* Value: 'your-company-id'
|
|
27
|
+
* }, {
|
|
28
|
+
* Name: 'FormID',
|
|
29
|
+
* Value: '123456789'
|
|
30
|
+
* }, {
|
|
31
|
+
* Name: 'LastCheckedTimestamp',
|
|
32
|
+
* Value: '2024-01-01T12:00:00Z'
|
|
33
|
+
* }]
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
let WatchNewJotFormSubmissionsAction = class WatchNewJotFormSubmissionsAction extends jotform_base_action_1.JotFormBaseAction {
|
|
38
|
+
get Description() {
|
|
39
|
+
return 'Polls JotForm for new submissions since the last check. Returns only new submissions and updates the last checked timestamp. Perfect for triggering workflows, sending notifications, or syncing data to other systems.';
|
|
40
|
+
}
|
|
41
|
+
async InternalRunAction(params) {
|
|
42
|
+
try {
|
|
43
|
+
const contextUser = params.ContextUser;
|
|
44
|
+
if (!contextUser) {
|
|
45
|
+
return {
|
|
46
|
+
Success: false,
|
|
47
|
+
ResultCode: 'MISSING_CONTEXT_USER',
|
|
48
|
+
Message: 'Context user is required for JotForm API calls'
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const companyId = this.getParamValue(params.Params, 'CompanyID');
|
|
52
|
+
const formId = this.getParamValue(params.Params, 'FormID');
|
|
53
|
+
if (!formId) {
|
|
54
|
+
return {
|
|
55
|
+
Success: false,
|
|
56
|
+
ResultCode: 'MISSING_FORM_ID',
|
|
57
|
+
Message: 'FormID parameter is required'
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const apiToken = await this.getSecureAPIToken(companyId, contextUser);
|
|
61
|
+
let lastChecked = this.getParamValue(params.Params, 'LastCheckedTimestamp');
|
|
62
|
+
const onlyCompleted = this.getParamValue(params.Params, 'OnlyCompleted') === true;
|
|
63
|
+
const region = this.getParamValue(params.Params, 'Region');
|
|
64
|
+
const maxSubmissions = this.getParamValue(params.Params, 'MaxSubmissions') || 1000;
|
|
65
|
+
if (!lastChecked) {
|
|
66
|
+
const defaultLookback = this.getParamValue(params.Params, 'DefaultLookbackMinutes') || 60;
|
|
67
|
+
const lookbackDate = new Date();
|
|
68
|
+
lookbackDate.setMinutes(lookbackDate.getMinutes() - defaultLookback);
|
|
69
|
+
lastChecked = lookbackDate.toISOString();
|
|
70
|
+
}
|
|
71
|
+
const currentTimestamp = new Date().toISOString();
|
|
72
|
+
// Build filter for JotForm API
|
|
73
|
+
// JotForm uses created_at field with "gt:" prefix for greater than
|
|
74
|
+
const filter = {
|
|
75
|
+
created_at: `gt:${lastChecked}`
|
|
76
|
+
};
|
|
77
|
+
if (onlyCompleted) {
|
|
78
|
+
filter.status = 'ACTIVE';
|
|
79
|
+
}
|
|
80
|
+
const jfSubmissions = await this.getAllJotFormSubmissions(formId, apiToken, {
|
|
81
|
+
filter,
|
|
82
|
+
orderby: 'created_at',
|
|
83
|
+
maxSubmissions,
|
|
84
|
+
region
|
|
85
|
+
});
|
|
86
|
+
const newSubmissions = jfSubmissions.map(s => this.normalizeJotFormSubmission(s));
|
|
87
|
+
const completedCount = newSubmissions.filter(s => s.completed).length;
|
|
88
|
+
const partialCount = newSubmissions.filter(s => !s.completed).length;
|
|
89
|
+
// Group submissions by field type for analysis
|
|
90
|
+
const submissionsByType = {};
|
|
91
|
+
if (newSubmissions.length > 0) {
|
|
92
|
+
const firstSubmission = newSubmissions[0];
|
|
93
|
+
for (const answer of firstSubmission.answers) {
|
|
94
|
+
submissionsByType[answer.fieldType] = [];
|
|
95
|
+
}
|
|
96
|
+
for (const submission of newSubmissions) {
|
|
97
|
+
for (const answer of submission.answers) {
|
|
98
|
+
if (!submissionsByType[answer.fieldType]) {
|
|
99
|
+
submissionsByType[answer.fieldType] = [];
|
|
100
|
+
}
|
|
101
|
+
submissionsByType[answer.fieldType].push({
|
|
102
|
+
submissionId: submission.responseId,
|
|
103
|
+
question: answer.question,
|
|
104
|
+
answer: answer.answer,
|
|
105
|
+
submittedAt: submission.submittedAt
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const emails = this.extractEmailFromResponses(newSubmissions);
|
|
111
|
+
const outputParams = [
|
|
112
|
+
{
|
|
113
|
+
Name: 'NewSubmissions',
|
|
114
|
+
Type: 'Output',
|
|
115
|
+
Value: newSubmissions
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
Name: 'Count',
|
|
119
|
+
Type: 'Output',
|
|
120
|
+
Value: newSubmissions.length
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
Name: 'CompletedCount',
|
|
124
|
+
Type: 'Output',
|
|
125
|
+
Value: completedCount
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
Name: 'PartialCount',
|
|
129
|
+
Type: 'Output',
|
|
130
|
+
Value: partialCount
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
Name: 'LastChecked',
|
|
134
|
+
Type: 'Output',
|
|
135
|
+
Value: currentTimestamp
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
Name: 'PreviouslyChecked',
|
|
139
|
+
Type: 'Output',
|
|
140
|
+
Value: lastChecked
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
Name: 'SubmissionsByType',
|
|
144
|
+
Type: 'Output',
|
|
145
|
+
Value: submissionsByType
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
Name: 'ExtractedEmails',
|
|
149
|
+
Type: 'Output',
|
|
150
|
+
Value: emails
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
Name: 'HasNewSubmissions',
|
|
154
|
+
Type: 'Output',
|
|
155
|
+
Value: newSubmissions.length > 0
|
|
156
|
+
}
|
|
157
|
+
];
|
|
158
|
+
for (const outputParam of outputParams) {
|
|
159
|
+
const existingParam = params.Params.find(p => p.Name === outputParam.Name);
|
|
160
|
+
if (existingParam) {
|
|
161
|
+
existingParam.Value = outputParam.Value;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
params.Params.push(outputParam);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const message = newSubmissions.length > 0
|
|
168
|
+
? `Found ${newSubmissions.length} new submissions (${completedCount} completed, ${partialCount} partial) since ${new Date(lastChecked).toLocaleString()}`
|
|
169
|
+
: `No new submissions since ${new Date(lastChecked).toLocaleString()}`;
|
|
170
|
+
return {
|
|
171
|
+
Success: true,
|
|
172
|
+
ResultCode: newSubmissions.length > 0 ? 'NEW_SUBMISSIONS' : 'NO_NEW_SUBMISSIONS',
|
|
173
|
+
Message: message
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
178
|
+
return {
|
|
179
|
+
Success: false,
|
|
180
|
+
ResultCode: 'ERROR',
|
|
181
|
+
Message: this.buildFormErrorMessage('Watch New JotForm Submissions', errorMessage, error)
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
get Params() {
|
|
186
|
+
return [
|
|
187
|
+
{
|
|
188
|
+
Name: 'CompanyID',
|
|
189
|
+
Type: 'Input',
|
|
190
|
+
Value: null
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
Name: 'FormID',
|
|
194
|
+
Type: 'Input',
|
|
195
|
+
Value: null
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
Name: 'LastCheckedTimestamp',
|
|
199
|
+
Type: 'Input',
|
|
200
|
+
Value: null
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
Name: 'DefaultLookbackMinutes',
|
|
204
|
+
Type: 'Input',
|
|
205
|
+
Value: 60
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
Name: 'OnlyCompleted',
|
|
209
|
+
Type: 'Input',
|
|
210
|
+
Value: false
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
Name: 'Region',
|
|
214
|
+
Type: 'Input',
|
|
215
|
+
Value: 'us'
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
Name: 'MaxSubmissions',
|
|
219
|
+
Type: 'Input',
|
|
220
|
+
Value: 1000
|
|
221
|
+
}
|
|
222
|
+
];
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
exports.WatchNewJotFormSubmissionsAction = WatchNewJotFormSubmissionsAction;
|
|
226
|
+
exports.WatchNewJotFormSubmissionsAction = WatchNewJotFormSubmissionsAction = __decorate([
|
|
227
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, 'Watch for New JotForm Submissions')
|
|
228
|
+
], WatchNewJotFormSubmissionsAction);
|
|
229
|
+
//# sourceMappingURL=watch-new-submissions.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-new-submissions.action.js","sourceRoot":"","sources":["../../../../src/providers/jotform/actions/watch-new-submissions.action.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mDAAuD;AACvD,gEAA2D;AAE3D,qDAAqD;AAErD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEI,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,uCAAiB;IAEnE,IAAW,WAAW;QAClB,OAAO,yNAAyN,CAAC;IACrO,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,UAAU,EAAE,iBAAiB;oBAC7B,OAAO,EAAE,8BAA8B;iBAC1C,CAAC;YACN,CAAC;YAED,M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I,EAAE,eAAe;gBACrB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,KAAK;aACf;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,IAAI;aACd;SACJ,CAAC;IACN,CAAC;CACJ,CAAA;AA/MY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,sBAAa,EAAC,oBAAU,EAAE,mCAAmC,CAAC;GAClD,gCAAgC,CA+M5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/jotform/index.ts"],"names":[],"mappings":"AACA,cAAc,uBAAuB,CAAC;AAGtC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
// Base JotForm Action
|
|
18
|
+
__exportStar(require("./jotform-base.action"), exports);
|
|
19
|
+
// All JotForm Actions
|
|
20
|
+
__exportStar(require("./actions"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/jotform/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sBAAsB;AACtB,wDAAsC;AAEtC,sBAAsB;AACtB,4CAA0B"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { BaseFormBuilderAction, FormResponse } from '../../base/base-form-builder.action';
|
|
2
|
+
import { AxiosInstance } from 'axios';
|
|
3
|
+
/**
|
|
4
|
+
* JotForm API response structures
|
|
5
|
+
*/
|
|
6
|
+
export interface JotFormSubmission {
|
|
7
|
+
id: string;
|
|
8
|
+
form_id: string;
|
|
9
|
+
ip: string;
|
|
10
|
+
created_at: string;
|
|
11
|
+
status: string;
|
|
12
|
+
new: string;
|
|
13
|
+
flag: string;
|
|
14
|
+
answers: Record<string, {
|
|
15
|
+
name: string;
|
|
16
|
+
order: string;
|
|
17
|
+
text: string;
|
|
18
|
+
type: string;
|
|
19
|
+
answer?: string | string[];
|
|
20
|
+
prettyFormat?: string;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
export interface JotFormSubmissionsResult {
|
|
24
|
+
responseCode: number;
|
|
25
|
+
message: string;
|
|
26
|
+
content: JotFormSubmission[];
|
|
27
|
+
limit: number;
|
|
28
|
+
offset: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Base class for all JotForm actions.
|
|
32
|
+
* Handles JotForm-specific authentication and API interaction patterns.
|
|
33
|
+
*/
|
|
34
|
+
export declare abstract class JotFormBaseAction extends BaseFormBuilderAction {
|
|
35
|
+
protected get formPlatform(): string;
|
|
36
|
+
protected get integrationName(): string;
|
|
37
|
+
protected get apiBaseUrl(): string;
|
|
38
|
+
private axiosInstance;
|
|
39
|
+
private currentAPIKey;
|
|
40
|
+
/**
|
|
41
|
+
* Get axios instance with JotForm authentication
|
|
42
|
+
*/
|
|
43
|
+
protected getAxiosInstance(apiKey: string, region?: 'us' | 'eu' | 'hipaa'): AxiosInstance;
|
|
44
|
+
/**
|
|
45
|
+
* Get regional base URL
|
|
46
|
+
*/
|
|
47
|
+
protected getRegionalBaseUrl(region?: 'us' | 'eu' | 'hipaa'): string;
|
|
48
|
+
/**
|
|
49
|
+
* Get submissions from a JotForm
|
|
50
|
+
*/
|
|
51
|
+
protected getJotFormSubmissions(formId: string, apiKey: string, options?: {
|
|
52
|
+
limit?: number;
|
|
53
|
+
offset?: number;
|
|
54
|
+
filter?: Record<string, string>;
|
|
55
|
+
orderby?: string;
|
|
56
|
+
region?: 'us' | 'eu' | 'hipaa';
|
|
57
|
+
}): Promise<JotFormSubmissionsResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Get all submissions with automatic pagination
|
|
60
|
+
*/
|
|
61
|
+
protected getAllJotFormSubmissions(formId: string, apiKey: string, options?: {
|
|
62
|
+
filter?: Record<string, string>;
|
|
63
|
+
orderby?: string;
|
|
64
|
+
maxSubmissions?: number;
|
|
65
|
+
region?: 'us' | 'eu' | 'hipaa';
|
|
66
|
+
}): Promise<JotFormSubmission[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Get a single submission by ID
|
|
69
|
+
*/
|
|
70
|
+
protected getSingleJotFormSubmission(submissionId: string, apiKey: string, region?: 'us' | 'eu' | 'hipaa'): Promise<JotFormSubmission>;
|
|
71
|
+
/**
|
|
72
|
+
* Get form details
|
|
73
|
+
*/
|
|
74
|
+
protected getJotFormDetails(formId: string, apiKey: string, region?: 'us' | 'eu' | 'hipaa'): Promise<any>;
|
|
75
|
+
/**
|
|
76
|
+
* Get form questions/fields
|
|
77
|
+
*/
|
|
78
|
+
protected getJotFormQuestions(formId: string, apiKey: string, region?: 'us' | 'eu' | 'hipaa'): Promise<any>;
|
|
79
|
+
/**
|
|
80
|
+
* Create a new submission
|
|
81
|
+
*/
|
|
82
|
+
protected createJotFormSubmission(formId: string, apiKey: string, submissionData: Record<string, any>, region?: 'us' | 'eu' | 'hipaa'): Promise<any>;
|
|
83
|
+
/**
|
|
84
|
+
* Normalize JotForm submission to common format
|
|
85
|
+
*/
|
|
86
|
+
protected normalizeJotFormSubmission(jfSubmission: JotFormSubmission): FormResponse;
|
|
87
|
+
/**
|
|
88
|
+
* Handle JotForm-specific errors
|
|
89
|
+
*/
|
|
90
|
+
protected handleJotFormError(error: any): Error;
|
|
91
|
+
/**
|
|
92
|
+
* Sleep helper for rate limiting
|
|
93
|
+
*/
|
|
94
|
+
protected sleep(ms: number): Promise<void>;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=jotform-base.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jotform-base.action.d.ts","sourceRoot":"","sources":["../../../src/providers/jotform/jotform-base.action.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAc,MAAM,qCAAqC,CAAC;AAEtG,OAAc,EAAE,aAAa,EAAc,MAAM,OAAO,CAAC;AAGzD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC,CAAC;CACN;AAED,MAAM,WAAW,wBAAwB;IACrC,YAAY,E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