@appsemble/cli 0.18.27 → 0.18.31

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 (130) hide show
  1. package/dist/commands/app/create.d.ts +2 -1
  2. package/dist/commands/app/create.js +9 -3
  3. package/dist/commands/app/create.js.map +1 -1
  4. package/dist/commands/app/update.js +4 -2
  5. package/dist/commands/app/update.js.map +1 -1
  6. package/dist/commands/asset/create.d.ts +15 -0
  7. package/dist/commands/asset/create.js +66 -0
  8. package/dist/commands/asset/create.js.map +1 -0
  9. package/dist/commands/asset.d.ts +4 -0
  10. package/dist/commands/asset.js +11 -0
  11. package/dist/commands/asset.js.map +1 -0
  12. package/dist/commands/block/build.js +3 -4
  13. package/dist/commands/block/build.js.map +1 -1
  14. package/dist/commands/block/extract-messages.js +3 -4
  15. package/dist/commands/block/extract-messages.js.map +1 -1
  16. package/dist/commands/block/publish.js +4 -6
  17. package/dist/commands/block/publish.js.map +1 -1
  18. package/dist/commands/config/get.js +2 -1
  19. package/dist/commands/config/get.js.map +1 -1
  20. package/dist/commands/config/set.js +2 -1
  21. package/dist/commands/config/set.js.map +1 -1
  22. package/dist/commands/organization/create.js +9 -31
  23. package/dist/commands/organization/create.js.map +1 -1
  24. package/dist/commands/organization/update.js +9 -30
  25. package/dist/commands/organization/update.js.map +1 -1
  26. package/dist/commands/resource/create.d.ts +3 -1
  27. package/dist/commands/resource/create.js +17 -7
  28. package/dist/commands/resource/create.js.map +1 -1
  29. package/dist/commands/resource/update.d.ts +3 -1
  30. package/dist/commands/resource/update.js +18 -8
  31. package/dist/commands/resource/update.js.map +1 -1
  32. package/dist/commands/start.js +2 -2
  33. package/dist/commands/start.js.map +1 -1
  34. package/dist/commands/{app/team → team}/create.d.ts +5 -2
  35. package/dist/commands/team/create.js +44 -0
  36. package/dist/commands/team/create.js.map +1 -0
  37. package/dist/commands/{app/team → team}/delete.d.ts +4 -2
  38. package/dist/commands/team/delete.js +39 -0
  39. package/dist/commands/team/delete.js.map +1 -0
  40. package/dist/commands/{app/team → team}/member/delete.d.ts +4 -2
  41. package/dist/commands/{app/team → team}/member/delete.js +16 -6
  42. package/dist/commands/team/member/delete.js.map +1 -0
  43. package/dist/commands/{app/team → team}/member/invite.d.ts +4 -2
  44. package/dist/commands/{app/team → team}/member/invite.js +16 -6
  45. package/dist/commands/team/member/invite.js.map +1 -0
  46. package/dist/commands/{app/team → team}/member/update.d.ts +4 -2
  47. package/dist/commands/{app/team → team}/member/update.js +16 -6
  48. package/dist/commands/team/member/update.js.map +1 -0
  49. package/dist/commands/{app/team → team}/member.d.ts +0 -0
  50. package/dist/commands/{app/team → team}/member.js +0 -0
  51. package/dist/commands/team/member.js.map +1 -0
  52. package/dist/commands/{app/team → team}/update.d.ts +4 -2
  53. package/dist/commands/{app/team → team}/update.js +7 -10
  54. package/dist/commands/team/update.js.map +1 -0
  55. package/dist/commands/{app/team.d.ts → team.d.ts} +0 -0
  56. package/dist/commands/{app/team.js → team.js} +0 -0
  57. package/dist/commands/team.js.map +1 -0
  58. package/dist/lib/app.d.ts +146 -0
  59. package/dist/lib/app.js +332 -9
  60. package/dist/lib/app.js.map +1 -1
  61. package/dist/lib/{createResource.d.ts → asset.d.ts} +5 -4
  62. package/dist/lib/asset.js +23 -0
  63. package/dist/lib/asset.js.map +1 -0
  64. package/dist/lib/block.d.ts +61 -0
  65. package/dist/lib/block.js +297 -0
  66. package/dist/lib/block.js.map +1 -0
  67. package/dist/lib/getBlockConfigFromTypeScript.js +4 -3
  68. package/dist/lib/getBlockConfigFromTypeScript.js.map +1 -1
  69. package/dist/lib/organization.d.ts +21 -0
  70. package/dist/lib/organization.js +65 -0
  71. package/dist/lib/organization.js.map +1 -0
  72. package/dist/lib/{updateResource.d.ts → resource.d.ts} +19 -0
  73. package/dist/lib/{updateResource.js → resource.js} +17 -2
  74. package/dist/lib/resource.js.map +1 -0
  75. package/dist/lib/serverImport.js +4 -3
  76. package/dist/lib/serverImport.js.map +1 -1
  77. package/dist/lib/team.d.ts +6 -1
  78. package/dist/lib/team.js +17 -8
  79. package/dist/lib/team.js.map +1 -1
  80. package/dist/types.d.ts +2 -2
  81. package/package.json +5 -5
  82. package/dist/commands/app/team/create.js +0 -29
  83. package/dist/commands/app/team/create.js.map +0 -1
  84. package/dist/commands/app/team/delete.js +0 -29
  85. package/dist/commands/app/team/delete.js.map +0 -1
  86. package/dist/commands/app/team/member/delete.js.map +0 -1
  87. package/dist/commands/app/team/member/invite.js.map +0 -1
  88. package/dist/commands/app/team/member/update.js.map +0 -1
  89. package/dist/commands/app/team/member.js.map +0 -1
  90. package/dist/commands/app/team/update.js.map +0 -1
  91. package/dist/commands/app/team.js.map +0 -1
  92. package/dist/lib/buildBlock.d.ts +0 -9
  93. package/dist/lib/buildBlock.js +0 -39
  94. package/dist/lib/buildBlock.js.map +0 -1
  95. package/dist/lib/createApp.d.ts +0 -59
  96. package/dist/lib/createApp.js +0 -120
  97. package/dist/lib/createApp.js.map +0 -1
  98. package/dist/lib/createResource.js +0 -25
  99. package/dist/lib/createResource.js.map +0 -1
  100. package/dist/lib/discoverBlocks.d.ts +0 -10
  101. package/dist/lib/discoverBlocks.js +0 -24
  102. package/dist/lib/discoverBlocks.js.map +0 -1
  103. package/dist/lib/getBlockConfig.d.ts +0 -8
  104. package/dist/lib/getBlockConfig.js +0 -45
  105. package/dist/lib/getBlockConfig.js.map +0 -1
  106. package/dist/lib/makePayload.d.ts +0 -9
  107. package/dist/lib/makePayload.js +0 -94
  108. package/dist/lib/makePayload.js.map +0 -1
  109. package/dist/lib/processBlockMessages.d.ts +0 -2
  110. package/dist/lib/processBlockMessages.js +0 -43
  111. package/dist/lib/processBlockMessages.js.map +0 -1
  112. package/dist/lib/publishBlock.d.ts +0 -8
  113. package/dist/lib/publishBlock.js +0 -32
  114. package/dist/lib/publishBlock.js.map +0 -1
  115. package/dist/lib/traverseAppDirectory.d.ts +0 -11
  116. package/dist/lib/traverseAppDirectory.js +0 -94
  117. package/dist/lib/traverseAppDirectory.js.map +0 -1
  118. package/dist/lib/traverseBlockThemes.d.ts +0 -9
  119. package/dist/lib/traverseBlockThemes.js +0 -40
  120. package/dist/lib/traverseBlockThemes.js.map +0 -1
  121. package/dist/lib/updateApp.d.ts +0 -55
  122. package/dist/lib/updateApp.js +0 -78
  123. package/dist/lib/updateApp.js.map +0 -1
  124. package/dist/lib/updateResource.js.map +0 -1
  125. package/dist/lib/uploadAppBlockTheme.d.ts +0 -11
  126. package/dist/lib/uploadAppBlockTheme.js +0 -33
  127. package/dist/lib/uploadAppBlockTheme.js.map +0 -1
  128. package/dist/lib/uploadMessages.d.ts +0 -9
  129. package/dist/lib/uploadMessages.js +0 -39
  130. package/dist/lib/uploadMessages.js.map +0 -1
