@appsemble/cli 0.20.28 → 0.20.29
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 +4 -4
- package/index.js +0 -0
- package/package.json +5 -5
- package/__fixtures__/getBlockConfigFromTypeScript/comments/index.ts +0 -40
- package/__fixtures__/getBlockConfigFromTypeScript/comments/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/index.ts +0 -34
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/index.ts +0 -34
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/index.ts +0 -34
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/index.ts +0 -34
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/index.ts +0 -11
- package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/tsconfig.json +0 -7
- package/__fixtures__/getBlockConfigFromTypeScript/tsError/index.ts +0 -4
- package/__fixtures__/getBlockConfigFromTypeScript/tsError/tsconfig.json +0 -8
- package/__fixtures__/getBlockConfigFromTypeScript/valid/index.ts +0 -28
- package/__fixtures__/getBlockConfigFromTypeScript/valid/tsconfig.json +0 -7
- package/__fixtures__/makePayload/with-icon/icon.svg +0 -2
- package/assets/appsemblerc.schema.json +0 -150
- package/changed/added/.gitkeep +0 -0
- package/changed/changed/.gitkeep +0 -0
- package/changed/deprecated/.gitkeep +0 -0
- package/changed/fixed/.gitkeep +0 -0
- package/changed/removed/.gitkeep +0 -0
- package/changed/security/.gitkeep +0 -0
- package/commands/app/create.js.map +0 -1
- package/commands/app/create.ts +0 -104
- package/commands/app/extract-messages.js.map +0 -1
- package/commands/app/extract-messages.ts +0 -56
- package/commands/app/index.js.map +0 -1
- package/commands/app/index.ts +0 -18
- package/commands/app/update.js.map +0 -1
- package/commands/app/update.ts +0 -111
- package/commands/asset/create.js.map +0 -1
- package/commands/asset/create.ts +0 -84
- package/commands/asset/index.js.map +0 -1
- package/commands/asset/index.ts +0 -12
- package/commands/block/build.js.map +0 -1
- package/commands/block/build.ts +0 -32
- package/commands/block/extract-messages.js.map +0 -1
- package/commands/block/extract-messages.ts +0 -41
- package/commands/block/index.js.map +0 -1
- package/commands/block/index.ts +0 -18
- package/commands/block/publish.js.map +0 -1
- package/commands/block/publish.ts +0 -58
- package/commands/cleanupResources.js.map +0 -1
- package/commands/cleanupResources.ts +0 -45
- package/commands/config/get.js.map +0 -1
- package/commands/config/get.ts +0 -27
- package/commands/config/index.js.map +0 -1
- package/commands/config/index.ts +0 -16
- package/commands/config/set.js.map +0 -1
- package/commands/config/set.ts +0 -45
- package/commands/login.js.map +0 -1
- package/commands/login.ts +0 -5
- package/commands/logout.js.map +0 -1
- package/commands/logout.ts +0 -5
- package/commands/migrate.js.map +0 -1
- package/commands/migrate.ts +0 -50
- package/commands/organization/create.js.map +0 -1
- package/commands/organization/create.ts +0 -65
- package/commands/organization/index.js.map +0 -1
- package/commands/organization/index.ts +0 -16
- package/commands/organization/update.js.map +0 -1
- package/commands/organization/update.ts +0 -65
- package/commands/resource/create.js.map +0 -1
- package/commands/resource/create.ts +0 -78
- package/commands/resource/index.js.map +0 -1
- package/commands/resource/index.ts +0 -16
- package/commands/resource/update.js.map +0 -1
- package/commands/resource/update.ts +0 -77
- package/commands/runCronJobs.js.map +0 -1
- package/commands/runCronJobs.ts +0 -45
- package/commands/start.js.map +0 -1
- package/commands/start.ts +0 -140
- package/commands/team/create.js.map +0 -1
- package/commands/team/create.ts +0 -60
- package/commands/team/delete.js.map +0 -1
- package/commands/team/delete.ts +0 -54
- package/commands/team/index.js.map +0 -1
- package/commands/team/index.ts +0 -20
- package/commands/team/member/delete.js.map +0 -1
- package/commands/team/member/delete.ts +0 -61
- package/commands/team/member/index.js.map +0 -1
- package/commands/team/member/index.ts +0 -18
- package/commands/team/member/invite.js.map +0 -1
- package/commands/team/member/invite.ts +0 -61
- package/commands/team/member/update.js.map +0 -1
- package/commands/team/member/update.ts +0 -70
- package/commands/team/update.js.map +0 -1
- package/commands/team/update.ts +0 -60
- package/index.js.map +0 -1
- package/index.ts +0 -74
- package/jest.config.js +0 -3
- package/jest.setup.js.map +0 -1
- package/jest.setup.ts +0 -4
- package/lib/__snapshots__/getBlockConfigFromTypeScript.test.ts.snap +0 -4241
- package/lib/app.js.map +0 -1
- package/lib/app.ts +0 -795
- package/lib/asset.js.map +0 -1
- package/lib/asset.ts +0 -43
- package/lib/authentication.js.map +0 -1
- package/lib/authentication.ts +0 -194
- package/lib/block.js.map +0 -1
- package/lib/block.test.js.map +0 -1
- package/lib/block.test.ts +0 -103
- package/lib/block.ts +0 -384
- package/lib/coercers.js.map +0 -1
- package/lib/coercers.test.js.map +0 -1
- package/lib/coercers.test.ts +0 -27
- package/lib/coercers.ts +0 -58
- package/lib/getBlockConfigFromTypeScript.js.map +0 -1
- package/lib/getBlockConfigFromTypeScript.test.js.map +0 -1
- package/lib/getBlockConfigFromTypeScript.test.ts +0 -282
- package/lib/getBlockConfigFromTypeScript.ts +0 -356
- package/lib/initAxios.js.map +0 -1
- package/lib/initAxios.ts +0 -16
- package/lib/loadWebpackConfig.js.map +0 -1
- package/lib/loadWebpackConfig.ts +0 -52
- package/lib/organization.js.map +0 -1
- package/lib/organization.ts +0 -105
- package/lib/output.js.map +0 -1
- package/lib/output.ts +0 -19
- package/lib/processCss.js.map +0 -1
- package/lib/processCss.ts +0 -24
- package/lib/resource.js.map +0 -1
- package/lib/resource.ts +0 -128
- package/lib/serverImport.js.map +0 -1
- package/lib/serverImport.ts +0 -42
- package/lib/team.js.map +0 -1
- package/lib/team.ts +0 -152
- package/tsconfig.json +0 -9
- package/types.js.map +0 -1
- package/types.ts +0 -110
package/commands/team/create.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Argv } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import { resolveAppIdAndRemote } from '../../lib/app.js';
|
|
4
|
-
import { authenticate } from '../../lib/authentication.js';
|
|
5
|
-
import { createTeam } from '../../lib/team.js';
|
|
6
|
-
import { BaseArguments } from '../../types.js';
|
|
7
|
-
|
|
8
|
-
interface CreateTeamArguments extends BaseArguments {
|
|
9
|
-
appId: number;
|
|
10
|
-
name: string;
|
|
11
|
-
context: string;
|
|
12
|
-
app: string;
|
|
13
|
-
annotation: string[];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const command = 'create <name>';
|
|
17
|
-
export const description = 'Create a new team for an app.';
|
|
18
|
-
|
|
19
|
-
export function builder(yargs: Argv): Argv<any> {
|
|
20
|
-
return yargs
|
|
21
|
-
.positional('name', {
|
|
22
|
-
describe: 'The name of the team.',
|
|
23
|
-
demandOption: true,
|
|
24
|
-
})
|
|
25
|
-
.option('annotation', {
|
|
26
|
-
type: 'array',
|
|
27
|
-
describe: 'The new list of annotations. The format is key=value.',
|
|
28
|
-
})
|
|
29
|
-
.option('app-id', {
|
|
30
|
-
describe: 'The ID of the app to create the team for.',
|
|
31
|
-
type: 'number',
|
|
32
|
-
})
|
|
33
|
-
.option('app', {
|
|
34
|
-
describe: 'The path to the app.',
|
|
35
|
-
demandOption: 'context',
|
|
36
|
-
})
|
|
37
|
-
.option('context', {
|
|
38
|
-
describe: 'If specified, use the specified context from .appsemblerc.yaml',
|
|
39
|
-
demandOption: 'app',
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export async function handler({
|
|
44
|
-
annotation,
|
|
45
|
-
app,
|
|
46
|
-
appId,
|
|
47
|
-
clientCredentials,
|
|
48
|
-
context,
|
|
49
|
-
name,
|
|
50
|
-
remote,
|
|
51
|
-
}: CreateTeamArguments): Promise<void> {
|
|
52
|
-
const [resolvedAppId, resolvedRemote] = await resolveAppIdAndRemote(app, context, remote, appId);
|
|
53
|
-
await authenticate(resolvedRemote, 'teams:write', clientCredentials);
|
|
54
|
-
await createTeam({
|
|
55
|
-
name,
|
|
56
|
-
appId: resolvedAppId,
|
|
57
|
-
annotations: annotation,
|
|
58
|
-
remote: resolvedRemote,
|
|
59
|
-
});
|
|
60
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["delete.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAU/C,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAChC,MAAM,CAAC,MAAM,WAAW,GAAG,sCAAsC,CAAC;AAElE,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,MAAM,CAAC,IAAI,EAAE;QACZ,QAAQ,EAAE,+BAA+B;QACzC,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,QAAQ,EAAE,4CAA4C;QACtD,IAAI,EAAE,QAAQ;KACf,CAAC;SACD,MAAM,CAAC,KAAK,EAAE;QACb,QAAQ,EAAE,sBAAsB;QAChC,YAAY,EAAE,SAAS;KACxB,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,QAAQ,EAAE,gEAAgE;QAC1E,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,GAAG,EACH,KAAK,EACL,iBAAiB,EACjB,OAAO,EACP,EAAE,EACF,MAAM,GACc;IACpB,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG,MAAM,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,YAAY,CAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,UAAU,CAAC;QACf,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC"}
|
package/commands/team/delete.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Argv } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import { resolveAppIdAndRemote } from '../../lib/app.js';
|
|
4
|
-
import { authenticate } from '../../lib/authentication.js';
|
|
5
|
-
import { deleteTeam } from '../../lib/team.js';
|
|
6
|
-
import { BaseArguments } from '../../types.js';
|
|
7
|
-
|
|
8
|
-
interface DeleteTeamArguments extends BaseArguments {
|
|
9
|
-
appId: number;
|
|
10
|
-
id: number;
|
|
11
|
-
context: string;
|
|
12
|
-
app: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const command = 'delete';
|
|
16
|
-
export const description = 'Delete an existing team from an app.';
|
|
17
|
-
|
|
18
|
-
export function builder(yargs: Argv): Argv<any> {
|
|
19
|
-
return yargs
|
|
20
|
-
.option('id', {
|
|
21
|
-
describe: 'The ID of the team to delete.',
|
|
22
|
-
demandOption: true,
|
|
23
|
-
})
|
|
24
|
-
.option('app-id', {
|
|
25
|
-
describe: 'The ID of the app to delete the team from.',
|
|
26
|
-
type: 'number',
|
|
27
|
-
})
|
|
28
|
-
.option('app', {
|
|
29
|
-
describe: 'The path to the app.',
|
|
30
|
-
demandOption: 'context',
|
|
31
|
-
})
|
|
32
|
-
.option('context', {
|
|
33
|
-
describe: 'If specified, use the specified context from .appsemblerc.yaml',
|
|
34
|
-
demandOption: 'app',
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export async function handler({
|
|
39
|
-
app,
|
|
40
|
-
appId,
|
|
41
|
-
clientCredentials,
|
|
42
|
-
context,
|
|
43
|
-
id,
|
|
44
|
-
remote,
|
|
45
|
-
}: DeleteTeamArguments): Promise<void> {
|
|
46
|
-
const [resolvedAppId, resolvedRemote] = await resolveAppIdAndRemote(app, context, remote, appId);
|
|
47
|
-
|
|
48
|
-
await authenticate(resolvedRemote, 'teams:write', clientCredentials);
|
|
49
|
-
await deleteTeam({
|
|
50
|
-
id,
|
|
51
|
-
appId: resolvedAppId,
|
|
52
|
-
remote: resolvedRemote,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,gCAAgC,CAAC;AAE5D,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,OAAO,CAAC,MAAkC,CAAC;SAC3C,OAAO,CAAC,UAAsC,CAAC;SAC/C,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC,MAAkC,CAAC;SAC3C,aAAa,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC"}
|
package/commands/team/index.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Argv, CommandModule } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import * as create from './create.js';
|
|
4
|
-
import * as deleteTeam from './delete.js';
|
|
5
|
-
import * as member from './member/index.js';
|
|
6
|
-
import * as update from './update.js';
|
|
7
|
-
|
|
8
|
-
export { noop as handler } from '@appsemble/utils';
|
|
9
|
-
|
|
10
|
-
export const command = 'team';
|
|
11
|
-
export const description = 'Commands related to app teams.';
|
|
12
|
-
|
|
13
|
-
export function builder(yargs: Argv): Argv {
|
|
14
|
-
return yargs
|
|
15
|
-
.command(create as unknown as CommandModule)
|
|
16
|
-
.command(deleteTeam as unknown as CommandModule)
|
|
17
|
-
.command(member)
|
|
18
|
-
.command(update as unknown as CommandModule)
|
|
19
|
-
.demandCommand(1);
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["delete.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAWpD,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,sDAAsD,CAAC;AAElF,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,MAAM,CAAC,IAAI,EAAE;QACZ,QAAQ,EAAE,qBAAqB;QAC/B,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,QAAQ,EAAE,+BAA+B;QACzC,IAAI,EAAE,QAAQ;KACf,CAAC;SACD,UAAU,CAAC,MAAM,EAAE;QAClB,QAAQ,EAAE,yDAAyD;QACnE,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,KAAK,EAAE;QACb,QAAQ,EAAE,sBAAsB;QAChC,YAAY,EAAE,SAAS;KACxB,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,QAAQ,EAAE,gEAAgE;QAC1E,YAAY,EAAE,KAAK;KACpB,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,GAAG,EACH,KAAK,EACL,iBAAiB,EACjB,OAAO,EACP,EAAE,EACF,MAAM,EACN,IAAI,GACgB;IACpB,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG,MAAM,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,YAAY,CAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,YAAY,CAAC;QACjB,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;QACJ,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Argv } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import { resolveAppIdAndRemote } from '../../../lib/app.js';
|
|
4
|
-
import { authenticate } from '../../../lib/authentication.js';
|
|
5
|
-
import { deleteMember } from '../../../lib/team.js';
|
|
6
|
-
import { BaseArguments } from '../../../types.js';
|
|
7
|
-
|
|
8
|
-
interface DeleteTeamArguments extends BaseArguments {
|
|
9
|
-
appId: number;
|
|
10
|
-
id: number;
|
|
11
|
-
user: string;
|
|
12
|
-
context: string;
|
|
13
|
-
app: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const command = 'delete <user>';
|
|
17
|
-
export const description = 'Delete a new member to an existing team from an app.';
|
|
18
|
-
|
|
19
|
-
export function builder(yargs: Argv): Argv<any> {
|
|
20
|
-
return yargs
|
|
21
|
-
.option('id', {
|
|
22
|
-
describe: 'The ID of the team.',
|
|
23
|
-
demandOption: true,
|
|
24
|
-
})
|
|
25
|
-
.option('app-id', {
|
|
26
|
-
describe: 'The ID of the app of the team',
|
|
27
|
-
type: 'number',
|
|
28
|
-
})
|
|
29
|
-
.positional('user', {
|
|
30
|
-
describe: 'The ID or email address of the user you want to delete.',
|
|
31
|
-
demandOption: true,
|
|
32
|
-
})
|
|
33
|
-
.option('app', {
|
|
34
|
-
describe: 'The path to the app.',
|
|
35
|
-
demandOption: 'context',
|
|
36
|
-
})
|
|
37
|
-
.option('context', {
|
|
38
|
-
describe: 'If specified, use the specified context from .appsemblerc.yaml',
|
|
39
|
-
demandOption: 'app',
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export async function handler({
|
|
44
|
-
app,
|
|
45
|
-
appId,
|
|
46
|
-
clientCredentials,
|
|
47
|
-
context,
|
|
48
|
-
id,
|
|
49
|
-
remote,
|
|
50
|
-
user,
|
|
51
|
-
}: DeleteTeamArguments): Promise<void> {
|
|
52
|
-
const [resolvedAppId, resolvedRemote] = await resolveAppIdAndRemote(app, context, remote, appId);
|
|
53
|
-
|
|
54
|
-
await authenticate(resolvedRemote, 'teams:write', clientCredentials);
|
|
55
|
-
await deleteMember({
|
|
56
|
-
id,
|
|
57
|
-
appId: resolvedAppId,
|
|
58
|
-
user,
|
|
59
|
-
remote: resolvedRemote,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,YAAY,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAChC,MAAM,CAAC,MAAM,WAAW,GAAG,uCAAuC,CAAC;AAEnE,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,OAAO,CAAC,YAAwC,CAAC;SACjD,OAAO,CAAC,MAAkC,CAAC;SAC3C,OAAO,CAAC,MAAkC,CAAC;SAC3C,aAAa,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Argv, CommandModule } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import * as deleteMember from './delete.js';
|
|
4
|
-
import * as invite from './invite.js';
|
|
5
|
-
import * as update from './update.js';
|
|
6
|
-
|
|
7
|
-
export { noop as handler } from '@appsemble/utils';
|
|
8
|
-
|
|
9
|
-
export const command = 'member';
|
|
10
|
-
export const description = 'Commands related to app team members.';
|
|
11
|
-
|
|
12
|
-
export function builder(yargs: Argv): Argv {
|
|
13
|
-
return yargs
|
|
14
|
-
.command(deleteMember as unknown as CommandModule)
|
|
15
|
-
.command(invite as unknown as CommandModule)
|
|
16
|
-
.command(update as unknown as CommandModule)
|
|
17
|
-
.demandCommand(1);
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invite.js","sourceRoot":"","sources":["invite.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAWpD,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,sDAAsD,CAAC;AAElF,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,MAAM,CAAC,IAAI,EAAE;QACZ,QAAQ,EAAE,qBAAqB;QAC/B,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,QAAQ,EAAE,+BAA+B;QACzC,IAAI,EAAE,QAAQ;KACf,CAAC;SACD,MAAM,CAAC,KAAK,EAAE;QACb,QAAQ,EAAE,sBAAsB;QAChC,YAAY,EAAE,SAAS;KACxB,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,QAAQ,EAAE,gEAAgE;QAC1E,YAAY,EAAE,KAAK;KACpB,CAAC;SACD,UAAU,CAAC,MAAM,EAAE;QAClB,QAAQ,EAAE,yDAAyD;QACnE,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,GAAG,EACH,KAAK,EACL,iBAAiB,EACjB,OAAO,EACP,EAAE,EACF,MAAM,EACN,IAAI,GACgB;IACpB,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG,MAAM,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,YAAY,CAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,YAAY,CAAC;QACjB,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;QACJ,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Argv } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import { resolveAppIdAndRemote } from '../../../lib/app.js';
|
|
4
|
-
import { authenticate } from '../../../lib/authentication.js';
|
|
5
|
-
import { inviteMember } from '../../../lib/team.js';
|
|
6
|
-
import { BaseArguments } from '../../../types.js';
|
|
7
|
-
|
|
8
|
-
interface InviteTeamArguments extends BaseArguments {
|
|
9
|
-
appId: number;
|
|
10
|
-
id: number;
|
|
11
|
-
user: string;
|
|
12
|
-
context: string;
|
|
13
|
-
app: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const command = 'invite <user>';
|
|
17
|
-
export const description = 'Invite a new member to an existing team from an app.';
|
|
18
|
-
|
|
19
|
-
export function builder(yargs: Argv): Argv<any> {
|
|
20
|
-
return yargs
|
|
21
|
-
.option('id', {
|
|
22
|
-
describe: 'The ID of the team.',
|
|
23
|
-
demandOption: true,
|
|
24
|
-
})
|
|
25
|
-
.option('app-id', {
|
|
26
|
-
describe: 'The ID of the app of the team',
|
|
27
|
-
type: 'number',
|
|
28
|
-
})
|
|
29
|
-
.option('app', {
|
|
30
|
-
describe: 'The path to the app.',
|
|
31
|
-
demandOption: 'context',
|
|
32
|
-
})
|
|
33
|
-
.option('context', {
|
|
34
|
-
describe: 'If specified, use the specified context from .appsemblerc.yaml',
|
|
35
|
-
demandOption: 'app',
|
|
36
|
-
})
|
|
37
|
-
.positional('user', {
|
|
38
|
-
describe: 'The ID or email address of the user you want to invite.',
|
|
39
|
-
demandOption: true,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export async function handler({
|
|
44
|
-
app,
|
|
45
|
-
appId,
|
|
46
|
-
clientCredentials,
|
|
47
|
-
context,
|
|
48
|
-
id,
|
|
49
|
-
remote,
|
|
50
|
-
user,
|
|
51
|
-
}: InviteTeamArguments): Promise<void> {
|
|
52
|
-
const [resolvedAppId, resolvedRemote] = await resolveAppIdAndRemote(app, context, remote, appId);
|
|
53
|
-
|
|
54
|
-
await authenticate(resolvedRemote, 'teams:write', clientCredentials);
|
|
55
|
-
await inviteMember({
|
|
56
|
-
id,
|
|
57
|
-
appId: resolvedAppId,
|
|
58
|
-
user,
|
|
59
|
-
remote: resolvedRemote,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAYpD,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAC;AAC9C,MAAM,CAAC,MAAM,WAAW,GAAG,iCAAiC,CAAC;AAE7D,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,MAAM,CAAC,IAAI,EAAE;QACZ,QAAQ,EAAE,qBAAqB;QAC/B,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,QAAQ,EAAE,+BAA+B;QACzC,IAAI,EAAE,QAAQ;KACf,CAAC;SACD,MAAM,CAAC,KAAK,EAAE;QACb,QAAQ,EAAE,sBAAsB;QAChC,YAAY,EAAE,SAAS;KACxB,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,QAAQ,EAAE,gEAAgE;QAC1E,YAAY,EAAE,KAAK;KACpB,CAAC;SACD,UAAU,CAAC,MAAM,EAAE;QAClB,QAAQ,EAAE,yDAAyD;QACnE,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,UAAU,CAAC,MAAM,EAAE;QAClB,QAAQ,EAAE,6BAA6B;QACvC,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;KACjC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,GAAG,EACH,KAAK,EACL,iBAAiB,EACjB,OAAO,EACP,EAAE,EACF,MAAM,EACN,IAAI,EACJ,IAAI,GACgB;IACpB,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG,MAAM,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,YAAY,CAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,YAAY,CAAC;QACjB,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;QACJ,IAAI;QACJ,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { TeamRole } from '@appsemble/utils';
|
|
2
|
-
import { Argv } from 'yargs';
|
|
3
|
-
|
|
4
|
-
import { resolveAppIdAndRemote } from '../../../lib/app.js';
|
|
5
|
-
import { authenticate } from '../../../lib/authentication.js';
|
|
6
|
-
import { updateMember } from '../../../lib/team.js';
|
|
7
|
-
import { BaseArguments } from '../../../types.js';
|
|
8
|
-
|
|
9
|
-
interface InviteTeamArguments extends BaseArguments {
|
|
10
|
-
appId: number;
|
|
11
|
-
id: number;
|
|
12
|
-
user: string;
|
|
13
|
-
role: TeamRole;
|
|
14
|
-
context: string;
|
|
15
|
-
app: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const command = 'update <user> <role>';
|
|
19
|
-
export const description = 'Update an existing team member.';
|
|
20
|
-
|
|
21
|
-
export function builder(yargs: Argv): Argv<any> {
|
|
22
|
-
return yargs
|
|
23
|
-
.option('id', {
|
|
24
|
-
describe: 'The ID of the team.',
|
|
25
|
-
demandOption: true,
|
|
26
|
-
})
|
|
27
|
-
.option('app-id', {
|
|
28
|
-
describe: 'The ID of the app of the team',
|
|
29
|
-
type: 'number',
|
|
30
|
-
})
|
|
31
|
-
.option('app', {
|
|
32
|
-
describe: 'The path to the app.',
|
|
33
|
-
demandOption: 'context',
|
|
34
|
-
})
|
|
35
|
-
.option('context', {
|
|
36
|
-
describe: 'If specified, use the specified context from .appsemblerc.yaml',
|
|
37
|
-
demandOption: 'app',
|
|
38
|
-
})
|
|
39
|
-
.positional('user', {
|
|
40
|
-
describe: 'The ID or email address of the user you want to invite.',
|
|
41
|
-
demandOption: true,
|
|
42
|
-
})
|
|
43
|
-
.positional('role', {
|
|
44
|
-
describe: 'The new role of the member.',
|
|
45
|
-
demandOption: true,
|
|
46
|
-
choices: Object.values(TeamRole),
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export async function handler({
|
|
51
|
-
app,
|
|
52
|
-
appId,
|
|
53
|
-
clientCredentials,
|
|
54
|
-
context,
|
|
55
|
-
id,
|
|
56
|
-
remote,
|
|
57
|
-
role,
|
|
58
|
-
user,
|
|
59
|
-
}: InviteTeamArguments): Promise<void> {
|
|
60
|
-
const [resolvedAppId, resolvedRemote] = await resolveAppIdAndRemote(app, context, remote, appId);
|
|
61
|
-
|
|
62
|
-
await authenticate(resolvedRemote, 'teams:write', clientCredentials);
|
|
63
|
-
await updateMember({
|
|
64
|
-
id,
|
|
65
|
-
appId: resolvedAppId,
|
|
66
|
-
user,
|
|
67
|
-
role,
|
|
68
|
-
remote: resolvedRemote,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["update.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAY/C,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAChC,MAAM,CAAC,MAAM,WAAW,GAAG,qCAAqC,CAAC;AAEjE,MAAM,UAAU,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,MAAM,CAAC,IAAI,EAAE;QACZ,QAAQ,EAAE,+BAA+B;QACzC,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,QAAQ,EAAE,2BAA2B;KACtC,CAAC;SACD,MAAM,CAAC,YAAY,EAAE;QACpB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,uDAAuD;KAClE,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,QAAQ,EAAE,4CAA4C;QACtD,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,UAAU,EACV,GAAG,EACH,KAAK,EACL,iBAAiB,EACjB,OAAO,EACP,EAAE,EACF,IAAI,EACJ,MAAM,GACc;IACpB,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG,MAAM,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,YAAY,CAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,UAAU,CAAC;QACf,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;QACJ,WAAW,EAAE,UAAU;QACvB,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC"}
|
package/commands/team/update.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Argv } from 'yargs';
|
|
2
|
-
|
|
3
|
-
import { resolveAppIdAndRemote } from '../../lib/app.js';
|
|
4
|
-
import { authenticate } from '../../lib/authentication.js';
|
|
5
|
-
import { updateTeam } from '../../lib/team.js';
|
|
6
|
-
import { BaseArguments } from '../../types.js';
|
|
7
|
-
|
|
8
|
-
interface UpdateTeamArguments extends BaseArguments {
|
|
9
|
-
appId: number;
|
|
10
|
-
id: number;
|
|
11
|
-
name: string;
|
|
12
|
-
annotation: string[];
|
|
13
|
-
context: string;
|
|
14
|
-
app: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const command = 'update';
|
|
18
|
-
export const description = 'Update an existing team for an app.';
|
|
19
|
-
|
|
20
|
-
export function builder(yargs: Argv): Argv<any> {
|
|
21
|
-
return yargs
|
|
22
|
-
.option('id', {
|
|
23
|
-
describe: 'The ID of the team to update.',
|
|
24
|
-
demandOption: true,
|
|
25
|
-
})
|
|
26
|
-
.option('name', {
|
|
27
|
-
describe: 'The new name of the team.',
|
|
28
|
-
})
|
|
29
|
-
.option('annotation', {
|
|
30
|
-
type: 'array',
|
|
31
|
-
describe: 'The new list of annotations. The format is key=value.',
|
|
32
|
-
})
|
|
33
|
-
.option('app-id', {
|
|
34
|
-
describe: 'The ID of the app to delete the team from.',
|
|
35
|
-
type: 'number',
|
|
36
|
-
demandOption: true,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export async function handler({
|
|
41
|
-
annotation,
|
|
42
|
-
app,
|
|
43
|
-
appId,
|
|
44
|
-
clientCredentials,
|
|
45
|
-
context,
|
|
46
|
-
id,
|
|
47
|
-
name,
|
|
48
|
-
remote,
|
|
49
|
-
}: UpdateTeamArguments): Promise<void> {
|
|
50
|
-
const [resolvedAppId, resolvedRemote] = await resolveAppIdAndRemote(app, context, remote, appId);
|
|
51
|
-
|
|
52
|
-
await authenticate(resolvedRemote, 'teams:write', clientCredentials);
|
|
53
|
-
await updateTeam({
|
|
54
|
-
id,
|
|
55
|
-
appId: resolvedAppId,
|
|
56
|
-
name,
|
|
57
|
-
annotations: annotation,
|
|
58
|
-
remote: resolvedRemote,
|
|
59
|
-
});
|
|
60
|
-
}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AACA,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,OAAO,KAAK,GAAG,MAAM,yBAAyB,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AACnD,OAAO,KAAK,gBAAgB,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,MAAM,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,YAAY,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,WAAW,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,0BAA0B,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,GAAG,MAAM,gBAAgB,CAAC,SAAS,IAAI,EAAE,MAAM,EAAE,CAAC;AAEzD,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC;AAE5B,MAAM,QAAQ,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAChD,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAEnD,IAAI,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACtC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;KACpB,MAAM,CAAC,SAAS,EAAE;IACjB,KAAK,EAAE,GAAG;IACV,QAAQ,EAAE,oBAAoB;IAC9B,IAAI,EAAE,OAAO;CACd,CAAC;KACD,MAAM,CAAC,OAAO,EAAE;IACf,KAAK,EAAE,GAAG;IACV,QAAQ,EAAE,oBAAoB;IAC9B,IAAI,EAAE,OAAO;CACd,CAAC;KACD,MAAM,CAAC,QAAQ,EAAE;IAChB,WAAW,EAAE,yCAAyC;IACtD,OAAO,EAAE,uBAAuB;IAChC,MAAM,EAAE,YAAY;CACrB,CAAC;KACD,MAAM,CAAC,oBAAoB,EAAE;IAC5B,WAAW,EAAE,qGAAqG,mBAAmB,wBAAwB;CAC9J,CAAC;KACD,UAAU,CAAC,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;KACxC,OAAO,CAAC,GAAG,CAAC;KACZ,OAAO,CAAC,KAAK,CAAC;KACd,OAAO,CAAC,KAAK,CAAC;KACd,OAAO,CAAC,gBAA4C,CAAC;KACrD,OAAO,CAAC,MAAM,CAAC;KACf,OAAO,CAAC,KAAiC,CAAC;KAC1C,OAAO,CAAC,MAAkC,CAAC;KAC3C,OAAO,CAAC,OAAmC,CAAC;KAC5C,OAAO,CAAC,YAAY,CAAC;KACrB,OAAO,CAAC,QAAQ,CAAC;KACjB,OAAO,CAAC,WAAuC,CAAC;KAChD,OAAO,CAAC,KAAiC,CAAC;KAC1C,OAAO,CAAC,IAAI,CAAC;KACb,aAAa,CAAC,CAAC,CAAC;IACjB,6EAA6E;KAC5E,cAAc,EAAE;KAChB,IAAI,CAAC,WAAW,CAAC;KACjB,IAAI,EAAE;KACN,UAAU,EAAE,CAAC;AAChB,IAAI,KAAK,EAAE;IACT,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CACtC;AACD,MAAM,CAAC,KAAK,EAAE,CAAC"}
|
package/index.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import process from 'node:process';
|
|
3
|
-
|
|
4
|
-
import { configureLogger, handleError } from '@appsemble/node-utils';
|
|
5
|
-
import { cosmiconfig } from 'cosmiconfig';
|
|
6
|
-
import yargs, { CommandModule } from 'yargs';
|
|
7
|
-
|
|
8
|
-
import * as app from './commands/app/index.js';
|
|
9
|
-
import * as asset from './commands/asset/index.js';
|
|
10
|
-
import * as block from './commands/block/index.js';
|
|
11
|
-
import * as cleanupResources from './commands/cleanupResources.js';
|
|
12
|
-
import * as config from './commands/config/index.js';
|
|
13
|
-
import * as login from './commands/login.js';
|
|
14
|
-
import * as logout from './commands/logout.js';
|
|
15
|
-
import * as migrate from './commands/migrate.js';
|
|
16
|
-
import * as organization from './commands/organization/index.js';
|
|
17
|
-
import * as resource from './commands/resource/index.js';
|
|
18
|
-
import * as runCronJobs from './commands/runCronJobs.js';
|
|
19
|
-
import * as start from './commands/start.js';
|
|
20
|
-
import * as team from './commands/team/index.js';
|
|
21
|
-
import { CREDENTIALS_ENV_VAR } from './lib/authentication.js';
|
|
22
|
-
import { coerceRemote } from './lib/coercers.js';
|
|
23
|
-
import { initAxios } from './lib/initAxios.js';
|
|
24
|
-
import pkg from './package.json' assert { type: 'json' };
|
|
25
|
-
|
|
26
|
-
process.title = 'appsemble';
|
|
27
|
-
|
|
28
|
-
const explorer = cosmiconfig('appsembleServer');
|
|
29
|
-
const found = await explorer.search(process.cwd());
|
|
30
|
-
|
|
31
|
-
let parser = yargs(process.argv.slice(2))
|
|
32
|
-
.version(pkg.version)
|
|
33
|
-
.option('verbose', {
|
|
34
|
-
alias: 'v',
|
|
35
|
-
describe: 'Increase verbosity',
|
|
36
|
-
type: 'count',
|
|
37
|
-
})
|
|
38
|
-
.option('quiet', {
|
|
39
|
-
alias: 'q',
|
|
40
|
-
describe: 'Decrease verbosity',
|
|
41
|
-
type: 'count',
|
|
42
|
-
})
|
|
43
|
-
.option('remote', {
|
|
44
|
-
description: 'The Appsemble host that should be used.',
|
|
45
|
-
default: 'https://appsemble.app',
|
|
46
|
-
coerce: coerceRemote,
|
|
47
|
-
})
|
|
48
|
-
.option('client-credentials', {
|
|
49
|
-
description: `OAuth2 client credentials formatted as "client_id:client_secret". This may also be defined in the ${CREDENTIALS_ENV_VAR} environment variable.`,
|
|
50
|
-
})
|
|
51
|
-
.middleware([configureLogger, initAxios])
|
|
52
|
-
.command(app)
|
|
53
|
-
.command(asset)
|
|
54
|
-
.command(block)
|
|
55
|
-
.command(cleanupResources as unknown as CommandModule)
|
|
56
|
-
.command(config)
|
|
57
|
-
.command(login as unknown as CommandModule)
|
|
58
|
-
.command(logout as unknown as CommandModule)
|
|
59
|
-
.command(migrate as unknown as CommandModule)
|
|
60
|
-
.command(organization)
|
|
61
|
-
.command(resource)
|
|
62
|
-
.command(runCronJobs as unknown as CommandModule)
|
|
63
|
-
.command(start as unknown as CommandModule)
|
|
64
|
-
.command(team)
|
|
65
|
-
.demandCommand(1)
|
|
66
|
-
// .strict() isn’t used because of https://github.com/yargs/yargs/issues/2058
|
|
67
|
-
.strictCommands()
|
|
68
|
-
.fail(handleError)
|
|
69
|
-
.help()
|
|
70
|
-
.completion();
|
|
71
|
-
if (found) {
|
|
72
|
-
parser = parser.config(found.config);
|
|
73
|
-
}
|
|
74
|
-
parser.parse();
|
package/jest.config.js
DELETED
package/jest.setup.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jest.setup.js","sourceRoot":"","sources":["jest.setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,WAAW,CAAC,CAAC,CAAC,CAAC"}
|
package/jest.setup.ts
DELETED