@appsemble/cli 0.20.27 → 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.
Files changed (136) hide show
  1. package/README.md +4 -4
  2. package/index.js +0 -0
  3. package/package.json +5 -5
  4. package/__fixtures__/getBlockConfigFromTypeScript/comments/index.ts +0 -40
  5. package/__fixtures__/getBlockConfigFromTypeScript/comments/tsconfig.json +0 -7
  6. package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/index.ts +0 -34
  7. package/__fixtures__/getBlockConfigFromTypeScript/duplicateActions/tsconfig.json +0 -7
  8. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/index.ts +0 -34
  9. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventEmitters/tsconfig.json +0 -7
  10. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/index.ts +0 -34
  11. package/__fixtures__/getBlockConfigFromTypeScript/duplicateEventListeners/tsconfig.json +0 -7
  12. package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/index.ts +0 -34
  13. package/__fixtures__/getBlockConfigFromTypeScript/duplicateParameters/tsconfig.json +0 -7
  14. package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/index.ts +0 -11
  15. package/__fixtures__/getBlockConfigFromTypeScript/fontawesomeParameters/tsconfig.json +0 -7
  16. package/__fixtures__/getBlockConfigFromTypeScript/tsError/index.ts +0 -4
  17. package/__fixtures__/getBlockConfigFromTypeScript/tsError/tsconfig.json +0 -8
  18. package/__fixtures__/getBlockConfigFromTypeScript/valid/index.ts +0 -28
  19. package/__fixtures__/getBlockConfigFromTypeScript/valid/tsconfig.json +0 -7
  20. package/__fixtures__/makePayload/with-icon/icon.svg +0 -2
  21. package/assets/appsemblerc.schema.json +0 -150
  22. package/changed/added/.gitkeep +0 -0
  23. package/changed/changed/.gitkeep +0 -0
  24. package/changed/deprecated/.gitkeep +0 -0
  25. package/changed/fixed/.gitkeep +0 -0
  26. package/changed/removed/.gitkeep +0 -0
  27. package/changed/security/.gitkeep +0 -0
  28. package/commands/app/create.js.map +0 -1
  29. package/commands/app/create.ts +0 -104
  30. package/commands/app/extract-messages.js.map +0 -1
  31. package/commands/app/extract-messages.ts +0 -56
  32. package/commands/app/index.js.map +0 -1
  33. package/commands/app/index.ts +0 -18
  34. package/commands/app/update.js.map +0 -1
  35. package/commands/app/update.ts +0 -111
  36. package/commands/asset/create.js.map +0 -1
  37. package/commands/asset/create.ts +0 -84
  38. package/commands/asset/index.js.map +0 -1
  39. package/commands/asset/index.ts +0 -12
  40. package/commands/block/build.js.map +0 -1
  41. package/commands/block/build.ts +0 -32
  42. package/commands/block/extract-messages.js.map +0 -1
  43. package/commands/block/extract-messages.ts +0 -41
  44. package/commands/block/index.js.map +0 -1
  45. package/commands/block/index.ts +0 -18
  46. package/commands/block/publish.js.map +0 -1
  47. package/commands/block/publish.ts +0 -58
  48. package/commands/cleanupResources.js.map +0 -1
  49. package/commands/cleanupResources.ts +0 -45
  50. package/commands/config/get.js.map +0 -1
  51. package/commands/config/get.ts +0 -27
  52. package/commands/config/index.js.map +0 -1
  53. package/commands/config/index.ts +0 -16
  54. package/commands/config/set.js.map +0 -1
  55. package/commands/config/set.ts +0 -45
  56. package/commands/login.js.map +0 -1
  57. package/commands/login.ts +0 -5
  58. package/commands/logout.js.map +0 -1
  59. package/commands/logout.ts +0 -5
  60. package/commands/migrate.js.map +0 -1
  61. package/commands/migrate.ts +0 -50
  62. package/commands/organization/create.js.map +0 -1
  63. package/commands/organization/create.ts +0 -65
  64. package/commands/organization/index.js.map +0 -1
  65. package/commands/organization/index.ts +0 -16
  66. package/commands/organization/update.js.map +0 -1
  67. package/commands/organization/update.ts +0 -65
  68. package/commands/resource/create.js.map +0 -1
  69. package/commands/resource/create.ts +0 -78
  70. package/commands/resource/index.js.map +0 -1
  71. package/commands/resource/index.ts +0 -16
  72. package/commands/resource/update.js.map +0 -1
  73. package/commands/resource/update.ts +0 -77
  74. package/commands/runCronJobs.js.map +0 -1
  75. package/commands/runCronJobs.ts +0 -45
  76. package/commands/start.js.map +0 -1
  77. package/commands/start.ts +0 -140
  78. package/commands/team/create.js.map +0 -1
  79. package/commands/team/create.ts +0 -60
  80. package/commands/team/delete.js.map +0 -1
  81. package/commands/team/delete.ts +0 -54
  82. package/commands/team/index.js.map +0 -1
  83. package/commands/team/index.ts +0 -20
  84. package/commands/team/member/delete.js.map +0 -1
  85. package/commands/team/member/delete.ts +0 -61
  86. package/commands/team/member/index.js.map +0 -1
  87. package/commands/team/member/index.ts +0 -18
  88. package/commands/team/member/invite.js.map +0 -1
  89. package/commands/team/member/invite.ts +0 -61
  90. package/commands/team/member/update.js.map +0 -1
  91. package/commands/team/member/update.ts +0 -70
  92. package/commands/team/update.js.map +0 -1
  93. package/commands/team/update.ts +0 -60
  94. package/index.js.map +0 -1
  95. package/index.ts +0 -74
  96. package/jest.config.js +0 -3
  97. package/jest.setup.js.map +0 -1
  98. package/jest.setup.ts +0 -4
  99. package/lib/__snapshots__/getBlockConfigFromTypeScript.test.ts.snap +0 -4241
  100. package/lib/app.js.map +0 -1
  101. package/lib/app.ts +0 -795
  102. package/lib/asset.js.map +0 -1
  103. package/lib/asset.ts +0 -43
  104. package/lib/authentication.js.map +0 -1
  105. package/lib/authentication.ts +0 -194
  106. package/lib/block.js.map +0 -1
  107. package/lib/block.test.js.map +0 -1
  108. package/lib/block.test.ts +0 -103
  109. package/lib/block.ts +0 -384
  110. package/lib/coercers.js.map +0 -1
  111. package/lib/coercers.test.js.map +0 -1
  112. package/lib/coercers.test.ts +0 -27
  113. package/lib/coercers.ts +0 -58
  114. package/lib/getBlockConfigFromTypeScript.js.map +0 -1
  115. package/lib/getBlockConfigFromTypeScript.test.js.map +0 -1
  116. package/lib/getBlockConfigFromTypeScript.test.ts +0 -282
  117. package/lib/getBlockConfigFromTypeScript.ts +0 -356
  118. package/lib/initAxios.js.map +0 -1
  119. package/lib/initAxios.ts +0 -16
  120. package/lib/loadWebpackConfig.js.map +0 -1
  121. package/lib/loadWebpackConfig.ts +0 -52
  122. package/lib/organization.js.map +0 -1
  123. package/lib/organization.ts +0 -105
  124. package/lib/output.js.map +0 -1
  125. package/lib/output.ts +0 -19
  126. package/lib/processCss.js.map +0 -1
  127. package/lib/processCss.ts +0 -24
  128. package/lib/resource.js.map +0 -1
  129. package/lib/resource.ts +0 -128
  130. package/lib/serverImport.js.map +0 -1
  131. package/lib/serverImport.ts +0 -42
  132. package/lib/team.js.map +0 -1
  133. package/lib/team.ts +0 -152
  134. package/tsconfig.json +0 -9
  135. package/types.js.map +0 -1
  136. package/types.ts +0 -110
@@ -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"}
@@ -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"}
@@ -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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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,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AU;QACvB,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;AACL,CAAC"}
@@ -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,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,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
@@ -1,3 +0,0 @@
1
- import { createJestConfig } from '../../config/jest/config.js';
2
-
3
- export default createJestConfig(import.meta);
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
@@ -1,4 +0,0 @@
1
- import { setFixtureBase, setLogLevel } from '@appsemble/node-utils';
2
-
3
- setFixtureBase(import.meta);
4
- setLogLevel(0);