@@ -7,8 +7,9 @@ exports.handler = exports.builder = exports.description = exports.command = void
7
7
  const node_utils_1 = require("@appsemble/node-utils");
8
8
  const fast_glob_1 = __importDefault(require("fast-glob"));
9
9
  const normalize_path_1 = __importDefault(require("normalize-path"));
10
+ const app_1 = require("../../lib/app");
10
11
  const authentication_1 = require("../../lib/authentication");
11
- const updateResource_1 = require("../../lib/updateResource");
12
+ const resource_1 = require("../../lib/resource");
12
13
  exports.command = 'update <resource-name> <paths...>';
13
14
  exports.description = 'Update resources based on a specified JSON file or directory. Entries without the property `id` will be skipped.';
14
15
  function builder(yargs) {
@@ -23,14 +24,23 @@ function builder(yargs) {
23
24
  demandOption: true,
24
25
  })
25
26
  .option('app-id', {
26
- describe: 'The ID of the app to update the resources of.',
27
+ describe: 'The ID of the app to create the resources for.',
27
28
  type: 'number',
28
- demandOption: true,
29
+ conflicts: 'app',
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',
29
38
  });
30
39
  }
31
40
  exports.builder = builder;
32
- async function handler({ appId, clientCredentials, paths, remote, resourceName, }) {
33
- await authentication_1.authenticate(remote, 'resources:write', clientCredentials);
41
+ async function handler({ app, appId, clientCredentials, context, paths, remote, resourceName, }) {
42
+ const [resolvedAppId, resolvedRemote] = await app_1.resolveAppIdAndRemote(app, context, remote, appId);
43
+ await authentication_1.authenticate(resolvedRemote, 'resources:write', clientCredentials);
34
44
  const normalizedPaths = paths.map((path) => normalize_path_1.default(path));
35
45
  const files = await fast_glob_1.default(normalizedPaths, { absolute: true, onlyFiles: true });
36
46
  if (!files.length) {
@@ -39,11 +49,11 @@ async function handler({ appId, clientCredentials, paths, remote, resourceName,
39
49
  node_utils_1.logger.info(`Updating resources based on ${files.length} files`);
40
50
  for (const path of files) {
41
51
  node_utils_1.logger.info('');
42
- await updateResource_1.updateResource({
52
+ await resource_1.updateResource({
43
53
  resourceName,
44
- appId,
54
+ appId: resolvedAppId,
45
55
  path,
46
- remote,
56
+ remote: resolvedRemote,
47
57
  });
48
58
  }
49
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/resource/update.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+D;AAC/D,0DAA2B;AAC3B,oEAA2C;AAG3C,6DAAwD;AACxD,6DAA0D;AAS7C,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,WAAW,GACtB,kHAAkH,CAAC;AAErH,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,UAAU,CAAC,eAAe,EAAE;QAC3B,QAAQ,EAAE,kDAAkD;QAC5D,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,UAAU,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,qCAAqC;QAC/C,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,QAAQ,EAAE,+CAA+C;QACzD,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACP,CAAC;AAhBD,0BAgBC;A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ChB,MAAM,yBAAc,CAAC;YACnB,YAAY;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI;YACJ,MAAM,EAAE,cAAc;SACvB,CAAC,CAAC;KACJ;AACH,CAAC;AA7BD,0BA6BC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handler = exports.builder = exports.description = exports.command = void 0;
4
- const discoverBlocks_1 = require("../lib/discoverBlocks");
4
+ const block_1 = require("../lib/block");
5
5
  const loadWebpackConfig_1 = require("../lib/loadWebpackConfig");
6
6
  const serverImport_1 = require("../lib/serverImport");
7
7
  exports.command = 'start';
@@ -122,7 +122,7 @@ exports.builder = builder;
122
122
  async function handler(argv) {
123
123
  const { setArgv, start } = await serverImport_1.serverImport('setArgv', 'start');
124
124
  setArgv(argv);
125
- const blocks = await discoverBlocks_1.discoverBlocks(process.cwd());
125
+ const blocks = await block_1.discoverBlocks(process.cwd());
126
126
  const webpackConfigs = await Promise.all(blocks.map((block) => loadWebpackConfig_1.loadWebpackConfig(block, 'development')));
127
127
  return start({ webpackConfigs });
128
128
  }
@@ -1 +1 @@
1
- {"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":";;;AAEA,0DAAuD;AACvD,gEAA6D;AAC7D,sDAAmD;AAGtC,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,WAAW,GAAG,yCAAyC,CAAC;AAErE,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,MAAM,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,iDAAiD;QACvD,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;KACd,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,4FAA4F;KACnG,CAAC;SACD,MAAM,CAAC,eAAe,EAAE;QACvB,IAAI,EAAE,yCAAyC;QAC/C,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,IAAI;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O,CAAC,IAAmB;IAC/C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,2BAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAClE,OAAO,CAAC,IAAI,CAAC,CAAC;IACd,MAAM,MAAM,GAAG,MAAM,sBAAc,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACnD,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,GAAG,CACtC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qCAAiB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAC/D,CAAC;IACF,OAAO,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC;AACnC,CAAC;AARD,0BAQC"}
@@ -1,11 +1,14 @@
1
1
  import { Argv } from 'yargs';
2
- import { BaseArguments } from '../../../types';
2
+ import { BaseArguments } from '../../types';
3
3
  interface CreateTeamArguments extends BaseArguments {
4
4
  appId: number;
5
5
  name: string;
6
+ context: string;
7
+ app: string;
8
+ annotation: string[];
6
9
  }
7
10
  export declare const command = "create <name>";
8
11
  export declare const description = "Create a new team for an app.";
9
12
  export declare function builder(yargs: Argv): Argv;
10
- export declare function handler({ appId, clientCredentials, name, remote, }: CreateTeamArguments): Promise<void>;
13
+ export declare function handler({ annotation, app, appId, clientCredentials, context, name, remote, }: CreateTeamArguments): Promise<void>;
11
14
  export {};
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handler = exports.builder = exports.description = exports.command = void 0;
4
+ const app_1 = require("../../lib/app");
5
+ const authentication_1 = require("../../lib/authentication");
6
+ const team_1 = require("../../lib/team");
7
+ exports.command = 'create <name>';
8
+ exports.description = 'Create a new team for an app.';
9
+ function builder(yargs) {
10
+ return yargs
11
+ .positional('name', {
12
+ describe: 'The name of the team.',
13
+ demandOption: true,
14
+ })
15
+ .option('annotation', {
16
+ type: 'array',
17
+ describe: 'The new list of annotations. The format is key=value.',
18
+ })
19
+ .option('app-id', {
20
+ describe: 'The ID of the app to create the team for.',
21
+ type: 'number',
22
+ conflicts: 'app',
23
+ })
24
+ .option('app', {
25
+ describe: 'The path to the app.',
26
+ demandOption: 'context',
27
+ })
28
+ .option('context', {
29
+ describe: 'If specified, use the specified context from .appsemblerc.yaml',
30
+ demandOption: 'app',
31
+ });
32
+ }
33
+ exports.builder = builder;
34
+ async function handler({ annotation, app, appId, clientCredentials, context, name, remote, }) {
35
+ const [resolvedAppId, resolvedRemote] = await app_1.resolveAppIdAndRemote(app, context, remote, appId);
36
+ await authentication_1.authenticate(resolvedRemote, 'teams:write', clientCredentials);
37
+ await team_1.createTeam({
38
+ name,
39
+ appId: resolvedAppId,
40
+ annotations: annotation,
41
+ });
42
+ }
43
+ exports.handler = handler;
44
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/team/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;QACd,SAAS,EAAE,KAAK;KACjB,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;AAvBD,0BAuBC;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,2BAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACjG,MAAM,6BAAY,CAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,iBAAU,CAAC;QACf,IAAI;QACJ,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,UAAU;KACxB,CAAC,CAAC;AACL,CAAC;AAhBD,0BAgBC"}
@@ -1,11 +1,13 @@
1
1
  import { Argv } from 'yargs';
2
- import { BaseArguments } from '../../../types';
2
+ import { BaseArguments } from '../../types';
3
3
  interface DeleteTeamArguments extends BaseArguments {
4
4
  appId: number;
5
5
  id: number;
6
+ context: string;
7
+ app: string;
6
8
  }
7
9
  export declare const command = "delete";
8
10
  export declare const description = "Delete an existing team from an app.";
9
11
  export declare function builder(yargs: Argv): Argv;
10
- export declare function handler({ appId, clientCredentials, id, remote, }: DeleteTeamArguments): Promise<void>;
12
+ export declare function handler({ app, appId, clientCredentials, context, id, remote, }: DeleteTeamArguments): Promise<void>;
11
13
  export {};
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handler = exports.builder = exports.description = exports.command = void 0;
4
+ const app_1 = require("../../lib/app");
5
+ const authentication_1 = require("../../lib/authentication");
6
+ const team_1 = require("../../lib/team");
7
+ exports.command = 'delete';
8
+ exports.description = 'Delete an existing team from an app.';
9
+ function builder(yargs) {
10
+ return yargs
11
+ .option('id', {
12
+ describe: 'The ID of the team to delete.',
13
+ demandOption: true,
14
+ })
15
+ .option('app-id', {
16
+ describe: 'The ID of the app to delete the team from.',
17
+ type: 'number',
18
+ conflicts: 'app',
19
+ })
20
+ .option('app', {
21
+ describe: 'The path to the app.',
22
+ demandOption: 'context',
23
+ })
24
+ .option('context', {
25
+ describe: 'If specified, use the specified context from .appsemblerc.yaml',
26
+ demandOption: 'app',
27
+ });
28
+ }
29
+ exports.builder = builder;
30
+ async function handler({ app, appId, clientCredentials, context, id, remote, }) {
31
+ const [resolvedAppId, resolvedRemote] = await app_1.resolveAppIdAndRemote(app, context, remote, appId);
32
+ await authentication_1.authenticate(resolvedRemote, 'teams:write', clientCredentials);
33
+ await team_1.deleteTeam({
34
+ id,
35
+ appId: resolvedAppId,
36
+ });
37
+ }
38
+ exports.handler = handler;
39
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/team/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;QACd,SAAS,EAAE,KAAK;KACjB,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;AAnBD,0BAmBC;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,2BAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,6BAAY,CAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,iBAAU,CAAC;QACf,EAAE;QACF,KAAK,EAAE,aAAa;KACrB,CAAC,CAAC;AACL,CAAC;AAfD,0BAeC"}
@@ -1,12 +1,14 @@
1
1
  import { Argv } from 'yargs';
2
- import { BaseArguments } from '../../../../types';
2
+ import { BaseArguments } from '../../../types';
3
3
  interface DeleteTeamArguments extends BaseArguments {
4
4
  appId: number;
5
5
  id: number;
6
6
  user: string;
7
+ context: string;
8
+ app: string;
7
9
  }
8
10
  export declare const command = "delete <user>";
9
11
  export declare const description = "Delete a new member to an existing team from an app.";
10
12
  export declare function builder(yargs: Argv): Argv;
11
- export declare function handler({ appId, clientCredentials, id, remote, user, }: DeleteTeamArguments): Promise<void>;
13
+ export declare function handler({ app, appId, clientCredentials, context, id, remote, user, }: DeleteTeamArguments): Promise<void>;
12
14
  export {};
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handler = exports.builder = exports.description = exports.command = void 0;
4
- const authentication_1 = require("../../../../lib/authentication");
5
- const team_1 = require("../../../../lib/team");
4
+ const app_1 = require("../../../lib/app");
5
+ const authentication_1 = require("../../../lib/authentication");
6
+ const team_1 = require("../../../lib/team");
6
7
  exports.command = 'delete <user>';
7
8
  exports.description = 'Delete a new member to an existing team from an app.';
8
9
  function builder(yargs) {
@@ -14,19 +15,28 @@ function builder(yargs) {
14
15
  .option('app-id', {
15
16
  describe: 'The ID of the app of the team',
16
17
  type: 'number',
17
- demandOption: true,
18
+ conflicts: 'app',
18
19
  })
19
20
  .positional('user', {
20
21
  describe: 'The ID or email address of the user you want to delete.',
21
22
  demandOption: true,
23
+ })
24
+ .option('app', {
25
+ describe: 'The path to the app.',
26
+ demandOption: 'context',
27
+ })
28
+ .option('context', {
29
+ describe: 'If specified, use the specified context from .appsemblerc.yaml',
30
+ demandOption: 'app',
22
31
  });
23
32
  }
24
33
  exports.builder = builder;
25
- async function handler({ appId, clientCredentials, id, remote, user, }) {
26
- await authentication_1.authenticate(remote, 'teams:write', clientCredentials);
34
+ async function handler({ app, appId, clientCredentials, context, id, remote, user, }) {
35
+ const [resolvedAppId, resolvedRemote] = await app_1.resolveAppIdAndRemote(app, context, remote, appId);
36
+ await authentication_1.authenticate(resolvedRemote, 'teams:write', clientCredentials);
27
37
  await team_1.deleteMember({
28
38
  id,
29
- appId,
39
+ appId: resolvedAppId,
30
40
  user,
31
41
  });
32
42
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/team/member/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;QACd,SAAS,EAAE,KAAK;KACjB,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;AAvBD,0BAuBC;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,2BAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,6BAAY,CAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,mBAAY,CAAC;QACjB,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAjBD,0BAiBC"}
@@ -1,12 +1,14 @@
1
1
  import { Argv } from 'yargs';
2
- import { BaseArguments } from '../../../../types';
2
+ import { BaseArguments } from '../../../types';
3
3
  interface InviteTeamArguments extends BaseArguments {
4
4
  appId: number;
5
5
  id: number;
6
6
  user: string;
7
+ context: string;
8
+ app: string;
7
9
  }
8
10
  export declare const command = "invite <user>";
9
11
  export declare const description = "Invite a new member to an existing team from an app.";
10
12
  export declare function builder(yargs: Argv): Argv;
11
- export declare function handler({ appId, clientCredentials, id, remote, user, }: InviteTeamArguments): Promise<void>;
13
+ export declare function handler({ app, appId, clientCredentials, context, id, remote, user, }: InviteTeamArguments): Promise<void>;
12
14
  export {};
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handler = exports.builder = exports.description = exports.command = void 0;
4
- const authentication_1 = require("../../../../lib/authentication");
5
- const team_1 = require("../../../../lib/team");
4
+ const app_1 = require("../../../lib/app");
5
+ const authentication_1 = require("../../../lib/authentication");
6
+ const team_1 = require("../../../lib/team");
6
7
  exports.command = 'invite <user>';
7
8
  exports.description = 'Invite a new member to an existing team from an app.';
8
9
  function builder(yargs) {
@@ -14,7 +15,15 @@ function builder(yargs) {
14
15
  .option('app-id', {
15
16
  describe: 'The ID of the app of the team',
16
17
  type: 'number',
17
- demandOption: true,
18
+ conflicts: 'app',
19
+ })
20
+ .option('app', {
21
+ describe: 'The path to the app.',
22
+ demandOption: 'context',
23
+ })
24
+ .option('context', {
25
+ describe: 'If specified, use the specified context from .appsemblerc.yaml',
26
+ demandOption: 'app',
18
27
  })
19
28
  .positional('user', {
20
29
  describe: 'The ID or email address of the user you want to invite.',
@@ -22,11 +31,12 @@ function builder(yargs) {
22
31
  });
23
32
  }
24
33
  exports.builder = builder;
25
- async function handler({ appId, clientCredentials, id, remote, user, }) {
26
- await authentication_1.authenticate(remote, 'teams:write', clientCredentials);
34
+ async function handler({ app, appId, clientCredentials, context, id, remote, user, }) {
35
+ const [resolvedAppId, resolvedRemote] = await app_1.resolveAppIdAndRemote(app, context, remote, appId);
36
+ await authentication_1.authenticate(resolvedRemote, 'teams:write', clientCredentials);
27
37
  await team_1.inviteMember({
28
38
  id,
29
- appId,
39
+ appId: resolvedAppId,
30
40
  user,
31
41
  });
32
42
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invite.js","sourceRoot":"","sources":["../../../../src/commands/team/member/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;QACd,SAAS,EAAE,KAAK;KACjB,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;AAvBD,0BAuBC;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,2BAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,6BAAY,CAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,mBAAY,CAAC;QACjB,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAjBD,0BAiBC"}
@@ -1,14 +1,16 @@
1
1
  import { TeamRole } from '@appsemble/utils';
2
2
  import { Argv } from 'yargs';
3
- import { BaseArguments } from '../../../../types';
3
+ import { BaseArguments } from '../../../types';
4
4
  interface InviteTeamArguments extends BaseArguments {
5
5
  appId: number;
6
6
  id: number;
7
7
  user: string;
8
8
  role: TeamRole;
9
+ context: string;
10
+ app: string;
9
11
  }
10
12
  export declare const command = "update <user> <role>";
11
13
  export declare const description = "Update an existing team member.";
12
14
  export declare function builder(yargs: Argv): Argv;
13
- export declare function handler({ appId, clientCredentials, id, remote, role, user, }: InviteTeamArguments): Promise<void>;
15
+ export declare function handler({ app, appId, clientCredentials, context, id, remote, role, user, }: InviteTeamArguments): Promise<void>;
14
16
  export {};
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handler = exports.builder = exports.description = exports.command = void 0;
4
4
  const utils_1 = require("@appsemble/utils");
5
- const authentication_1 = require("../../../../lib/authentication");
6
- const team_1 = require("../../../../lib/team");
5
+ const app_1 = require("../../../lib/app");
6
+ const authentication_1 = require("../../../lib/authentication");
7
+ const team_1 = require("../../../lib/team");
7
8
  exports.command = 'update <user> <role>';
8
9
  exports.description = 'Update an existing team member.';
9
10
  function builder(yargs) {
@@ -15,7 +16,15 @@ function builder(yargs) {
15
16
  .option('app-id', {
16
17
  describe: 'The ID of the app of the team',
17
18
  type: 'number',
18
- demandOption: true,
19
+ conflicts: 'app',
20
+ })
21
+ .option('app', {
22
+ describe: 'The path to the app.',
23
+ demandOption: 'context',
24
+ })
25
+ .option('context', {
26
+ describe: 'If specified, use the specified context from .appsemblerc.yaml',
27
+ demandOption: 'app',
19
28
  })
20
29
  .positional('user', {
21
30
  describe: 'The ID or email address of the user you want to invite.',
@@ -28,11 +37,12 @@ function builder(yargs) {
28
37
  });
29
38
  }
30
39
  exports.builder = builder;
31
- async function handler({ appId, clientCredentials, id, remote, role, user, }) {
32
- await authentication_1.authenticate(remote, 'teams:write', clientCredentials);
40
+ async function handler({ app, appId, clientCredentials, context, id, remote, role, user, }) {
41
+ const [resolvedAppId, resolvedRemote] = await app_1.resolveAppIdAndRemote(app, context, remote, appId);
42
+ await authentication_1.authenticate(resolvedRemote, 'teams:write', clientCredentials);
33
43
  await team_1.updateMember({
34
44
  id,
35
- appId,
45
+ appId: resolvedAppId,
36
46
  user,
37
47
  role,
38
48
  });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/team/member/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;QACd,SAAS,EAAE,KAAK;KACjB,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;AA5BD,0BA4BC;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,2BAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,6BAAY,CAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,mBAAY,CAAC;QACjB,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;QACJ,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAnBD,0BAmBC"}
File without changes
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member.js","sourceRoot":"","sources":["../../../src/commands/team/member.ts"],"names":[],"mappings":";;;AAAA,sDAA0D;AAG7C,QAAA,OAAO,GAAG,QAAQ,CAAC;AACnB,QAAA,WAAW,GAAG,uCAAuC,CAAC;AAEnE,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,8BAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;AAC5D,CAAC;AAFD,0BAEC"}
@@ -1,13 +1,15 @@
1
1
  import { Argv } from 'yargs';
2
- import { BaseArguments } from '../../../types';
2
+ import { BaseArguments } from '../../types';
3
3
  interface UpdateTeamArguments extends BaseArguments {
4
4
  appId: number;
5
5
  id: number;
6
6
  name: string;
7
7
  annotation: string[];
8
+ context: string;
9
+ app: string;
8
10
  }
9
11
  export declare const command = "update";
10
12
  export declare const description = "Update an existing team for an app.";
11
13
  export declare function builder(yargs: Argv): Argv;
12
- export declare function handler({ annotation, appId, clientCredentials, id, name, remote, }: UpdateTeamArguments): Promise<void>;
14
+ export declare function handler({ annotation, app, appId, clientCredentials, context, id, name, remote, }: UpdateTeamArguments): Promise<void>;
13
15
  export {};
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handler = exports.builder = exports.description = exports.command = void 0;
4
- const node_utils_1 = require("@appsemble/node-utils");
5
- const authentication_1 = require("../../../lib/authentication");
6
- const team_1 = require("../../../lib/team");
4
+ const app_1 = require("../../lib/app");
5
+ const authentication_1 = require("../../lib/authentication");
6
+ const team_1 = require("../../lib/team");
7
7
  exports.command = 'update';
8
8
  exports.description = 'Update an existing team for an app.';
9
9
  function builder(yargs) {
@@ -26,15 +26,12 @@ function builder(yargs) {
26
26
  });
27
27
  }
28
28
  exports.builder = builder;
29
- const annotationRegex = /^\w+=.+$/;
30
- async function handler({ annotation, appId, clientCredentials, id, name, remote, }) {
31
- if (annotation.some((a) => !annotationRegex.test(a))) {
32
- throw new node_utils_1.AppsembleError('One of the annotations did not follow the pattern of key=value');
33
- }
34
- await authentication_1.authenticate(remote, 'teams:write', clientCredentials);
29
+ async function handler({ annotation, app, appId, clientCredentials, context, id, name, remote, }) {
30
+ const [resolvedAppId, resolvedRemote] = await app_1.resolveAppIdAndRemote(app, context, remote, appId);
31
+ await authentication_1.authenticate(resolvedRemote, 'teams:write', clientCredentials);
35
32
  await team_1.updateTeam({
36
33
  id,
37
- appId,
34
+ appId: resolvedAppId,
38
35
  name,
39
36
  annotations: annotation,
40
37
  });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/team/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,2BAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjG,MAAM,6BAAY,CAAC,cAAc,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IACrE,MAAM,iBAAU,CAAC;QACf,EAAE;QACF,KAAK,EAAE,aAAa;QACpB,IAAI;QACJ,WAAW,EAAE,UAAU;KACxB,CAAC,CAAC;AACL,CAAC;AAnBD,0BAmBC"}
File without changes
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team.js","sourceRoot":"","sources":["../../src/commands/team.ts"],"names":[],"mappings":";;;AAAA,sDAA0D;AAG7C,QAAA,OAAO,GAAG,MAAM,CAAC;AACjB,QAAA,WAAW,GAAG,gCAAgC,CAAC;AAE5D,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,8BAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;AAC5D,CAAC;AAFD,0BAEC"}