Skip to content

Commit 8dc6a6e

Browse files
committed
Merge branch 'master' into 15629-notion-usability-audit
2 parents c83bc11 + 33f6217 commit 8dc6a6e

File tree

107 files changed

+3704
-627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+3704
-627
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import brillium from "../../brillium.app.mjs";
2+
3+
export default {
4+
key: "brillium-list-assessments",
5+
name: "List Assessments",
6+
description: "Retrieve all Assessments for a Brillium account. [See the documentation](https://support.brillium.com/en-us/knowledgebase/article/KA-01063)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
brillium,
11+
accountId: {
12+
propDefinition: [
13+
brillium,
14+
"accountId",
15+
],
16+
},
17+
page: {
18+
propDefinition: [
19+
brillium,
20+
"page",
21+
],
22+
},
23+
pageSize: {
24+
propDefinition: [
25+
brillium,
26+
"pageSize",
27+
],
28+
},
29+
},
30+
async run({ $ }) {
31+
try {
32+
const { Assessments: assessments } = await this.brillium.listAssessments({
33+
$,
34+
accountId: this.accountId,
35+
params: {
36+
page: this.page,
37+
pagesize: this.pageSize,
38+
},
39+
});
40+
if (assessments?.length) {
41+
$.export("$summary", `Successfully retrieved ${assessments.length} assessment${assessments.length === 1
42+
? ""
43+
: "s"}`);
44+
}
45+
return assessments;
46+
} catch {
47+
$.export("$summary", "No Assessments found");
48+
}
49+
},
50+
};
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import brillium from "../../brillium.app.mjs";
2+
3+
export default {
4+
key: "brillium-list-questions",
5+
name: "List Questions",
6+
description: "Retrieve all Questions for an Assessment. [See the documentation](https://support.brillium.com/en-us/knowledgebase/article/KA-01071)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
brillium,
11+
accountId: {
12+
propDefinition: [
13+
brillium,
14+
"accountId",
15+
],
16+
},
17+
assessmentId: {
18+
propDefinition: [
19+
brillium,
20+
"assessmentId",
21+
(c) => ({
22+
accountId: c.accountId,
23+
}),
24+
],
25+
},
26+
topicId: {
27+
propDefinition: [
28+
brillium,
29+
"topicId",
30+
(c) => ({
31+
assessmentId: c.assessmentId,
32+
}),
33+
],
34+
optional: true,
35+
},
36+
page: {
37+
propDefinition: [
38+
brillium,
39+
"page",
40+
],
41+
},
42+
pageSize: {
43+
propDefinition: [
44+
brillium,
45+
"pageSize",
46+
],
47+
},
48+
},
49+
async run({ $ }) {
50+
try {
51+
const params = {
52+
page: this.page,
53+
pagesize: this.pageSize,
54+
};
55+
const { Questions: questions } = this.topicId
56+
? await this.brillium.listTopicQuestions({
57+
$,
58+
topicId: this.topicId,
59+
params,
60+
})
61+
: await this.brillium.listQuestions({
62+
$,
63+
assessmentId: this.assessmentId,
64+
params,
65+
});
66+
if (questions?.length) {
67+
$.export("$summary", `Successfully retrieved ${questions.length} question${questions.length === 1
68+
? ""
69+
: "s"}`);
70+
}
71+
return questions;
72+
} catch {
73+
$.export("$summary", "No Questions found");
74+
}
75+
},
76+
};
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import brillium from "../../brillium.app.mjs";
2+
3+
export default {
4+
key: "brillium-list-respondent-results",
5+
name: "List Respondent Results",
6+
description: "Retrieves results for a respondent. [See the documentation](https://support.brillium.com/en-us/knowledgebase/article/KA-01073)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
brillium,
11+
accountId: {
12+
propDefinition: [
13+
brillium,
14+
"accountId",
15+
],
16+
},
17+
respondentId: {
18+
propDefinition: [
19+
brillium,
20+
"respondentId",
21+
(c) => ({
22+
accountId: c.accountId,
23+
}),
24+
],
25+
},
26+
page: {
27+
propDefinition: [
28+
brillium,
29+
"page",
30+
],
31+
},
32+
pageSize: {
33+
propDefinition: [
34+
brillium,
35+
"pageSize",
36+
],
37+
},
38+
},
39+
async run({ $ }) {
40+
try {
41+
const { Results: results } = await this.brillium.listRespondentResults({
42+
$,
43+
respondentId: this.respondentId,
44+
params: {
45+
page: this.page,
46+
pagesize: this.pageSize,
47+
},
48+
});
49+
if (results?.length) {
50+
$.export("$summary", `Successfully retrieved ${results.length} result${results.length === 1
51+
? ""
52+
: "s"}`);
53+
}
54+
return results;
55+
} catch {
56+
$.export("$summary", "No Results found");
57+
}
58+
},
59+
};
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import brillium from "../../brillium.app.mjs";
2+
3+
export default {
4+
key: "brillium-list-respondents",
5+
name: "List Respondents",
6+
description: "Retrieve all Respondents for a Brillium account. [See the documentation](https://support.brillium.com/en-us/knowledgebase/article/KA-01061)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
brillium,
11+
accountId: {
12+
propDefinition: [
13+
brillium,
14+
"accountId",
15+
],
16+
},
17+
assessmentId: {
18+
propDefinition: [
19+
brillium,
20+
"assessmentId",
21+
(c) => ({
22+
accountId: c.accountId,
23+
}),
24+
],
25+
optional: true,
26+
},
27+
page: {
28+
propDefinition: [
29+
brillium,
30+
"page",
31+
],
32+
},
33+
pageSize: {
34+
propDefinition: [
35+
brillium,
36+
"pageSize",
37+
],
38+
},
39+
},
40+
async run({ $ }) {
41+
try {
42+
const params = {
43+
page: this.page,
44+
pagesize: this.pageSize,
45+
};
46+
const { Respondents: respondents } = this.assessmentId
47+
? await this.brillium.listAssessmentRespondents({
48+
$,
49+
assessmentId: this.assessmentId,
50+
params,
51+
})
52+
: await this.brillium.listRespondents({
53+
$,
54+
accountId: this.accountId,
55+
params,
56+
});
57+
if (respondents?.length) {
58+
$.export("$summary", `Successfully retrieved ${respondents.length} respondent${respondents.length === 1
59+
? ""
60+
: "s"}`);
61+
}
62+
return respondents;
63+
} catch {
64+
$.export("$summary", "No Respondents found");
65+
}
66+
},
67+
};
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import brillium from "../../brillium.app.mjs";
2+
3+
export default {
4+
key: "brillium-list-topics",
5+
name: "List Topics",
6+
description: "Retrieve all Topics for an Assessment. [See the documentation](https://support.brillium.com/en-us/knowledgebase/article/KA-01063)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
brillium,
11+
accountId: {
12+
propDefinition: [
13+
brillium,
14+
"accountId",
15+
],
16+
},
17+
assessmentId: {
18+
propDefinition: [
19+
brillium,
20+
"assessmentId",
21+
(c) => ({
22+
accountId: c.accountId,
23+
}),
24+
],
25+
},
26+
page: {
27+
propDefinition: [
28+
brillium,
29+
"page",
30+
],
31+
},
32+
pageSize: {
33+
propDefinition: [
34+
brillium,
35+
"pageSize",
36+
],
37+
},
38+
},
39+
async run({ $ }) {
40+
try {
41+
const { QuestionGroups: topics } = await this.brillium.listTopics({
42+
$,
43+
assessmentId: this.assessmentId,
44+
params: {
45+
page: this.page,
46+
pagesize: this.pageSize,
47+
},
48+
});
49+
if (topics?.length) {
50+
$.export("$summary", `Successfully retrieved ${topics.length} topic${topics.length === 1
51+
? ""
52+
: "s"}`);
53+
}
54+
return topics;
55+
} catch {
56+
$.export("$summary", "No Topics found");
57+
}
58+
},
59+
};

0 commit comments

Comments
 (0)