@hubspot/local-dev-lib 1.13.1 → 2.0.1
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/api/appsDev.d.ts +6 -5
- package/api/appsDev.js +6 -10
- package/api/customObjects.d.ts +7 -6
- package/api/customObjects.js +13 -16
- package/api/designManager.d.ts +3 -2
- package/api/designManager.js +5 -8
- package/api/developerTestAccounts.d.ts +5 -4
- package/api/developerTestAccounts.js +9 -10
- package/api/fileManager.d.ts +5 -4
- package/api/fileManager.js +9 -9
- package/api/fileMapper.d.ts +8 -8
- package/api/fileMapper.js +16 -16
- package/api/fileTransport.d.ts +4 -3
- package/api/fileTransport.js +5 -5
- package/api/functions.d.ts +6 -5
- package/api/functions.js +11 -14
- package/api/github.d.ts +6 -6
- package/api/github.js +29 -13
- package/api/hubdb.d.ts +9 -8
- package/api/hubdb.js +17 -20
- package/api/lighthouseScore.d.ts +4 -3
- package/api/lighthouseScore.js +7 -10
- package/api/localDevAuth.d.ts +5 -4
- package/api/localDevAuth.js +8 -9
- package/api/marketplaceValidation.d.ts +4 -3
- package/api/marketplaceValidation.js +4 -7
- package/api/projects.d.ts +31 -30
- package/api/projects.js +52 -52
- package/api/sandboxHubs.d.ts +5 -4
- package/api/sandboxHubs.js +9 -10
- package/api/sandboxSync.d.ts +4 -4
- package/api/sandboxSync.js +5 -14
- package/api/secrets.d.ts +5 -4
- package/api/secrets.js +9 -12
- package/api/validateHubl.d.ts +2 -1
- package/api/validateHubl.js +3 -6
- package/config/CLIConfiguration.d.ts +3 -3
- package/config/CLIConfiguration.js +22 -20
- package/config/configFile.js +7 -14
- package/config/config_DEPRECATED.js +5 -2
- package/config/index.js +45 -48
- package/errors/errors_DEPRECATED.js +2 -2
- package/errors/index.d.ts +18 -0
- package/errors/index.js +63 -0
- package/http/addQueryParams.d.ts +2 -0
- package/http/addQueryParams.js +14 -0
- package/http/getAxiosConfig.d.ts +2 -2
- package/http/getAxiosConfig.js +10 -2
- package/http/index.d.ts +9 -14
- package/http/index.js +28 -53
- package/http/unauthed.d.ts +15 -0
- package/http/unauthed.js +38 -0
- package/lang/en.json +1 -2
- package/lang/lang/en.json +1 -2
- package/lib/archive.js +11 -10
- package/lib/cms/functions.d.ts +7 -1
- package/lib/cms/functions.js +22 -18
- package/lib/cms/handleFieldsJS.js +8 -7
- package/lib/cms/modules.js +4 -5
- package/lib/cms/processFieldsJs.js +8 -7
- package/lib/cms/templates.js +2 -3
- package/lib/cms/uploadFolder.js +16 -14
- package/lib/cms/validate.js +1 -1
- package/lib/cms/watch.js +16 -9
- package/lib/customObjects.js +4 -15
- package/lib/fileManager.js +22 -21
- package/lib/fileMapper.js +24 -31
- package/lib/fs.js +2 -2
- package/lib/github.js +21 -21
- package/lib/gitignore.js +2 -2
- package/lib/hubdb.d.ts +3 -2
- package/lib/hubdb.js +11 -9
- package/lib/notify.js +2 -2
- package/lib/oauth.d.ts +1 -1
- package/lib/oauth.js +8 -17
- package/lib/personalAccessKey.js +16 -21
- package/lib/portManager.js +2 -2
- package/lib/trackUsage.js +3 -3
- package/models/FileSystemError.d.ts +6 -0
- package/models/FileSystemError.js +47 -0
- package/models/HubSpotHttpError.d.ts +24 -0
- package/models/HubSpotHttpError.js +197 -0
- package/models/OAuth2Manager.d.ts +1 -2
- package/models/OAuth2Manager.js +13 -28
- package/package.json +2 -1
- package/types/Error.d.ts +7 -5
- package/types/Files.d.ts +4 -4
- package/types/Http.d.ts +6 -10
- package/types/Sandbox.d.ts +0 -5
- package/utils/PortManagerServer.d.ts +3 -3
- package/utils/PortManagerServer.js +9 -9
- package/utils/cms/modules.js +2 -2
- package/utils/detectPort.js +3 -3
- package/errors/apiErrors.d.ts +0 -25
- package/errors/apiErrors.js +0 -176
- package/errors/fileSystemErrors.d.ts +0 -6
- package/errors/fileSystemErrors.js +0 -35
- package/errors/standardErrors.d.ts +0 -20
- package/errors/standardErrors.js +0 -62
- package/lib/developerTestAccounts.d.ts +0 -4
- package/lib/developerTestAccounts.js +0 -35
- package/lib/sandboxes.d.ts +0 -14
- package/lib/sandboxes.js +0 -70
- package/models/HubSpotAuthError.d.ts +0 -12
- package/models/HubSpotAuthError.js +0 -20
package/api/hubdb.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { AxiosPromise } from 'axios';
|
|
1
2
|
import { QueryParams } from '../types/Http';
|
|
2
3
|
import { CreateRowsResponse, FetchRowsResponse, Row, Schema, Table } from '../types/Hubdb';
|
|
3
|
-
export declare function fetchTable(accountId: number, tableId: string):
|
|
4
|
-
export declare function createTable(accountId: number, schema: Schema):
|
|
5
|
-
export declare function updateTable(accountId: number, tableId: string, schema: Schema):
|
|
6
|
-
export declare function publishTable(accountId: number, tableId: string):
|
|
7
|
-
export declare function deleteTable(accountId: number, tableId: string):
|
|
8
|
-
export declare function createRows(accountId: number, tableId: string, rows: Array<Row>):
|
|
9
|
-
export declare function fetchRows(accountId: number, tableId: string, params?: QueryParams):
|
|
10
|
-
export declare function deleteRows(accountId: number, tableId: string, rowIds: Array<string>):
|
|
4
|
+
export declare function fetchTable(accountId: number, tableId: string): AxiosPromise<Table>;
|
|
5
|
+
export declare function createTable(accountId: number, schema: Schema): AxiosPromise<Table>;
|
|
6
|
+
export declare function updateTable(accountId: number, tableId: string, schema: Schema): AxiosPromise<Table>;
|
|
7
|
+
export declare function publishTable(accountId: number, tableId: string): AxiosPromise<Table>;
|
|
8
|
+
export declare function deleteTable(accountId: number, tableId: string): AxiosPromise<void>;
|
|
9
|
+
export declare function createRows(accountId: number, tableId: string, rows: Array<Row>): AxiosPromise<CreateRowsResponse>;
|
|
10
|
+
export declare function fetchRows(accountId: number, tableId: string, params?: QueryParams): AxiosPromise<FetchRowsResponse>;
|
|
11
|
+
export declare function deleteRows(accountId: number, tableId: string, rowIds: Array<string>): AxiosPromise<void>;
|
package/api/hubdb.js
CHANGED
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.deleteRows = exports.fetchRows = exports.createRows = exports.deleteTable = exports.publishTable = exports.updateTable = exports.createTable = exports.fetchTable = void 0;
|
|
7
|
-
const http_1 =
|
|
4
|
+
const http_1 = require("../http");
|
|
8
5
|
const HUBDB_API_PATH = 'cms/v3/hubdb';
|
|
9
|
-
|
|
10
|
-
return http_1.
|
|
6
|
+
function fetchTable(accountId, tableId) {
|
|
7
|
+
return http_1.http.get(accountId, {
|
|
11
8
|
url: `${HUBDB_API_PATH}/tables/${tableId}`,
|
|
12
9
|
});
|
|
13
10
|
}
|
|
14
11
|
exports.fetchTable = fetchTable;
|
|
15
|
-
|
|
16
|
-
return http_1.
|
|
12
|
+
function createTable(accountId, schema) {
|
|
13
|
+
return http_1.http.post(accountId, {
|
|
17
14
|
url: `${HUBDB_API_PATH}/tables`,
|
|
18
15
|
data: schema,
|
|
19
16
|
});
|
|
20
17
|
}
|
|
21
18
|
exports.createTable = createTable;
|
|
22
|
-
|
|
23
|
-
return http_1.
|
|
19
|
+
function updateTable(accountId, tableId, schema) {
|
|
20
|
+
return http_1.http.patch(accountId, {
|
|
24
21
|
url: `${HUBDB_API_PATH}/tables/${tableId}/draft`,
|
|
25
22
|
data: schema,
|
|
26
23
|
});
|
|
27
24
|
}
|
|
28
25
|
exports.updateTable = updateTable;
|
|
29
|
-
|
|
30
|
-
return http_1.
|
|
26
|
+
function publishTable(accountId, tableId) {
|
|
27
|
+
return http_1.http.post(accountId, {
|
|
31
28
|
url: `${HUBDB_API_PATH}/tables/${tableId}/draft/publish`,
|
|
32
29
|
headers: {
|
|
33
30
|
'Content-Type': 'application/json',
|
|
@@ -35,28 +32,28 @@ async function publishTable(accountId, tableId) {
|
|
|
35
32
|
});
|
|
36
33
|
}
|
|
37
34
|
exports.publishTable = publishTable;
|
|
38
|
-
|
|
39
|
-
return http_1.
|
|
35
|
+
function deleteTable(accountId, tableId) {
|
|
36
|
+
return http_1.http.delete(accountId, {
|
|
40
37
|
url: `${HUBDB_API_PATH}/tables/${tableId}`,
|
|
41
38
|
});
|
|
42
39
|
}
|
|
43
40
|
exports.deleteTable = deleteTable;
|
|
44
|
-
|
|
45
|
-
return http_1.
|
|
41
|
+
function createRows(accountId, tableId, rows) {
|
|
42
|
+
return http_1.http.post(accountId, {
|
|
46
43
|
url: `${HUBDB_API_PATH}/tables/${tableId}/rows/draft/batch/create`,
|
|
47
44
|
data: { inputs: rows },
|
|
48
45
|
});
|
|
49
46
|
}
|
|
50
47
|
exports.createRows = createRows;
|
|
51
|
-
|
|
52
|
-
return http_1.
|
|
48
|
+
function fetchRows(accountId, tableId, params = {}) {
|
|
49
|
+
return http_1.http.get(accountId, {
|
|
53
50
|
url: `${HUBDB_API_PATH}/tables/${tableId}/rows/draft`,
|
|
54
51
|
params,
|
|
55
52
|
});
|
|
56
53
|
}
|
|
57
54
|
exports.fetchRows = fetchRows;
|
|
58
|
-
|
|
59
|
-
return http_1.
|
|
55
|
+
function deleteRows(accountId, tableId, rowIds) {
|
|
56
|
+
return http_1.http.post(accountId, {
|
|
60
57
|
url: `${HUBDB_API_PATH}/tables/${tableId}/rows/draft/batch/purge`,
|
|
61
58
|
data: { inputs: rowIds },
|
|
62
59
|
});
|
package/api/lighthouseScore.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { AxiosPromise } from 'axios';
|
|
1
2
|
import { Data, QueryParams } from '../types/Http';
|
|
2
3
|
import { GetLighthouseScoreResponse, RequestLighthouseScoreResponse } from '../types/Lighthouse';
|
|
3
|
-
export declare function requestLighthouseScore(accountId: number, data?: Data):
|
|
4
|
-
export declare function getLighthouseScoreStatus(accountId: number, params?: QueryParams):
|
|
5
|
-
export declare function getLighthouseScore(accountId: number, params?: QueryParams):
|
|
4
|
+
export declare function requestLighthouseScore(accountId: number, data?: Data): AxiosPromise<RequestLighthouseScoreResponse>;
|
|
5
|
+
export declare function getLighthouseScoreStatus(accountId: number, params?: QueryParams): AxiosPromise<string>;
|
|
6
|
+
export declare function getLighthouseScore(accountId: number, params?: QueryParams): AxiosPromise<GetLighthouseScoreResponse>;
|
package/api/lighthouseScore.js
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getLighthouseScore = exports.getLighthouseScoreStatus = exports.requestLighthouseScore = void 0;
|
|
7
|
-
const http_1 =
|
|
4
|
+
const http_1 = require("../http");
|
|
8
5
|
const LIGHTHOUSE_SCORE_API_BASE = 'quality-engine/v1/lighthouse';
|
|
9
|
-
|
|
10
|
-
return http_1.
|
|
6
|
+
function requestLighthouseScore(accountId, data = {}) {
|
|
7
|
+
return http_1.http.post(accountId, {
|
|
11
8
|
url: `${LIGHTHOUSE_SCORE_API_BASE}/request`,
|
|
12
9
|
data,
|
|
13
10
|
});
|
|
14
11
|
}
|
|
15
12
|
exports.requestLighthouseScore = requestLighthouseScore;
|
|
16
|
-
|
|
17
|
-
return http_1.
|
|
13
|
+
function getLighthouseScoreStatus(accountId, params = {}) {
|
|
14
|
+
return http_1.http.get(accountId, {
|
|
18
15
|
url: `${LIGHTHOUSE_SCORE_API_BASE}/status`,
|
|
19
16
|
params,
|
|
20
17
|
});
|
|
21
18
|
}
|
|
22
19
|
exports.getLighthouseScoreStatus = getLighthouseScoreStatus;
|
|
23
|
-
|
|
24
|
-
return http_1.
|
|
20
|
+
function getLighthouseScore(accountId, params = {}) {
|
|
21
|
+
return http_1.http.get(accountId, {
|
|
25
22
|
url: `${LIGHTHOUSE_SCORE_API_BASE}/scores`,
|
|
26
23
|
params,
|
|
27
24
|
});
|
package/api/localDevAuth.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { AxiosPromise } from 'axios';
|
|
1
2
|
import { Environment } from '../types/Config';
|
|
2
3
|
import { ScopeData, AccessTokenResponse, EnabledFeaturesResponse } from '../types/Accounts';
|
|
3
4
|
import { PublicAppInstallationData } from '../types/Apps';
|
|
4
|
-
export declare function fetchAccessToken(personalAccessKey: string, env?: Environment, portalId?: number):
|
|
5
|
-
export declare function fetchScopeData(accountId: number, scopeGroup: string):
|
|
6
|
-
export declare function fetchAppInstallationData(portalId: number, projectId: number, appUid: string, requiredScopeGroups: Array<string>, optionalScopeGroups?: Array<string>):
|
|
7
|
-
export declare function fetchEnabledFeatures(accountId: number): Promise<EnabledFeaturesResponse
|
|
5
|
+
export declare function fetchAccessToken(personalAccessKey: string, env?: Environment, portalId?: number): AxiosPromise<AccessTokenResponse>;
|
|
6
|
+
export declare function fetchScopeData(accountId: number, scopeGroup: string): AxiosPromise<ScopeData>;
|
|
7
|
+
export declare function fetchAppInstallationData(portalId: number, projectId: number, appUid: string, requiredScopeGroups: Array<string>, optionalScopeGroups?: Array<string>): AxiosPromise<PublicAppInstallationData>;
|
|
8
|
+
export declare function fetchEnabledFeatures(accountId: number): Promise<import("axios").AxiosResponse<EnabledFeaturesResponse, any>>;
|
package/api/localDevAuth.js
CHANGED
|
@@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fetchEnabledFeatures = exports.fetchAppInstallationData = exports.fetchScopeData = exports.fetchAccessToken = void 0;
|
|
7
7
|
const getAxiosConfig_1 = require("../http/getAxiosConfig");
|
|
8
|
-
const http_1 =
|
|
8
|
+
const http_1 = require("../http");
|
|
9
9
|
const environments_1 = require("../constants/environments");
|
|
10
10
|
const axios_1 = __importDefault(require("axios"));
|
|
11
11
|
const LOCALDEVAUTH_API_AUTH_PATH = 'localdevauth/v1/auth';
|
|
12
|
-
|
|
12
|
+
function fetchAccessToken(personalAccessKey, env = environments_1.ENVIRONMENTS.PROD, portalId) {
|
|
13
13
|
const axiosConfig = (0, getAxiosConfig_1.getAxiosConfig)({
|
|
14
14
|
env,
|
|
15
15
|
localHostOverride: true,
|
|
@@ -19,22 +19,21 @@ async function fetchAccessToken(personalAccessKey, env = environments_1.ENVIRONM
|
|
|
19
19
|
},
|
|
20
20
|
params: portalId ? { portalId } : {},
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
return (0, axios_1.default)({
|
|
23
23
|
...axiosConfig,
|
|
24
24
|
method: 'post',
|
|
25
25
|
});
|
|
26
|
-
return data;
|
|
27
26
|
}
|
|
28
27
|
exports.fetchAccessToken = fetchAccessToken;
|
|
29
|
-
|
|
30
|
-
return http_1.
|
|
28
|
+
function fetchScopeData(accountId, scopeGroup) {
|
|
29
|
+
return http_1.http.get(accountId, {
|
|
31
30
|
url: `${LOCALDEVAUTH_API_AUTH_PATH}/check-scopes`,
|
|
32
31
|
params: { scopeGroup },
|
|
33
32
|
});
|
|
34
33
|
}
|
|
35
34
|
exports.fetchScopeData = fetchScopeData;
|
|
36
|
-
|
|
37
|
-
return http_1.
|
|
35
|
+
function fetchAppInstallationData(portalId, projectId, appUid, requiredScopeGroups, optionalScopeGroups = []) {
|
|
36
|
+
return http_1.http.post(portalId, {
|
|
38
37
|
url: `${LOCALDEVAUTH_API_AUTH_PATH}/install-info`,
|
|
39
38
|
data: {
|
|
40
39
|
portalId,
|
|
@@ -47,7 +46,7 @@ async function fetchAppInstallationData(portalId, projectId, appUid, requiredSco
|
|
|
47
46
|
}
|
|
48
47
|
exports.fetchAppInstallationData = fetchAppInstallationData;
|
|
49
48
|
async function fetchEnabledFeatures(accountId) {
|
|
50
|
-
return http_1.
|
|
49
|
+
return http_1.http.get(accountId, {
|
|
51
50
|
url: `${LOCALDEVAUTH_API_AUTH_PATH}/enabled-features`,
|
|
52
51
|
});
|
|
53
52
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { AxiosPromise } from 'axios';
|
|
1
2
|
import { Data, QueryParams } from '../types/Http';
|
|
2
3
|
import { GetValidationResultsResponse } from '../types/MarketplaceValidation';
|
|
3
|
-
export declare function requestValidation(accountId: number, data?: Data):
|
|
4
|
-
export declare function getValidationStatus(accountId: number, params?: QueryParams):
|
|
5
|
-
export declare function getValidationResults(accountId: number, params?: QueryParams):
|
|
4
|
+
export declare function requestValidation(accountId: number, data?: Data): AxiosPromise<number>;
|
|
5
|
+
export declare function getValidationStatus(accountId: number, params?: QueryParams): AxiosPromise<string>;
|
|
6
|
+
export declare function getValidationResults(accountId: number, params?: QueryParams): AxiosPromise<GetValidationResultsResponse>;
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getValidationResults = exports.getValidationStatus = exports.requestValidation = void 0;
|
|
7
|
-
const http_1 =
|
|
4
|
+
const http_1 = require("../http");
|
|
8
5
|
const VALIDATION_API_BASE = 'quality-engine/v1/validation';
|
|
9
6
|
function requestValidation(accountId, data = {}) {
|
|
10
|
-
return http_1.
|
|
7
|
+
return http_1.http.post(accountId, {
|
|
11
8
|
url: `${VALIDATION_API_BASE}/request`,
|
|
12
9
|
data,
|
|
13
10
|
});
|
|
14
11
|
}
|
|
15
12
|
exports.requestValidation = requestValidation;
|
|
16
13
|
function getValidationStatus(accountId, params = {}) {
|
|
17
|
-
return http_1.
|
|
14
|
+
return http_1.http.get(accountId, {
|
|
18
15
|
url: `${VALIDATION_API_BASE}/status`,
|
|
19
16
|
params,
|
|
20
17
|
});
|
|
21
18
|
}
|
|
22
19
|
exports.getValidationStatus = getValidationStatus;
|
|
23
20
|
function getValidationResults(accountId, params = {}) {
|
|
24
|
-
return http_1.
|
|
21
|
+
return http_1.http.get(accountId, {
|
|
25
22
|
url: `${VALIDATION_API_BASE}/results`,
|
|
26
23
|
params,
|
|
27
24
|
});
|
package/api/projects.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { AxiosPromise } from 'axios';
|
|
2
3
|
import { QueryParams } from '../types/Http';
|
|
3
4
|
import { Project, FetchProjectResponse, UploadProjectResponse, ProjectSettings, FetchPlatformVersionResponse } from '../types/Project';
|
|
4
5
|
import { Build, FetchProjectBuildsResponse } from '../types/Build';
|
|
@@ -6,34 +7,34 @@ import { ComponentStructureResponse, ProjectComponentsMetadata } from '../types/
|
|
|
6
7
|
import { Deploy, ProjectDeployResponse } from '../types/Deploy';
|
|
7
8
|
import { ProjectLog } from '../types/ProjectLog';
|
|
8
9
|
import { MigrateAppResponse, CloneAppResponse, PollAppResponse } from '../types/Migration';
|
|
9
|
-
export declare function fetchProjects(accountId: number):
|
|
10
|
-
export declare function createProject(accountId: number, name: string):
|
|
11
|
-
export declare function uploadProject(accountId: number, projectName: string, projectFile: string, uploadMessage: string, platformVersion?: string):
|
|
12
|
-
export declare function fetchProject(accountId: number, projectName: string):
|
|
13
|
-
export declare function fetchProjectComponentsMetadata(accountId: number, projectId: number):
|
|
14
|
-
export declare function downloadProject(accountId: number, projectName: string, buildId: number):
|
|
15
|
-
export declare function deleteProject(accountId: number, projectName: string):
|
|
16
|
-
export declare function fetchPlatformVersions(accountId: number):
|
|
17
|
-
export declare function fetchProjectBuilds(accountId: number, projectName: string, params?: QueryParams):
|
|
18
|
-
export declare function getBuildStatus(accountId: number, projectName: string, buildId: number):
|
|
19
|
-
export declare function getBuildStructure(accountId: number, projectName: string, buildId: number):
|
|
20
|
-
export declare function deployProject(accountId: number, projectName: string, buildId: number):
|
|
21
|
-
export declare function getDeployStatus(accountId: number, projectName: string, deployId: number):
|
|
22
|
-
export declare function getDeployStructure(accountId: number, projectName: string, deployId: number):
|
|
23
|
-
export declare function fetchProjectSettings(accountId: number, projectName: string):
|
|
24
|
-
export declare function provisionBuild(accountId: number, projectName: string, platformVersion?: string):
|
|
25
|
-
export declare function queueBuild(accountId: number, projectName: string, platformVersion?: string):
|
|
26
|
-
export declare function uploadFileToBuild(accountId: number, projectName: string, filePath: string, path: string):
|
|
27
|
-
export declare function deleteFileFromBuild(accountId: number, projectName: string, path: string):
|
|
28
|
-
export declare function cancelStagedBuild(accountId: number, projectName: string):
|
|
29
|
-
|
|
10
|
+
export declare function fetchProjects(accountId: number): AxiosPromise<FetchProjectResponse>;
|
|
11
|
+
export declare function createProject(accountId: number, name: string): AxiosPromise<Project>;
|
|
12
|
+
export declare function uploadProject(accountId: number, projectName: string, projectFile: string, uploadMessage: string, platformVersion?: string): AxiosPromise<UploadProjectResponse>;
|
|
13
|
+
export declare function fetchProject(accountId: number, projectName: string): AxiosPromise<Project>;
|
|
14
|
+
export declare function fetchProjectComponentsMetadata(accountId: number, projectId: number): AxiosPromise<ProjectComponentsMetadata>;
|
|
15
|
+
export declare function downloadProject(accountId: number, projectName: string, buildId: number): AxiosPromise<Buffer>;
|
|
16
|
+
export declare function deleteProject(accountId: number, projectName: string): AxiosPromise<void>;
|
|
17
|
+
export declare function fetchPlatformVersions(accountId: number): AxiosPromise<FetchPlatformVersionResponse>;
|
|
18
|
+
export declare function fetchProjectBuilds(accountId: number, projectName: string, params?: QueryParams): AxiosPromise<FetchProjectBuildsResponse>;
|
|
19
|
+
export declare function getBuildStatus(accountId: number, projectName: string, buildId: number): AxiosPromise<Build>;
|
|
20
|
+
export declare function getBuildStructure(accountId: number, projectName: string, buildId: number): AxiosPromise<ComponentStructureResponse>;
|
|
21
|
+
export declare function deployProject(accountId: number, projectName: string, buildId: number): AxiosPromise<ProjectDeployResponse>;
|
|
22
|
+
export declare function getDeployStatus(accountId: number, projectName: string, deployId: number): AxiosPromise<Deploy>;
|
|
23
|
+
export declare function getDeployStructure(accountId: number, projectName: string, deployId: number): AxiosPromise<ComponentStructureResponse>;
|
|
24
|
+
export declare function fetchProjectSettings(accountId: number, projectName: string): AxiosPromise<ProjectSettings>;
|
|
25
|
+
export declare function provisionBuild(accountId: number, projectName: string, platformVersion?: string): AxiosPromise<Build>;
|
|
26
|
+
export declare function queueBuild(accountId: number, projectName: string, platformVersion?: string): AxiosPromise<void>;
|
|
27
|
+
export declare function uploadFileToBuild(accountId: number, projectName: string, filePath: string, path: string): AxiosPromise<void>;
|
|
28
|
+
export declare function deleteFileFromBuild(accountId: number, projectName: string, path: string): AxiosPromise<void>;
|
|
29
|
+
export declare function cancelStagedBuild(accountId: number, projectName: string): AxiosPromise<void>;
|
|
30
|
+
type WarnLogsResponse = {
|
|
30
31
|
logs: Array<ProjectLog>;
|
|
31
|
-
}
|
|
32
|
-
export declare function
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export declare function
|
|
36
|
-
export declare function
|
|
37
|
-
export declare function
|
|
38
|
-
export declare function
|
|
39
|
-
export
|
|
32
|
+
};
|
|
33
|
+
export declare function fetchBuildWarnLogs(accountId: number, projectName: string, buildId: number): AxiosPromise<WarnLogsResponse>;
|
|
34
|
+
export declare function fetchDeployWarnLogs(accountId: number, projectName: string, deployId: number): AxiosPromise<WarnLogsResponse>;
|
|
35
|
+
export declare function migrateApp(accountId: number, appId: number, projectName: string): AxiosPromise<MigrateAppResponse>;
|
|
36
|
+
export declare function checkMigrationStatus(accountId: number, id: number): AxiosPromise<PollAppResponse>;
|
|
37
|
+
export declare function cloneApp(accountId: number, appId: number): AxiosPromise<CloneAppResponse>;
|
|
38
|
+
export declare function checkCloneStatus(accountId: number, exportId: number): AxiosPromise<CloneAppResponse>;
|
|
39
|
+
export declare function downloadClonedProject(accountId: number, exportId: number): AxiosPromise<Buffer>;
|
|
40
|
+
export {};
|
package/api/projects.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.downloadClonedProject = exports.checkCloneStatus = exports.cloneApp = exports.checkMigrationStatus = exports.migrateApp = exports.fetchDeployWarnLogs = exports.fetchBuildWarnLogs = exports.cancelStagedBuild = exports.deleteFileFromBuild = exports.uploadFileToBuild = exports.queueBuild = exports.provisionBuild = exports.fetchProjectSettings = exports.getDeployStructure = exports.getDeployStatus = exports.deployProject = exports.getBuildStructure = exports.getBuildStatus = exports.fetchProjectBuilds = exports.fetchPlatformVersions = exports.deleteProject = exports.downloadProject = exports.fetchProjectComponentsMetadata = exports.fetchProject = exports.uploadProject = exports.createProject = exports.fetchProjects = void 0;
|
|
7
|
-
const http_1 =
|
|
7
|
+
const http_1 = require("../http");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const PROJECTS_API_PATH = 'dfs/v1/projects';
|
|
10
10
|
const DEVELOPER_FILE_SYSTEM_PATH = 'dfs/v1';
|
|
@@ -12,14 +12,14 @@ const PROJECTS_DEPLOY_API_PATH = 'dfs/deploy/v1';
|
|
|
12
12
|
const PROJECTS_LOGS_API_PATH = 'dfs/logging/v1';
|
|
13
13
|
const DEVELOPER_PROJECTS_API_PATH = 'developer/projects/v1';
|
|
14
14
|
const MIGRATIONS_API_PATH = 'dfs/migrations/v1';
|
|
15
|
-
|
|
16
|
-
return http_1.
|
|
15
|
+
function fetchProjects(accountId) {
|
|
16
|
+
return http_1.http.get(accountId, {
|
|
17
17
|
url: DEVELOPER_PROJECTS_API_PATH,
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
exports.fetchProjects = fetchProjects;
|
|
21
|
-
|
|
22
|
-
return http_1.
|
|
21
|
+
function createProject(accountId, name) {
|
|
22
|
+
return http_1.http.post(accountId, {
|
|
23
23
|
url: DEVELOPER_PROJECTS_API_PATH,
|
|
24
24
|
data: {
|
|
25
25
|
name,
|
|
@@ -27,7 +27,7 @@ async function createProject(accountId, name) {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
exports.createProject = createProject;
|
|
30
|
-
|
|
30
|
+
function uploadProject(accountId, projectName, projectFile, uploadMessage, platformVersion) {
|
|
31
31
|
const formData = {
|
|
32
32
|
file: fs_1.default.createReadStream(projectFile),
|
|
33
33
|
uploadMessage,
|
|
@@ -35,7 +35,7 @@ async function uploadProject(accountId, projectName, projectFile, uploadMessage,
|
|
|
35
35
|
if (platformVersion) {
|
|
36
36
|
formData.platformVersion = platformVersion;
|
|
37
37
|
}
|
|
38
|
-
return http_1.
|
|
38
|
+
return http_1.http.post(accountId, {
|
|
39
39
|
url: `${PROJECTS_API_PATH}/upload/${encodeURIComponent(projectName)}`,
|
|
40
40
|
timeout: 60_000,
|
|
41
41
|
data: formData,
|
|
@@ -43,59 +43,59 @@ async function uploadProject(accountId, projectName, projectFile, uploadMessage,
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
exports.uploadProject = uploadProject;
|
|
46
|
-
|
|
47
|
-
return http_1.
|
|
46
|
+
function fetchProject(accountId, projectName) {
|
|
47
|
+
return http_1.http.get(accountId, {
|
|
48
48
|
url: `${DEVELOPER_PROJECTS_API_PATH}/by-name/${encodeURIComponent(projectName)}`,
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
exports.fetchProject = fetchProject;
|
|
52
52
|
async function fetchProjectComponentsMetadata(accountId, projectId) {
|
|
53
|
-
return http_1.
|
|
53
|
+
return http_1.http.get(accountId, {
|
|
54
54
|
url: `${DEVELOPER_FILE_SYSTEM_PATH}/projects-deployed-build/${projectId}`,
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
57
|
exports.fetchProjectComponentsMetadata = fetchProjectComponentsMetadata;
|
|
58
58
|
async function downloadProject(accountId, projectName, buildId) {
|
|
59
|
-
return http_1.
|
|
59
|
+
return http_1.http.get(accountId, {
|
|
60
60
|
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds/${buildId}/archive-full`,
|
|
61
61
|
responseType: 'arraybuffer',
|
|
62
62
|
headers: { accept: 'application/zip', 'Content-Type': 'application/json' },
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
exports.downloadProject = downloadProject;
|
|
66
|
-
|
|
67
|
-
return http_1.
|
|
66
|
+
function deleteProject(accountId, projectName) {
|
|
67
|
+
return http_1.http.delete(accountId, {
|
|
68
68
|
url: `${DEVELOPER_PROJECTS_API_PATH}/${encodeURIComponent(projectName)}`,
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
exports.deleteProject = deleteProject;
|
|
72
|
-
|
|
73
|
-
return http_1.
|
|
72
|
+
function fetchPlatformVersions(accountId) {
|
|
73
|
+
return http_1.http.get(accountId, {
|
|
74
74
|
url: `${DEVELOPER_PROJECTS_API_PATH}/platformVersion`,
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
exports.fetchPlatformVersions = fetchPlatformVersions;
|
|
78
|
-
|
|
79
|
-
return http_1.
|
|
78
|
+
function fetchProjectBuilds(accountId, projectName, params = {}) {
|
|
79
|
+
return http_1.http.get(accountId, {
|
|
80
80
|
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds`,
|
|
81
81
|
params,
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
exports.fetchProjectBuilds = fetchProjectBuilds;
|
|
85
|
-
|
|
86
|
-
return http_1.
|
|
85
|
+
function getBuildStatus(accountId, projectName, buildId) {
|
|
86
|
+
return http_1.http.get(accountId, {
|
|
87
87
|
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds/${buildId}/status`,
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
exports.getBuildStatus = getBuildStatus;
|
|
91
|
-
|
|
92
|
-
return http_1.
|
|
91
|
+
function getBuildStructure(accountId, projectName, buildId) {
|
|
92
|
+
return http_1.http.get(accountId, {
|
|
93
93
|
url: `dfs/v1/builds/by-project-name/${encodeURIComponent(projectName)}/builds/${buildId}/structure`,
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
exports.getBuildStructure = getBuildStructure;
|
|
97
|
-
|
|
98
|
-
return http_1.
|
|
97
|
+
function deployProject(accountId, projectName, buildId) {
|
|
98
|
+
return http_1.http.post(accountId, {
|
|
99
99
|
url: `${PROJECTS_DEPLOY_API_PATH}/deploys/queue/async`,
|
|
100
100
|
data: {
|
|
101
101
|
projectName,
|
|
@@ -104,26 +104,26 @@ async function deployProject(accountId, projectName, buildId) {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
exports.deployProject = deployProject;
|
|
107
|
-
|
|
108
|
-
return http_1.
|
|
107
|
+
function getDeployStatus(accountId, projectName, deployId) {
|
|
108
|
+
return http_1.http.get(accountId, {
|
|
109
109
|
url: `${PROJECTS_DEPLOY_API_PATH}/deploy-status/projects/${encodeURIComponent(projectName)}/deploys/${deployId}`,
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
exports.getDeployStatus = getDeployStatus;
|
|
113
|
-
|
|
114
|
-
return http_1.
|
|
113
|
+
function getDeployStructure(accountId, projectName, deployId) {
|
|
114
|
+
return http_1.http.get(accountId, {
|
|
115
115
|
url: `${PROJECTS_DEPLOY_API_PATH}/deploys/by-project-name/${encodeURIComponent(projectName)}/deploys/${deployId}/structure`,
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
exports.getDeployStructure = getDeployStructure;
|
|
119
|
-
|
|
120
|
-
return http_1.
|
|
119
|
+
function fetchProjectSettings(accountId, projectName) {
|
|
120
|
+
return http_1.http.get(accountId, {
|
|
121
121
|
url: `${DEVELOPER_PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/settings`,
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
exports.fetchProjectSettings = fetchProjectSettings;
|
|
125
125
|
async function provisionBuild(accountId, projectName, platformVersion) {
|
|
126
|
-
return http_1.
|
|
126
|
+
return http_1.http.post(accountId, {
|
|
127
127
|
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds/staged/provision`,
|
|
128
128
|
params: { platformVersion },
|
|
129
129
|
headers: { 'Content-Type': 'application/json' },
|
|
@@ -131,16 +131,16 @@ async function provisionBuild(accountId, projectName, platformVersion) {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
exports.provisionBuild = provisionBuild;
|
|
134
|
-
|
|
135
|
-
return http_1.
|
|
134
|
+
function queueBuild(accountId, projectName, platformVersion) {
|
|
135
|
+
return http_1.http.post(accountId, {
|
|
136
136
|
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds/staged/queue`,
|
|
137
137
|
params: { platformVersion },
|
|
138
138
|
headers: { 'Content-Type': 'application/json' },
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
exports.queueBuild = queueBuild;
|
|
142
|
-
|
|
143
|
-
return http_1.
|
|
142
|
+
function uploadFileToBuild(accountId, projectName, filePath, path) {
|
|
143
|
+
return http_1.http.put(accountId, {
|
|
144
144
|
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds/staged/files/${encodeURIComponent(path)}`,
|
|
145
145
|
data: {
|
|
146
146
|
file: fs_1.default.createReadStream(filePath),
|
|
@@ -149,33 +149,33 @@ async function uploadFileToBuild(accountId, projectName, filePath, path) {
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
exports.uploadFileToBuild = uploadFileToBuild;
|
|
152
|
-
|
|
153
|
-
return http_1.
|
|
152
|
+
function deleteFileFromBuild(accountId, projectName, path) {
|
|
153
|
+
return http_1.http.delete(accountId, {
|
|
154
154
|
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds/staged/files/${encodeURIComponent(path)}`,
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
exports.deleteFileFromBuild = deleteFileFromBuild;
|
|
158
|
-
|
|
159
|
-
return http_1.
|
|
158
|
+
function cancelStagedBuild(accountId, projectName) {
|
|
159
|
+
return http_1.http.post(accountId, {
|
|
160
160
|
url: `${PROJECTS_API_PATH}/${encodeURIComponent(projectName)}/builds/staged/cancel`,
|
|
161
161
|
headers: { 'Content-Type': 'application/json' },
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
exports.cancelStagedBuild = cancelStagedBuild;
|
|
165
|
-
|
|
166
|
-
return http_1.
|
|
165
|
+
function fetchBuildWarnLogs(accountId, projectName, buildId) {
|
|
166
|
+
return http_1.http.get(accountId, {
|
|
167
167
|
url: `${PROJECTS_LOGS_API_PATH}/logs/projects/${encodeURIComponent(projectName)}/builds/${buildId}/combined/warn`,
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
exports.fetchBuildWarnLogs = fetchBuildWarnLogs;
|
|
171
|
-
|
|
172
|
-
return http_1.
|
|
171
|
+
function fetchDeployWarnLogs(accountId, projectName, deployId) {
|
|
172
|
+
return http_1.http.get(accountId, {
|
|
173
173
|
url: `${PROJECTS_LOGS_API_PATH}/logs/projects/${encodeURIComponent(projectName)}/deploys/${deployId}/combined/warn`,
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
176
|
exports.fetchDeployWarnLogs = fetchDeployWarnLogs;
|
|
177
|
-
|
|
178
|
-
return http_1.
|
|
177
|
+
function migrateApp(accountId, appId, projectName) {
|
|
178
|
+
return http_1.http.post(accountId, {
|
|
179
179
|
url: `${MIGRATIONS_API_PATH}/migrations`,
|
|
180
180
|
data: {
|
|
181
181
|
componentId: appId,
|
|
@@ -185,14 +185,14 @@ async function migrateApp(accountId, appId, projectName) {
|
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
187
|
exports.migrateApp = migrateApp;
|
|
188
|
-
|
|
189
|
-
return http_1.
|
|
188
|
+
function checkMigrationStatus(accountId, id) {
|
|
189
|
+
return http_1.http.get(accountId, {
|
|
190
190
|
url: `${MIGRATIONS_API_PATH}/migrations/${id}`,
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
exports.checkMigrationStatus = checkMigrationStatus;
|
|
194
|
-
|
|
195
|
-
return http_1.
|
|
194
|
+
function cloneApp(accountId, appId) {
|
|
195
|
+
return http_1.http.post(accountId, {
|
|
196
196
|
url: `${MIGRATIONS_API_PATH}/exports`,
|
|
197
197
|
data: {
|
|
198
198
|
componentId: appId,
|
|
@@ -201,14 +201,14 @@ async function cloneApp(accountId, appId) {
|
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
203
|
exports.cloneApp = cloneApp;
|
|
204
|
-
|
|
205
|
-
return http_1.
|
|
204
|
+
function checkCloneStatus(accountId, exportId) {
|
|
205
|
+
return http_1.http.get(accountId, {
|
|
206
206
|
url: `${MIGRATIONS_API_PATH}/exports/${exportId}/status`,
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
209
|
exports.checkCloneStatus = checkCloneStatus;
|
|
210
|
-
|
|
211
|
-
return http_1.
|
|
210
|
+
function downloadClonedProject(accountId, exportId) {
|
|
211
|
+
return http_1.http.get(accountId, {
|
|
212
212
|
url: `${MIGRATIONS_API_PATH}/exports/${exportId}/download-as-clone`,
|
|
213
213
|
responseType: 'arraybuffer',
|
|
214
214
|
});
|
package/api/sandboxHubs.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { AxiosPromise } from 'axios';
|
|
1
2
|
import { Environment } from '../types/Config';
|
|
2
3
|
import { SandboxHubData, SandboxResponse, SandboxUsageLimitsResponse } from '../types/Sandbox';
|
|
3
|
-
export declare function createSandbox(accountId: number, name: string, type: 1 | 2):
|
|
4
|
-
export declare function deleteSandbox(parentAccountId: number, sandboxAccountId: number):
|
|
5
|
-
export declare function getSandboxUsageLimits(parentAccountId: number):
|
|
6
|
-
export declare function fetchSandboxHubData(accessToken: string, accountId: number, env?: Environment):
|
|
4
|
+
export declare function createSandbox(accountId: number, name: string, type: 1 | 2): AxiosPromise<SandboxResponse>;
|
|
5
|
+
export declare function deleteSandbox(parentAccountId: number, sandboxAccountId: number): AxiosPromise<void>;
|
|
6
|
+
export declare function getSandboxUsageLimits(parentAccountId: number): AxiosPromise<SandboxUsageLimitsResponse>;
|
|
7
|
+
export declare function fetchSandboxHubData(accessToken: string, accountId: number, env?: Environment): AxiosPromise<SandboxHubData>;
|