@hubspot/local-dev-lib 0.0.4 → 0.0.6

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.
Files changed (178) hide show
  1. package/api/customObjects.d.ts +7 -0
  2. package/api/customObjects.js +48 -0
  3. package/api/designManager.d.ts +13 -0
  4. package/api/designManager.js +21 -0
  5. package/api/fileManager.d.ts +5 -0
  6. package/api/fileManager.js +62 -0
  7. package/api/fileMapper.d.ts +10 -0
  8. package/api/fileMapper.js +104 -0
  9. package/api/functions.d.ts +4 -0
  10. package/api/functions.js +32 -0
  11. package/api/hubdb.d.ts +10 -0
  12. package/api/hubdb.js +61 -0
  13. package/api/lighthouseScore.d.ts +5 -0
  14. package/api/lighthouseScore.js +29 -0
  15. package/api/localDevAuth.d.ts +12 -0
  16. package/api/localDevAuth.js +38 -0
  17. package/api/marketplaceValidation.d.ts +5 -0
  18. package/api/marketplaceValidation.js +29 -0
  19. package/api/projects.d.ts +27 -0
  20. package/api/projects.js +126 -0
  21. package/api/sandboxHubs.d.ts +6 -0
  22. package/api/sandboxHubs.js +50 -0
  23. package/api/sandboxSync.d.ts +4 -0
  24. package/api/sandboxSync.js +35 -0
  25. package/api/secrets.d.ts +8 -0
  26. package/api/secrets.js +40 -0
  27. package/api/validateHubl.d.ts +2 -0
  28. package/api/validateHubl.js +18 -0
  29. package/config/CLIConfiguration.d.ts +22 -16
  30. package/config/CLIConfiguration.js +39 -9
  31. package/config/configFile.d.ts +4 -4
  32. package/config/configFile.js +2 -2
  33. package/config/configUtils.d.ts +8 -8
  34. package/config/config_DEPRECATED.d.ts +78 -0
  35. package/config/config_DEPRECATED.js +636 -0
  36. package/config/environment.d.ts +2 -3
  37. package/config/environment.js +11 -17
  38. package/config/index.d.ts +38 -0
  39. package/config/index.js +232 -0
  40. package/constants/api.d.ts +17 -0
  41. package/constants/api.js +20 -0
  42. package/constants/auth.d.ts +13 -0
  43. package/constants/auth.js +8 -1
  44. package/constants/config.d.ts +0 -4
  45. package/constants/config.js +1 -5
  46. package/constants/environments.d.ts +1 -0
  47. package/constants/environments.js +1 -0
  48. package/constants/extensions.d.ts +2 -0
  49. package/constants/extensions.js +4 -1
  50. package/constants/files.d.ts +16 -0
  51. package/constants/files.js +17 -1
  52. package/enums/build.d.ts +36 -0
  53. package/enums/build.js +39 -0
  54. package/enums/deploy.d.ts +11 -0
  55. package/enums/deploy.js +14 -0
  56. package/enums/project.d.ts +6 -0
  57. package/enums/project.js +9 -0
  58. package/errors/HubSpotAuthError.d.ts +8 -2
  59. package/errors/HubSpotAuthError.js +14 -0
  60. package/errors/apiErrors.d.ts +9 -0
  61. package/errors/apiErrors.js +182 -0
  62. package/errors/errors_DEPRECATED.d.ts +7 -0
  63. package/errors/errors_DEPRECATED.js +73 -0
  64. package/errors/fileSystemErrors.d.ts +1 -7
  65. package/errors/standardErrors.d.ts +7 -1
  66. package/errors/standardErrors.js +20 -23
  67. package/http/getAxiosConfig.d.ts +6 -0
  68. package/http/getAxiosConfig.js +22 -0
  69. package/http/index.d.ts +18 -0
  70. package/http/index.js +175 -0
  71. package/lang/en.lyaml +247 -0
  72. package/lib/cms/functions.d.ts +13 -0
  73. package/lib/cms/functions.js +181 -0
  74. package/lib/cms/handleFieldsJS.d.ts +2 -1
  75. package/lib/cms/handleFieldsJS.js +4 -3
  76. package/lib/cms/modules.js +3 -3
  77. package/lib/cms/processFieldsJs.d.ts +1 -0
  78. package/lib/cms/processFieldsJs.js +122 -0
  79. package/lib/cms/templates.d.ts +25 -0
  80. package/lib/cms/templates.js +62 -0
  81. package/lib/cms/themes.js +2 -2
  82. package/lib/cms/uploadFolder.d.ts +18 -0
  83. package/lib/cms/uploadFolder.js +182 -0
  84. package/lib/cms/watch.d.ts +20 -0
  85. package/lib/cms/watch.js +194 -0
  86. package/lib/customObjects.d.ts +5 -0
  87. package/lib/customObjects.js +36 -0
  88. package/lib/environment.d.ts +2 -1
  89. package/lib/fileMapper.d.ts +13 -0
  90. package/lib/fileMapper.js +322 -0
  91. package/lib/github.d.ts +6 -3
  92. package/lib/github.js +36 -27
  93. package/lib/gitignore.js +1 -46
  94. package/lib/hubdb.d.ts +16 -0
  95. package/lib/hubdb.js +130 -0
  96. package/lib/ignoreRules.d.ts +3 -0
  97. package/lib/ignoreRules.js +69 -0
  98. package/lib/logging/git.d.ts +2 -0
  99. package/lib/logging/git.js +54 -0
  100. package/lib/logging/logger.d.ts +44 -0
  101. package/lib/logging/logger.js +146 -0
  102. package/lib/logging/logs.d.ts +22 -0
  103. package/lib/logging/logs.js +82 -0
  104. package/lib/logging/table.d.ts +3 -0
  105. package/lib/logging/table.js +47 -0
  106. package/lib/oauth.d.ts +7 -0
  107. package/lib/oauth.js +44 -0
  108. package/lib/path.d.ts +2 -1
  109. package/lib/path.js +8 -3
  110. package/lib/personalAccessKey.d.ts +13 -0
  111. package/lib/personalAccessKey.js +135 -0
  112. package/lib/sandboxes.d.ts +14 -0
  113. package/lib/sandboxes.js +71 -0
  114. package/lib/trackUsage.d.ts +1 -0
  115. package/lib/trackUsage.js +53 -0
  116. package/lib/validate.d.ts +2 -0
  117. package/lib/validate.js +40 -0
  118. package/models/OAuth2Manager.d.ts +34 -0
  119. package/models/OAuth2Manager.js +126 -0
  120. package/package.json +25 -13
  121. package/types/Accounts.d.ts +66 -21
  122. package/types/Activity.d.ts +20 -0
  123. package/types/Activity.js +2 -0
  124. package/types/Api.d.ts +2 -0
  125. package/types/Api.js +2 -0
  126. package/types/Build.d.ts +41 -0
  127. package/types/Build.js +2 -0
  128. package/types/CLIOptions.d.ts +5 -0
  129. package/types/ComponentStructure.d.ts +20 -0
  130. package/types/ComponentStructure.js +2 -0
  131. package/types/Config.d.ts +17 -4
  132. package/types/Deploy.d.ts +42 -0
  133. package/types/Deploy.js +2 -0
  134. package/types/Error.d.ts +32 -7
  135. package/types/FileManager.d.ts +66 -0
  136. package/types/FileManager.js +2 -0
  137. package/types/Files.d.ts +33 -1
  138. package/types/Functions.d.ts +40 -0
  139. package/types/Functions.js +2 -0
  140. package/types/Github.d.ts +6 -0
  141. package/types/Http.d.ts +33 -0
  142. package/types/Http.js +2 -0
  143. package/types/Hubdb.d.ts +90 -0
  144. package/types/Hubdb.js +2 -0
  145. package/types/HublValidation.d.ts +59 -0
  146. package/types/HublValidation.js +2 -0
  147. package/types/Lighthouse.d.ts +25 -0
  148. package/types/Lighthouse.js +2 -0
  149. package/types/MarketplaceValidation.d.ts +28 -0
  150. package/types/MarketplaceValidation.js +2 -0
  151. package/types/Project.d.ts +38 -0
  152. package/types/Project.js +2 -0
  153. package/types/Sandbox.d.ts +165 -0
  154. package/types/Sandbox.js +2 -0
  155. package/types/Schemas.d.ts +42 -0
  156. package/types/Schemas.js +2 -0
  157. package/utils/{modules.d.ts → cms/modules.d.ts} +1 -1
  158. package/utils/{modules.js → cms/modules.js} +3 -3
  159. package/utils/getAccountIdentifier.d.ts +10 -0
  160. package/utils/getAccountIdentifier.js +40 -0
  161. package/utils/git.d.ts +7 -2
  162. package/utils/git.js +54 -7
  163. package/utils/lang.d.ts +4 -0
  164. package/utils/lang.js +9 -2
  165. package/utils/notify.d.ts +1 -0
  166. package/utils/notify.js +42 -0
  167. package/utils/objectUtils.d.ts +8 -0
  168. package/utils/objectUtils.js +33 -0
  169. package/constants/index.d.ts +0 -16
  170. package/constants/index.js +0 -12
  171. package/http/requestOptions.d.ts +0 -20
  172. package/http/requestOptions.js +0 -27
  173. package/lib/cms/index.d.ts +0 -10
  174. package/lib/cms/index.js +0 -13
  175. package/lib/index.d.ts +0 -11
  176. package/lib/index.js +0 -14
  177. /package/utils/{fieldsJS.d.ts → cms/fieldsJS.d.ts} +0 -0
  178. /package/utils/{fieldsJS.js → cms/fieldsJS.js} +0 -0
