@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.
- 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/{app/team → team}/create.d.ts +5 -2
- package/dist/commands/team/create.js +44 -0
- package/dist/commands/team/create.js.map +1 -0
- package/dist/commands/{app/team → team}/delete.d.ts +4 -2
- package/dist/commands/team/delete.js +39 -0
- package/dist/commands/team/delete.js.map +1 -0
- package/dist/commands/{app/team → team}/member/delete.d.ts +4 -2
- package/dist/commands/{app/team → team}/member/delete.js +16 -6
- package/dist/commands/team/member/delete.js.map +1 -0
- package/dist/commands/{app/team → team}/member/invite.d.ts +4 -2
- package/dist/commands/{app/team → team}/member/invite.js +16 -6
- package/dist/commands/team/member/invite.js.map +1 -0
- package/dist/commands/{app/team → team}/member/update.d.ts +4 -2
- package/dist/commands/{app/team → team}/member/update.js +16 -6
- package/dist/commands/team/member/update.js.map +1 -0
- package/dist/commands/{app/team → team}/member.d.ts +0 -0
- package/dist/commands/{app/team → team}/member.js +0 -0
- package/dist/commands/team/member.js.map +1 -0
- package/dist/commands/{app/team → team}/update.d.ts +4 -2
- package/dist/commands/{app/team → team}/update.js +7 -10
- package/dist/commands/team/update.js.map +1 -0
- package/dist/commands/{app/team.d.ts → team.d.ts} +0 -0
- package/dist/commands/{app/team.js → team.js} +0 -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 +6 -1
- package/dist/lib/team.js +17 -8
- package/dist/lib/team.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +5 -5
- package/dist/commands/app/team/create.js +0 -29
- package/dist/commands/app/team/create.js.map +0 -1
- package/dist/commands/app/team/delete.js +0 -29
- package/dist/commands/app/team/delete.js.map +0 -1
- package/dist/commands/app/team/member/delete.js.map +0 -1
- package/dist/commands/app/team/member/invite.js.map +0 -1
- package/dist/commands/app/team/member/update.js.map +0 -1
- package/dist/commands/app/team/member.js.map +0 -1
- package/dist/commands/app/team/update.js.map +0 -1
- package/dist/commands/app/team.js.map +0 -1
- 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
package/dist/lib/team.d.ts
CHANGED
|
@@ -38,8 +38,13 @@ interface CreateTeamParams extends SharedTeamParams {
|
|
|
38
38
|
* The name of the team.
|
|
39
39
|
*/
|
|
40
40
|
name: string;
|
|
41
|
+
/**
|
|
42
|
+
* The list of annotations to apply in key=value format.
|
|
43
|
+
*/
|
|
44
|
+
annotations?: string[];
|
|
41
45
|
}
|
|
42
|
-
export declare function
|
|
46
|
+
export declare function resolveAnnotations(annotations: string[]): Record<string, string>;
|
|
47
|
+
export declare function createTeam({ appId, name, annotations, }: CreateTeamParams): Promise<void>;
|
|
43
48
|
export declare function deleteTeam({ appId, id }: SharedExistingTeamParams): Promise<void>;
|
|
44
49
|
export declare function updateTeam({ appId, id, name, annotations, }: UpdateTeamParams): Promise<void>;
|
|
45
50
|
export declare function inviteMember({ appId, id, user }: SharedTeamMemberParams): Promise<void>;
|
package/dist/lib/team.js
CHANGED
|
@@ -3,13 +3,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.deleteMember = exports.updateMember = exports.inviteMember = exports.updateTeam = exports.deleteTeam = exports.createTeam = void 0;
|
|
6
|
+
exports.deleteMember = exports.updateMember = exports.inviteMember = exports.updateTeam = exports.deleteTeam = exports.createTeam = exports.resolveAnnotations = void 0;
|
|
7
7
|
const node_utils_1 = require("@appsemble/node-utils");
|
|
8
8
|
const axios_1 = __importDefault(require("axios"));
|
|
9
|
-
|
|
9
|
+
function resolveAnnotations(annotations) {
|
|
10
|
+
const annotationRegex = /^\w+=.+$/;
|
|
11
|
+
if (annotations.some((a) => !annotationRegex.test(a))) {
|
|
12
|
+
throw new node_utils_1.AppsembleError('One of the annotations did not follow the pattern of key=value');
|
|
13
|
+
}
|
|
14
|
+
return annotations.length
|
|
15
|
+
? Object.fromEntries(annotations.map((annotation) => {
|
|
16
|
+
const [key, ...value] = annotation.split('=');
|
|
17
|
+
return [key, value.join('=')];
|
|
18
|
+
}))
|
|
19
|
+
: undefined;
|
|
20
|
+
}
|
|
21
|
+
exports.resolveAnnotations = resolveAnnotations;
|
|
22
|
+
async function createTeam({ appId, name, annotations = [], }) {
|
|
10
23
|
node_utils_1.logger.info(`Creating team ${name}`);
|
|
11
24
|
const { data: { id }, } = await axios_1.default.post(`/api/apps/${appId}/teams`, {
|
|
12
25
|
name,
|
|
26
|
+
annotations: resolveAnnotations(annotations),
|
|
13
27
|
});
|
|
14
28
|
node_utils_1.logger.info(`Successfully created team ${name} with ID ${id}`);
|
|
15
29
|
}
|
|
@@ -24,12 +38,7 @@ async function updateTeam({ appId, id, name, annotations = [], }) {
|
|
|
24
38
|
node_utils_1.logger.info(`Updating team ${id}`);
|
|
25
39
|
await axios_1.default.put(`/api/apps/${appId}/teams/${id}`, {
|
|
26
40
|
name,
|
|
27
|
-
annotations: annotations
|
|
28
|
-
? Object.fromEntries(annotations.map((annotation) => {
|
|
29
|
-
const [key, ...value] = annotation.split('=');
|
|
30
|
-
return [key, value.join('=')];
|
|
31
|
-
}))
|
|
32
|
-
: undefined,
|
|
41
|
+
annotations: resolveAnnotations(annotations),
|
|
33
42
|
});
|
|
34
43
|
node_utils_1.logger.info(`Successfully updated team ${id}`);
|
|
35
44
|
}
|
package/dist/lib/team.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../src/lib/team.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+
|
|
1
|
+
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../src/lib/team.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA+D;AAE/D,kDAA0B;AAsD1B,SA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C;AAC5D,CAAC;AATD,oCASC;AAEM,KAAK,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAA0B;IAC5E,mBAAM,CAAC,IAAI,CAAC,YAAY,IAAI,YAAY,EAAE,EAAE,CAAC,CAAC;IAC9C,MAAM,eAAK,CAAC,MAAM,CAAC,aAAa,KAAK,UAAU,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC;IACrE,mBAAM,CAAC,IAAI,CAAC,wBAAwB,IAAI,cAAc,EAAE,EAAE,CAAC,CAAC;AAC9D,CAAC;AAJD,oCAIC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -55,10 +55,10 @@ export interface AppsembleContext {
|
|
|
55
55
|
iconBackground?: string;
|
|
56
56
|
maskableIcon?: string;
|
|
57
57
|
/**
|
|
58
|
-
* If `id` is specified, this will override `--
|
|
58
|
+
* If `id` is specified, this will override `--id` passed by the command line when
|
|
59
59
|
* updating an app.
|
|
60
60
|
*/
|
|
61
|
-
id?:
|
|
61
|
+
id?: number;
|
|
62
62
|
/**
|
|
63
63
|
* If `private` is specified, this will override `--private` passed on the command line.
|
|
64
64
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/cli",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.31",
|
|
4
4
|
"description": "The CLI for developing with Appsemble apps and blocks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"test": "jest"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@appsemble/node-utils": "0.18.
|
|
36
|
-
"@appsemble/types": "0.18.
|
|
37
|
-
"@appsemble/utils": "0.18.
|
|
35
|
+
"@appsemble/node-utils": "0.18.31",
|
|
36
|
+
"@appsemble/types": "0.18.31",
|
|
37
|
+
"@appsemble/utils": "0.18.31",
|
|
38
38
|
"@fortawesome/fontawesome-common-types": "^0.2.35",
|
|
39
39
|
"axios": "^0.21.1",
|
|
40
40
|
"chalk": "^4.1.1",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"yargs": "^17.0.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@appsemble/types": "0.18.
|
|
59
|
+
"@appsemble/types": "0.18.31",
|
|
60
60
|
"@types/concat-stream": "^1.6.1",
|
|
61
61
|
"@types/fs-extra": "^9.0.12",
|
|
62
62
|
"@types/inquirer": "^7.3.3",
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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");
|
|
6
|
-
exports.command = 'create <name>';
|
|
7
|
-
exports.description = 'Create a new team for an app.';
|
|
8
|
-
function builder(yargs) {
|
|
9
|
-
return yargs
|
|
10
|
-
.positional('name', {
|
|
11
|
-
describe: 'The name of the team.',
|
|
12
|
-
demandOption: true,
|
|
13
|
-
})
|
|
14
|
-
.option('app-id', {
|
|
15
|
-
describe: 'The ID of the app to create the team for.',
|
|
16
|
-
type: 'number',
|
|
17
|
-
demandOption: true,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
exports.builder = builder;
|
|
21
|
-
async function handler({ appId, clientCredentials, name, remote, }) {
|
|
22
|
-
await authentication_1.authenticate(remote, 'teams:write', clientCredentials);
|
|
23
|
-
await team_1.createTeam({
|
|
24
|
-
name,
|
|
25
|
-
appId,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
exports.handler = handler;
|
|
29
|
-
//# sourceMappingURL=create.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/app/team/create.ts"],"names":[],"mappings":";;;AAEA,gEAA2D;AAC3D,4CAA+C;AAQlC,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,QAAQ,EAAE;QAChB,QAAQ,EAAE,2CAA2C;QACrD,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACP,CAAC;AAXD,0BAWC;AAEM,KAAK,UAAU,OAAO,CAAC,EAC5B,KAAK,EACL,iBAAiB,EACjB,IAAI,EACJ,MAAM,GACc;IACpB,MAAM,6BAAY,CAAC,MAAM,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IAE7D,MAAM,iBAAU,CAAC;QACf,IAAI;QACJ,KAAK;KACN,CAAC,CAAC;AACL,CAAC;AAZD,0BAYC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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");
|
|
6
|
-
exports.command = 'delete';
|
|
7
|
-
exports.description = 'Delete an existing team from an app.';
|
|
8
|
-
function builder(yargs) {
|
|
9
|
-
return yargs
|
|
10
|
-
.option('id', {
|
|
11
|
-
describe: 'The ID of the team to delete.',
|
|
12
|
-
demandOption: true,
|
|
13
|
-
})
|
|
14
|
-
.option('app-id', {
|
|
15
|
-
describe: 'The ID of the app to delete the team from.',
|
|
16
|
-
type: 'number',
|
|
17
|
-
demandOption: true,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
exports.builder = builder;
|
|
21
|
-
async function handler({ appId, clientCredentials, id, remote, }) {
|
|
22
|
-
await authentication_1.authenticate(remote, 'teams:write', clientCredentials);
|
|
23
|
-
await team_1.deleteTeam({
|
|
24
|
-
id,
|
|
25
|
-
appId,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
exports.handler = handler;
|
|
29
|
-
//# sourceMappingURL=delete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/app/team/delete.ts"],"names":[],"mappings":";;;AAEA,gEAA2D;AAC3D,4CAA+C;AAQlC,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,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACP,CAAC;AAXD,0BAWC;AAEM,KAAK,UAAU,OAAO,CAAC,EAC5B,KAAK,EACL,iBAAiB,EACjB,EAAE,EACF,MAAM,GACc;IACpB,MAAM,6BAAY,CAAC,MAAM,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IAE7D,MAAM,iBAAU,CAAC;QACf,EAAE;QACF,KAAK;KACN,CAAC,CAAC;AACL,CAAC;AAZD,0BAYC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../../src/commands/app/team/member/delete.ts"],"names":[],"mappings":";;;AAEA,mEAA8D;AAC9D,+CAAoD;AASvC,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,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,UAAU,CAAC,MAAM,EAAE;QAClB,QAAQ,EAAE,yDAAyD;QACnE,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACP,CAAC;AAfD,0BAeC;AAEM,KAAK,UAAU,OAAO,CAAC,EAC5B,KAAK,EACL,iBAAiB,EACjB,EAAE,EACF,MAAM,EACN,IAAI,GACgB;IACpB,MAAM,6BAAY,CAAC,MAAM,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IAE7D,MAAM,mBAAY,CAAC;QACjB,EAAE;QACF,KAAK;QACL,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAdD,0BAcC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invite.js","sourceRoot":"","sources":["../../../../../src/commands/app/team/member/invite.ts"],"names":[],"mappings":";;;AAEA,mEAA8D;AAC9D,+CAAoD;AASvC,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,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,UAAU,CAAC,MAAM,EAAE;QAClB,QAAQ,EAAE,yDAAyD;QACnE,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACP,CAAC;AAfD,0BAeC;AAEM,KAAK,UAAU,OAAO,CAAC,EAC5B,KAAK,EACL,iBAAiB,EACjB,EAAE,EACF,MAAM,EACN,IAAI,GACgB;IACpB,MAAM,6BAAY,CAAC,MAAM,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IAE7D,MAAM,mBAAY,CAAC;QACjB,EAAE;QACF,KAAK;QACL,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAdD,0BAcC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../src/commands/app/team/member/update.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAG5C,mEAA8D;AAC9D,+CAAoD;AAUvC,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,YAAY,EAAE,IAAI;KACnB,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;AApBD,0BAoBC;AAEM,KAAK,UAAU,OAAO,CAAC,EAC5B,KAAK,EACL,iBAAiB,EACjB,EAAE,EACF,MAAM,EACN,IAAI,EACJ,IAAI,GACgB;IACpB,MAAM,6BAAY,CAAC,MAAM,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IAE7D,MAAM,mBAAY,CAAC;QACjB,EAAE;QACF,KAAK;QACL,IAAI;QACJ,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAhBD,0BAgBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"member.js","sourceRoot":"","sources":["../../../../src/commands/app/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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/app/team/update.ts"],"names":[],"mappings":";;;AAAA,sDAAuD;AAGvD,gEAA2D;AAC3D,4CAA+C;AAUlC,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;AAED,MAAM,eAAe,GAAG,UAAU,CAAC;AAE5B,KAAK,UAAU,OAAO,CAAC,EAC5B,UAAU,EACV,KAAK,EACL,iBAAiB,EACjB,EAAE,EACF,IAAI,EACJ,MAAM,GACc;IACpB,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;QACpD,MAAM,IAAI,2BAAc,CAAC,gEAAgE,CAAC,CAAC;KAC5F;IAED,MAAM,6BAAY,CAAC,MAAM,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;IAE7D,MAAM,iBAAU,CAAC;QACf,EAAE;QACF,KAAK;QACL,IAAI;QACJ,WAAW,EAAE,UAAU;KACxB,CAAC,CAAC;AACL,CAAC;AApBD,0BAoBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"team.js","sourceRoot":"","sources":["../../../src/commands/app/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"}
|
package/dist/lib/buildBlock.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BlockConfig } from '@appsemble/types';
|
|
2
|
-
import { Stats } from 'webpack';
|
|
3
|
-
/**
|
|
4
|
-
* Builds a block using Webpack.
|
|
5
|
-
*
|
|
6
|
-
* @param config - The config of the block to build.
|
|
7
|
-
* @returns The Webpack stats object.
|
|
8
|
-
*/
|
|
9
|
-
export declare function buildBlock(config: BlockConfig): Promise<Stats>;
|
package/dist/lib/buildBlock.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildBlock = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const node_utils_1 = require("@appsemble/node-utils");
|
|
6
|
-
const fs_extra_1 = require("fs-extra");
|
|
7
|
-
const webpack_1 = require("webpack");
|
|
8
|
-
const loadWebpackConfig_1 = require("./loadWebpackConfig");
|
|
9
|
-
/**
|
|
10
|
-
* Builds a block using Webpack.
|
|
11
|
-
*
|
|
12
|
-
* @param config - The config of the block to build.
|
|
13
|
-
* @returns The Webpack stats object.
|
|
14
|
-
*/
|
|
15
|
-
async function buildBlock(config) {
|
|
16
|
-
const conf = await loadWebpackConfig_1.loadWebpackConfig(config, 'production', path_1.join(config.dir, config.output));
|
|
17
|
-
if (await fs_extra_1.pathExists(conf.output.path)) {
|
|
18
|
-
node_utils_1.logger.warn(`Removing ${conf.output.path}`);
|
|
19
|
-
await fs_extra_1.remove(conf.output.path);
|
|
20
|
-
}
|
|
21
|
-
node_utils_1.logger.info(`Building ${config.name}@${config.version} 🔨`);
|
|
22
|
-
const compiler = webpack_1.webpack(conf);
|
|
23
|
-
return new Promise((resolve, reject) => {
|
|
24
|
-
compiler.run((err, stats) => {
|
|
25
|
-
if (err) {
|
|
26
|
-
reject(err);
|
|
27
|
-
}
|
|
28
|
-
else if (stats.hasErrors()) {
|
|
29
|
-
reject(new node_utils_1.AppsembleError(stats.toString({ colors: true })));
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
node_utils_1.logger.verbose(stats.toString({ colors: true }));
|
|
33
|
-
resolve(stats);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
exports.buildBlock = buildBlock;
|
|
39
|
-
//# sourceMappingURL=buildBlock.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildBlock.js","sourceRoot":"","sources":["../../src/lib/buildBlock.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAE5B,sDAA+D;AAE/D,uCAA8C;AAC9C,qCAAyC;AAEzC,2DAAwD;AAExD;;;;;GAKG;AACI,KAAK,UAAU,UAAU,CAAC,MAAmB;IAClD,MAAM,IAAI,GAAG,MAAM,qCAAiB,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|
-
/**
|
|
5
|
-
* The OAuth2 client credentials to use.
|
|
6
|
-
*/
|
|
7
|
-
clientCredentials: string;
|
|
8
|
-
/**
|
|
9
|
-
* If specified, the context matching this name is used, overriding command line flags.
|
|
10
|
-
*/
|
|
11
|
-
context?: string;
|
|
12
|
-
/**
|
|
13
|
-
* The ID of the organization to upload for.
|
|
14
|
-
*/
|
|
15
|
-
organization: string;
|
|
16
|
-
/**
|
|
17
|
-
* The path in which the App YAML is located.
|
|
18
|
-
*/
|
|
19
|
-
path: string;
|
|
20
|
-
/**
|
|
21
|
-
* Whether the App should be marked as private.
|
|
22
|
-
*/
|
|
23
|
-
private: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* The remote server to create the app on.
|
|
26
|
-
*/
|
|
27
|
-
remote: string;
|
|
28
|
-
/**
|
|
29
|
-
* Whether the App should be marked as a template.
|
|
30
|
-
*/
|
|
31
|
-
template: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* The icon to upload.
|
|
34
|
-
*/
|
|
35
|
-
icon: NodeJS.ReadStream | ReadStream;
|
|
36
|
-
/**
|
|
37
|
-
* The background color to use for the icon in opaque contexts.
|
|
38
|
-
*/
|
|
39
|
-
iconBackground: string;
|
|
40
|
-
/**
|
|
41
|
-
* The maskable icon to upload.
|
|
42
|
-
*/
|
|
43
|
-
maskableIcon: NodeJS.ReadStream | ReadStream;
|
|
44
|
-
/**
|
|
45
|
-
* Whether the API should be called with a dry run.
|
|
46
|
-
*/
|
|
47
|
-
dryRun: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Whether resources from the `resources` directory should be created after creating the app.
|
|
50
|
-
*/
|
|
51
|
-
resources: boolean;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Create a new App.
|
|
55
|
-
*
|
|
56
|
-
* @param options - The options to use for creating an app.
|
|
57
|
-
*/
|
|
58
|
-
export declare function createApp({ clientCredentials, context, dryRun, path, resources, ...options }: CreateAppParams): Promise<void>;
|
|
59
|
-
export {};
|
package/dist/lib/createApp.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createApp = void 0;
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const path_1 = require("path");
|
|
9
|
-
const url_1 = require("url");
|
|
10
|
-
const util_1 = require("util");
|
|
11
|
-
const node_utils_1 = require("@appsemble/node-utils");
|
|
12
|
-
const axios_1 = __importDefault(require("axios"));
|
|
13
|
-
const form_data_1 = __importDefault(require("form-data"));
|
|
14
|
-
const fs_extra_1 = require("fs-extra");
|
|
15
|
-
const authentication_1 = require("./authentication");
|
|
16
|
-
const createResource_1 = require("./createResource");
|
|
17
|
-
const traverseAppDirectory_1 = require("./traverseAppDirectory");
|
|
18
|
-
const traverseBlockThemes_1 = require("./traverseBlockThemes");
|
|
19
|
-
const uploadMessages_1 = require("./uploadMessages");
|
|
20
|
-
/**
|
|
21
|
-
* Create a new App.
|
|
22
|
-
*
|
|
23
|
-
* @param options - The options to use for creating an app.
|
|
24
|
-
*/
|
|
25
|
-
async function createApp({ clientCredentials, context, dryRun, path, resources, ...options }) {
|
|
26
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
27
|
-
const file = await fs_1.promises.stat(path);
|
|
28
|
-
const formData = new form_data_1.default();
|
|
29
|
-
let appsembleContext;
|
|
30
|
-
if (file.isFile()) {
|
|
31
|
-
// Assuming file is App YAML
|
|
32
|
-
const [app, data] = await node_utils_1.readData(path);
|
|
33
|
-
formData.append('yaml', data);
|
|
34
|
-
formData.append('definition', JSON.stringify(app));
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
appsembleContext = await traverseAppDirectory_1.traverseAppDirectory(path, context, formData);
|
|
38
|
-
}
|
|
39
|
-
const remote = (_a = appsembleContext.remote) !== null && _a !== void 0 ? _a : options.remote;
|
|
40
|
-
const organizationId = (_b = appsembleContext.organization) !== null && _b !== void 0 ? _b : options.organization;
|
|
41
|
-
const template = (_d = (_c = appsembleContext.template) !== null && _c !== void 0 ? _c : options.template) !== null && _d !== void 0 ? _d : false;
|
|
42
|
-
const isPrivate = (_e = appsembleContext.private) !== null && _e !== void 0 ? _e : options.private;
|
|
43
|
-
const iconBackground = (_f = appsembleContext.iconBackground) !== null && _f !== void 0 ? _f : options.iconBackground;
|
|
44
|
-
const icon = (_g = options.icon) !== null && _g !== void 0 ? _g : appsembleContext.icon;
|
|
45
|
-
const maskableIcon = (_h = options.maskableIcon) !== null && _h !== void 0 ? _h : appsembleContext.maskableIcon;
|
|
46
|
-
node_utils_1.logger.verbose(`App remote: ${remote}`);
|
|
47
|
-
node_utils_1.logger.verbose(`App organzation: ${organizationId}`);
|
|
48
|
-
node_utils_1.logger.verbose(`App is template: ${util_1.inspect(template, { colors: true })}`);
|
|
49
|
-
node_utils_1.logger.verbose(`App is private: ${util_1.inspect(isPrivate, { colors: true })}`);
|
|
50
|
-
node_utils_1.logger.verbose(`Icon background: ${iconBackground}`);
|
|
51
|
-
if (!organizationId) {
|
|
52
|
-
throw new node_utils_1.AppsembleError('An organization id must be passed as a command line flag or in the context');
|
|
53
|
-
}
|
|
54
|
-
formData.append('OrganizationId', organizationId);
|
|
55
|
-
formData.append('template', String(template));
|
|
56
|
-
formData.append('private', String(isPrivate));
|
|
57
|
-
formData.append('iconBackground', iconBackground);
|
|
58
|
-
if (icon) {
|
|
59
|
-
const realIcon = typeof icon === 'string' ? fs_1.createReadStream(icon) : icon;
|
|
60
|
-
node_utils_1.logger.info(`Using icon from ${(_j = realIcon.path) !== null && _j !== void 0 ? _j : 'stdin'}`);
|
|
61
|
-
formData.append('icon', realIcon);
|
|
62
|
-
}
|
|
63
|
-
if (maskableIcon) {
|
|
64
|
-
const realIcon = typeof maskableIcon === 'string' ? fs_1.createReadStream(maskableIcon) : maskableIcon;
|
|
65
|
-
node_utils_1.logger.info(`Using icon from ${(_k = realIcon.path) !== null && _k !== void 0 ? _k : 'stdin'}`);
|
|
66
|
-
formData.append('icon', realIcon);
|
|
67
|
-
}
|
|
68
|
-
await authentication_1.authenticate(remote, resources ? 'apps:write resources:write' : 'apps:write', clientCredentials);
|
|
69
|
-
const { data } = await axios_1.default.post('/api/apps', formData, { baseURL: remote, params: { dryRun } });
|
|
70
|
-
if (dryRun) {
|
|
71
|
-
node_utils_1.logger.info('Skipped uploading block themes and app messages.');
|
|
72
|
-
node_utils_1.logger.info('Successfully ran dry run. The app should be valid when creating it.');
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (file.isDirectory() && !dryRun) {
|
|
76
|
-
// After uploading the app, upload block styles and messages if they are available
|
|
77
|
-
await traverseBlockThemes_1.traverseBlockThemes(path, data.id, remote, false);
|
|
78
|
-
await uploadMessages_1.uploadMessages(path, data.id, remote, false);
|
|
79
|
-
if (resources && fs_1.existsSync(path_1.join(path, 'resources'))) {
|
|
80
|
-
const resourcePath = path_1.join(path, 'resources');
|
|
81
|
-
try {
|
|
82
|
-
const resourceFiles = await fs_1.promises.readdir(resourcePath, { withFileTypes: true });
|
|
83
|
-
for (const resource of resourceFiles) {
|
|
84
|
-
if (resource.isFile()) {
|
|
85
|
-
const { name } = path_1.parse(resource.name);
|
|
86
|
-
await createResource_1.createResource({
|
|
87
|
-
appId: data.id,
|
|
88
|
-
path: path_1.join(resourcePath, resource.name),
|
|
89
|
-
remote,
|
|
90
|
-
resourceName: name,
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
else if (resource.isDirectory()) {
|
|
94
|
-
const subDirectoryResources = await fs_extra_1.readdir(path_1.join(resourcePath, resource.name), {
|
|
95
|
-
withFileTypes: true,
|
|
96
|
-
});
|
|
97
|
-
for (const subResource of subDirectoryResources.filter((s) => s.isFile())) {
|
|
98
|
-
await createResource_1.createResource({
|
|
99
|
-
appId: data.id,
|
|
100
|
-
path: path_1.join(resourcePath, resource.name, subResource.name),
|
|
101
|
-
remote,
|
|
102
|
-
resourceName: resource.name,
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
node_utils_1.logger.error('Something went wrong when creating resources:');
|
|
110
|
-
node_utils_1.logger.error(error);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
const { host, protocol } = new url_1.URL(remote);
|
|
115
|
-
node_utils_1.logger.info(`Successfully created app ${data.definition.name}! 🙌`);
|
|
116
|
-
node_utils_1.logger.info(`App URL: ${protocol}//${data.path}.${data.OrganizationId}.${host}`);
|
|
117
|
-
node_utils_1.logger.info(`App store page: ${new url_1.URL(`/apps/${data.id}`, remote)}`);
|
|
118
|
-
}
|
|
119
|
-
exports.createApp = createApp;
|
|
120
|
-
//# sourceMappingURL=createApp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createApp.js","sourceRoot":"","sources":["../../src/lib/createApp.ts"],"names":[],"mappings":";;;;;;AAAA,2BAA8E;AAC9E,+BAAmC;AACnC,6BAA0B;AAC1B,+BAA+B;AAE/B,sDAAyE;AACzE,kDAA0B;AAC1B,0DAAiC;AACjC,uCAAmC;AAGnC,qDAAgD;AAChD,qDAAkD;AAClD,iEAA8D;AAC9D,+DAA4D;AAC5D,qDAAkD;AAgElD;;;;GAIG;AACI,KAAK,UAAU,SAAS,CAAC,EAC9B,iBAAiB,EACjB,OAAO,EACP,MAAM,EACN,IAAI,EACJ,SAAS,EACT,GAAG,OAAO,EACM;;IAChB,MAAM,IAAI,GAAG,MAAM,aAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,QAAQ,GAAG,IAAI,mBAAQ,EAAE,CAAC;IAChC,IAAI,gBAAkC,CAAC;IAEvC,IAAI,IAAI,CAAC,MAAM,EAAE,E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
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createResource = void 0;
|
|
7
|
-
const url_1 = require("url");
|
|
8
|
-
const node_utils_1 = require("@appsemble/node-utils");
|
|
9
|
-
const axios_1 = __importDefault(require("axios"));
|
|
10
|
-
async function createResource({ appId, path, remote, resourceName, }) {
|
|
11
|
-
const [file] = await node_utils_1.readData(path);
|
|
12
|
-
if (typeof file !== 'object') {
|
|
13
|
-
throw new node_utils_1.AppsembleError(`File at ${path} does not contain an object or array of objects`);
|
|
14
|
-
}
|
|
15
|
-
const resources = [].concat(file);
|
|
16
|
-
node_utils_1.logger.info(`Creating ${resources.length} resource(s) from ${path}`);
|
|
17
|
-
for (const resource of resources) {
|
|
18
|
-
const { data: { id }, } = await axios_1.default.post(`/api/apps/${appId}/resources/${resourceName}`, resource, {
|
|
19
|
-
baseURL: remote,
|
|
20
|
-
});
|
|
21
|
-
node_utils_1.logger.info(`Successfully created resource ${id} at ${new url_1.URL(`/apps/${appId}/resources/${resourceName}/${id}`, remote)}`);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.createResource = createResource;
|
|
25
|
-
//# sourceMappingURL=createResource.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createResource.js","sourceRoot":"","sources":["../../src/lib/createResource.ts"],"names":[],"mappings":";;;;;;AAAA,6BAA0B;AAE1B,sDAAyE;AAEzE,kDAA0B;AAwBnB,KAAK,UAAU,cAAc,CAAC,EACnC,KAAK,EACL,IAAI,EACJ,MAAM,EACN,YAAY,GACS;IACrB,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,qBAAQ,CAAW,IAAI,CAAC,CAAC;IAE9C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAI,2BAAc,CAAC,WAAW,IAAI,iDAAiD,CAAC,CAAC;KAC5F;IAED,MAAM,SAAS,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClC,mBAAM,CAAC,IAAI,CAAC,YAAY,SAAS,CAAC,MAAM,qBAAqB,IAAI,EAAE,CAAC,CAAC;IAErE,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;QAChC,MAAM,EACJ,IAAI,EAAE,EAAE,EAAE,EAAE,GACb,GAAG,MAAM,eAAK,CAAC,IAAI,CAAW,aAAa,KAAK,cAAc,YAAY,EAAE,EAAE,QAAQ,EAAE;YACvF,OAAO,EAAE,MAAM;SAChB,CAAC,CAAC;QAEH,mBAAM,CAAC,IAAI,CACT,iCAAiC,EAAE,OAAO,IAAI,SAAG,CAC/C,SAAS,KAAK,cAAc,YAAY,IAAI,EAAE,EAAE,EAChD,MAAM,CACP,EAAE,CACJ,CAAC;KACH;AACH,CAAC;AA7BD,wCA6BC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { BlockConfig } from '@appsemble/types';
|
|
2
|
-
/**
|
|
3
|
-
* Discover Appsemble blocks based on workspaces in a monorepo.
|
|
4
|
-
*
|
|
5
|
-
* Both Lerna and Yarn workspaces are supported.
|
|
6
|
-
*
|
|
7
|
-
* @param root - The project root in which to find workspaces.
|
|
8
|
-
* @returns Discovered Appsemble blocks.
|
|
9
|
-
*/
|
|
10
|
-
export declare function discoverBlocks(root: string): Promise<BlockConfig[]>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.discoverBlocks = void 0;
|
|
4
|
-
const node_utils_1 = require("@appsemble/node-utils");
|
|
5
|
-
const getBlockConfig_1 = require("./getBlockConfig");
|
|
6
|
-
/**
|
|
7
|
-
* Discover Appsemble blocks based on workspaces in a monorepo.
|
|
8
|
-
*
|
|
9
|
-
* Both Lerna and Yarn workspaces are supported.
|
|
10
|
-
*
|
|
11
|
-
* @param root - The project root in which to find workspaces.
|
|
12
|
-
* @returns Discovered Appsemble blocks.
|
|
13
|
-
*/
|
|
14
|
-
async function discoverBlocks(root) {
|
|
15
|
-
const dirs = await node_utils_1.getWorkspaces(root);
|
|
16
|
-
const manifests = await Promise.all(dirs
|
|
17
|
-
.concat(root)
|
|
18
|
-
.map((path) => getBlockConfig_1.getBlockConfig(path))
|
|
19
|
-
// Ignore non-block workspaces.
|
|
20
|
-
.map((p) => p.catch(() => null)));
|
|
21
|
-
return manifests.filter(Boolean);
|
|
22
|
-
}
|
|
23
|
-
exports.discoverBlocks = discoverBlocks;
|
|
24
|
-
//# sourceMappingURL=discoverBlocks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discoverBlocks.js","sourceRoot":"","sources":["../../src/lib/discoverBlocks.ts"],"names":[],"mappings":";;;AAAA,sDAAsD;AAGtD,qDAAkD;AAElD;;;;;;;GAOG;AACI,KAAK,UAAU,cAAc,CAAC,IAAY;IAC/C,MAAM,IAAI,GAAG,MAAM,0BAAa,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CACjC,IAAI;SACD,MAAM,CAAC,IAAI,CAAC;SACZ,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,+BAAc,CAAC,IAAI,CAAC,CAAC;QACpC,+BAA+B;SAC9B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CACnC,CAAC;IACF,OAAO,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAVD,wCAUC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BlockConfig } from '@appsemble/types';
|
|
2
|
-
/**
|
|
3
|
-
* Get the block configuration from a block directory.
|
|
4
|
-
*
|
|
5
|
-
* @param dir - The directory in which to search for the configuration file.
|
|
6
|
-
* @returns The block configuration.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getBlockConfig(dir: string): Promise<BlockConfig>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBlockConfig = void 0;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const util_1 = require("util");
|
|
7
|
-
const node_utils_1 = require("@appsemble/node-utils");
|
|
8
|
-
const chalk_1 = require("chalk");
|
|
9
|
-
const cosmiconfig_1 = require("cosmiconfig");
|
|
10
|
-
/**
|
|
11
|
-
* Get the block configuration from a block directory.
|
|
12
|
-
*
|
|
13
|
-
* @param dir - The directory in which to search for the configuration file.
|
|
14
|
-
* @returns The block configuration.
|
|
15
|
-
*/
|
|
16
|
-
async function getBlockConfig(dir) {
|
|
17
|
-
const explorer = cosmiconfig_1.cosmiconfig('appsemble', { stopDir: dir });
|
|
18
|
-
const found = await explorer.search(dir);
|
|
19
|
-
if (!found) {
|
|
20
|
-
throw new node_utils_1.AppsembleError('No Appsemble configuration file found.');
|
|
21
|
-
}
|
|
22
|
-
const { config, filepath } = found;
|
|
23
|
-
node_utils_1.logger.info(`Found configuration file: ${filepath}`);
|
|
24
|
-
const [pkg] = await node_utils_1.readData(path_1.join(dir, 'package.json'));
|
|
25
|
-
if (!pkg.private) {
|
|
26
|
-
node_utils_1.logger.warn(`It is ${chalk_1.underline.yellow('highly recommended')} to set “${chalk_1.green('"private"')}: ${chalk_1.cyan('true')}” in package.json`);
|
|
27
|
-
}
|
|
28
|
-
let longDescription;
|
|
29
|
-
if (fs_1.existsSync(path_1.join(dir, 'README.md'))) {
|
|
30
|
-
longDescription = await fs_1.promises.readFile(path_1.join(dir, 'README.md'), 'utf8');
|
|
31
|
-
}
|
|
32
|
-
const result = {
|
|
33
|
-
description: pkg.description,
|
|
34
|
-
longDescription,
|
|
35
|
-
name: pkg.name,
|
|
36
|
-
version: pkg.version,
|
|
37
|
-
webpack: undefined,
|
|
38
|
-
...config,
|
|
39
|
-
dir,
|
|
40
|
-
};
|
|
41
|
-
node_utils_1.logger.verbose(`Resolved block configuration: ${util_1.inspect(result, { colors: true })}`);
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
44
|
-
exports.getBlockConfig = getBlockConfig;
|
|
45
|
-
//# sourceMappingURL=getBlockConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getBlockConfig.js","sourceRoot":"","sources":["../../src/lib/getBlockConfig.ts"],"names":[],"mappings":";;;AAAA,2BAAgD;AAChD,+BAA4B;AAC5B,+BAA+B;AAE/B,sDAAyE;AAEzE,iCAA+C;AAC/C,6CAA0C;AAG1C;;;;;GAKG;AACI,KAAK,UAAU,cAAc,CAAC,GAAW;IAC9C,MAAM,QAAQ,GAAG,yBAAW,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,CAAC,KAAK,EAAE;QACV,MAAM,IAAI,2BAAc,CAAC,wCAAwC,CAAC,CAAC;KACpE;IACD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACnC,mBAAM,CAAC,IAAI,CAAC,6BAA6B,QAAQ,EAAE,CAAC,CAAC;IACrD,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,qBAAQ,CAAc,WAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC;IACrE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE;QAChB,mBAAM,CAAC,IAAI,CACT,SAAS,iBAAS,CAAC,MAAM,CAAC,oBAAoB,CAAC,YAAY,aAAK,CAAC,WAAW,CAAC,KAAK,YAAI,CACpF,MAAM,CACP,mBAAmB,CACrB,CAAC;KACH;IACD,IAAI,eAAuB,CAAC;IAC5B,IAAI,eAAU,CAAC,WAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,EAAE;QACtC,eAAe,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,WAAI,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;KACrE;IAED,MAAM,MAAM,GAAG;QACb,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,eAAe;QACf,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,OAAO,EAAE,SAAS;QAClB,GAAG,MAAM;QACT,GAAG;KACJ,CAAC;IACF,mBAAM,CAAC,OAAO,CAAC,iCAAiC,cAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IACrF,OAAO,MAAM,CAAC;AAChB,CAAC;AAhCD,wCAgCC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BlockConfig } from '@appsemble/types';
|
|
2
|
-
import FormData from 'form-data';
|
|
3
|
-
/**
|
|
4
|
-
* Configure the payload for a new block version upload.
|
|
5
|
-
*
|
|
6
|
-
* @param config - The block configuration
|
|
7
|
-
* @returns The payload that should be sent to the version endpoint.
|
|
8
|
-
*/
|
|
9
|
-
export declare function makePayload(config: BlockConfig): Promise<FormData>;
|