@appsemble/cli 0.20.10 → 0.20.11
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/__fixtures__/getBlockConfigFromTypeScript/comments/index.ts +40 -0
- package/__fixtures__/getBlockConfigFromTypeScript/comments/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/index.ts +34 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/index.ts +34 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/index.ts +34 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/index.ts +34 -0
- package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/index.ts +11 -0
- package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/tsconfig.json +7 -0
- package/__fixtures__/getBlockConfigFromTypeScript/tsError/index.ts +4 -0
- package/__fixtures__/getBlockConfigFromTypeScript/tsError/tsconfig.json +8 -0
- package/__fixtures__/getBlockConfigFromTypeScript/valid/index.ts +28 -0
- package/__fixtures__/getBlockConfigFromTypeScript/valid/tsconfig.json +7 -0
- package/__fixtures__/makePayload/no-icon/output/block.js +1 -0
- package/__fixtures__/makePayload/with-icon/icon.svg +2 -0
- package/__fixtures__/makePayload/with-icon/output/block.js +1 -0
- package/assets/appsemblerc.schema.json +150 -0
- 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/{dist/commands → commands}/app/create.d.ts +0 -0
- package/{dist/commands → commands}/app/create.js +0 -0
- package/commands/app/create.js.map +1 -0
- package/commands/app/create.ts +104 -0
- package/{dist/commands → commands}/app/extract-messages.d.ts +0 -0
- package/{dist/commands → commands}/app/extract-messages.js +0 -0
- package/commands/app/extract-messages.js.map +1 -0
- package/commands/app/extract-messages.ts +56 -0
- package/{dist/commands → commands}/app/index.d.ts +0 -0
- package/{dist/commands → commands}/app/index.js +0 -0
- package/commands/app/index.js.map +1 -0
- package/commands/app/index.ts +14 -0
- package/{dist/commands → commands}/app/update.d.ts +0 -0
- package/{dist/commands → commands}/app/update.js +0 -0
- package/commands/app/update.js.map +1 -0
- package/commands/app/update.ts +111 -0
- package/{dist/commands → commands}/asset/create.d.ts +0 -0
- package/{dist/commands → commands}/asset/create.js +0 -0
- package/commands/asset/create.js.map +1 -0
- package/commands/asset/create.ts +84 -0
- package/{dist/commands → commands}/asset/index.d.ts +0 -0
- package/{dist/commands → commands}/asset/index.js +0 -0
- package/commands/asset/index.js.map +1 -0
- package/commands/asset/index.ts +12 -0
- package/{dist/commands → commands}/block/build.d.ts +0 -0
- package/{dist/commands → commands}/block/build.js +0 -0
- package/commands/block/build.js.map +1 -0
- package/commands/block/build.ts +32 -0
- package/{dist/commands → commands}/block/extract-messages.d.ts +0 -0
- package/{dist/commands → commands}/block/extract-messages.js +0 -0
- package/commands/block/extract-messages.js.map +1 -0
- package/commands/block/extract-messages.ts +41 -0
- package/{dist/commands → commands}/block/index.d.ts +0 -0
- package/{dist/commands → commands}/block/index.js +0 -0
- package/commands/block/index.js.map +1 -0
- package/commands/block/index.ts +14 -0
- package/{dist/commands → commands}/block/publish.d.ts +0 -0
- package/{dist/commands → commands}/block/publish.js +0 -0
- package/commands/block/publish.js.map +1 -0
- package/commands/block/publish.ts +58 -0
- package/{dist/commands → commands}/cleanupResources.d.ts +0 -0
- package/{dist/commands → commands}/cleanupResources.js +0 -0
- package/commands/cleanupResources.js.map +1 -0
- package/commands/cleanupResources.ts +45 -0
- package/{dist/commands → commands}/config/get.d.ts +0 -0
- package/{dist/commands → commands}/config/get.js +0 -0
- package/commands/config/get.js.map +1 -0
- package/commands/config/get.ts +26 -0
- package/{dist/commands → commands}/config/index.d.ts +0 -0
- package/{dist/commands → commands}/config/index.js +0 -0
- package/commands/config/index.js.map +1 -0
- package/commands/config/index.ts +13 -0
- package/{dist/commands → commands}/config/set.d.ts +0 -0
- package/{dist/commands → commands}/config/set.js +0 -0
- package/commands/config/set.js.map +1 -0
- package/commands/config/set.ts +44 -0
- package/{dist/commands → commands}/login.d.ts +0 -0
- package/{dist/commands → commands}/login.js +0 -0
- package/commands/login.js.map +1 -0
- package/commands/login.ts +5 -0
- package/{dist/commands → commands}/logout.d.ts +0 -0
- package/{dist/commands → commands}/logout.js +0 -0
- package/commands/logout.js.map +1 -0
- package/commands/logout.ts +5 -0
- package/{dist/commands → commands}/migrate.d.ts +0 -0
- package/{dist/commands → commands}/migrate.js +5 -2
- package/commands/migrate.js.map +1 -0
- package/commands/migrate.ts +50 -0
- package/{dist/commands → commands}/organization/create.d.ts +0 -0
- package/{dist/commands → commands}/organization/create.js +0 -0
- package/commands/organization/create.js.map +1 -0
- package/commands/organization/create.ts +65 -0
- package/{dist/commands → commands}/organization/index.d.ts +0 -0
- package/{dist/commands → commands}/organization/index.js +0 -0
- package/commands/organization/index.js.map +1 -0
- package/commands/organization/index.ts +13 -0
- package/{dist/commands → commands}/organization/update.d.ts +0 -0
- package/{dist/commands → commands}/organization/update.js +0 -0
- package/commands/organization/update.js.map +1 -0
- package/commands/organization/update.ts +65 -0
- package/{dist/commands → commands}/resource/create.d.ts +0 -0
- package/{dist/commands → commands}/resource/create.js +0 -0
- package/commands/resource/create.js.map +1 -0
- package/commands/resource/create.ts +78 -0
- package/{dist/commands → commands}/resource/index.d.ts +0 -0
- package/{dist/commands → commands}/resource/index.js +0 -0
- package/commands/resource/index.js.map +1 -0
- package/commands/resource/index.ts +13 -0
- package/{dist/commands → commands}/resource/update.d.ts +0 -0
- package/{dist/commands → commands}/resource/update.js +0 -0
- package/commands/resource/update.js.map +1 -0
- package/commands/resource/update.ts +77 -0
- package/{dist/commands → commands}/runCronJobs.d.ts +0 -0
- package/{dist/commands → commands}/runCronJobs.js +0 -0
- package/commands/runCronJobs.js.map +1 -0
- package/commands/runCronJobs.ts +45 -0
- package/{dist/commands → commands}/start.d.ts +0 -0
- package/{dist/commands → commands}/start.js +0 -0
- package/commands/start.js.map +1 -0
- package/commands/start.ts +140 -0
- package/{dist/commands → commands}/team/create.d.ts +0 -0
- package/{dist/commands → commands}/team/create.js +0 -0
- package/commands/team/create.js.map +1 -0
- package/commands/team/create.ts +60 -0
- package/{dist/commands → commands}/team/delete.d.ts +0 -0
- package/{dist/commands → commands}/team/delete.js +0 -0
- package/commands/team/delete.js.map +1 -0
- package/commands/team/delete.ts +54 -0
- package/{dist/commands → commands}/team/index.d.ts +0 -0
- package/{dist/commands → commands}/team/index.js +0 -0
- package/commands/team/index.js.map +1 -0
- package/commands/team/index.ts +15 -0
- package/{dist/commands → commands}/team/member/delete.d.ts +0 -0
- package/{dist/commands → commands}/team/member/delete.js +0 -0
- package/commands/team/member/delete.js.map +1 -0
- package/commands/team/member/delete.ts +61 -0
- package/{dist/commands → commands}/team/member/index.d.ts +0 -0
- package/{dist/commands → commands}/team/member/index.js +0 -0
- package/commands/team/member/index.js.map +1 -0
- package/commands/team/member/index.ts +14 -0
- package/{dist/commands → commands}/team/member/invite.d.ts +0 -0
- package/{dist/commands → commands}/team/member/invite.js +0 -0
- package/commands/team/member/invite.js.map +1 -0
- package/commands/team/member/invite.ts +61 -0
- package/{dist/commands → commands}/team/member/update.d.ts +0 -0
- package/{dist/commands → commands}/team/member/update.js +0 -0
- package/commands/team/member/update.js.map +1 -0
- package/commands/team/member/update.ts +70 -0
- package/{dist/commands → commands}/team/update.d.ts +0 -0
- package/{dist/commands → commands}/team/update.js +0 -0
- package/commands/team/update.js.map +1 -0
- package/commands/team/update.ts +60 -0
- package/index.d.ts +2 -0
- package/{dist/index.js → index.js} +2 -6
- package/index.js.map +1 -0
- package/index.ts +74 -0
- package/jest.config.js +1 -0
- package/jest.setup.d.ts +1 -0
- package/jest.setup.js +6 -0
- package/jest.setup.js.map +1 -0
- package/jest.setup.ts +4 -0
- package/lib/__snapshots__/getBlockConfigFromTypeScript.test.ts.snap +3872 -0
- package/{dist/lib → lib}/app.d.ts +17 -17
- package/{dist/lib → lib}/app.js +29 -29
- package/lib/app.js.map +1 -0
- package/lib/app.ts +797 -0
- package/{dist/lib → lib}/asset.d.ts +0 -0
- package/{dist/lib → lib}/asset.js +0 -0
- package/lib/asset.js.map +1 -0
- package/lib/asset.ts +43 -0
- package/{dist/lib → lib}/authentication.d.ts +3 -3
- package/{dist/lib → lib}/authentication.js +47 -15
- package/lib/authentication.js.map +1 -0
- package/lib/authentication.ts +193 -0
- package/{dist/lib → lib}/block.d.ts +16 -16
- package/{dist/lib → lib}/block.js +27 -27
- package/lib/block.js.map +1 -0
- package/lib/block.test.d.ts +1 -0
- package/lib/block.test.js +106 -0
- package/lib/block.test.js.map +1 -0
- package/lib/block.test.ts +103 -0
- package/lib/block.ts +384 -0
- package/{dist/lib → lib}/coercers.d.ts +2 -2
- package/{dist/lib → lib}/coercers.js +2 -2
- package/lib/coercers.js.map +1 -0
- package/lib/coercers.test.d.ts +1 -0
- package/lib/coercers.test.js +28 -0
- package/lib/coercers.test.js.map +1 -0
- package/lib/coercers.test.ts +27 -0
- package/lib/coercers.ts +57 -0
- package/{dist/lib → lib}/getBlockConfigFromTypeScript.d.ts +1 -1
- package/{dist/lib → lib}/getBlockConfigFromTypeScript.js +38 -36
- package/lib/getBlockConfigFromTypeScript.js.map +1 -0
- package/lib/getBlockConfigFromTypeScript.test.d.ts +1 -0
- package/lib/getBlockConfigFromTypeScript.test.js +238 -0
- package/lib/getBlockConfigFromTypeScript.test.js.map +1 -0
- package/lib/getBlockConfigFromTypeScript.test.ts +281 -0
- package/lib/getBlockConfigFromTypeScript.ts +354 -0
- package/{dist/lib → lib}/initAxios.d.ts +1 -1
- package/{dist/lib → lib}/initAxios.js +3 -4
- package/lib/initAxios.js.map +1 -0
- package/lib/initAxios.ts +16 -0
- package/{dist/lib → lib}/loadWebpackConfig.d.ts +3 -3
- package/{dist/lib → lib}/loadWebpackConfig.js +3 -3
- package/lib/loadWebpackConfig.js.map +1 -0
- package/lib/loadWebpackConfig.ts +59 -0
- package/{dist/lib → lib}/organization.d.ts +1 -1
- package/{dist/lib → lib}/organization.js +0 -0
- package/lib/organization.js.map +1 -0
- package/lib/organization.ts +105 -0
- package/{dist/lib → lib}/output.d.ts +0 -0
- package/{dist/lib → lib}/output.js +0 -0
- package/lib/output.js.map +1 -0
- package/lib/output.ts +19 -0
- package/{dist/lib → lib}/processCss.d.ts +1 -1
- package/{dist/lib → lib}/processCss.js +3 -3
- package/lib/processCss.js.map +1 -0
- package/lib/processCss.ts +24 -0
- package/{dist/lib → lib}/resource.d.ts +0 -0
- package/{dist/lib → lib}/resource.js +1 -1
- package/lib/resource.js.map +1 -0
- package/lib/resource.ts +128 -0
- package/{dist/lib → lib}/serverImport.d.ts +1 -1
- package/{dist/lib → lib}/serverImport.js +2 -2
- package/lib/serverImport.js.map +1 -0
- package/lib/serverImport.ts +43 -0
- package/{dist/lib → lib}/team.d.ts +0 -0
- package/{dist/lib → lib}/team.js +0 -0
- package/lib/team.js.map +1 -0
- package/lib/team.ts +152 -0
- package/package.json +13 -11
- package/tsconfig.json +10 -0
- package/{dist/types.d.ts → types.d.ts} +0 -0
- package/{dist/types.js → types.js} +0 -0
- package/types.js.map +1 -0
- package/types.ts +110 -0
- package/dist/commands/app/create.js.map +0 -1
- package/dist/commands/app/extract-messages.js.map +0 -1
- package/dist/commands/app/index.js.map +0 -1
- package/dist/commands/app/update.js.map +0 -1
- package/dist/commands/asset/create.js.map +0 -1
- package/dist/commands/asset/index.js.map +0 -1
- package/dist/commands/block/build.js.map +0 -1
- package/dist/commands/block/extract-messages.js.map +0 -1
- package/dist/commands/block/index.js.map +0 -1
- package/dist/commands/block/publish.js.map +0 -1
- package/dist/commands/cleanupResources.js.map +0 -1
- package/dist/commands/config/get.js.map +0 -1
- package/dist/commands/config/index.js.map +0 -1
- package/dist/commands/config/set.js.map +0 -1
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/migrate.js.map +0 -1
- package/dist/commands/organization/create.js.map +0 -1
- package/dist/commands/organization/index.js.map +0 -1
- package/dist/commands/organization/update.js.map +0 -1
- package/dist/commands/resource/create.js.map +0 -1
- package/dist/commands/resource/index.js.map +0 -1
- package/dist/commands/resource/update.js.map +0 -1
- package/dist/commands/runCronJobs.js.map +0 -1
- package/dist/commands/start.js.map +0 -1
- package/dist/commands/team/create.js.map +0 -1
- package/dist/commands/team/delete.js.map +0 -1
- package/dist/commands/team/index.js.map +0 -1
- package/dist/commands/team/member/delete.js.map +0 -1
- package/dist/commands/team/member/index.js.map +0 -1
- package/dist/commands/team/member/invite.js.map +0 -1
- package/dist/commands/team/member/update.js.map +0 -1
- package/dist/commands/team/update.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js.map +0 -1
- package/dist/lib/app.js.map +0 -1
- package/dist/lib/asset.js.map +0 -1
- package/dist/lib/authentication.js.map +0 -1
- package/dist/lib/block.js.map +0 -1
- package/dist/lib/coercers.js.map +0 -1
- package/dist/lib/getBlockConfigFromTypeScript.js.map +0 -1
- package/dist/lib/initAxios.js.map +0 -1
- package/dist/lib/loadWebpackConfig.js.map +0 -1
- package/dist/lib/organization.js.map +0 -1
- package/dist/lib/output.js.map +0 -1
- package/dist/lib/processCss.js.map +0 -1
- package/dist/lib/readPackageJson.d.ts +0 -9
- package/dist/lib/readPackageJson.js +0 -16
- package/dist/lib/readPackageJson.js.map +0 -1
- package/dist/lib/resource.js.map +0 -1
- package/dist/lib/serverImport.js.map +0 -1
- package/dist/lib/team.js.map +0 -1
- package/dist/types.js.map +0 -1
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["create.ts"],"names":[],"mappings":";;;AAEA,uCAAsD;AACtD,6DAAwD;AACxD,yCAA4C;AAW/B,QAAA,OAAO,GAAG,eAAe,CAAC;AAC1B,QAAA,WAAW,GAAG,+BAA+B,CAAC;AAE3D,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,MAAM,EAAE;QAClB,QAAQ,EAAE,uBAAuB;QACjC,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,YAAY,EAAE;QACpB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,uDAAuD;KAClE,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,QAAQ,EAAE,2CAA2C;QACrD,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;AAtBD,0BAsBC;AAEM,KAAK,UAAU,OAAO,CAAC,EAC5B,UAAU,EACV,GAAG,EACH,KAAK,EACL,iBAAiB,EACjB,OAAO,EACP,IAAI,EACJ,MAAM,GACc;IACpB,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC,GAAG,MAAM,IAAA,2BAAqB,EAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACjG,MAAM,IAAA,6BAAY,EAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,IAAA,iBAAU,EAAC;QACf,IAAI;QACJ,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,UAAU;QACvB,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC;AAjBD,0BAiBC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import { resolveAppIdAndRemote } from '../../lib/app';
|
|
4
|
+
import { authenticate } from '../../lib/authentication';
|
|
5
|
+
import { createTeam } from '../../lib/team';
|
|
6
|
+
import { BaseArguments } from '../../types';
|
|
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
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["delete.ts"],"names":[],"mappings":";;;AAEA,uCAAsD;AACtD,6DAAwD;AACxD,yCAA4C;AAU/B,QAAA,OAAO,GAAG,QAAQ,CAAC;AACnB,QAAA,WAAW,GAAG,sCAAsC,CAAC;AAElE,SAAgB,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;AAlBD,0BAkBC;AAEM,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,IAAA,2BAAqB,EAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,IAAA,6BAAY,EAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,IAAA,iBAAU,EAAC;QACf,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC;AAhBD,0BAgBC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import { resolveAppIdAndRemote } from '../../lib/app';
|
|
4
|
+
import { authenticate } from '../../lib/authentication';
|
|
5
|
+
import { deleteTeam } from '../../lib/team';
|
|
6
|
+
import { BaseArguments } from '../../types';
|
|
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
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,iDAAmC;AACnC,qDAAuC;AACvC,iDAAmC;AACnC,iDAAmC;AAEnC,0CAAmD;AAA1C,gGAAA,IAAI,OAAW;AAEX,QAAA,OAAO,GAAG,MAAM,CAAC;AACjB,QAAA,WAAW,GAAG,gCAAgC,CAAC;AAE5D,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AACpG,CAAC;AAFD,0BAEC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import * as create from './create';
|
|
4
|
+
import * as deleteTeam from './delete';
|
|
5
|
+
import * as member from './member';
|
|
6
|
+
import * as update from './update';
|
|
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.command(create).command(deleteTeam).command(member).command(update).demandCommand(1);
|
|
15
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["delete.ts"],"names":[],"mappings":";;;AAEA,0CAAyD;AACzD,gEAA2D;AAC3D,4CAAiD;AAWpC,QAAA,OAAO,GAAG,eAAe,CAAC;AAC1B,QAAA,WAAW,GAAG,sDAAsD,CAAC;AAElF,SAAgB,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;AAtBD,0BAsBC;AAEM,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,IAAA,2BAAqB,EAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,IAAA,6BAAY,EAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,IAAA,mBAAY,EAAC;QACjB,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;QACJ,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC;AAlBD,0BAkBC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import { resolveAppIdAndRemote } from '../../../lib/app';
|
|
4
|
+
import { authenticate } from '../../../lib/authentication';
|
|
5
|
+
import { deleteMember } from '../../../lib/team';
|
|
6
|
+
import { BaseArguments } from '../../../types';
|
|
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
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uDAAyC;AACzC,iDAAmC;AACnC,iDAAmC;AAEnC,0CAAmD;AAA1C,gGAAA,IAAI,OAAW;AAEX,QAAA,OAAO,GAAG,QAAQ,CAAC;AACnB,QAAA,WAAW,GAAG,uCAAuC,CAAC;AAEnE,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC;AAFD,0BAEC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import * as deleteMember from './delete';
|
|
4
|
+
import * as invite from './invite';
|
|
5
|
+
import * as update from './update';
|
|
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.command(deleteMember).command(invite).command(update).demandCommand(1);
|
|
14
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invite.js","sourceRoot":"","sources":["invite.ts"],"names":[],"mappings":";;;AAEA,0CAAyD;AACzD,gEAA2D;AAC3D,4CAAiD;AAWpC,QAAA,OAAO,GAAG,eAAe,CAAC;AAC1B,QAAA,WAAW,GAAG,sDAAsD,CAAC;AAElF,SAAgB,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;AAtBD,0BAsBC;AAEM,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,IAAA,2BAAqB,EAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,IAAA,6BAAY,EAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,IAAA,mBAAY,EAAC;QACjB,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;QACJ,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC;AAlBD,0BAkBC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import { resolveAppIdAndRemote } from '../../../lib/app';
|
|
4
|
+
import { authenticate } from '../../../lib/authentication';
|
|
5
|
+
import { inviteMember } from '../../../lib/team';
|
|
6
|
+
import { BaseArguments } from '../../../types';
|
|
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
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["update.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAG5C,0CAAyD;AACzD,gEAA2D;AAC3D,4CAAiD;AAYpC,QAAA,OAAO,GAAG,sBAAsB,CAAC;AACjC,QAAA,WAAW,GAAG,iCAAiC,CAAC;AAE7D,SAAgB,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,gBAAQ,CAAC;KACjC,CAAC,CAAC;AACP,CAAC;AA3BD,0BA2BC;AAEM,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,IAAA,2BAAqB,EAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,IAAA,6BAAY,EAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,IAAA,mBAAY,EAAC;QACjB,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;QACJ,IAAI;QACJ,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC;AApBD,0BAoBC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { TeamRole } from '@appsemble/utils';
|
|
2
|
+
import { Argv } from 'yargs';
|
|
3
|
+
|
|
4
|
+
import { resolveAppIdAndRemote } from '../../../lib/app';
|
|
5
|
+
import { authenticate } from '../../../lib/authentication';
|
|
6
|
+
import { updateMember } from '../../../lib/team';
|
|
7
|
+
import { BaseArguments } from '../../../types';
|
|
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
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["update.ts"],"names":[],"mappings":";;;AAEA,uCAAsD;AACtD,6DAAwD;AACxD,yCAA4C;AAY/B,QAAA,OAAO,GAAG,QAAQ,CAAC;AACnB,QAAA,WAAW,GAAG,qCAAqC,CAAC;AAEjE,SAAgB,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;AAlBD,0BAkBC;AAEM,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,IAAA,2BAAqB,EAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,IAAA,6BAAY,EAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,IAAA,iBAAU,EAAC;QACf,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;QACJ,WAAW,EAAE,UAAU;QACvB,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC;AApBD,0BAoBC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
|
|
3
|
+
import { resolveAppIdAndRemote } from '../../lib/app';
|
|
4
|
+
import { authenticate } from '../../lib/authentication';
|
|
5
|
+
import { updateTeam } from '../../lib/team';
|
|
6
|
+
import { BaseArguments } from '../../types';
|
|
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.d.ts
ADDED
|
@@ -27,7 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.main = void 0;
|
|
31
30
|
const node_utils_1 = require("@appsemble/node-utils");
|
|
32
31
|
const cosmiconfig_1 = require("cosmiconfig");
|
|
33
32
|
const yargs_1 = __importDefault(require("yargs"));
|
|
@@ -47,6 +46,7 @@ const team = __importStar(require("./commands/team"));
|
|
|
47
46
|
const authentication_1 = require("./lib/authentication");
|
|
48
47
|
const coercers_1 = require("./lib/coercers");
|
|
49
48
|
const initAxios_1 = require("./lib/initAxios");
|
|
49
|
+
process.title = 'appsemble';
|
|
50
50
|
async function main(argv) {
|
|
51
51
|
const explorer = (0, cosmiconfig_1.cosmiconfig)('appsembleServer');
|
|
52
52
|
const found = await explorer.search(process.cwd());
|
|
@@ -94,9 +94,5 @@ async function main(argv) {
|
|
|
94
94
|
}
|
|
95
95
|
parser.parse(argv);
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
if (require.main === module) {
|
|
99
|
-
process.title = 'appsemble';
|
|
100
|
-
main(process.argv.slice(2));
|
|
101
|
-
}
|
|
97
|
+
main(process.argv.slice(2));
|
|
102
98
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sDAAqE;AACrE,6CAA0C;AAC1C,kDAA0B;AAE1B,oDAAsC;AACtC,wDAA0C;AAC1C,wDAA0C;AAC1C,8EAAgE;AAChE,0DAA4C;AAC5C,wDAA0C;AAC1C,0DAA4C;AAC5C,4DAA8C;AAC9C,sEAAwD;AACxD,8DAAgD;AAChD,oEAAsD;AACtD,wDAA0C;AAC1C,sDAAwC;AACxC,yDAA2D;AAC3D,6CAA8C;AAC9C,+CAA4C;AAE5C,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC;AAE5B,KAAK,UAAU,IAAI,CAAC,IAAc;IAChC,MAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,iBAAiB,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAEnD,IAAI,MAAM,GAAG,eAAK;SACf,MAAM,CAAC,SAAS,EAAE;QACjB,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,oBAAoB;QAC9B,IAAI,EAAE,OAAO;KACd,CAAC;SACD,MAAM,CAAC,OAAO,EAAE;QACf,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,oBAAoB;QAC9B,IAAI,EAAE,OAAO;KACd,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,WAAW,EAAE,yCAAyC;QACtD,OAAO,EAAE,uBAAuB;QAChC,MAAM,EAAE,uBAAY;KACrB,CAAC;SACD,MAAM,CAAC,oBAAoB,EAAE;QAC5B,WAAW,EAAE,qGAAqG,oCAAmB,wBAAwB;KAC9J,CAAC;SACD,UAAU,CAAC,CAAC,4BAAe,EAAE,qBAAS,CAAC,CAAC;SACxC,OAAO,CAAC,GAAG,CAAC;SACZ,OAAO,CAAC,KAAK,CAAC;SACd,OAAO,CAAC,KAAK,CAAC;SACd,OAAO,CAAC,gBAAgB,CAAC;SACzB,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC,KAAK,CAAC;SACd,OAAO,CAAC,MAAM,CAAC;SACf,OAAO,CAAC,OAAO,CAAC;SAChB,OAAO,CAAC,YAAY,CAAC;SACrB,OAAO,CAAC,QAAQ,CAAC;SACjB,OAAO,CAAC,WAAW,CAAC;SACpB,OAAO,CAAC,KAAK,CAAC;SACd,OAAO,CAAC,IAAI,CAAC;SACb,aAAa,CAAC,CAAC,CAAC;QACjB,6EAA6E;SAC5E,cAAc,EAAE;SAChB,IAAI,CAAC,wBAAW,CAAC;SACjB,IAAI,EAAE;SACN,UAAU,EAAE,CAAC;IAChB,IAAI,KAAK,EAAE;QACT,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;KACtC;IACD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC;AAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/index.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { configureLogger, handleError } from '@appsemble/node-utils';
|
|
3
|
+
import { cosmiconfig } from 'cosmiconfig';
|
|
4
|
+
import yargs from 'yargs';
|
|
5
|
+
|
|
6
|
+
import * as app from './commands/app';
|
|
7
|
+
import * as asset from './commands/asset';
|
|
8
|
+
import * as block from './commands/block';
|
|
9
|
+
import * as cleanupResources from './commands/cleanupResources';
|
|
10
|
+
import * as config from './commands/config';
|
|
11
|
+
import * as login from './commands/login';
|
|
12
|
+
import * as logout from './commands/logout';
|
|
13
|
+
import * as migrate from './commands/migrate';
|
|
14
|
+
import * as organization from './commands/organization';
|
|
15
|
+
import * as resource from './commands/resource';
|
|
16
|
+
import * as runCronJobs from './commands/runCronJobs';
|
|
17
|
+
import * as start from './commands/start';
|
|
18
|
+
import * as team from './commands/team';
|
|
19
|
+
import { CREDENTIALS_ENV_VAR } from './lib/authentication';
|
|
20
|
+
import { coerceRemote } from './lib/coercers';
|
|
21
|
+
import { initAxios } from './lib/initAxios';
|
|
22
|
+
|
|
23
|
+
process.title = 'appsemble';
|
|
24
|
+
|
|
25
|
+
async function main(argv: string[]): Promise<void> {
|
|
26
|
+
const explorer = cosmiconfig('appsembleServer');
|
|
27
|
+
const found = await explorer.search(process.cwd());
|
|
28
|
+
|
|
29
|
+
let parser = yargs
|
|
30
|
+
.option('verbose', {
|
|
31
|
+
alias: 'v',
|
|
32
|
+
describe: 'Increase verbosity',
|
|
33
|
+
type: 'count',
|
|
34
|
+
})
|
|
35
|
+
.option('quiet', {
|
|
36
|
+
alias: 'q',
|
|
37
|
+
describe: 'Decrease verbosity',
|
|
38
|
+
type: 'count',
|
|
39
|
+
})
|
|
40
|
+
.option('remote', {
|
|
41
|
+
description: 'The Appsemble host that should be used.',
|
|
42
|
+
default: 'https://appsemble.app',
|
|
43
|
+
coerce: coerceRemote,
|
|
44
|
+
})
|
|
45
|
+
.option('client-credentials', {
|
|
46
|
+
description: `OAuth2 client credentials formatted as "client_id:client_secret". This may also be defined in the ${CREDENTIALS_ENV_VAR} environment variable.`,
|
|
47
|
+
})
|
|
48
|
+
.middleware([configureLogger, initAxios])
|
|
49
|
+
.command(app)
|
|
50
|
+
.command(asset)
|
|
51
|
+
.command(block)
|
|
52
|
+
.command(cleanupResources)
|
|
53
|
+
.command(config)
|
|
54
|
+
.command(login)
|
|
55
|
+
.command(logout)
|
|
56
|
+
.command(migrate)
|
|
57
|
+
.command(organization)
|
|
58
|
+
.command(resource)
|
|
59
|
+
.command(runCronJobs)
|
|
60
|
+
.command(start)
|
|
61
|
+
.command(team)
|
|
62
|
+
.demandCommand(1)
|
|
63
|
+
// .strict() isn’t used because of https://github.com/yargs/yargs/issues/2058
|
|
64
|
+
.strictCommands()
|
|
65
|
+
.fail(handleError)
|
|
66
|
+
.help()
|
|
67
|
+
.completion();
|
|
68
|
+
if (found) {
|
|
69
|
+
parser = parser.config(found.config);
|
|
70
|
+
}
|
|
71
|
+
parser.parse(argv);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
main(process.argv.slice(2));
|
package/jest.config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../config/jest/config')(__dirname);
|
package/jest.setup.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/jest.setup.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.setup.js","sourceRoot":"","sources":["jest.setup.ts"],"names":[],"mappings":";;AAAA,sDAAoE;AAEpE,IAAA,2BAAc,EAAC,SAAS,CAAC,CAAC;AAC1B,IAAA,wBAAW,EAAC,CAAC,CAAC,CAAC"}
|
package/jest.setup.ts
ADDED