@@ -1,50 +1,95 @@
1
- import { DEFAULT_MODES } from '../constants/config';
2
- import { ValueOf } from './Utils';
1
+ import { Mode } from './Files';
2
+ import { Environment } from './Config';
3
3
  export type AuthType = 'personalaccesskey' | 'apikey' | 'oauth2';
4
- export interface CLIAccount {
4
+ export interface CLIAccount_NEW {
5
5
  name?: string;
6
6
  accountId: number;
7
- defaultMode?: ValueOf<typeof DEFAULT_MODES>;
8
- env?: string;
7
+ defaultMode?: Mode;
8
+ env: Environment;
9
9
  authType?: AuthType;
10
- auth?: object;
10
+ auth?: {
11
+ tokenInfo?: TokenInfo;
12
+ };
11
13
  sandboxAccountType?: string | null;
12
14
  parentAccountId?: number | null;
13
15
  apiKey?: string;
14
16
  personalAccessKey?: string;
15
17
  }
16
- export type PersonalAccessKeyTokenInfo = {
17
- accessToken: string;
18
- expiresAt: string;
19
- };
20
- export type OauthTokenInfo = {
18
+ export interface CLIAccount_DEPRECATED {
19
+ name?: string;
20
+ portalId?: number;
21
+ defaultMode?: Mode;
22
+ env: Environment;
23
+ authType?: AuthType;
24
+ auth?: {
25
+ tokenInfo?: TokenInfo;
26
+ };
27
+ sandboxAccountType?: string | null;
28
+ parentAccountId?: number | null;
29
+ apiKey?: string;
30
+ personalAccessKey?: string;
31
+ }
32
+ export type CLIAccount = CLIAccount_NEW | CLIAccount_DEPRECATED;
33
+ export type TokenInfo = {
34
+ accessToken?: string;
35
+ expiresAt?: string;
21
36
  refreshToken?: string;
22
37
  };
23
- export interface PersonalAccessKeyAccount extends CLIAccount {
38
+ export interface PersonalAccessKeyAccount_NEW extends CLIAccount_NEW {
39
+ authType: 'personalaccesskey';
40
+ personalAccessKey: string;
41
+ }
42
+ export interface PersonalAccessKeyAccount_DEPRECATED extends CLIAccount_DEPRECATED {
24
43
  authType: 'personalaccesskey';
25
- auth?: {
26
- tokenInfo: PersonalAccessKeyTokenInfo;
27
- };
28
44
  personalAccessKey: string;
29
45
  }
30
- export interface OAuthAccount extends CLIAccount {
46
+ export type PersonalAccessKeyAccount = PersonalAccessKeyAccount_NEW | PersonalAccessKeyAccount_DEPRECATED;
47
+ export interface OAuthAccount_NEW extends CLIAccount_NEW {
31
48
  authType: 'oauth2';
32
- auth?: {
49
+ auth: {
33
50
  clientId?: string;
34
51
  clientSecret?: string;
35
52
  scopes?: Array<string>;
36
- tokenInfo?: OauthTokenInfo;
53
+ tokenInfo?: TokenInfo;
37
54
  };
38
55
  }
39
- export interface APIKeyAccount extends CLIAccount {
56
+ export interface OAuthAccount_DEPRECATED extends CLIAccount_DEPRECATED {
57
+ authType: 'oauth2';
58
+ auth: {
59
+ clientId?: string;
60
+ clientSecret?: string;
61
+ scopes?: Array<string>;
62
+ tokenInfo?: TokenInfo;
63
+ };
64
+ }
65
+ export type OAuthAccount = OAuthAccount_NEW | OAuthAccount_DEPRECATED;
66
+ export interface APIKeyAccount_NEW extends CLIAccount_NEW {
40
67
  authType: 'apikey';
41
68
  apiKey: string;
42
69
  }
43
- export interface FlatAccountFields<T extends OauthTokenInfo | PersonalAccessKeyTokenInfo> extends CLIAccount {
44
- tokenInfo?: T;
70
+ export interface APIKeyAccount_DEPRECATED extends CLIAccount_DEPRECATED {
71
+ authType: 'apikey';
72
+ apiKey: string;
73
+ }
74
+ export type APIKeyAccount = APIKeyAccount_NEW | APIKeyAccount_DEPRECATED;
75
+ export interface FlatAccountFields_NEW extends CLIAccount_NEW {
76
+ tokenInfo?: TokenInfo;
77
+ clientId?: string;
78
+ clientSecret?: string;
79
+ scopes?: Array<string>;
80
+ apiKey?: string;
81
+ personalAccessKey?: string;
82
+ }
83
+ export interface FlatAccountFields_DEPRECATED extends CLIAccount_DEPRECATED {
84
+ tokenInfo?: TokenInfo;
45
85
  clientId?: string;
46
86
  clientSecret?: string;
47
87
  scopes?: Array<string>;
48
88
  apiKey?: string;
49
89
  personalAccessKey?: string;
50
90
  }
91
+ export type FlatAccountFields = FlatAccountFields_NEW | FlatAccountFields_DEPRECATED;
92
+ export type ScopeData = {
93
+ portalScopesInGroup: Array<string>;
94
+ userScopesInGroup: Array<string>;
95
+ };
@@ -0,0 +1,20 @@
1
+ import { ACTIVITY_SOURCE } from '../enums/project';
2
+ import { ValueOf } from './Utils';
3
+ import { GithubSourceData } from './Github';
4
+ export interface GithubActivitySource extends GithubSourceData {
5
+ authorEmail: string;
6
+ authorName: string;
7
+ branchName: string;
8
+ branch: string;
9
+ commitHash: string;
10
+ committersUsername: string;
11
+ ownerName: string;
12
+ owner: string;
13
+ repositoryName: string;
14
+ type: typeof ACTIVITY_SOURCE.GITHUB_USER;
15
+ }
16
+ export type HubspotActivitySource = {
17
+ userId?: number;
18
+ type: ValueOf<typeof ACTIVITY_SOURCE>;
19
+ };
20
+ export type ActivitySource = GithubActivitySource | HubspotActivitySource;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/types/Api.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { HTTP_METHOD_VERBS } from '../constants/api';
2
+ export type HttpMethod = keyof typeof HTTP_METHOD_VERBS;
package/types/Api.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,8 @@
1
1
  export interface CLIOptions {
2
+ silenceErrors?: boolean;
2
3
  useEnv?: boolean;
3
4
  }
5
+ export type WriteConfigOptions = {
6
+ path?: string;
7
+ source?: string;
8
+ };
@@ -0,0 +1,20 @@
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 ComponentMetadata = {
10
+ componentIdentifier: string;
11
+ componentName: string;
12
+ componentType: ValueOf<typeof COMPONENT_TYPES> | ValueOf<typeof SUBCOMPONENT_TYPES>;
13
+ metadata: {
14
+ appId: string;
15
+ };
16
+ parentComponentType: string;
17
+ };
18
+ export type ComponentMetadataResponse = {
19
+ results: Array<ComponentMetadata>;
20
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/types/Config.d.ts CHANGED
@@ -1,10 +1,23 @@
1
- import { CLIAccount } from './Accounts';
2
- export interface CLIConfig {
3
- accounts: Array<CLIAccount>;
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>;
4
6
  allowUsageTracking?: boolean;
5
7
  defaultAccount?: string | number;
6
8
  defaultMode?: string;
7
9
  httpTimeout?: number;
8
- env?: string;
10
+ env?: Environment;
9
11
  httpUseLocalhost?: boolean;
10
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> | '';
@@ -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
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/types/Error.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { HttpMethod } from './Api';
1
2
  export interface BaseError extends Error {
2
3
  name: string;
3
4
  message: string;
@@ -6,26 +7,50 @@ export interface BaseError extends Error {
6
7
  syscall?: string | null;
7
8
  reason?: string;
8
9
  statusCode?: number;
10
+ error?: BaseError;
11
+ errors?: Array<BaseError>;
9
12
  }
10
13
  export interface StatusCodeError extends BaseError {
11
- name: 'StatusCodeError';
12
- statusCode: number;
14
+ name: string;
15
+ statusCode?: number;
13
16
  message: string;
17
+ category?: string;
18
+ subCategory?: string;
14
19
  response: {
15
20
  request: {
16
21
  href: string;
17
22
  method: string;
18
23
  };
19
24
  body: {
20
- [key: string]: string;
25
+ message?: string;
26
+ errors?: Array<StatusCodeError>;
27
+ category?: string;
28
+ subCategory?: string;
21
29
  };
22
30
  headers: {
23
31
  [key: string]: string;
24
32
  };
33
+ statusCode: number;
25
34
  };
26
- }
27
- export interface GithubError extends BaseError {
28
- error: {
29
- message?: string;
35
+ options?: {
36
+ method: HttpMethod;
37
+ };
38
+ errorTokens?: {
39
+ line: number;
30
40
  };
41
+ error?: StatusCodeError;
42
+ errors?: Array<StatusCodeError>;
31
43
  }
44
+ export type FileSystemErrorContext = {
45
+ filepath: string;
46
+ write?: boolean;
47
+ read?: boolean;
48
+ accountId?: number;
49
+ };
50
+ export type StatusCodeErrorContext = {
51
+ accountId?: number;
52
+ request?: string;
53
+ payload?: string;
54
+ projectName?: string;
55
+ };
56
+ export type OptionalError = BaseError | null | undefined;
@@ -0,0 +1,66 @@
1
+ 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
+ charset_guess: string;
17
+ line_count: number;
18
+ indexable: boolean;
19
+ };
20
+ created: number;
21
+ updated: number;
22
+ deleted_at: number;
23
+ folder_id: number | null;
24
+ hidden: boolean;
25
+ archived: boolean;
26
+ created_by: number;
27
+ deleted_by: number | null;
28
+ replaceable: boolean;
29
+ default_hosting_url: string;
30
+ teams?: Array<number>;
31
+ is_indexable: boolean;
32
+ cloud_key_hash: string;
33
+ url: string;
34
+ title: string;
35
+ cdn_purge_embargo_time: number | null;
36
+ file_hash: string;
37
+ };
38
+ type Folder = {
39
+ id: number;
40
+ portal_id: number;
41
+ name: string;
42
+ deleted: boolean;
43
+ teams?: Array<number>;
44
+ parent_folder_id: number | null;
45
+ created: number;
46
+ updated: number;
47
+ deleted_at: number;
48
+ full_path: string;
49
+ category: number;
50
+ hidden: false;
51
+ cdn_purge_embargo_time: number | null;
52
+ };
53
+ export type UploadResponse = {
54
+ objects: Array<File>;
55
+ };
56
+ export type FetchStatResponse = {
57
+ file: File | null;
58
+ folder: Folder | null;
59
+ };
60
+ export type FetchFilesOrFolderResponse = {
61
+ limit: number;
62
+ offset: number;
63
+ objects: Array<File | Folder>;
64
+ total_count: number;
65
+ };
66
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/types/Files.d.ts CHANGED
@@ -1,8 +1,40 @@
1
1
  import { ValueOf } from '../types/Utils';
2
- import { STAT_TYPES } from '../constants/files';
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 { StatusCodeError } from './Error';
3
6
  export type StatType = ValueOf<typeof STAT_TYPES>;
4
7
  export type FileData = {
5
8
  filepath: string;
6
9
  files?: Array<string>;
7
10
  type: StatType;
8
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: StatusCodeError | null;
33
+ file: string;
34
+ };
35
+ export type FileTree = {
36
+ source?: string;
37
+ path: string;
38
+ children: Array<FileTree>;
39
+ };
40
+ export {};
@@ -0,0 +1,40 @@
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 {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/types/Github.d.ts CHANGED
@@ -55,4 +55,10 @@ export type GithubRepoFile = {
55
55
  html: string;
56
56
  };
57
57
  };
58
+ export interface GithubSourceData {
59
+ branch: string;
60
+ owner: string;
61
+ repositoryName: string;
62
+ source: string;
63
+ }
58
64
  export {};
@@ -0,0 +1,33 @@
1
+ /// <reference types="node" />
2
+ import { ReadStream } from 'fs';
3
+ export type Body = {
4
+ [key: string]: any;
5
+ };
6
+ export type AxiosConfigOptions = {
7
+ url: string;
8
+ env?: string;
9
+ localHostOverride?: boolean;
10
+ params?: {
11
+ portalId?: number;
12
+ buffer?: boolean;
13
+ environmentId?: number;
14
+ version?: string;
15
+ };
16
+ body?: Body | JSON;
17
+ resolveWithFullResponse?: boolean;
18
+ };
19
+ export type QueryParams = {
20
+ [key: string]: string | number | boolean;
21
+ };
22
+ export type FormData = {
23
+ [key: string]: string | ReadStream;
24
+ };
25
+ export type HttpOptions = AxiosConfigOptions & {
26
+ query?: QueryParams;
27
+ formData?: FormData;
28
+ timeout?: number;
29
+ encoding?: string | null;
30
+ headers?: {
31
+ [header: string]: string | string[] | undefined;
32
+ };
33
+ };
package/types/Http.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,90 @@
1
+ export type Schema = {
2
+ label: string;
3
+ name: string;
4
+ columns: Array<Column>;
5
+ useForPages: boolean;
6
+ allowChildTables: boolean;
7
+ enableChildTablePages: boolean;
8
+ allowPublicApiAccess: boolean;
9
+ };
10
+ export type Table = {
11
+ id: string;
12
+ name: string;
13
+ portalId: number;
14
+ createdAt: string;
15
+ publishedAt: string;
16
+ updatedAt: string;
17
+ label: string;
18
+ columns: Array<Column>;
19
+ rows: Array<Row>;
20
+ partitioningSettings?: null;
21
+ published: boolean;
22
+ cosObjectType: string;
23
+ updated: number;
24
+ archived: boolean;
25
+ columnCount: number;
26
+ cdnPurgeEmbargoTime: number | null;
27
+ rowCount: number;
28
+ createdBy: {
29
+ id: string;
30
+ email: string;
31
+ firstName: string;
32
+ lastName: string;
33
+ };
34
+ useForPages: boolean;
35
+ allowChildTables: boolean;
36
+ enableChildTablePages: boolean;
37
+ crmObjectTypeId: number;
38
+ dynamicMetaTags?: null;
39
+ allowPublicApiAccess: boolean;
40
+ };
41
+ export type Column = {
42
+ name: string;
43
+ label: string;
44
+ id: string;
45
+ archived: boolean;
46
+ type: string;
47
+ deleted?: boolean;
48
+ foreignIdsByName?: {
49
+ [key: string]: {
50
+ id: string;
51
+ name: string;
52
+ type: string;
53
+ };
54
+ };
55
+ foreignIdsById?: {
56
+ [key: string]: {
57
+ id: string;
58
+ name: string;
59
+ type: string;
60
+ };
61
+ };
62
+ };
63
+ export type Row = {
64
+ id: string;
65
+ createdAt: string;
66
+ updatedAt: string;
67
+ publishedAt: string | null;
68
+ values: {
69
+ text_column: string;
70
+ };
71
+ path: string | null;
72
+ name: string | null;
73
+ childTableId?: string;
74
+ isSoftEditable?: boolean;
75
+ };
76
+ export type CreateRowsResponse = {
77
+ status: string;
78
+ results: Array<Row>;
79
+ startedAt: string;
80
+ completedAt: string;
81
+ };
82
+ export type FetchRowsResponse = {
83
+ total: number;
84
+ results: Array<Row>;
85
+ paging?: {
86
+ next: {
87
+ after: string | null;
88
+ };
89
+ };
90
+ };
package/types/Hubdb.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });