Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import app from "../../survicate.app.mjs";

export default {
key: "survicate-delete-personal-data",
name: "Delete Personal Data",
description: "Deletes personal data associated with an email address for GDPR compliance. [See the documentation](https://developers.survicate.com/data-export/personal-data/)",
version: "0.0.1",
type: "action",
annotations: {
readOnlyHint: false,
destructiveHint: true,
openWorldHint: true,
},
props: {
app,
email: {
type: "string",
label: "Email",
description: "The email address for which to delete all associated data. The search is case-insensitive and handles whitespace.",
},
},
async run({ $ }) {
const {
app,
email,
} = this;

const response = await app.deletePersonalData({
$,
params: {
email,
},
});

$.export("$summary", "Successfully deleted personal data");
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import app from "../../survicate.app.mjs";

export default {
key: "survicate-get-personal-data-counters",
name: "Get Personal Data Counters",
description: "Retrieves counts of personal data records for GDPR compliance. [See the documentation](https://developers.survicate.com/data-export/personal-data/)",
version: "0.0.1",
type: "action",
annotations: {
readOnlyHint: true,
destructiveHint: false,
openWorldHint: true,
},
props: {
app,
email: {
type: "string",
label: "Email",
description: "The email address to search for across all data sources. The search is case-insensitive and handles whitespace.",
},
},
async run({ $ }) {
const {
app,
email,
} = this;

const response = await app.getPersonalDataCounters({
$,
params: {
email,
},
});

$.export("$summary", "Successfully retrieved personal data counters");
return response;
},
};
48 changes: 48 additions & 0 deletions components/survicate/actions/get-response/get-response.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import app from "../../survicate.app.mjs";

export default {
key: "survicate-get-response",
name: "Get Response",
description: "Retrieves detailed information about a specific response. [See the documentation](https://developers.survicate.com/data-export/response/)",
version: "0.0.1",
type: "action",
annotations: {
readOnlyHint: true,
destructiveHint: false,
openWorldHint: true,
},
props: {
app,
surveyId: {
propDefinition: [
app,
"surveyId",
],
},
responseId: {
propDefinition: [
app,
"responseId",
({ surveyId }) => ({
surveyId,
}),
],
},
},
async run({ $ }) {
const {
app,
surveyId,
responseId,
} = this;

const response = await app.getResponse({
$,
surveyId,
responseId,
});

$.export("$summary", `Successfully retrieved response with UUID \`${response.uuid}\``);
return response;
},
};
37 changes: 37 additions & 0 deletions components/survicate/actions/get-survey/get-survey.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import app from "../../survicate.app.mjs";

export default {
key: "survicate-get-survey",
name: "Get Survey",
description: "Retrieves detailed information about a specific survey. [See the documentation](https://developers.survicate.com/data-export/survey/)",
version: "0.0.1",
type: "action",
annotations: {
readOnlyHint: true,
destructiveHint: false,
openWorldHint: true,
},
props: {
app,
surveyId: {
propDefinition: [
app,
"surveyId",
],
},
},
async run({ $ }) {
const {
app,
surveyId,
} = this;

const response = await app.getSurvey({
$,
surveyId,
});

$.export("$summary", `Successfully retrieved survey with ID \`${response.id}\``);
return response;
},
};
56 changes: 56 additions & 0 deletions components/survicate/actions/list-questions/list-questions.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import app from "../../survicate.app.mjs";

export default {
key: "survicate-list-questions",
name: "List Questions",
description: "Retrieves a list of questions for a specific survey. [See the documentation](https://developers.survicate.com/data-export/survey/)",
version: "0.0.1",
type: "action",
annotations: {
readOnlyHint: true,
destructiveHint: false,
openWorldHint: true,
},
props: {
app,
surveyId: {
propDefinition: [
app,
"surveyId",
],
},
itemsPerPage: {
propDefinition: [
app,
"itemsPerPage",
],
},
start: {
description: "The unique identifier of the question, used to return paginated results. This identifier is included in the response for each request, as part of the `next_url` parameter.",
propDefinition: [
app,
"start",
],
},
},
async run({ $ }) {
const {
app,
surveyId,
itemsPerPage,
start,
} = this;

const response = await app.listQuestions({
$,
surveyId,
params: {
items_per_page: itemsPerPage,
start,
},
});

$.export("$summary", `Successfully retrieved \`${response.data?.length}\` question(s)`);
return response.data;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import app from "../../survicate.app.mjs";

export default {
key: "survicate-list-respondent-attributes",
name: "List Respondent Attributes",
description: "Retrieves the names and values of custom attributes associated with a specific respondent, which have been passed to Survicate through the JavaScript API, integrations, or embedded within the survey link. [See the documentation](https://developers.survicate.com/data-export/respondent/)",
version: "0.0.1",
type: "action",
annotations: {
readOnlyHint: true,
destructiveHint: false,
openWorldHint: true,
},
props: {
app,
respondentUuid: {
propDefinition: [
app,
"respondentUuid",
],
},
itemsPerPage: {
propDefinition: [
app,
"itemsPerPage",
],
},
start: {
description: "The unique identifier of the attribute, used to return paginated results. This identifier is included in the response for each request, as part of the `next_url` parameter.",
propDefinition: [
app,
"start",
],
},
},
async run({ $ }) {
const {
app,
respondentUuid,
itemsPerPage,
start,
} = this;

const response = await app.listRespondentAttributes({
$,
respondentUuid,
params: {
items_per_page: itemsPerPage,
start,
},
});

$.export("$summary", `Successfully retrieved \`${response.data?.length}\` attribute(s) for respondent with UUID \`${respondentUuid}\``);
return response.data;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import app from "../../survicate.app.mjs";

export default {
key: "survicate-list-respondent-responses",
name: "List Respondent Responses",
description: "Retrieves a list of survey responses provided by a specific respondent identified by their unique identifier (UUID). [See the documentation](https://developers.survicate.com/data-export/respondent/)",
version: "0.0.1",
type: "action",
annotations: {
readOnlyHint: true,
destructiveHint: false,
openWorldHint: true,
},
props: {
app,
respondentUuid: {
propDefinition: [
app,
"respondentUuid",
],
},
itemsPerPage: {
propDefinition: [
app,
"itemsPerPage",
],
},
start: {
description: "Optional start timestamp for filtering responses. Responses collected before this timestamp will be included. Format: ISO 8601 with microseconds (e.g., `2023-01-01T00:00:00.000000Z`).",
propDefinition: [
app,
"start",
],
},
},
async run({ $ }) {
const {
app,
respondentUuid,
itemsPerPage,
start,
} = this;

const response = await app.listRespondentResponses({
$,
respondentUuid,
params: {
items_per_page: itemsPerPage,
start,
},
});

$.export("$summary", `Successfully retrieved \`${response.data?.length}\` response(s) for respondent with UUID \`${respondentUuid}\``);
return response.data;
},
};
Loading
Loading