@appsemble/cli 0.18.26 → 0.18.30
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/dist/commands/app/create.d.ts +2 -1
- package/dist/commands/app/create.js +9 -3
- package/dist/commands/app/create.js.map +1 -1
- package/dist/commands/app/update.js +4 -2
- package/dist/commands/app/update.js.map +1 -1
- package/dist/commands/asset/create.d.ts +15 -0
- package/dist/commands/asset/create.js +66 -0
- package/dist/commands/asset/create.js.map +1 -0
- package/dist/commands/asset.d.ts +4 -0
- package/dist/commands/asset.js +11 -0
- package/dist/commands/asset.js.map +1 -0
- package/dist/commands/block/build.js +3 -4
- package/dist/commands/block/build.js.map +1 -1
- package/dist/commands/block/extract-messages.js +3 -4
- package/dist/commands/block/extract-messages.js.map +1 -1
- package/dist/commands/block/publish.js +4 -6
- package/dist/commands/block/publish.js.map +1 -1
- package/dist/commands/config/get.js +2 -1
- package/dist/commands/config/get.js.map +1 -1
- package/dist/commands/config/set.js +2 -1
- package/dist/commands/config/set.js.map +1 -1
- package/dist/commands/organization/create.js +9 -31
- package/dist/commands/organization/create.js.map +1 -1
- package/dist/commands/organization/update.js +9 -30
- package/dist/commands/organization/update.js.map +1 -1
- package/dist/commands/resource/create.d.ts +3 -1
- package/dist/commands/resource/create.js +17 -7
- package/dist/commands/resource/create.js.map +1 -1
- package/dist/commands/resource/update.d.ts +3 -1
- package/dist/commands/resource/update.js +18 -8
- package/dist/commands/resource/update.js.map +1 -1
- package/dist/commands/start.js +2 -2
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/team/create.d.ts +14 -0
- package/dist/commands/team/create.js +44 -0
- package/dist/commands/team/create.js.map +1 -0
- package/dist/commands/team/delete.d.ts +13 -0
- package/dist/commands/team/delete.js +39 -0
- package/dist/commands/team/delete.js.map +1 -0
- package/dist/commands/team/member/delete.d.ts +14 -0
- package/dist/commands/team/member/delete.js +44 -0
- package/dist/commands/team/member/delete.js.map +1 -0
- package/dist/commands/team/member/invite.d.ts +14 -0
- package/dist/commands/team/member/invite.js +44 -0
- package/dist/commands/team/member/invite.js.map +1 -0
- package/dist/commands/team/member/update.d.ts +16 -0
- package/dist/commands/team/member/update.js +51 -0
- package/dist/commands/team/member/update.js.map +1 -0
- package/dist/commands/team/member.d.ts +4 -0
- package/dist/commands/team/member.js +11 -0
- package/dist/commands/team/member.js.map +1 -0
- package/dist/commands/team/update.d.ts +15 -0
- package/dist/commands/team/update.js +40 -0
- package/dist/commands/team/update.js.map +1 -0
- package/dist/commands/team.d.ts +4 -0
- package/dist/commands/team.js +11 -0
- package/dist/commands/team.js.map +1 -0
- package/dist/lib/app.d.ts +146 -0
- package/dist/lib/app.js +332 -9
- package/dist/lib/app.js.map +1 -1
- package/dist/lib/{createResource.d.ts → asset.d.ts} +5 -4
- package/dist/lib/asset.js +23 -0
- package/dist/lib/asset.js.map +1 -0
- package/dist/lib/block.d.ts +61 -0
- package/dist/lib/block.js +297 -0
- package/dist/lib/block.js.map +1 -0
- package/dist/lib/getBlockConfigFromTypeScript.js +4 -3
- package/dist/lib/getBlockConfigFromTypeScript.js.map +1 -1
- package/dist/lib/organization.d.ts +21 -0
- package/dist/lib/organization.js +65 -0
- package/dist/lib/organization.js.map +1 -0
- package/dist/lib/{updateResource.d.ts → resource.d.ts} +19 -0
- package/dist/lib/{updateResource.js → resource.js} +17 -2
- package/dist/lib/resource.js.map +1 -0
- package/dist/lib/serverImport.js +4 -3
- package/dist/lib/serverImport.js.map +1 -1
- package/dist/lib/team.d.ts +53 -0
- package/dist/lib/team.js +64 -0
- package/dist/lib/team.js.map +1 -0
- package/dist/types.d.ts +2 -2
- package/package.json +5 -5
- package/dist/lib/buildBlock.d.ts +0 -9
- package/dist/lib/buildBlock.js +0 -39
- package/dist/lib/buildBlock.js.map +0 -1
- package/dist/lib/createApp.d.ts +0 -59
- package/dist/lib/createApp.js +0 -120
- package/dist/lib/createApp.js.map +0 -1
- package/dist/lib/createResource.js +0 -25
- package/dist/lib/createResource.js.map +0 -1
- package/dist/lib/discoverBlocks.d.ts +0 -10
- package/dist/lib/discoverBlocks.js +0 -24
- package/dist/lib/discoverBlocks.js.map +0 -1
- package/dist/lib/getBlockConfig.d.ts +0 -8
- package/dist/lib/getBlockConfig.js +0 -45
- package/dist/lib/getBlockConfig.js.map +0 -1
- package/dist/lib/makePayload.d.ts +0 -9
- package/dist/lib/makePayload.js +0 -94
- package/dist/lib/makePayload.js.map +0 -1
- package/dist/lib/processBlockMessages.d.ts +0 -2
- package/dist/lib/processBlockMessages.js +0 -43
- package/dist/lib/processBlockMessages.js.map +0 -1
- package/dist/lib/publishBlock.d.ts +0 -8
- package/dist/lib/publishBlock.js +0 -32
- package/dist/lib/publishBlock.js.map +0 -1
- package/dist/lib/traverseAppDirectory.d.ts +0 -11
- package/dist/lib/traverseAppDirectory.js +0 -94
- package/dist/lib/traverseAppDirectory.js.map +0 -1
- package/dist/lib/traverseBlockThemes.d.ts +0 -9
- package/dist/lib/traverseBlockThemes.js +0 -40
- package/dist/lib/traverseBlockThemes.js.map +0 -1
- package/dist/lib/updateApp.d.ts +0 -55
- package/dist/lib/updateApp.js +0 -78
- package/dist/lib/updateApp.js.map +0 -1
- package/dist/lib/updateResource.js.map +0 -1
- package/dist/lib/uploadAppBlockTheme.d.ts +0 -11
- package/dist/lib/uploadAppBlockTheme.js +0 -33
- package/dist/lib/uploadAppBlockTheme.js.map +0 -1
- package/dist/lib/uploadMessages.d.ts +0 -9
- package/dist/lib/uploadMessages.js +0 -39
- 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
|
|
12
|
+
const resource_1 = require("../../lib/resource");
|
|
12
13
|
exports.command = 'create <resource-name> <paths...>';
|
|
13
14
|
exports.description = 'Create resources based on a specified JSON file or directory.';
|
|
14
15
|
function builder(yargs) {
|
|
@@ -25,12 +26,21 @@ function builder(yargs) {
|
|
|
25
26
|
.option('app-id', {
|
|
26
27
|
describe: 'The ID of the app to create the resources for.',
|
|
27
28
|
type: 'number',
|
|
28
|
-
|
|
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
|
|
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(`Creating resources based on ${files.length} files`);
|
|
40
50
|
for (const path of files) {
|
|
41
51
|
node_utils_1.logger.info('');
|
|
42
|
-
await
|
|
52
|
+
await resource_1.createResource({
|
|
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":"create.js","sourceRoot":"","sources":["../../../src/commands/resource/create.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+D;AAC/D,0DAA2B;AAC3B,oEAA2C;AAG3C,6DAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/resource/create.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+D;AAC/D,0DAA2B;AAC3B,oEAA2C;AAG3C,uCAAsD;AACtD,6DAAwD;AACxD,iDAAoD;AAWvC,QAAA,OAAO,GAAG,mCAAmC,CAAC;AAC9C,QAAA,WAAW,GAAG,+DAA+D,CAAC;AAE3F,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,gDAAgD;QAC1D,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;AAxBD,0BAwBC;AAEM,KAAK,UAAU,OAAO,CAAC,EAC5B,GAAG,EACH,KAAK,EACL,iBAAiB,EACjB,OAAO,EACP,KAAK,EACL,MAAM,EACN,YAAY,GACY;IACxB,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,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;IAEzE,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,wBAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IACjE,MAAM,KAAK,GAAG,MAAM,mBAAE,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE7E,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;QACjB,MAAM,IAAI,2BAAc,CAAC,sBAAsB,CAAC,CAAC;KAClD;IAED,mBAAM,CAAC,IAAI,CAAC,+BAA+B,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAC;IACjE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,mBAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB,MAAM,yBAAc,CAAC;YACnB,YAAY;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI;YACJ,MAAM,EAAE,cAAc;SACvB,CAAC,CAAC;KACJ;AACH,CAAC;AA7BD,0BA6BC"}
|
|
@@ -4,9 +4,11 @@ interface CreateResourceArguments extends BaseArguments {
|
|
|
4
4
|
resourceName: string;
|
|
5
5
|
paths: string[];
|
|
6
6
|
appId: number;
|
|
7
|
+
context: string;
|
|
8
|
+
app: string;
|
|
7
9
|
}
|
|
8
10
|
export declare const command = "update <resource-name> <paths...>";
|
|
9
11
|
export declare const description = "Update resources based on a specified JSON file or directory. Entries without the property `id` will be skipped.";
|
|
10
12
|
export declare function builder(yargs: Argv): Argv;
|
|
11
|
-
export declare function handler({ appId, clientCredentials, paths, remote, resourceName, }: CreateResourceArguments): Promise<void>;
|
|
13
|
+
export declare function handler({ app, appId, clientCredentials, context, paths, remote, resourceName, }: CreateResourceArguments): Promise<void>;
|
|
12
14
|
export {};
|
|
@@ -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
|
|
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
|
|
27
|
+
describe: 'The ID of the app to create the resources for.',
|
|
27
28
|
type: 'number',
|
|
28
|
-
|
|
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
|
|
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
|
|
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,
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/resource/update.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+D;AAC/D,0DAA2B;AAC3B,oEAA2C;AAG3C,uCAAsD;AACtD,6DAAwD;AACxD,iDAAoD;AAWvC,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,gDAAgD;QAC1D,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,KAAK;KACjB,CAAC;SAC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
|
|
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
|
|
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
|
|
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,
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/commands/start.ts"],"names":[],"mappings":";;;AAEA,wCAA8C;AAC9C,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;KACd,CAAC;SACD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AAE,CAAC,KAAK,EAAE,SAAS,CAAC;KAC5B,CAAC,CAAC;AACP,CAAC;AA/GD,0BA+GC;AAEM,KAAK,UAAU,OAAO,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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
import { BaseArguments } from '../../types';
|
|
3
|
+
interface CreateTeamArguments extends BaseArguments {
|
|
4
|
+
appId: number;
|
|
5
|
+
name: string;
|
|
6
|
+
context: string;
|
|
7
|
+
app: string;
|
|
8
|
+
annotation: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare const command = "create <name>";
|
|
11
|
+
export declare const description = "Create a new team for an app.";
|
|
12
|
+
export declare function builder(yargs: Argv): Argv;
|
|
13
|
+
export declare function handler({ annotation, app, appId, clientCredentials, context, name, remote, }: CreateTeamArguments): Promise<void>;
|
|
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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
import { BaseArguments } from '../../types';
|
|
3
|
+
interface DeleteTeamArguments extends BaseArguments {
|
|
4
|
+
appId: number;
|
|
5
|
+
id: number;
|
|
6
|
+
context: string;
|
|
7
|
+
app: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const command = "delete";
|
|
10
|
+
export declare const description = "Delete an existing team from an app.";
|
|
11
|
+
export declare function builder(yargs: Argv): Argv;
|
|
12
|
+
export declare function handler({ app, appId, clientCredentials, context, id, remote, }: DeleteTeamArguments): Promise<void>;
|
|
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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
import { BaseArguments } from '../../../types';
|
|
3
|
+
interface DeleteTeamArguments extends BaseArguments {
|
|
4
|
+
appId: number;
|
|
5
|
+
id: number;
|
|
6
|
+
user: string;
|
|
7
|
+
context: string;
|
|
8
|
+
app: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const command = "delete <user>";
|
|
11
|
+
export declare const description = "Delete a new member to an existing team from an app.";
|
|
12
|
+
export declare function builder(yargs: Argv): Argv;
|
|
13
|
+
export declare function handler({ app, appId, clientCredentials, context, id, remote, user, }: DeleteTeamArguments): Promise<void>;
|
|
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 = 'delete <user>';
|
|
8
|
+
exports.description = 'Delete a new member to an existing team from an app.';
|
|
9
|
+
function builder(yargs) {
|
|
10
|
+
return yargs
|
|
11
|
+
.option('id', {
|
|
12
|
+
describe: 'The ID of the team.',
|
|
13
|
+
demandOption: true,
|
|
14
|
+
})
|
|
15
|
+
.option('app-id', {
|
|
16
|
+
describe: 'The ID of the app of the team',
|
|
17
|
+
type: 'number',
|
|
18
|
+
conflicts: 'app',
|
|
19
|
+
})
|
|
20
|
+
.positional('user', {
|
|
21
|
+
describe: 'The ID or email address of the user you want to delete.',
|
|
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',
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.builder = builder;
|
|
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);
|
|
37
|
+
await team_1.deleteMember({
|
|
38
|
+
id,
|
|
39
|
+
appId: resolvedAppId,
|
|
40
|
+
user,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
exports.handler = handler;
|
|
44
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
import { BaseArguments } from '../../../types';
|
|
3
|
+
interface InviteTeamArguments extends BaseArguments {
|
|
4
|
+
appId: number;
|
|
5
|
+
id: number;
|
|
6
|
+
user: string;
|
|
7
|
+
context: string;
|
|
8
|
+
app: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const command = "invite <user>";
|
|
11
|
+
export declare const description = "Invite a new member to an existing team from an app.";
|
|
12
|
+
export declare function builder(yargs: Argv): Argv;
|
|
13
|
+
export declare function handler({ app, appId, clientCredentials, context, id, remote, user, }: InviteTeamArguments): Promise<void>;
|
|
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 = 'invite <user>';
|
|
8
|
+
exports.description = 'Invite a new member to an existing team from an app.';
|
|
9
|
+
function builder(yargs) {
|
|
10
|
+
return yargs
|
|
11
|
+
.option('id', {
|
|
12
|
+
describe: 'The ID of the team.',
|
|
13
|
+
demandOption: true,
|
|
14
|
+
})
|
|
15
|
+
.option('app-id', {
|
|
16
|
+
describe: 'The ID of the app of the team',
|
|
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
|
+
.positional('user', {
|
|
29
|
+
describe: 'The ID or email address of the user you want to invite.',
|
|
30
|
+
demandOption: true,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.builder = builder;
|
|
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);
|
|
37
|
+
await team_1.inviteMember({
|
|
38
|
+
id,
|
|
39
|
+
appId: resolvedAppId,
|
|
40
|
+
user,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
exports.handler = handler;
|
|
44
|
+
//# sourceMappingURL=invite.js.map
|
|
@@ -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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TeamRole } from '@appsemble/utils';
|
|
2
|
+
import { Argv } from 'yargs';
|
|
3
|
+
import { BaseArguments } from '../../../types';
|
|
4
|
+
interface InviteTeamArguments extends BaseArguments {
|
|
5
|
+
appId: number;
|
|
6
|
+
id: number;
|
|
7
|
+
user: string;
|
|
8
|
+
role: TeamRole;
|
|
9
|
+
context: string;
|
|
10
|
+
app: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const command = "update <user> <role>";
|
|
13
|
+
export declare const description = "Update an existing team member.";
|
|
14
|
+
export declare function builder(yargs: Argv): Argv;
|
|
15
|
+
export declare function handler({ app, appId, clientCredentials, context, id, remote, role, user, }: InviteTeamArguments): Promise<void>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handler = exports.builder = exports.description = exports.command = void 0;
|
|
4
|
+
const utils_1 = require("@appsemble/utils");
|
|
5
|
+
const app_1 = require("../../../lib/app");
|
|
6
|
+
const authentication_1 = require("../../../lib/authentication");
|
|
7
|
+
const team_1 = require("../../../lib/team");
|
|
8
|
+
exports.command = 'update <user> <role>';
|
|
9
|
+
exports.description = 'Update an existing team member.';
|
|
10
|
+
function builder(yargs) {
|
|
11
|
+
return yargs
|
|
12
|
+
.option('id', {
|
|
13
|
+
describe: 'The ID of the team.',
|
|
14
|
+
demandOption: true,
|
|
15
|
+
})
|
|
16
|
+
.option('app-id', {
|
|
17
|
+
describe: 'The ID of the app of the team',
|
|
18
|
+
type: 'number',
|
|
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',
|
|
28
|
+
})
|
|
29
|
+
.positional('user', {
|
|
30
|
+
describe: 'The ID or email address of the user you want to invite.',
|
|
31
|
+
demandOption: true,
|
|
32
|
+
})
|
|
33
|
+
.positional('role', {
|
|
34
|
+
describe: 'The new role of the member.',
|
|
35
|
+
demandOption: true,
|
|
36
|
+
choices: Object.values(utils_1.TeamRole),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.builder = builder;
|
|
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);
|
|
43
|
+
await team_1.updateMember({
|
|
44
|
+
id,
|
|
45
|
+
appId: resolvedAppId,
|
|
46
|
+
user,
|
|
47
|
+
role,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
exports.handler = handler;
|
|
51
|
+
//# sourceMappingURL=update.js.map
|