@hubspot/local-dev-lib 0.0.1-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 -0
- package/api/customObjects.js +45 -0
- package/api/designManager.d.ts +5 -0
- package/api/designManager.js +18 -0
- package/api/developerTestAccounts.d.ts +7 -0
- package/api/developerTestAccounts.js +48 -0
- package/api/fileManager.d.ts +6 -0
- package/api/fileManager.js +63 -0
- package/api/fileMapper.d.ts +12 -0
- package/api/fileMapper.js +106 -0
- package/api/fileTransport.d.ts +4 -0
- package/api/fileTransport.js +39 -0
- package/api/functions.d.ts +8 -0
- package/api/functions.js +43 -0
- package/api/github.d.ts +11 -0
- package/api/github.js +71 -0
- package/api/hubdb.d.ts +12 -0
- package/api/hubdb.js +67 -0
- package/api/lighthouseScore.d.ts +6 -0
- package/api/lighthouseScore.js +26 -0
- package/api/localDevAuth.d.ts +8 -0
- package/api/localDevAuth.js +53 -0
- package/api/marketplaceValidation.d.ts +6 -0
- package/api/marketplaceValidation.js +26 -0
- package/api/projects.d.ts +40 -0
- package/api/projects.js +216 -0
- package/api/sandboxHubs.d.ts +7 -0
- package/api/sandboxHubs.js +49 -0
- package/api/sandboxSync.d.ts +4 -0
- package/api/sandboxSync.js +26 -0
- package/api/secrets.d.ts +6 -0
- package/api/secrets.js +37 -0
- package/api/validateHubl.d.ts +3 -0
- package/api/validateHubl.js +15 -0
- package/config/CLIConfiguration.d.ts +62 -0
- package/config/CLIConfiguration.js +467 -0
- package/config/configFile.d.ts +21 -0
- package/config/configFile.js +102 -0
- package/config/configUtils.d.ts +5 -0
- package/config/configUtils.js +87 -0
- package/config/config_DEPRECATED.d.ts +75 -0
- package/config/config_DEPRECATED.js +678 -0
- package/config/environment.d.ts +2 -0
- package/config/environment.js +60 -0
- package/config/getAccountIdentifier.d.ts +2 -0
- package/config/getAccountIdentifier.js +15 -0
- package/config/index.d.ts +41 -0
- package/config/index.js +260 -0
- package/constants/api.d.ts +15 -0
- package/constants/api.js +18 -0
- package/constants/auth.d.ts +37 -0
- package/constants/auth.js +38 -0
- package/constants/config.d.ts +18 -0
- package/constants/config.js +22 -0
- package/constants/environments.d.ts +15 -0
- package/constants/environments.js +18 -0
- package/constants/extensions.d.ts +6 -0
- package/constants/extensions.js +28 -0
- package/constants/files.d.ts +21 -0
- package/constants/files.js +24 -0
- package/constants/ports.d.ts +3 -0
- package/constants/ports.js +6 -0
- package/enums/build.d.ts +36 -0
- package/enums/build.js +39 -0
- package/enums/deploy.d.ts +11 -0
- package/enums/deploy.js +14 -0
- package/enums/project.d.ts +6 -0
- package/enums/project.js +9 -0
- package/errors/errors_DEPRECATED.d.ts +3 -0
- package/errors/errors_DEPRECATED.js +60 -0
- 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 +9 -0
- package/http/getAxiosConfig.js +66 -0
- package/http/index.d.ts +17 -0
- package/http/index.js +173 -0
- package/http/unauthed.d.ts +15 -0
- package/http/unauthed.js +38 -0
- package/lang/en.json +389 -0
- package/lib/archive.d.ts +3 -0
- package/lib/archive.js +117 -0
- package/lib/cms/functions.d.ts +8 -0
- package/lib/cms/functions.js +181 -0
- package/lib/cms/handleFieldsJS.d.ts +33 -0
- package/lib/cms/handleFieldsJS.js +148 -0
- package/lib/cms/modules.d.ts +14 -0
- package/lib/cms/modules.js +186 -0
- package/lib/cms/processFieldsJs.d.ts +1 -0
- package/lib/cms/processFieldsJs.js +97 -0
- package/lib/cms/templates.d.ts +65 -0
- package/lib/cms/templates.js +107 -0
- package/lib/cms/themes.d.ts +2 -0
- package/lib/cms/themes.js +34 -0
- package/lib/cms/uploadFolder.d.ts +7 -0
- package/lib/cms/uploadFolder.js +202 -0
- package/lib/cms/validate.d.ts +2 -0
- package/lib/cms/validate.js +40 -0
- package/lib/cms/watch.d.ts +4 -0
- package/lib/cms/watch.js +201 -0
- package/lib/customObjects.d.ts +5 -0
- package/lib/customObjects.js +42 -0
- package/lib/environment.d.ts +2 -0
- package/lib/environment.js +16 -0
- package/lib/escapeRegExp.d.ts +1 -0
- package/lib/escapeRegExp.js +7 -0
- package/lib/fileManager.d.ts +2 -0
- package/lib/fileManager.js +184 -0
- package/lib/fileMapper.d.ts +18 -0
- package/lib/fileMapper.js +317 -0
- package/lib/fs.d.ts +4 -0
- package/lib/fs.js +71 -0
- package/lib/github.d.ts +8 -0
- package/lib/github.js +167 -0
- package/lib/gitignore.d.ts +3 -0
- package/lib/gitignore.js +49 -0
- package/lib/hubdb.d.ts +17 -0
- package/lib/hubdb.js +133 -0
- package/lib/ignoreRules.d.ts +3 -0
- package/lib/ignoreRules.js +69 -0
- package/lib/logger.d.ts +56 -0
- package/lib/logger.js +146 -0
- package/lib/notify.d.ts +1 -0
- package/lib/notify.js +43 -0
- package/lib/oauth.d.ts +4 -0
- package/lib/oauth.js +34 -0
- package/lib/path.d.ts +14 -0
- package/lib/path.js +134 -0
- package/lib/personalAccessKey.d.ts +10 -0
- package/lib/personalAccessKey.js +163 -0
- package/lib/portManager.d.ts +10 -0
- package/lib/portManager.js +46 -0
- package/lib/text.d.ts +2 -0
- package/lib/text.js +24 -0
- package/lib/trackUsage.d.ts +1 -0
- package/lib/trackUsage.js +63 -0
- package/lib/urls.d.ts +2 -0
- package/lib/urls.js +24 -0
- 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 +12 -0
- package/models/OAuth2Manager.js +105 -0
- package/package.json +81 -0
- package/types/Accounts.d.ts +178 -0
- package/types/Accounts.js +2 -0
- package/types/Activity.d.ts +20 -0
- package/types/Activity.js +2 -0
- package/types/Api.d.ts +2 -0
- package/types/Api.js +2 -0
- package/types/Apps.d.ts +77 -0
- package/types/Apps.js +2 -0
- package/types/Archive.d.ts +9 -0
- package/types/Archive.js +2 -0
- package/types/Build.d.ts +41 -0
- package/types/Build.js +2 -0
- package/types/CLIOptions.d.ts +8 -0
- package/types/CLIOptions.js +2 -0
- package/types/ComponentStructure.d.ts +40 -0
- package/types/ComponentStructure.js +2 -0
- package/types/Config.d.ts +37 -0
- package/types/Config.js +2 -0
- package/types/Deploy.d.ts +42 -0
- package/types/Deploy.js +2 -0
- package/types/DesignManager.d.ts +10 -0
- package/types/DesignManager.js +2 -0
- package/types/Error.d.ts +37 -0
- package/types/Error.js +2 -0
- package/types/FieldsJS.d.ts +1 -0
- package/types/FieldsJS.js +2 -0
- package/types/FileManager.d.ts +71 -0
- package/types/FileManager.js +2 -0
- package/types/Files.d.ts +79 -0
- package/types/Files.js +2 -0
- package/types/Functions.d.ts +66 -0
- package/types/Functions.js +2 -0
- package/types/Github.d.ts +76 -0
- package/types/Github.js +2 -0
- package/types/Http.d.ts +29 -0
- package/types/Http.js +2 -0
- package/types/Hubdb.d.ts +109 -0
- package/types/Hubdb.js +2 -0
- package/types/HublValidation.d.ts +59 -0
- package/types/HublValidation.js +2 -0
- package/types/Lang.d.ts +10 -0
- package/types/Lang.js +2 -0
- package/types/Lighthouse.d.ts +25 -0
- package/types/Lighthouse.js +2 -0
- package/types/MarketplaceValidation.d.ts +28 -0
- package/types/MarketplaceValidation.js +2 -0
- package/types/Migration.d.ts +28 -0
- package/types/Migration.js +10 -0
- package/types/Modules.d.ts +16 -0
- package/types/Modules.js +2 -0
- package/types/PortManager.d.ts +11 -0
- package/types/PortManager.js +2 -0
- package/types/Project.d.ts +42 -0
- package/types/Project.js +2 -0
- package/types/ProjectLog.d.ts +9 -0
- package/types/ProjectLog.js +2 -0
- package/types/Sandbox.d.ts +155 -0
- package/types/Sandbox.js +2 -0
- package/types/Schemas.d.ts +39 -0
- package/types/Schemas.js +2 -0
- package/types/Secrets.d.ts +3 -0
- package/types/Secrets.js +2 -0
- package/types/Utils.d.ts +6 -0
- package/types/Utils.js +2 -0
- package/types/developerTestAccounts.d.ts +12 -0
- package/types/developerTestAccounts.js +2 -0
- package/utils/PortManagerServer.d.ts +26 -0
- package/utils/PortManagerServer.js +158 -0
- package/utils/accounts.d.ts +4 -0
- package/utils/accounts.js +28 -0
- package/utils/cms/fieldsJS.d.ts +2 -0
- package/utils/cms/fieldsJS.js +18 -0
- package/utils/cms/modules.d.ts +4 -0
- package/utils/cms/modules.js +54 -0
- package/utils/detectPort.d.ts +1 -0
- package/utils/detectPort.js +102 -0
- package/utils/git.d.ts +3 -0
- package/utils/git.js +71 -0
- package/utils/lang.d.ts +6 -0
- package/utils/lang.js +88 -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/Apps.js
ADDED
package/types/Archive.js
ADDED
package/types/Build.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ValueOf } from './Utils';
|
|
2
|
+
import { BUILD_STATUS, SUBBUILD_TYPES, DEPLOYABLE_STATES } from '../enums/build';
|
|
3
|
+
import { ActivitySource } from './Activity';
|
|
4
|
+
import { DeployStatusTaskLocator } from './Deploy';
|
|
5
|
+
import { OptionalError } from './Error';
|
|
6
|
+
export type SubbuildStatus = {
|
|
7
|
+
buildName: string;
|
|
8
|
+
buildType: ValueOf<typeof SUBBUILD_TYPES>;
|
|
9
|
+
errorMessage: string;
|
|
10
|
+
finishedAt: string;
|
|
11
|
+
rootPath: string;
|
|
12
|
+
standardError?: OptionalError;
|
|
13
|
+
startedAt: string;
|
|
14
|
+
status: ValueOf<typeof BUILD_STATUS>;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
export type Build = {
|
|
18
|
+
activitySource: ActivitySource;
|
|
19
|
+
buildId: number;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
deployableState: ValueOf<typeof DEPLOYABLE_STATES>;
|
|
22
|
+
deployStatusTaskLocator: DeployStatusTaskLocator;
|
|
23
|
+
enqueuedAt: string;
|
|
24
|
+
finishedAt: string;
|
|
25
|
+
isAutoDeployEnabled: boolean;
|
|
26
|
+
portalId: number;
|
|
27
|
+
projectName: string;
|
|
28
|
+
startedAt: string;
|
|
29
|
+
status: ValueOf<typeof BUILD_STATUS>;
|
|
30
|
+
subbuildStatuses: Array<SubbuildStatus>;
|
|
31
|
+
uploadMessage: string;
|
|
32
|
+
};
|
|
33
|
+
export type FetchProjectBuildsResponse = {
|
|
34
|
+
results: Array<Build>;
|
|
35
|
+
paging: {
|
|
36
|
+
next: {
|
|
37
|
+
after: string;
|
|
38
|
+
link: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
package/types/Build.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { COMPONENT_TYPES, SUBCOMPONENT_TYPES } from '../enums/build';
|
|
2
|
+
import { ValueOf } from './Utils';
|
|
3
|
+
export type ComponentStructure = {
|
|
4
|
+
[key: string]: Array<string>;
|
|
5
|
+
};
|
|
6
|
+
export type ComponentStructureResponse = {
|
|
7
|
+
topLevelComponentsWithChildren: ComponentStructure;
|
|
8
|
+
};
|
|
9
|
+
export type ProjectComponentsMetadata = {
|
|
10
|
+
topLevelComponentMetadata: TopLevelComponents[];
|
|
11
|
+
};
|
|
12
|
+
export interface ComponentMetadata<T> {
|
|
13
|
+
componentName: string;
|
|
14
|
+
type: {
|
|
15
|
+
name: T;
|
|
16
|
+
};
|
|
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;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ENVIRONMENTS } from '../constants/environments';
|
|
2
|
+
import { CLIAccount_NEW, CLIAccount_DEPRECATED } from './Accounts';
|
|
3
|
+
import { ValueOf } from './Utils';
|
|
4
|
+
export interface CLIConfig_NEW {
|
|
5
|
+
accounts: Array<CLIAccount_NEW>;
|
|
6
|
+
allowUsageTracking?: boolean;
|
|
7
|
+
defaultAccount?: string | number;
|
|
8
|
+
defaultMode?: string;
|
|
9
|
+
httpTimeout?: number;
|
|
10
|
+
env?: Environment;
|
|
11
|
+
httpUseLocalhost?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface CLIConfig_DEPRECATED {
|
|
14
|
+
portals: Array<CLIAccount_DEPRECATED>;
|
|
15
|
+
allowUsageTracking?: boolean;
|
|
16
|
+
defaultPortal?: string | number;
|
|
17
|
+
defaultMode?: string;
|
|
18
|
+
httpTimeout?: number;
|
|
19
|
+
env?: Environment;
|
|
20
|
+
httpUseLocalhost?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export type CLIConfig = CLIConfig_NEW | CLIConfig_DEPRECATED;
|
|
23
|
+
export type Environment = ValueOf<typeof ENVIRONMENTS> | '';
|
|
24
|
+
export type EnvironmentConfigVariables = {
|
|
25
|
+
apiKey?: string;
|
|
26
|
+
clientId?: string;
|
|
27
|
+
clientSecret?: string;
|
|
28
|
+
personalAccessKey?: string;
|
|
29
|
+
accountId?: number;
|
|
30
|
+
refreshToken?: string;
|
|
31
|
+
env?: Environment;
|
|
32
|
+
};
|
|
33
|
+
export type GitInclusionResult = {
|
|
34
|
+
inGit: boolean;
|
|
35
|
+
configIgnored: boolean;
|
|
36
|
+
gitignoreFiles: Array<string>;
|
|
37
|
+
};
|
package/types/Config.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ValueOf } from './Utils';
|
|
2
|
+
import { ACTIVITY_SOURCE } from '../enums/project';
|
|
3
|
+
import { DEPLOY_ACTION, DEPLOY_STATUS } from '../enums/deploy';
|
|
4
|
+
import { COMPONENT_TYPES, SUBCOMPONENT_TYPES } from '../enums/build';
|
|
5
|
+
import { OptionalError } from './Error';
|
|
6
|
+
export type DeployStatus = ValueOf<typeof DEPLOY_STATUS>;
|
|
7
|
+
export type SubdeployStatus = {
|
|
8
|
+
action: ValueOf<typeof DEPLOY_ACTION>;
|
|
9
|
+
deployName: string;
|
|
10
|
+
deployType: ValueOf<typeof COMPONENT_TYPES> | ValueOf<typeof SUBCOMPONENT_TYPES>;
|
|
11
|
+
errorMessage: string;
|
|
12
|
+
finishedAt: string;
|
|
13
|
+
standardError?: OptionalError;
|
|
14
|
+
startedAt: string;
|
|
15
|
+
status: DeployStatus;
|
|
16
|
+
id: string;
|
|
17
|
+
};
|
|
18
|
+
export type Deploy = {
|
|
19
|
+
buildId: number;
|
|
20
|
+
deployId: number;
|
|
21
|
+
enqueuedAt: string;
|
|
22
|
+
finishedAt: string;
|
|
23
|
+
portalId: number;
|
|
24
|
+
projectName: string;
|
|
25
|
+
startedAt: string;
|
|
26
|
+
status: DeployStatus;
|
|
27
|
+
subdeployStatuses: Array<SubdeployStatus>;
|
|
28
|
+
userId: number;
|
|
29
|
+
source: ValueOf<typeof ACTIVITY_SOURCE>;
|
|
30
|
+
};
|
|
31
|
+
export type DeployStatusTaskLocator = {
|
|
32
|
+
id: string;
|
|
33
|
+
links: Array<{
|
|
34
|
+
status: string;
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
37
|
+
export type ProjectDeployResponse = {
|
|
38
|
+
id: string;
|
|
39
|
+
links: {
|
|
40
|
+
status: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
package/types/Deploy.js
ADDED
package/types/Error.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface GenericError extends Error {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
export interface BaseError extends Error {
|
|
5
|
+
name: string;
|
|
6
|
+
message: string;
|
|
7
|
+
errno?: number | null;
|
|
8
|
+
code?: string | null;
|
|
9
|
+
syscall?: string | null;
|
|
10
|
+
reason?: string;
|
|
11
|
+
status?: number;
|
|
12
|
+
error?: BaseError;
|
|
13
|
+
errors?: Array<BaseError>;
|
|
14
|
+
}
|
|
15
|
+
export interface ValidationError extends BaseError {
|
|
16
|
+
errorTokens?: {
|
|
17
|
+
line: number;
|
|
18
|
+
};
|
|
19
|
+
context?: {
|
|
20
|
+
requiredScopes?: string[];
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export type FileSystemErrorContext = {
|
|
24
|
+
filepath?: string;
|
|
25
|
+
operation?: 'write' | 'read';
|
|
26
|
+
accountId?: number;
|
|
27
|
+
dest?: string;
|
|
28
|
+
};
|
|
29
|
+
export interface HubSpotHttpErrorContext extends FileSystemErrorContext {
|
|
30
|
+
request?: string;
|
|
31
|
+
payload?: string;
|
|
32
|
+
projectName?: string;
|
|
33
|
+
}
|
|
34
|
+
export type OptionalError = BaseError | null | undefined;
|
|
35
|
+
export type ErrorContext = {
|
|
36
|
+
accountId?: number;
|
|
37
|
+
};
|
package/types/Error.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type FieldsArray<T> = Array<T | FieldsArray<T>>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export type File = {
|
|
2
|
+
id: number;
|
|
3
|
+
portal_id: number;
|
|
4
|
+
name: string;
|
|
5
|
+
size: number;
|
|
6
|
+
height: number | null;
|
|
7
|
+
width: number | null;
|
|
8
|
+
encoding: string | null;
|
|
9
|
+
type: string;
|
|
10
|
+
extension: string;
|
|
11
|
+
cloud_key: string;
|
|
12
|
+
s3_url: string;
|
|
13
|
+
friendly_url: string;
|
|
14
|
+
meta: {
|
|
15
|
+
allows_anonymous_access: boolean;
|
|
16
|
+
line_count: number;
|
|
17
|
+
indexable: boolean;
|
|
18
|
+
};
|
|
19
|
+
created: number;
|
|
20
|
+
updated: number;
|
|
21
|
+
deleted_at: number;
|
|
22
|
+
folder_id: number | null;
|
|
23
|
+
hidden: boolean;
|
|
24
|
+
archived: boolean;
|
|
25
|
+
created_by: number;
|
|
26
|
+
deleted_by: number | null;
|
|
27
|
+
replaceable: boolean;
|
|
28
|
+
default_hosting_url: string;
|
|
29
|
+
teams?: Array<number>;
|
|
30
|
+
is_indexable: boolean;
|
|
31
|
+
cloud_key_hash: string;
|
|
32
|
+
url: string;
|
|
33
|
+
title: string;
|
|
34
|
+
cdn_purge_embargo_time: number | null;
|
|
35
|
+
file_hash: string;
|
|
36
|
+
};
|
|
37
|
+
export type Folder = {
|
|
38
|
+
id: number | 'None';
|
|
39
|
+
portal_id: number;
|
|
40
|
+
name: string;
|
|
41
|
+
deleted: boolean;
|
|
42
|
+
teams?: Array<number>;
|
|
43
|
+
parent_folder_id: number | null;
|
|
44
|
+
created: number;
|
|
45
|
+
updated: number;
|
|
46
|
+
deleted_at: number;
|
|
47
|
+
full_path: string;
|
|
48
|
+
category: number;
|
|
49
|
+
hidden: false;
|
|
50
|
+
cdn_purge_embargo_time: number | null;
|
|
51
|
+
};
|
|
52
|
+
export type UploadResponse = {
|
|
53
|
+
objects: Array<File>;
|
|
54
|
+
};
|
|
55
|
+
export type FetchStatResponse = {
|
|
56
|
+
file: File | null;
|
|
57
|
+
folder: Folder | null;
|
|
58
|
+
};
|
|
59
|
+
export type FetchFilesResponse = {
|
|
60
|
+
limit: number;
|
|
61
|
+
offset: number;
|
|
62
|
+
objects: Array<File>;
|
|
63
|
+
total_count: number;
|
|
64
|
+
};
|
|
65
|
+
export type FetchFolderResponse = {
|
|
66
|
+
limit: number;
|
|
67
|
+
offset: number;
|
|
68
|
+
objects: Array<Folder>;
|
|
69
|
+
total_count: number;
|
|
70
|
+
};
|
|
71
|
+
export type SimplifiedFolder = Partial<Folder> & Pick<Folder, 'id' | 'name'>;
|
package/types/Files.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ValueOf } from '../types/Utils';
|
|
2
|
+
import { STAT_TYPES, FILE_TYPES, FILE_UPLOAD_RESULT_TYPES } from '../constants/files';
|
|
3
|
+
import { MODE } from '../constants/files';
|
|
4
|
+
import { HttpOptions } from './Http';
|
|
5
|
+
import { AxiosError } from 'axios';
|
|
6
|
+
export type StatType = ValueOf<typeof STAT_TYPES>;
|
|
7
|
+
export type FileData = {
|
|
8
|
+
filepath: string;
|
|
9
|
+
files?: Array<string>;
|
|
10
|
+
type: StatType;
|
|
11
|
+
};
|
|
12
|
+
export type FileMapperNode = {
|
|
13
|
+
name: string;
|
|
14
|
+
createdAt: number;
|
|
15
|
+
updatedAt: number;
|
|
16
|
+
source: string | null;
|
|
17
|
+
path: string;
|
|
18
|
+
folder: boolean;
|
|
19
|
+
children: Array<FileMapperNode>;
|
|
20
|
+
};
|
|
21
|
+
export type Mode = ValueOf<typeof MODE>;
|
|
22
|
+
export type FileMapperOptions = Omit<HttpOptions, 'url'>;
|
|
23
|
+
export type FileMapperInputOptions = {
|
|
24
|
+
staging?: boolean;
|
|
25
|
+
assetVersion?: string;
|
|
26
|
+
overwrite?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type FileType = ValueOf<typeof FILE_TYPES>;
|
|
29
|
+
type ResultType = ValueOf<typeof FILE_UPLOAD_RESULT_TYPES>;
|
|
30
|
+
export type UploadFolderResults = {
|
|
31
|
+
resultType: ResultType;
|
|
32
|
+
error: unknown;
|
|
33
|
+
file: string;
|
|
34
|
+
};
|
|
35
|
+
export type FileTree = {
|
|
36
|
+
source?: string;
|
|
37
|
+
path: string;
|
|
38
|
+
children: Array<FileTree>;
|
|
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
|
+
mode?: Mode;
|
|
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;
|
|
79
|
+
export {};
|
package/types/Files.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
type ServerlessFunction = {
|
|
2
|
+
portalId: number;
|
|
3
|
+
id: number;
|
|
4
|
+
serverlessFunctionId: number;
|
|
5
|
+
route: string;
|
|
6
|
+
rawAssetPath: string;
|
|
7
|
+
method: string;
|
|
8
|
+
configHash: number;
|
|
9
|
+
secretNames: Array<string>;
|
|
10
|
+
created: number;
|
|
11
|
+
updated: number;
|
|
12
|
+
deletedAt: number;
|
|
13
|
+
deployId: number;
|
|
14
|
+
projectName: string | null;
|
|
15
|
+
authorFullName: string | null;
|
|
16
|
+
createdById: number | null;
|
|
17
|
+
updatedById: number | null;
|
|
18
|
+
appId: number | null;
|
|
19
|
+
subbuildId: number | null;
|
|
20
|
+
deployed: boolean;
|
|
21
|
+
deployedNullable: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type GetRoutesResponse = {
|
|
24
|
+
objects: Array<ServerlessFunction>;
|
|
25
|
+
total: number;
|
|
26
|
+
limit: number;
|
|
27
|
+
offset: number;
|
|
28
|
+
message: string | null;
|
|
29
|
+
totalCount: number;
|
|
30
|
+
};
|
|
31
|
+
export type GetBuildStatusResponse = {
|
|
32
|
+
status: string;
|
|
33
|
+
buildStartedAt: number;
|
|
34
|
+
updateCutoff?: number;
|
|
35
|
+
cdnUrl?: string;
|
|
36
|
+
buildTime?: number;
|
|
37
|
+
userId: number;
|
|
38
|
+
deployId: number;
|
|
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 {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
type GithubAuthor = {
|
|
2
|
+
login: string;
|
|
3
|
+
id: number;
|
|
4
|
+
node_id: string;
|
|
5
|
+
avatar_url: string;
|
|
6
|
+
gravatar_id: string;
|
|
7
|
+
url: string;
|
|
8
|
+
html_url: string;
|
|
9
|
+
followers_url: string;
|
|
10
|
+
following_url: string;
|
|
11
|
+
gists_url: string;
|
|
12
|
+
starred_url: string;
|
|
13
|
+
subscriptions_url: string;
|
|
14
|
+
organizations_url: string;
|
|
15
|
+
repos_url: string;
|
|
16
|
+
events_url: string;
|
|
17
|
+
received_events_url: string;
|
|
18
|
+
type: string;
|
|
19
|
+
site_admin: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type GithubReleaseData = {
|
|
22
|
+
url: string;
|
|
23
|
+
assets_url: string;
|
|
24
|
+
upload_url: string;
|
|
25
|
+
html_url: string;
|
|
26
|
+
id: number;
|
|
27
|
+
author: GithubAuthor;
|
|
28
|
+
node_id: string;
|
|
29
|
+
tag_name: string;
|
|
30
|
+
target_commitish: string;
|
|
31
|
+
name: string;
|
|
32
|
+
draft: boolean;
|
|
33
|
+
prerelease: boolean;
|
|
34
|
+
created_at: string;
|
|
35
|
+
published_at: string;
|
|
36
|
+
assets: Array<object>;
|
|
37
|
+
tarball_url: string;
|
|
38
|
+
zipball_url: string;
|
|
39
|
+
body: string;
|
|
40
|
+
mentions_count: number;
|
|
41
|
+
};
|
|
42
|
+
export type GithubRepoFile = {
|
|
43
|
+
name: string;
|
|
44
|
+
path: string;
|
|
45
|
+
sha: string;
|
|
46
|
+
size: number;
|
|
47
|
+
url: string;
|
|
48
|
+
html_url: string;
|
|
49
|
+
git_url: string;
|
|
50
|
+
download_url: string;
|
|
51
|
+
type: string;
|
|
52
|
+
_links: {
|
|
53
|
+
self: string;
|
|
54
|
+
git: string;
|
|
55
|
+
html: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export interface GithubSourceData {
|
|
59
|
+
branch: string;
|
|
60
|
+
owner: string;
|
|
61
|
+
repositoryName: string;
|
|
62
|
+
source: string;
|
|
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
|
+
};
|
|
76
|
+
export {};
|
package/types/Github.js
ADDED