@hubspot/local-dev-lib 3.13.1 → 3.14.0-beta.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/api/sandboxHubs.d.ts +3 -1
- package/api/sandboxHubs.js +18 -1
- package/package.json +1 -1
- package/types/Deploy.d.ts +17 -1
- package/types/Sandbox.d.ts +33 -0
- package/types/Sandbox.js +10 -0
package/api/sandboxHubs.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { AxiosPromise } from 'axios';
|
|
2
2
|
import { Environment } from '../types/Config';
|
|
3
|
-
import { SandboxHubData, SandboxResponse, SandboxUsageLimitsResponse } from '../types/Sandbox';
|
|
3
|
+
import { SandboxPersonalAccessKey, SandboxHubData, SandboxResponse, SandboxUsageLimitsResponse, V2Sandbox } from '../types/Sandbox';
|
|
4
4
|
import { HubSpotPromise } from '../types/Http';
|
|
5
5
|
export declare function createSandbox(accountId: number, name: string, type: 1 | 2): HubSpotPromise<SandboxResponse>;
|
|
6
6
|
export declare function deleteSandbox(parentAccountId: number, sandboxAccountId: number): HubSpotPromise<void>;
|
|
7
7
|
export declare function getSandboxUsageLimits(parentAccountId: number): HubSpotPromise<SandboxUsageLimitsResponse>;
|
|
8
8
|
export declare function fetchSandboxHubData(accessToken: string, accountId: number, env?: Environment): AxiosPromise<SandboxHubData>;
|
|
9
|
+
export declare function createV2Sandbox(accountId: number, name: string, type: 'STANDARD' | 'DEVELOPER', syncObjectRecords: boolean): HubSpotPromise<V2Sandbox>;
|
|
10
|
+
export declare function getSandboxPersonalAccessKey(accountId: number, sandboxId: number): HubSpotPromise<SandboxPersonalAccessKey>;
|
package/api/sandboxHubs.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchSandboxHubData = exports.getSandboxUsageLimits = exports.deleteSandbox = exports.createSandbox = void 0;
|
|
6
|
+
exports.getSandboxPersonalAccessKey = exports.createV2Sandbox = exports.fetchSandboxHubData = exports.getSandboxUsageLimits = exports.deleteSandbox = exports.createSandbox = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const http_1 = require("../http");
|
|
9
9
|
const getAxiosConfig_1 = require("../http/getAxiosConfig");
|
|
@@ -47,3 +47,20 @@ function fetchSandboxHubData(accessToken, accountId, env = environments_1.ENVIRO
|
|
|
47
47
|
return (0, axios_1.default)(reqWithToken);
|
|
48
48
|
}
|
|
49
49
|
exports.fetchSandboxHubData = fetchSandboxHubData;
|
|
50
|
+
function createV2Sandbox(accountId, name, type, syncObjectRecords) {
|
|
51
|
+
return http_1.http.post(accountId, {
|
|
52
|
+
url: `${SANDBOX_API_PATH_V2}/sandboxes`,
|
|
53
|
+
data: { name, type, syncObjectRecords },
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
exports.createV2Sandbox = createV2Sandbox;
|
|
57
|
+
function getSandboxPersonalAccessKey(accountId, sandboxId) {
|
|
58
|
+
return http_1.http.post(accountId, {
|
|
59
|
+
url: `${SANDBOX_API_PATH_V2}/sandboxes/${sandboxId}/personal-access-key`,
|
|
60
|
+
headers: {
|
|
61
|
+
'Content-Type': 'application/json',
|
|
62
|
+
},
|
|
63
|
+
timeout: api_1.SANDBOX_TIMEOUT,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.getSandboxPersonalAccessKey = getSandboxPersonalAccessKey;
|
package/package.json
CHANGED
package/types/Deploy.d.ts
CHANGED
|
@@ -35,9 +35,25 @@ export type DeployStatusTaskLocator = {
|
|
|
35
35
|
status: string;
|
|
36
36
|
}>;
|
|
37
37
|
};
|
|
38
|
-
export type
|
|
38
|
+
export type ProjectDeployResponseQueued = {
|
|
39
39
|
id: string;
|
|
40
|
+
buildResultType: 'DEPLOY_QUEUED';
|
|
40
41
|
links: {
|
|
41
42
|
status: string;
|
|
42
43
|
};
|
|
43
44
|
};
|
|
45
|
+
type SubdeployValidationIssue = {
|
|
46
|
+
uid: string;
|
|
47
|
+
componentTypeName: string;
|
|
48
|
+
errorMessages: string[];
|
|
49
|
+
blockingMessages: {
|
|
50
|
+
message: string;
|
|
51
|
+
isWarning: boolean;
|
|
52
|
+
}[];
|
|
53
|
+
};
|
|
54
|
+
export type ProjectDeployResponseBlocked = {
|
|
55
|
+
buildResultType: 'DEPLOY_BLOCKED';
|
|
56
|
+
issues: SubdeployValidationIssue[];
|
|
57
|
+
};
|
|
58
|
+
export type ProjectDeployResponse = ProjectDeployResponseQueued | ProjectDeployResponseBlocked;
|
|
59
|
+
export {};
|
package/types/Sandbox.d.ts
CHANGED
|
@@ -111,6 +111,33 @@ export type Sandbox = {
|
|
|
111
111
|
requestAccessFrom?: User | null;
|
|
112
112
|
superAdminsInSandbox?: number;
|
|
113
113
|
};
|
|
114
|
+
export declare const SandboxVersioning: {
|
|
115
|
+
readonly V1: "V1";
|
|
116
|
+
readonly V2: "V2";
|
|
117
|
+
};
|
|
118
|
+
export declare const SandboxStatus: {
|
|
119
|
+
readonly PENDING: "PENDING";
|
|
120
|
+
readonly READY: "READY";
|
|
121
|
+
readonly FAILED: "FAILED";
|
|
122
|
+
};
|
|
123
|
+
export type SandboxVersion = keyof typeof SandboxVersioning;
|
|
124
|
+
export type V2SandboxStatus = keyof typeof SandboxStatus;
|
|
125
|
+
export type V2Sandbox = {
|
|
126
|
+
sandboxHubId: number;
|
|
127
|
+
parentHubId: number;
|
|
128
|
+
name: string;
|
|
129
|
+
version: SandboxVersion;
|
|
130
|
+
type: string;
|
|
131
|
+
status: V2SandboxStatus;
|
|
132
|
+
createdAt: string;
|
|
133
|
+
createdByUser: User;
|
|
134
|
+
currentUserHasAccess?: boolean;
|
|
135
|
+
currentUserHasSuperAdminAccess?: boolean;
|
|
136
|
+
superAdminsInSandbox?: number;
|
|
137
|
+
requestAccessFrom?: User | null;
|
|
138
|
+
updatedAt?: string;
|
|
139
|
+
updatedByUser?: User | null;
|
|
140
|
+
};
|
|
114
141
|
export type SandboxResponse = {
|
|
115
142
|
sandbox: Sandbox;
|
|
116
143
|
personalAccessKey: string;
|
|
@@ -152,4 +179,10 @@ export type SandboxType = {
|
|
|
152
179
|
export type FetchTypesResponse = {
|
|
153
180
|
results: Array<SandboxType>;
|
|
154
181
|
};
|
|
182
|
+
export type SandboxPersonalAccessKey = {
|
|
183
|
+
personalAccessKey: {
|
|
184
|
+
encodedOAuthRefreshToken: string;
|
|
185
|
+
oauthAccessToken: string;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
155
188
|
export {};
|
package/types/Sandbox.js
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SandboxStatus = exports.SandboxVersioning = void 0;
|
|
4
|
+
exports.SandboxVersioning = {
|
|
5
|
+
V1: 'V1',
|
|
6
|
+
V2: 'V2',
|
|
7
|
+
};
|
|
8
|
+
exports.SandboxStatus = {
|
|
9
|
+
PENDING: 'PENDING',
|
|
10
|
+
READY: 'READY',
|
|
11
|
+
FAILED: 'FAILED',
|
|
12
|
+
};
|