@hubspot/local-dev-lib 0.2.4 → 0.2.6-experimental.0
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/LICENSE +12 -0
- package/README.md +17 -0
- package/api/appsDev.d.ts +6 -0
- package/api/appsDev.js +29 -0
- package/api/customObjects.d.ts +8 -7
- package/api/customObjects.js +13 -16
- package/api/designManager.d.ts +4 -13
- package/api/designManager.js +6 -9
- package/api/developerTestAccounts.d.ts +7 -0
- package/api/developerTestAccounts.js +48 -0
- package/api/fileManager.d.ts +5 -4
- package/api/fileManager.js +11 -11
- package/api/fileMapper.d.ts +8 -7
- package/api/fileMapper.js +16 -16
- package/api/fileTransport.d.ts +4 -0
- package/api/fileTransport.js +39 -0
- package/api/functions.d.ts +7 -7
- package/api/functions.js +13 -16
- package/api/github.d.ts +8 -9
- package/api/github.js +31 -13
- package/api/hubdb.d.ts +11 -10
- package/api/hubdb.js +28 -22
- package/api/lighthouseScore.d.ts +4 -4
- package/api/lighthouseScore.js +9 -12
- package/api/localDevAuth.d.ts +8 -16
- package/api/localDevAuth.js +34 -13
- package/api/marketplaceValidation.d.ts +4 -4
- package/api/marketplaceValidation.js +8 -11
- package/api/projects.d.ts +73 -22
- package/api/projects.js +199 -43
- package/api/sandboxHubs.d.ts +6 -4
- package/api/sandboxHubs.js +10 -11
- package/api/sandboxSync.d.ts +4 -4
- package/api/sandboxSync.js +4 -13
- package/api/secrets.d.ts +6 -8
- package/api/secrets.js +9 -12
- package/api/validateHubl.d.ts +2 -1
- package/api/validateHubl.js +3 -6
- package/config/CLIConfiguration.d.ts +15 -11
- package/config/CLIConfiguration.js +175 -90
- package/config/configFile.js +12 -18
- package/config/configUtils.d.ts +2 -21
- package/config/configUtils.js +5 -4
- package/config/config_DEPRECATED.d.ts +6 -8
- package/config/config_DEPRECATED.js +79 -25
- package/config/environment.js +5 -4
- package/config/getAccountIdentifier.d.ts +2 -0
- package/config/getAccountIdentifier.js +15 -0
- package/config/index.d.ts +13 -8
- package/config/index.js +97 -57
- package/constants/config.d.ts +18 -1
- package/constants/config.js +20 -3
- package/constants/environments.d.ts +1 -0
- package/constants/environments.js +1 -0
- package/constants/extensions.d.ts +2 -0
- package/constants/extensions.js +3 -1
- package/constants/files.d.ts +2 -2
- package/constants/files.js +3 -3
- package/constants/platformVersion.d.ts +6 -0
- package/constants/platformVersion.js +9 -0
- package/errors/errors_DEPRECATED.d.ts +1 -5
- 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 +6 -3
- package/http/getAxiosConfig.js +49 -6
- package/http/index.d.ts +11 -12
- package/http/index.js +35 -41
- package/http/unauthed.d.ts +14 -0
- package/http/unauthed.js +38 -0
- package/lang/en.json +378 -386
- package/lib/archive.d.ts +3 -8
- package/lib/archive.js +34 -30
- package/lib/cms/functions.d.ts +7 -12
- package/lib/cms/functions.js +49 -51
- package/lib/cms/handleFieldsJS.js +16 -14
- package/lib/cms/modules.d.ts +4 -15
- package/lib/cms/modules.js +81 -78
- package/lib/cms/processFieldsJs.js +10 -33
- package/lib/cms/templates.d.ts +43 -3
- package/lib/cms/templates.js +53 -11
- package/lib/cms/uploadFolder.d.ts +3 -14
- package/lib/cms/uploadFolder.js +58 -42
- package/lib/cms/validate.js +1 -1
- package/lib/cms/watch.d.ts +2 -18
- package/lib/cms/watch.js +63 -68
- package/lib/customObjects.js +4 -15
- package/lib/fileManager.d.ts +2 -6
- package/lib/fileManager.js +54 -65
- package/lib/fileMapper.d.ts +4 -15
- package/lib/fileMapper.js +67 -88
- package/lib/fs.d.ts +1 -1
- package/lib/fs.js +10 -6
- package/lib/github.d.ts +13 -14
- package/lib/github.js +70 -35
- package/lib/gitignore.d.ts +2 -0
- package/lib/gitignore.js +21 -4
- package/lib/hubdb.d.ts +3 -2
- package/lib/hubdb.js +11 -9
- package/{utils → lib}/notify.js +2 -2
- package/lib/oauth.d.ts +2 -5
- package/lib/oauth.js +14 -25
- package/lib/path.d.ts +3 -0
- package/lib/path.js +46 -1
- package/lib/personalAccessKey.d.ts +8 -11
- package/lib/personalAccessKey.js +75 -38
- package/lib/portManager.d.ts +3 -5
- package/lib/portManager.js +18 -6
- package/lib/trackUsage.js +18 -11
- package/lib/urls.js +5 -1
- 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 +2 -27
- package/models/OAuth2Manager.js +20 -34
- package/package.json +34 -36
- package/types/Accounts.d.ts +103 -3
- package/types/Apps.d.ts +77 -0
- package/types/Archive.d.ts +9 -0
- package/types/Archive.js +2 -0
- package/types/Build.d.ts +4 -2
- package/types/ComponentStructure.d.ts +30 -10
- package/types/Config.d.ts +19 -2
- package/types/Deploy.d.ts +3 -2
- package/types/DesignManager.d.ts +10 -0
- package/types/DesignManager.js +2 -0
- package/types/Error.d.ts +9 -5
- package/types/FieldsJS.d.ts +1 -0
- package/types/FieldsJS.js +2 -0
- package/types/FileManager.d.ts +1 -1
- package/types/Files.d.ts +43 -4
- package/types/Functions.d.ts +52 -0
- package/types/Github.d.ts +13 -0
- package/types/Http.d.ts +13 -12
- package/types/Hubdb.d.ts +9 -0
- package/types/MarketplaceValidation.d.ts +7 -3
- package/types/Migration.d.ts +28 -0
- package/types/Migration.js +10 -0
- package/types/Modules.d.ts +11 -0
- package/types/PortManager.d.ts +7 -0
- package/types/Project.d.ts +30 -0
- package/types/ProjectLog.d.ts +9 -0
- package/types/ProjectLog.js +2 -0
- package/types/Sandbox.d.ts +37 -47
- package/types/Schemas.d.ts +56 -0
- package/types/Secrets.d.ts +3 -0
- package/types/Secrets.js +2 -0
- package/types/developerTestAccounts.d.ts +13 -0
- package/types/developerTestAccounts.js +2 -0
- package/utils/PortManagerServer.d.ts +6 -7
- package/utils/PortManagerServer.js +22 -16
- package/utils/{getAccountIdentifier.d.ts → accounts.d.ts} +0 -6
- package/utils/{getAccountIdentifier.js → accounts.js} +1 -13
- package/utils/cms/fieldsJS.d.ts +1 -2
- package/utils/cms/modules.js +2 -2
- package/utils/detectPort.js +3 -3
- package/utils/git.d.ts +1 -7
- package/utils/git.js +2 -18
- package/errors/apiErrors.d.ts +0 -16
- 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 -21
- package/errors/standardErrors.js +0 -52
- package/lang/lang/en.json +0 -401
- package/lib/logging/git.d.ts +0 -2
- package/lib/logging/git.js +0 -54
- package/lib/logging/logs.d.ts +0 -22
- package/lib/logging/logs.js +0 -86
- package/lib/logging/table.d.ts +0 -3
- package/lib/logging/table.js +0 -47
- package/lib/sandboxes.d.ts +0 -14
- package/lib/sandboxes.js +0 -71
- package/models/HubSpotAuthError.d.ts +0 -12
- package/models/HubSpotAuthError.js +0 -20
- package/types/LogCallbacks.d.ts +0 -7
- package/utils/logger.d.ts +0 -5
- package/utils/logger.js +0 -23
- package/utils/objectUtils.d.ts +0 -8
- package/utils/objectUtils.js +0 -33
- /package/{utils → lib}/escapeRegExp.d.ts +0 -0
- /package/{utils → lib}/escapeRegExp.js +0 -0
- /package/lib/{logging/logger.d.ts → logger.d.ts} +0 -0
- /package/lib/{logging/logger.js → logger.js} +0 -0
- /package/{utils → lib}/notify.d.ts +0 -0
- /package/types/{LogCallbacks.js → Apps.js} +0 -0
package/types/Apps.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export type PublicAppInstallationData = {
|
|
2
|
+
appId: number;
|
|
3
|
+
isInstalledWithScopeGroups: boolean;
|
|
4
|
+
previouslyAuthorizedScopeGroups: Array<{
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
9
|
+
export type PublicAppDeveloperTestAccountInstallData = {
|
|
10
|
+
testPortalInstalls: Array<{
|
|
11
|
+
portalId: number;
|
|
12
|
+
accountName: string;
|
|
13
|
+
}>;
|
|
14
|
+
testPortalInstallCount: string;
|
|
15
|
+
};
|
|
16
|
+
export type PublicAppInstallCounts = {
|
|
17
|
+
uniquePortalInstallCount: number;
|
|
18
|
+
uniqueUserInstallCount: number;
|
|
19
|
+
uniqueBusinessUnitInstallCount: number;
|
|
20
|
+
};
|
|
21
|
+
export type PublicApp = {
|
|
22
|
+
id: number;
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
portalId: number;
|
|
26
|
+
updatedAt: number;
|
|
27
|
+
createdAt: number;
|
|
28
|
+
clientId: string;
|
|
29
|
+
iconUrl: string;
|
|
30
|
+
archived: boolean;
|
|
31
|
+
ownerId: number;
|
|
32
|
+
isUserLevel: boolean;
|
|
33
|
+
isBusinessUnitEnabled: boolean;
|
|
34
|
+
isFeatured: boolean;
|
|
35
|
+
isInternal: boolean;
|
|
36
|
+
documentationUrl: string | null;
|
|
37
|
+
supportUrl: string | null;
|
|
38
|
+
supportEmail: string | null;
|
|
39
|
+
supportPhone: string | null;
|
|
40
|
+
extensionIconUrl: string | null;
|
|
41
|
+
isAdvancedScopesSettingEnabled: boolean;
|
|
42
|
+
publicApplicationInstallCounts: PublicAppInstallCounts;
|
|
43
|
+
redirectUrls: Array<string>;
|
|
44
|
+
scopeGroupIds: Array<number>;
|
|
45
|
+
requiredScopeInfo?: Array<{
|
|
46
|
+
id: number;
|
|
47
|
+
name: string;
|
|
48
|
+
}>;
|
|
49
|
+
additionalScopeGroupIds: Array<number>;
|
|
50
|
+
additionalScopeInfo?: Array<{
|
|
51
|
+
id: number;
|
|
52
|
+
name: string;
|
|
53
|
+
}>;
|
|
54
|
+
optionalScopeGroupIds: Array<number>;
|
|
55
|
+
optionalScopeInfo?: Array<{
|
|
56
|
+
id: number;
|
|
57
|
+
name: string;
|
|
58
|
+
}>;
|
|
59
|
+
projectId: number | null;
|
|
60
|
+
sourceId: string | null;
|
|
61
|
+
providerInfo?: {
|
|
62
|
+
domain: string;
|
|
63
|
+
isVerified: boolean;
|
|
64
|
+
};
|
|
65
|
+
listingInfo?: {
|
|
66
|
+
listingUrl: string;
|
|
67
|
+
isCertified: boolean;
|
|
68
|
+
isPublished: boolean;
|
|
69
|
+
hasDraft: boolean;
|
|
70
|
+
inReview: boolean;
|
|
71
|
+
};
|
|
72
|
+
allowedExternalUrls: Array<string>;
|
|
73
|
+
preventProjectMigrations?: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type FetchPublicAppsForPortalResponse = {
|
|
76
|
+
results: Array<PublicApp>;
|
|
77
|
+
};
|
package/types/Archive.js
ADDED
package/types/Build.d.ts
CHANGED
|
@@ -2,17 +2,18 @@ import { ValueOf } from './Utils';
|
|
|
2
2
|
import { BUILD_STATUS, SUBBUILD_TYPES, DEPLOYABLE_STATES } from '../enums/build';
|
|
3
3
|
import { ActivitySource } from './Activity';
|
|
4
4
|
import { DeployStatusTaskLocator } from './Deploy';
|
|
5
|
-
import {
|
|
5
|
+
import { ProjectStandardError } from './Project';
|
|
6
6
|
export type SubbuildStatus = {
|
|
7
7
|
buildName: string;
|
|
8
8
|
buildType: ValueOf<typeof SUBBUILD_TYPES>;
|
|
9
9
|
errorMessage: string;
|
|
10
10
|
finishedAt: string;
|
|
11
11
|
rootPath: string;
|
|
12
|
-
standardError
|
|
12
|
+
standardError: ProjectStandardError | null;
|
|
13
13
|
startedAt: string;
|
|
14
14
|
status: ValueOf<typeof BUILD_STATUS>;
|
|
15
15
|
id: string;
|
|
16
|
+
visible: boolean;
|
|
16
17
|
};
|
|
17
18
|
export type Build = {
|
|
18
19
|
activitySource: ActivitySource;
|
|
@@ -29,6 +30,7 @@ export type Build = {
|
|
|
29
30
|
status: ValueOf<typeof BUILD_STATUS>;
|
|
30
31
|
subbuildStatuses: Array<SubbuildStatus>;
|
|
31
32
|
uploadMessage: string;
|
|
33
|
+
autoDeployId: number;
|
|
32
34
|
};
|
|
33
35
|
export type FetchProjectBuildsResponse = {
|
|
34
36
|
results: Array<Build>;
|
|
@@ -6,15 +6,35 @@ export type ComponentStructure = {
|
|
|
6
6
|
export type ComponentStructureResponse = {
|
|
7
7
|
topLevelComponentsWithChildren: ComponentStructure;
|
|
8
8
|
};
|
|
9
|
-
export type
|
|
10
|
-
|
|
9
|
+
export type ProjectComponentsMetadata = {
|
|
10
|
+
topLevelComponentMetadata: TopLevelComponents[];
|
|
11
|
+
};
|
|
12
|
+
export interface ComponentMetadata<T> {
|
|
11
13
|
componentName: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
appId: string;
|
|
14
|
+
type: {
|
|
15
|
+
name: T;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
}
|
|
17
|
+
deployOutput: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface TopLevelComponent extends ComponentMetadata<ValueOf<typeof COMPONENT_TYPES>> {
|
|
20
|
+
featureComponents: FeatureComponents[];
|
|
21
|
+
}
|
|
22
|
+
export interface PrivateAppComponentMetadata extends TopLevelComponent {
|
|
23
|
+
deployOutput: {
|
|
24
|
+
cardId: number;
|
|
25
|
+
appId: number;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export type TopLevelComponents = PrivateAppComponentMetadata | TopLevelComponent;
|
|
29
|
+
export interface FeatureComponent<T = unknown> extends ComponentMetadata<ValueOf<typeof SUBCOMPONENT_TYPES>> {
|
|
30
|
+
deployOutput: T;
|
|
31
|
+
}
|
|
32
|
+
export type AppFunctionComponentMetadata = FeatureComponent<{
|
|
33
|
+
appId: number;
|
|
34
|
+
appFunctionName: string;
|
|
35
|
+
endpoint?: {
|
|
36
|
+
path: string;
|
|
37
|
+
methods: string[];
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
export type FeatureComponents = FeatureComponent | AppFunctionComponentMetadata;
|
package/types/Config.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ENVIRONMENTS } from '../constants/environments';
|
|
2
2
|
import { CLIAccount_NEW, CLIAccount_DEPRECATED } from './Accounts';
|
|
3
|
+
import { CmsPublishMode } from './Files';
|
|
3
4
|
import { ValueOf } from './Utils';
|
|
4
5
|
export interface CLIConfig_NEW {
|
|
5
6
|
accounts: Array<CLIAccount_NEW>;
|
|
6
7
|
allowUsageTracking?: boolean;
|
|
7
8
|
defaultAccount?: string | number;
|
|
8
|
-
defaultMode?:
|
|
9
|
+
defaultMode?: CmsPublishMode;
|
|
10
|
+
defaultCmsPublishMode?: CmsPublishMode;
|
|
9
11
|
httpTimeout?: number;
|
|
10
12
|
env?: Environment;
|
|
11
13
|
httpUseLocalhost?: boolean;
|
|
@@ -14,10 +16,25 @@ export interface CLIConfig_DEPRECATED {
|
|
|
14
16
|
portals: Array<CLIAccount_DEPRECATED>;
|
|
15
17
|
allowUsageTracking?: boolean;
|
|
16
18
|
defaultPortal?: string | number;
|
|
17
|
-
defaultMode?:
|
|
19
|
+
defaultMode?: CmsPublishMode;
|
|
20
|
+
defaultCmsPublishMode?: CmsPublishMode;
|
|
18
21
|
httpTimeout?: number;
|
|
19
22
|
env?: Environment;
|
|
20
23
|
httpUseLocalhost?: boolean;
|
|
21
24
|
}
|
|
22
25
|
export type CLIConfig = CLIConfig_NEW | CLIConfig_DEPRECATED;
|
|
23
26
|
export type Environment = ValueOf<typeof ENVIRONMENTS> | '';
|
|
27
|
+
export type EnvironmentConfigVariables = {
|
|
28
|
+
apiKey?: string;
|
|
29
|
+
clientId?: string;
|
|
30
|
+
clientSecret?: string;
|
|
31
|
+
personalAccessKey?: string;
|
|
32
|
+
accountId?: number;
|
|
33
|
+
refreshToken?: string;
|
|
34
|
+
env?: Environment;
|
|
35
|
+
};
|
|
36
|
+
export type GitInclusionResult = {
|
|
37
|
+
inGit: boolean;
|
|
38
|
+
configIgnored: boolean;
|
|
39
|
+
gitignoreFiles: Array<string>;
|
|
40
|
+
};
|
package/types/Deploy.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ValueOf } from './Utils';
|
|
|
2
2
|
import { ACTIVITY_SOURCE } from '../enums/project';
|
|
3
3
|
import { DEPLOY_ACTION, DEPLOY_STATUS } from '../enums/deploy';
|
|
4
4
|
import { COMPONENT_TYPES, SUBCOMPONENT_TYPES } from '../enums/build';
|
|
5
|
-
import {
|
|
5
|
+
import { ProjectStandardError } from './Project';
|
|
6
6
|
export type DeployStatus = ValueOf<typeof DEPLOY_STATUS>;
|
|
7
7
|
export type SubdeployStatus = {
|
|
8
8
|
action: ValueOf<typeof DEPLOY_ACTION>;
|
|
@@ -10,10 +10,11 @@ export type SubdeployStatus = {
|
|
|
10
10
|
deployType: ValueOf<typeof COMPONENT_TYPES> | ValueOf<typeof SUBCOMPONENT_TYPES>;
|
|
11
11
|
errorMessage: string;
|
|
12
12
|
finishedAt: string;
|
|
13
|
-
standardError
|
|
13
|
+
standardError: ProjectStandardError | null;
|
|
14
14
|
startedAt: string;
|
|
15
15
|
status: DeployStatus;
|
|
16
16
|
id: string;
|
|
17
|
+
visible: boolean;
|
|
17
18
|
};
|
|
18
19
|
export type Deploy = {
|
|
19
20
|
buildId: number;
|
package/types/Error.d.ts
CHANGED
|
@@ -16,18 +16,22 @@ export interface ValidationError extends BaseError {
|
|
|
16
16
|
errorTokens?: {
|
|
17
17
|
line: number;
|
|
18
18
|
};
|
|
19
|
+
context?: {
|
|
20
|
+
requiredScopes?: string[];
|
|
21
|
+
};
|
|
19
22
|
}
|
|
20
23
|
export type FileSystemErrorContext = {
|
|
21
24
|
filepath?: string;
|
|
22
|
-
|
|
23
|
-
read?: boolean;
|
|
25
|
+
operation?: 'write' | 'read';
|
|
24
26
|
accountId?: number;
|
|
25
27
|
dest?: string;
|
|
26
28
|
};
|
|
27
|
-
export
|
|
28
|
-
accountId?: number;
|
|
29
|
+
export interface HubSpotHttpErrorContext extends FileSystemErrorContext {
|
|
29
30
|
request?: string;
|
|
30
31
|
payload?: string;
|
|
31
32
|
projectName?: string;
|
|
32
|
-
}
|
|
33
|
+
}
|
|
33
34
|
export type OptionalError = BaseError | null | undefined;
|
|
35
|
+
export type ErrorContext = {
|
|
36
|
+
accountId?: number;
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type FieldsArray<T> = Array<T | FieldsArray<T>>;
|
package/types/FileManager.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export type File = {
|
|
|
13
13
|
friendly_url: string;
|
|
14
14
|
meta: {
|
|
15
15
|
allows_anonymous_access: boolean;
|
|
16
|
-
charset_guess: string;
|
|
17
16
|
line_count: number;
|
|
18
17
|
indexable: boolean;
|
|
19
18
|
};
|
|
@@ -69,3 +68,4 @@ export type FetchFolderResponse = {
|
|
|
69
68
|
objects: Array<Folder>;
|
|
70
69
|
total_count: number;
|
|
71
70
|
};
|
|
71
|
+
export type SimplifiedFolder = Partial<Folder> & Pick<Folder, 'id' | 'name'>;
|
package/types/Files.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AxiosError } from 'axios';
|
|
2
1
|
import { ValueOf } from '../types/Utils';
|
|
3
2
|
import { STAT_TYPES, FILE_TYPES, FILE_UPLOAD_RESULT_TYPES } from '../constants/files';
|
|
4
|
-
import {
|
|
3
|
+
import { CMS_PUBLISH_MODE } from '../constants/files';
|
|
5
4
|
import { HttpOptions } from './Http';
|
|
5
|
+
import { AxiosError } from 'axios';
|
|
6
6
|
export type StatType = ValueOf<typeof STAT_TYPES>;
|
|
7
7
|
export type FileData = {
|
|
8
8
|
filepath: string;
|
|
@@ -18,7 +18,7 @@ export type FileMapperNode = {
|
|
|
18
18
|
folder: boolean;
|
|
19
19
|
children: Array<FileMapperNode>;
|
|
20
20
|
};
|
|
21
|
-
export type
|
|
21
|
+
export type CmsPublishMode = ValueOf<typeof CMS_PUBLISH_MODE>;
|
|
22
22
|
export type FileMapperOptions = Omit<HttpOptions, 'url'>;
|
|
23
23
|
export type FileMapperInputOptions = {
|
|
24
24
|
staging?: boolean;
|
|
@@ -29,7 +29,7 @@ export type FileType = ValueOf<typeof FILE_TYPES>;
|
|
|
29
29
|
type ResultType = ValueOf<typeof FILE_UPLOAD_RESULT_TYPES>;
|
|
30
30
|
export type UploadFolderResults = {
|
|
31
31
|
resultType: ResultType;
|
|
32
|
-
error:
|
|
32
|
+
error: unknown;
|
|
33
33
|
file: string;
|
|
34
34
|
};
|
|
35
35
|
export type FileTree = {
|
|
@@ -37,4 +37,43 @@ export type FileTree = {
|
|
|
37
37
|
path: string;
|
|
38
38
|
children: Array<FileTree>;
|
|
39
39
|
};
|
|
40
|
+
export type PathTypeData = {
|
|
41
|
+
isModule: boolean;
|
|
42
|
+
isHubspot: boolean;
|
|
43
|
+
isFile: boolean;
|
|
44
|
+
isRoot: boolean;
|
|
45
|
+
isFolder: boolean;
|
|
46
|
+
};
|
|
47
|
+
export type RecursiveFileMapperCallback = (node: FileMapperNode, filepath?: string, depth?: number) => boolean;
|
|
48
|
+
export type CommandOptions = {
|
|
49
|
+
convertFields?: boolean;
|
|
50
|
+
fieldOptions?: string;
|
|
51
|
+
saveOutput?: boolean;
|
|
52
|
+
onAttemptCallback?: (file: string | undefined, destPath: string) => void;
|
|
53
|
+
onSuccessCallback?: (file: string | undefined, destPath: string) => void;
|
|
54
|
+
onFirstErrorCallback?: (file: string, destPath: string, error: unknown) => void;
|
|
55
|
+
onRetryCallback?: (file: string, destPath: string) => void;
|
|
56
|
+
onFinalErrorCallback?: (accountId: number, file: string, destPath: string, error: unknown) => void;
|
|
57
|
+
};
|
|
58
|
+
export type FilePathsByType = {
|
|
59
|
+
[key: string]: Array<string>;
|
|
60
|
+
};
|
|
61
|
+
export type UploadFileOptions = FileMapperInputOptions & {
|
|
62
|
+
src: string;
|
|
63
|
+
commandOptions: {
|
|
64
|
+
convertFields?: boolean;
|
|
65
|
+
};
|
|
66
|
+
fieldOptions?: string;
|
|
67
|
+
};
|
|
68
|
+
export type WatchOptions = {
|
|
69
|
+
cmsPublishMode?: CmsPublishMode;
|
|
70
|
+
remove?: boolean;
|
|
71
|
+
disableInitial?: boolean;
|
|
72
|
+
notify?: string;
|
|
73
|
+
commandOptions: {
|
|
74
|
+
convertFields?: boolean;
|
|
75
|
+
};
|
|
76
|
+
filePaths?: Array<string>;
|
|
77
|
+
};
|
|
78
|
+
export type WatchErrorHandler = (error: AxiosError) => void;
|
|
40
79
|
export {};
|
package/types/Functions.d.ts
CHANGED
|
@@ -37,4 +37,56 @@ export type GetBuildStatusResponse = {
|
|
|
37
37
|
userId: number;
|
|
38
38
|
deployId: number;
|
|
39
39
|
};
|
|
40
|
+
export type FunctionConfig = {
|
|
41
|
+
runtime: string;
|
|
42
|
+
version: string;
|
|
43
|
+
environment: object;
|
|
44
|
+
secrets: Array<string>;
|
|
45
|
+
endpoints: {
|
|
46
|
+
[key: string]: {
|
|
47
|
+
method: string;
|
|
48
|
+
file: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export type FunctionConfigInfo = {
|
|
53
|
+
endpointPath: string;
|
|
54
|
+
endpointMethod: string;
|
|
55
|
+
functionFile: string;
|
|
56
|
+
};
|
|
57
|
+
export type FunctionInfo = {
|
|
58
|
+
functionsFolder: string;
|
|
59
|
+
filename: string;
|
|
60
|
+
endpointPath: string;
|
|
61
|
+
endpointMethod: string;
|
|
62
|
+
};
|
|
63
|
+
export type FunctionOptions = {
|
|
64
|
+
allowExistingFile?: boolean;
|
|
65
|
+
};
|
|
66
|
+
export type FunctionLog = {
|
|
67
|
+
id: string;
|
|
68
|
+
executionTime: number;
|
|
69
|
+
log: string;
|
|
70
|
+
error: {
|
|
71
|
+
message: string;
|
|
72
|
+
type: string;
|
|
73
|
+
stackTrace: string[][];
|
|
74
|
+
};
|
|
75
|
+
status: string;
|
|
76
|
+
createdAt: number;
|
|
77
|
+
memory: string;
|
|
78
|
+
};
|
|
79
|
+
export type GetFunctionLogsResponse = {
|
|
80
|
+
results: FunctionLog[];
|
|
81
|
+
paging: {
|
|
82
|
+
next: {
|
|
83
|
+
after: string;
|
|
84
|
+
link: string;
|
|
85
|
+
};
|
|
86
|
+
prev: {
|
|
87
|
+
before: string;
|
|
88
|
+
link: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
40
92
|
export {};
|
package/types/Github.d.ts
CHANGED
|
@@ -61,4 +61,17 @@ export interface GithubSourceData {
|
|
|
61
61
|
repositoryName: string;
|
|
62
62
|
source: string;
|
|
63
63
|
}
|
|
64
|
+
export type RepoPath = `${string}/${string}`;
|
|
65
|
+
export type DownloadGithubRepoZipOptions = {
|
|
66
|
+
branch?: string;
|
|
67
|
+
tag?: string;
|
|
68
|
+
};
|
|
69
|
+
export type CloneGithubRepoOptions = {
|
|
70
|
+
isRelease?: boolean;
|
|
71
|
+
type?: string;
|
|
72
|
+
branch?: string;
|
|
73
|
+
tag?: string;
|
|
74
|
+
sourceDir?: string;
|
|
75
|
+
hideLogs?: boolean;
|
|
76
|
+
};
|
|
64
77
|
export {};
|
package/types/Http.d.ts
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
import { AxiosPromise, ResponseType } from 'axios';
|
|
2
6
|
import { ReadStream } from 'fs';
|
|
7
|
+
import { Stream } from 'stream';
|
|
8
|
+
export type HubSpotPromise<T = unknown> = AxiosPromise<T>;
|
|
3
9
|
export type Data = {
|
|
4
10
|
[key: string]: any;
|
|
5
11
|
};
|
|
6
12
|
export type QueryParams = {
|
|
7
13
|
[key: string]: string | number | boolean | undefined;
|
|
8
14
|
};
|
|
9
|
-
export type
|
|
15
|
+
export type FormData = {
|
|
16
|
+
[key: string]: string | ReadStream;
|
|
17
|
+
};
|
|
18
|
+
export type HttpOptions = {
|
|
10
19
|
baseURL?: string;
|
|
11
20
|
url: string;
|
|
12
21
|
env?: string;
|
|
13
22
|
localHostOverride?: boolean;
|
|
14
|
-
|
|
15
|
-
data?: Data;
|
|
23
|
+
data?: Data | string | ArrayBuffer | ArrayBufferView | URLSearchParams | Stream | Buffer;
|
|
16
24
|
resolveWithFullResponse?: boolean;
|
|
25
|
+
params?: QueryParams;
|
|
17
26
|
timeout?: number;
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
export type FormData = {
|
|
21
|
-
[key: string]: string | ReadStream;
|
|
22
|
-
};
|
|
23
|
-
export type HttpOptions = AxiosConfigOptions & {
|
|
24
|
-
query?: QueryParams;
|
|
25
|
-
timeout?: number;
|
|
26
|
-
encoding?: string | null;
|
|
27
|
+
responseType?: ResponseType;
|
|
27
28
|
headers?: {
|
|
28
29
|
[header: string]: string | string[] | undefined;
|
|
29
30
|
};
|
package/types/Hubdb.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type Check = {
|
|
1
|
+
export type Check = {
|
|
2
2
|
check: string;
|
|
3
3
|
status: string;
|
|
4
4
|
title: string;
|
|
@@ -8,6 +8,11 @@ type Check = {
|
|
|
8
8
|
line: number | null;
|
|
9
9
|
file: string;
|
|
10
10
|
};
|
|
11
|
+
export interface ValidationError {
|
|
12
|
+
validationRequestId: number;
|
|
13
|
+
failureReasonType: string;
|
|
14
|
+
context: string;
|
|
15
|
+
}
|
|
11
16
|
export type GetValidationResultsResponse = {
|
|
12
17
|
validationRequestId: number;
|
|
13
18
|
assetPath: string;
|
|
@@ -22,7 +27,6 @@ export type GetValidationResultsResponse = {
|
|
|
22
27
|
results: Array<Check>;
|
|
23
28
|
};
|
|
24
29
|
};
|
|
25
|
-
errors: Array<
|
|
30
|
+
errors: Array<ValidationError>;
|
|
26
31
|
requestedAt: string;
|
|
27
32
|
};
|
|
28
|
-
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ValueOf } from './Utils';
|
|
2
|
+
import { ProjectStandardError } from './Project';
|
|
3
|
+
export declare const MIGRATION_STATUS: {
|
|
4
|
+
readonly BUILDING: "BUILDING";
|
|
5
|
+
readonly FAILURE: "FAILURE";
|
|
6
|
+
readonly PREPARING: "PREPARING";
|
|
7
|
+
readonly PENDING: "PENDING";
|
|
8
|
+
readonly SUCCESS: "SUCCESS";
|
|
9
|
+
};
|
|
10
|
+
export type MigrateAppResponse = {
|
|
11
|
+
id: number;
|
|
12
|
+
status: ValueOf<typeof MIGRATION_STATUS>;
|
|
13
|
+
};
|
|
14
|
+
export type CloneAppResponse = {
|
|
15
|
+
exportId: number;
|
|
16
|
+
status: ValueOf<typeof MIGRATION_STATUS>;
|
|
17
|
+
};
|
|
18
|
+
export type PollAppResponse = {
|
|
19
|
+
id: number;
|
|
20
|
+
project?: {
|
|
21
|
+
id: number;
|
|
22
|
+
name: string;
|
|
23
|
+
buildId: number;
|
|
24
|
+
deployId: number;
|
|
25
|
+
};
|
|
26
|
+
error: ProjectStandardError | null;
|
|
27
|
+
status: ValueOf<typeof MIGRATION_STATUS>;
|
|
28
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MIGRATION_STATUS = void 0;
|
|
4
|
+
exports.MIGRATION_STATUS = {
|
|
5
|
+
BUILDING: 'BUILDING',
|
|
6
|
+
FAILURE: 'FAILURE',
|
|
7
|
+
PREPARING: 'PREPARING',
|
|
8
|
+
PENDING: 'PENDING',
|
|
9
|
+
SUCCESS: 'SUCCESS',
|
|
10
|
+
};
|
package/types/Modules.d.ts
CHANGED
|
@@ -3,3 +3,14 @@ export type PathInput = {
|
|
|
3
3
|
isHubSpot?: boolean;
|
|
4
4
|
path: string;
|
|
5
5
|
};
|
|
6
|
+
export type ValidationResult = {
|
|
7
|
+
id: string;
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
export type ModuleDefinition = {
|
|
11
|
+
contentTypes: Array<string>;
|
|
12
|
+
moduleLabel: string;
|
|
13
|
+
reactType: boolean;
|
|
14
|
+
global: boolean;
|
|
15
|
+
availableForNewContent: boolean;
|
|
16
|
+
};
|
package/types/PortManager.d.ts
CHANGED
|
@@ -2,3 +2,10 @@ export type RequestPortsData = {
|
|
|
2
2
|
instanceId: string;
|
|
3
3
|
port?: number;
|
|
4
4
|
};
|
|
5
|
+
export type NetError = Error & {
|
|
6
|
+
code: string;
|
|
7
|
+
};
|
|
8
|
+
export type ListenCallback = (error: NetError | null, port: number) => void;
|
|
9
|
+
export type ServerPortMap = {
|
|
10
|
+
[instanceId: string]: number;
|
|
11
|
+
};
|
package/types/Project.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Build } from './Build';
|
|
2
2
|
import { GithubSourceData } from './Github';
|
|
3
|
+
import { ProjectLog } from './ProjectLog';
|
|
3
4
|
export type Project = {
|
|
4
5
|
createdAt: number;
|
|
5
6
|
deletedAt: number;
|
|
@@ -33,6 +34,35 @@ export type UploadProjectResponse = {
|
|
|
33
34
|
};
|
|
34
35
|
};
|
|
35
36
|
};
|
|
37
|
+
export type UploadIRResponse = {
|
|
38
|
+
buildId?: number;
|
|
39
|
+
createdBuildId: number;
|
|
40
|
+
};
|
|
36
41
|
export type ProjectSettings = {
|
|
37
42
|
isAutoDeployEnabled: boolean;
|
|
38
43
|
};
|
|
44
|
+
export type FetchPlatformVersionResponse = {
|
|
45
|
+
defaultPlatformVersion: string;
|
|
46
|
+
activePlatformVersions: Array<string>;
|
|
47
|
+
};
|
|
48
|
+
export type ProjectStandardError = {
|
|
49
|
+
status: string;
|
|
50
|
+
id?: string;
|
|
51
|
+
category: string;
|
|
52
|
+
subCategory?: string;
|
|
53
|
+
message?: string;
|
|
54
|
+
errors?: Array<{
|
|
55
|
+
message: string;
|
|
56
|
+
in?: string;
|
|
57
|
+
code?: string;
|
|
58
|
+
subcateogy?: string;
|
|
59
|
+
context: object;
|
|
60
|
+
}>;
|
|
61
|
+
context: object;
|
|
62
|
+
links: {
|
|
63
|
+
[key: string]: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export type WarnLogsResponse = {
|
|
67
|
+
logs: Array<ProjectLog>;
|
|
68
|
+
};
|