Skip to content

Commit 8d48ea1

Browse files
author
Ana Escontrela
authored
dev: removes invitation script (#1112)
1 parent aa03172 commit 8d48ea1

File tree

11 files changed

+98
-832
lines changed

11 files changed

+98
-832
lines changed

apps/asap-cli/src/cli.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import yargs from 'yargs/yargs';
99
import * as importers from './import';
10-
import inviteUsersFactory from './invite';
1110

1211
// eslint-disable-next-line no-unused-expressions
1312
yargs(process.argv.slice(2))
@@ -28,29 +27,6 @@ yargs(process.argv.slice(2))
2827
handler: async ({ path, entity }) =>
2928
importers[entity as 'users' | 'protocols'](path as string),
3029
})
31-
.command({
32-
command: 'invite [Options]',
33-
describe: 'invite people to the ASAP Hub',
34-
builder: (cli) =>
35-
cli
36-
.positional('role', {
37-
describe: 'specify a role to invite (optional)',
38-
type: 'string',
39-
default: undefined,
40-
choices: ['Staff', 'Grantee', 'Guest'],
41-
})
42-
.option('reinvite', {
43-
alias: 'r',
44-
type: 'boolean',
45-
description:
46-
"flag to reinvite users that didn't complete the registration process",
47-
}),
48-
49-
handler: async ({ role, reinvite }) => {
50-
const inviteUsers = inviteUsersFactory();
51-
inviteUsers(role as string | undefined, Boolean(reinvite));
52-
},
53-
})
5430
.demandCommand(1)
5531
.help('h')
5632
.alias('h', 'help')

apps/asap-cli/src/invite/index.ts

Lines changed: 0 additions & 198 deletions
This file was deleted.

apps/asap-cli/src/invite/send-mail.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

apps/asap-cli/test/import/users.fixtures.ts

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { RestTeam } from '@asap-hub/squidex';
1+
import { RestTeam, RestUser } from '@asap-hub/squidex';
22

33
export const fetchTeamsResponse: { total: number; items: RestTeam[] } = {
44
total: 1,
@@ -17,3 +17,87 @@ export const fetchTeamsResponse: { total: number; items: RestTeam[] } = {
1717
},
1818
],
1919
};
20+
21+
export const fetchUsersResponse: { total: number; items: RestUser[] } = {
22+
total: 200,
23+
items: [
24+
{
25+
id: 'userId1',
26+
lastModified: '2020-09-25T11:06:27.164Z',
27+
created: '2020-09-24T11:06:27.164Z',
28+
data: {
29+
avatar: { iv: [] },
30+
lastModifiedDate: { iv: '2020-09-25T11:06:27.164Z' },
31+
email: { iv: '[email protected]' },
32+
firstName: { iv: 'First' },
33+
lastName: { iv: 'Last' },
34+
jobTitle: { iv: 'Title' },
35+
institution: { iv: 'Institution' },
36+
connections: { iv: [] },
37+
biography: { iv: 'Biography' },
38+
teams: { iv: [] },
39+
questions: { iv: [] },
40+
skills: { iv: [] },
41+
role: { iv: 'Grantee' },
42+
onboarded: {
43+
iv: true,
44+
},
45+
labs: { iv: [] },
46+
},
47+
},
48+
{
49+
id: 'userId2',
50+
lastModified: '2020-09-25T11:06:27.164Z',
51+
created: '2020-09-24T11:06:27.164Z',
52+
data: {
53+
avatar: { iv: [] },
54+
lastModifiedDate: { iv: '2020-09-25T11:06:27.164Z' },
55+
email: { iv: '[email protected]' },
56+
firstName: { iv: 'First' },
57+
lastName: { iv: 'Last' },
58+
jobTitle: { iv: 'Title' },
59+
institution: { iv: 'Institution' },
60+
connections: { iv: [] },
61+
biography: { iv: 'Biography' },
62+
questions: { iv: [{ question: 'Question?' }] },
63+
teams: { iv: [] },
64+
skills: { iv: [] },
65+
role: { iv: 'Grantee' },
66+
onboarded: {
67+
iv: true,
68+
},
69+
labs: { iv: [] },
70+
},
71+
},
72+
{
73+
id: 'userId3',
74+
lastModified: '2020-09-25T11:06:27.164Z',
75+
created: '2020-09-24T11:06:27.164Z',
76+
data: {
77+
avatar: { iv: [] },
78+
lastModifiedDate: { iv: '2020-09-25T11:06:27.164Z' },
79+
email: { iv: '[email protected]' },
80+
firstName: { iv: 'First' },
81+
lastName: { iv: 'Last' },
82+
jobTitle: { iv: 'Title' },
83+
institution: { iv: 'Institution' },
84+
connections: {
85+
iv: [
86+
{
87+
code: 'ALREADY_HAS_CODE',
88+
},
89+
],
90+
},
91+
biography: { iv: 'Biography' },
92+
questions: { iv: [{ question: 'Question?' }] },
93+
teams: { iv: [] },
94+
skills: { iv: [] },
95+
role: { iv: 'Grantee' },
96+
onboarded: {
97+
iv: true,
98+
},
99+
labs: { iv: [] },
100+
},
101+
},
102+
],
103+
};

apps/asap-cli/test/import/users.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { join } from 'path';
33
import { config } from '@asap-hub/squidex';
44
import { identity } from '../helpers/squidex';
55
import { users as importUsers } from '../../src/import';
6-
import { fetchUsersResponse } from '../invite.fixtures';
7-
import { fetchTeamsResponse } from './users.fixtures';
6+
import { fetchTeamsResponse, fetchUsersResponse } from './users.fixtures';
87

98
const body = {
109
email: {

0 commit comments

Comments
 (0)