@appsemble/cli 0.38.2-test.0 → 0.39.0

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/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.38.2-test.0/config/assets/logo.svg) Appsemble CLI
1
+ # ![](https://gitlab.com/appsemble/appsemble/-/raw/0.39.0/config/assets/logo.svg) Appsemble CLI
2
2
 
3
3
  > Manage apps and blocks from the command line.
4
4
 
5
5
  [![npm](https://img.shields.io/npm/v/@appsemble/cli)](https://www.npmjs.com/package/@appsemble/cli)
6
- [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.38.2-test.0/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.38.2-test.0)
6
+ [![GitLab CI](https://gitlab.com/appsemble/appsemble/badges/0.39.0/pipeline.svg)](https://gitlab.com/appsemble/appsemble/-/releases/0.39.0)
7
7
  [![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://prettier.io)
8
8
 
9
9
  ## Table of Contents
@@ -342,5 +342,5 @@ appsemble run-cronjobs --interval 30
342
342
 
343
343
  ## License
344
344
 
345
- [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.38.2-test.0/LICENSE.md) ©
345
+ [LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.39.0/LICENSE.md) ©
346
346
  [Appsemble](https://appsemble.com)
@@ -1,4 +1,5 @@
1
1
  import * as create from './create.js';
2
+ import * as member from './member/index.js';
2
3
  import * as update from './update.js';
3
4
  import * as upsert from './upsert.js';
4
5
  export { noop as handler } from '@appsemble/utils';
@@ -7,6 +8,7 @@ export const description = 'Commands related to organizations.';
7
8
  export function builder(yargs) {
8
9
  return yargs
9
10
  .command(create)
11
+ .command(member)
10
12
  .command(update)
11
13
  .command(upsert)
12
14
  .demandCommand(1);
@@ -0,0 +1,12 @@
1
+ import { type Argv } from 'yargs';
2
+ import { type BaseArguments } from '../../../types.js';
3
+ interface AddOrganizationMemberArguments extends BaseArguments {
4
+ email: string;
5
+ id: string;
6
+ role: string;
7
+ }
8
+ export declare const command = "add <email>";
9
+ export declare const description = "Add an existing Appsemble account to an organization.";
10
+ export declare function builder(yargs: Argv): Argv<any>;
11
+ export declare function handler({ clientCredentials, email, id, remote, role, }: AddOrganizationMemberArguments): Promise<void>;
12
+ export {};
@@ -0,0 +1,25 @@
1
+ import { authenticate } from '@appsemble/node-utils';
2
+ import { PredefinedOrganizationRole, predefinedOrganizationRoles } from '@appsemble/types';
3
+ import { addOrganizationMember } from '../../../lib/organization.js';
4
+ export const command = 'add <email>';
5
+ export const description = 'Add an existing Appsemble account to an organization.';
6
+ export function builder(yargs) {
7
+ return yargs
8
+ .positional('email', {
9
+ describe: 'The email address of the account to add',
10
+ })
11
+ .option('id', {
12
+ describe: 'The id of the organization to add the account to',
13
+ demandOption: true,
14
+ })
15
+ .option('role', {
16
+ describe: 'The organization role to assign to the new member',
17
+ choices: predefinedOrganizationRoles,
18
+ default: PredefinedOrganizationRole.Member,
19
+ });
20
+ }
21
+ export async function handler({ clientCredentials, email, id, remote, role, }) {
22
+ await authenticate(remote, 'organizations:write', clientCredentials);
23
+ await addOrganizationMember({ email, id, role });
24
+ }
25
+ //# sourceMappingURL=add.js.map
@@ -0,0 +1,5 @@
1
+ import { type Argv } from 'yargs';
2
+ export { noop as handler } from '@appsemble/utils';
3
+ export declare const command = "member";
4
+ export declare const description = "Commands related to organization members.";
5
+ export declare function builder(yargs: Argv): Argv;
@@ -0,0 +1,8 @@
1
+ import * as add from './add.js';
2
+ export { noop as handler } from '@appsemble/utils';
3
+ export const command = 'member';
4
+ export const description = 'Commands related to organization members.';
5
+ export function builder(yargs) {
6
+ return yargs.command(add).demandCommand(1);
7
+ }
8
+ //# sourceMappingURL=index.js.map
@@ -18,4 +18,19 @@ interface OrganizationArguments {
18
18
  export declare function createOrganization({ city, countryCode, description, email, houseNumber, icon, id, invoiceReference, locale, name, streetName, vatIdNumber, website, zipCode, }: OrganizationArguments): Promise<void>;
19
19
  export declare function updateOrganization({ city, countryCode, description, email, houseNumber, icon, id, invoiceReference, locale, name, streetName, vatIdNumber, website, zipCode, }: OrganizationArguments): Promise<void>;
20
20
  export declare function upsertOrganization({ city, countryCode, description, email, houseNumber, icon, id, invoiceReference, locale, name, streetName, vatIdNumber, website, zipCode, }: OrganizationArguments): Promise<void>;
21
+ interface AddOrganizationMemberArguments {
22
+ /**
23
+ * The id of the organization to add the member to.
24
+ */
25
+ id: string;
26
+ /**
27
+ * The email address of the account to add.
28
+ */
29
+ email: string;
30
+ /**
31
+ * The organization role to assign to the new member.
32
+ */
33
+ role: string;
34
+ }
35
+ export declare function addOrganizationMember({ email, id, role, }: AddOrganizationMemberArguments): Promise<void>;
21
36
  export {};
@@ -175,4 +175,15 @@ export async function upsertOrganization({ city, countryCode, description, email
175
175
  }
176
176
  }
177
177
  }
178
+ export async function addOrganizationMember({ email, id, role, }) {
179
+ logger.info(`Adding ${email} to organization ${id} as ${role}`);
180
+ try {
181
+ await axios.post(`/api/organizations/${id}/members`, { email, role });
182
+ logger.info(`Successfully added ${email} to organization ${id}`);
183
+ }
184
+ catch (error) {
185
+ logger.error(error);
186
+ throw error;
187
+ }
188
+ }
178
189
  //# sourceMappingURL=organization.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appsemble/cli",
3
- "version": "0.38.2-test.0",
3
+ "version": "0.39.0",
4
4
  "description": "The CLI for developing with Appsemble apps and blocks",
5
5
  "keywords": [
6
6
  "app",
@@ -44,10 +44,10 @@
44
44
  "test": "vitest"
45
45
  },
46
46
  "dependencies": {
47
- "@appsemble/node-utils": "0.38.2-test.0",
48
- "@appsemble/types": "0.38.2-test.0",
49
- "@appsemble/lang-sdk": "0.38.2-test.0",
50
- "@appsemble/utils": "0.38.2-test.0",
47
+ "@appsemble/node-utils": "0.39.0",
48
+ "@appsemble/types": "0.39.0",
49
+ "@appsemble/lang-sdk": "0.39.0",
50
+ "@appsemble/utils": "0.39.0",
51
51
  "@fortawesome/fontawesome-common-types": "^6.0.0",
52
52
  "@inquirer/prompts": "^8.0.0",
53
53
  "@koa/cors": "^5.0.0",
@@ -90,8 +90,8 @@
90
90
  "yargs": "^17.0.0"
91
91
  },
92
92
  "devDependencies": {
93
- "@appsemble/types": "0.38.2-test.0",
94
- "@appsemble/server": "0.38.2-test.0",
93
+ "@appsemble/types": "0.39.0",
94
+ "@appsemble/server": "0.39.0",
95
95
  "@types/concat-stream": "2.0.3",
96
96
  "@types/koa__cors": "5.0.1",
97
97
  "@types/koa-compress": "4.0.7",
@@ -6,7 +6,7 @@ pages:
6
6
  - name: Example Page A
7
7
  blocks:
8
8
  - type: action-button
9
- version: 0.38.2-test.0
9
+ version: 0.39.0
10
10
  parameters:
11
11
  icon: arrow-right
12
12
  actions:
@@ -17,7 +17,7 @@ pages:
17
17
  - name: Example Page B
18
18
  blocks:
19
19
  - type: action-button
20
- version: 0.38.2-test.0
20
+ version: 0.39.0
21
21
  parameters:
22
22
  icon: arrow-left
23
23
  actions:
@@ -5,7 +5,7 @@
5
5
  "*.css"
6
6
  ],
7
7
  "dependencies": {
8
- "@appsemble/sdk": "0.38.2-test.0",
8
+ "@appsemble/sdk": "0.39.0",
9
9
  "mini-jsx": "^4.0.0"
10
10
  }
11
11
  }
@@ -5,8 +5,8 @@
5
5
  "*.css"
6
6
  ],
7
7
  "dependencies": {
8
- "@appsemble/preact": "0.38.2-test.0",
9
- "@appsemble/sdk": "0.38.2-test.0",
8
+ "@appsemble/preact": "0.39.0",
9
+ "@appsemble/sdk": "0.39.0",
10
10
  "preact": "^10.0.0"
11
11
  }
12
12
  }
@@ -5,6 +5,6 @@
5
5
  "*.css"
6
6
  ],
7
7
  "dependencies": {
8
- "@appsemble/sdk": "0.38.2-test.0"
8
+ "@appsemble/sdk": "0.39.0"
9
9
  }
10
10
  }
package/vitest.setup.js CHANGED
@@ -16,6 +16,7 @@ beforeAll(async () => {
16
16
  endPoint: process.env.S3_HOST || 'localhost',
17
17
  port: Number(process.env.S3_PORT) || 9009,
18
18
  useSSL: false,
19
+ bucket: process.env.S3_BUCKET,
19
20
  });
20
21
  });
21
22
  beforeEach(async () => {