1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | Object.defineProperty(exports, "__esModule", { value: true });
|
9 | exports.Org = exports.SandboxEvents = exports.OrgTypes = void 0;
|
10 | const path_1 = require("path");
|
11 | const fs = require("fs");
|
12 | const kit_1 = require("@salesforce/kit");
|
13 | const ts_types_1 = require("@salesforce/ts-types");
|
14 | const config_1 = require("../config/config");
|
15 | const configAggregator_1 = require("../config/configAggregator");
|
16 | const orgUsersConfig_1 = require("../config/orgUsersConfig");
|
17 | const global_1 = require("../global");
|
18 | const lifecycleEvents_1 = require("../lifecycleEvents");
|
19 | const logger_1 = require("../logger");
|
20 | const sfError_1 = require("../sfError");
|
21 | const sfdc_1 = require("../util/sfdc");
|
22 | const webOAuthServer_1 = require("../webOAuthServer");
|
23 | const messages_1 = require("../messages");
|
24 | const stateAggregator_1 = require("../stateAggregator");
|
25 | const pollingClient_1 = require("../status/pollingClient");
|
26 | const connection_1 = require("./connection");
|
27 | const authInfo_1 = require("./authInfo");
|
28 | const scratchOrgCreate_1 = require("./scratchOrgCreate");
|
29 | const orgConfigProperties_1 = require("./orgConfigProperties");
|
30 | messages_1.Messages.importMessagesDirectory(__dirname);
|
31 | const messages = messages_1.Messages.load('@salesforce/core', 'org', [
|
32 | 'deleteOrgHubError',
|
33 | 'insufficientAccessToDelete',
|
34 | 'missingAuthUsername',
|
35 | 'noDevHubFound',
|
36 | 'notADevHub',
|
37 | 'noUsernameFound',
|
38 | 'sandboxDeleteFailed',
|
39 | 'sandboxInfoCreateFailed',
|
40 | 'sandboxNotFound',
|
41 | 'scratchOrgNotFound',
|
42 | 'AuthInfoOrgIdUndefined',
|
43 | 'sandboxCreateNotComplete',
|
44 | 'SandboxProcessNotFoundBySandboxName',
|
45 | 'MultiSandboxProcessNotFoundBySandboxName',
|
46 | ]);
|
47 | var OrgTypes;
|
48 | (function (OrgTypes) {
|
49 | OrgTypes["Scratch"] = "scratch";
|
50 | OrgTypes["Sandbox"] = "sandbox";
|
51 | })(OrgTypes = exports.OrgTypes || (exports.OrgTypes = {}));
|
52 | var SandboxEvents;
|
53 | (function (SandboxEvents) {
|
54 | SandboxEvents["EVENT_STATUS"] = "status";
|
55 | SandboxEvents["EVENT_ASYNC_RESULT"] = "asyncResult";
|
56 | SandboxEvents["EVENT_RESULT"] = "result";
|
57 | SandboxEvents["EVENT_AUTH"] = "auth";
|
58 | SandboxEvents["EVENT_RESUME"] = "resume";
|
59 | })(SandboxEvents = exports.SandboxEvents || (exports.SandboxEvents = {}));
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | class Org extends kit_1.AsyncOptionalCreatable {
|
87 | |
88 |
|
89 |
|
90 | constructor(options) {
|
91 | super(options);
|
92 | this.status = Org.Status.UNKNOWN;
|
93 | this.options = options ?? {};
|
94 | }
|
95 | |
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 | async createSandbox(sandboxReq, options = {
|
103 | wait: kit_1.Duration.minutes(6),
|
104 | async: false,
|
105 | interval: kit_1.Duration.seconds(30),
|
106 | }) {
|
107 | this.logger.debug(`CreateSandbox called with SandboxRequest: ${sandboxReq}`);
|
108 | const createResult = await this.connection.tooling.create('SandboxInfo', sandboxReq);
|
109 | this.logger.debug(`Return from calling tooling.create: ${createResult}`);
|
110 | if (Array.isArray(createResult) || !createResult.success) {
|
111 | throw messages.createError('sandboxInfoCreateFailed', [JSON.stringify(createResult)]);
|
112 | }
|
113 | const sandboxCreationProgress = await this.querySandboxProcessBySandboxInfoId(createResult.id);
|
114 | this.logger.debug(`Return from calling singleRecordQuery with tooling: ${sandboxCreationProgress}`);
|
115 | const isAsync = !!options.async;
|
116 | if (isAsync) {
|
117 |
|
118 | await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_ASYNC_RESULT, sandboxCreationProgress);
|
119 | return sandboxCreationProgress;
|
120 | }
|
121 | const [wait, pollInterval] = this.validateWaitOptions(options);
|
122 | this.logger.debug(`create - pollStatusAndAuth sandboxProcessObj ${sandboxCreationProgress}, max wait time of ${wait.minutes} minutes`);
|
123 | return this.pollStatusAndAuth({
|
124 | sandboxProcessObj: sandboxCreationProgress,
|
125 | wait,
|
126 | pollInterval,
|
127 | });
|
128 | }
|
129 | |
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 | async cloneSandbox(sandboxReq, sourceSandboxName, options) {
|
137 | sandboxReq.SourceId = (await this.querySandboxProcessBySandboxName(sourceSandboxName)).SandboxInfoId;
|
138 | this.logger.debug('Clone sandbox sourceId %s', sandboxReq.SourceId);
|
139 | return this.createSandbox(sandboxReq, options);
|
140 | }
|
141 | |
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 | async resumeSandbox(resumeSandboxRequest, options = {
|
150 | wait: kit_1.Duration.minutes(0),
|
151 | async: false,
|
152 | interval: kit_1.Duration.seconds(30),
|
153 | }) {
|
154 | this.logger.debug(`ResumeSandbox called with ResumeSandboxRequest: ${resumeSandboxRequest}`);
|
155 | let sandboxCreationProgress;
|
156 |
|
157 | if (resumeSandboxRequest.SandboxName) {
|
158 | sandboxCreationProgress = await this.querySandboxProcessBySandboxName(resumeSandboxRequest.SandboxName);
|
159 | }
|
160 | else if (resumeSandboxRequest.SandboxProcessObjId) {
|
161 | sandboxCreationProgress = await this.querySandboxProcessById(resumeSandboxRequest.SandboxProcessObjId);
|
162 | }
|
163 | else {
|
164 | throw messages.createError('sandboxNotFound', [
|
165 | resumeSandboxRequest.SandboxName ?? resumeSandboxRequest.SandboxProcessObjId,
|
166 | ]);
|
167 | }
|
168 | this.logger.debug(`Return from calling singleRecordQuery with tooling: ${sandboxCreationProgress}`);
|
169 | await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_RESUME, sandboxCreationProgress);
|
170 | const [wait, pollInterval] = this.validateWaitOptions(options);
|
171 |
|
172 | if (wait.seconds === 0) {
|
173 | if (sandboxCreationProgress.Status === 'Completed') {
|
174 |
|
175 | const sandboxInfo = await this.sandboxSignupComplete(sandboxCreationProgress);
|
176 | if (sandboxInfo) {
|
177 | await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_AUTH, sandboxInfo);
|
178 | try {
|
179 | this.logger.debug(`sandbox signup complete with ${sandboxInfo}`);
|
180 | await this.writeSandboxAuthFile(sandboxCreationProgress, sandboxInfo);
|
181 | return sandboxCreationProgress;
|
182 | }
|
183 | catch (err) {
|
184 |
|
185 | }
|
186 | }
|
187 | }
|
188 | await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_ASYNC_RESULT, sandboxCreationProgress);
|
189 | throw messages.createError('sandboxCreateNotComplete');
|
190 | }
|
191 | this.logger.debug(`resume - pollStatusAndAuth sandboxProcessObj ${sandboxCreationProgress}, max wait time of ${wait.minutes} minutes`);
|
192 | return this.pollStatusAndAuth({
|
193 | sandboxProcessObj: sandboxCreationProgress,
|
194 | wait,
|
195 | pollInterval,
|
196 | });
|
197 | }
|
198 | |
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 | async scratchOrgCreate(options) {
|
206 | return (0, scratchOrgCreate_1.scratchOrgCreate)({ ...options, hubOrg: this });
|
207 | }
|
208 | |
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 | async sandboxStatus(sandboxname, options) {
|
216 | return this.authWithRetriesByName(sandboxname, options);
|
217 | }
|
218 | |
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 | async cleanLocalOrgData(orgDataPath, throwWhenRemoveFails = false) {
|
225 | let dataPath;
|
226 | try {
|
227 | dataPath = await this.getLocalDataDir(orgDataPath);
|
228 | this.logger.debug(`cleaning data for path: ${dataPath}`);
|
229 | }
|
230 | catch (err) {
|
231 | if (err instanceof Error && err.name === 'InvalidProjectWorkspaceError') {
|
232 |
|
233 |
|
234 |
|
235 | return;
|
236 | }
|
237 | throw err;
|
238 | }
|
239 | return this.manageDelete(async () => await fs.promises.rmdir(dataPath), dataPath, throwWhenRemoveFails);
|
240 | }
|
241 | |
242 |
|
243 |
|
244 | async retrieveOrgUsersConfig() {
|
245 | return orgUsersConfig_1.OrgUsersConfig.create(orgUsersConfig_1.OrgUsersConfig.getOptions(this.getOrgId()));
|
246 | }
|
247 | |
248 |
|
249 |
|
250 |
|
251 |
|
252 | async remove(throwWhenRemoveFails = false) {
|
253 |
|
254 |
|
255 | if (this.getConnection().isUsingAccessToken()) {
|
256 | return Promise.resolve();
|
257 | }
|
258 | await this.removeSandboxConfig();
|
259 | await this.removeUsers(throwWhenRemoveFails);
|
260 | await this.removeUsersConfig();
|
261 |
|
262 |
|
263 |
|
264 |
|
265 | await this.removeAuth();
|
266 | }
|
267 | |
268 |
|
269 |
|
270 |
|
271 | async isSandbox() {
|
272 | return (await stateAggregator_1.StateAggregator.getInstance()).sandboxes.hasFile(this.getOrgId());
|
273 | }
|
274 | |
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 |
|
282 |
|
283 | async checkScratchOrg(devHubUsernameOrAlias) {
|
284 | let aliasOrUsername = devHubUsernameOrAlias;
|
285 | if (!aliasOrUsername) {
|
286 | aliasOrUsername = this.configAggregator.getPropertyValue(orgConfigProperties_1.OrgConfigProperties.TARGET_DEV_HUB);
|
287 | }
|
288 | const devHubConnection = (await Org.create({ aliasOrUsername })).getConnection();
|
289 | const thisOrgAuthConfig = this.getConnection().getAuthInfoFields();
|
290 | const trimmedId = sfdc_1.sfdc.trimTo15(thisOrgAuthConfig.orgId);
|
291 | const DEV_HUB_SOQL = `SELECT CreatedDate,Edition,ExpirationDate FROM ActiveScratchOrg WHERE ScratchOrg='${trimmedId}'`;
|
292 | try {
|
293 | const results = await devHubConnection.query(DEV_HUB_SOQL);
|
294 | if (results.records.length !== 1) {
|
295 | throw new sfError_1.SfError('No results', 'NoResultsError');
|
296 | }
|
297 | }
|
298 | catch (err) {
|
299 | if (err instanceof Error && err.name === 'INVALID_TYPE') {
|
300 | throw messages.createError('notADevHub', [devHubConnection.getUsername()]);
|
301 | }
|
302 | throw err;
|
303 | }
|
304 | return thisOrgAuthConfig;
|
305 | }
|
306 | |
307 |
|
308 |
|
309 | async getDevHubOrg() {
|
310 | if (this.isDevHubOrg()) {
|
311 | return this;
|
312 | }
|
313 | else if (this.getField(Org.Fields.DEV_HUB_USERNAME)) {
|
314 | const devHubUsername = (0, ts_types_1.ensureString)(this.getField(Org.Fields.DEV_HUB_USERNAME));
|
315 | return Org.create({
|
316 | connection: await connection_1.Connection.create({
|
317 | authInfo: await authInfo_1.AuthInfo.create({ username: devHubUsername }),
|
318 | }),
|
319 | });
|
320 | }
|
321 | }
|
322 | |
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 | isDevHubOrg() {
|
330 | const isDevHub = this.getField(Org.Fields.IS_DEV_HUB);
|
331 | if ((0, ts_types_1.isBoolean)(isDevHub)) {
|
332 | return isDevHub;
|
333 | }
|
334 | else {
|
335 | return false;
|
336 | }
|
337 | }
|
338 | |
339 |
|
340 |
|
341 |
|
342 |
|
343 | async deleteFrom(controllingOrg) {
|
344 | if (typeof controllingOrg === 'string') {
|
345 | controllingOrg = await Org.create({
|
346 | aggregator: this.configAggregator,
|
347 | aliasOrUsername: controllingOrg,
|
348 | });
|
349 | }
|
350 | if (await this.isSandbox()) {
|
351 | await this.deleteSandbox(controllingOrg);
|
352 | }
|
353 | else {
|
354 | await this.deleteScratchOrg(controllingOrg);
|
355 | }
|
356 | }
|
357 | |
358 |
|
359 |
|
360 | async delete() {
|
361 | if (await this.isSandbox()) {
|
362 | await this.deleteSandbox();
|
363 | }
|
364 | else {
|
365 | await this.deleteScratchOrg();
|
366 | }
|
367 | }
|
368 | |
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 | async determineIfDevHubOrg(forceServerCheck = false) {
|
379 | const cachedIsDevHub = this.getField(Org.Fields.IS_DEV_HUB);
|
380 | if (!forceServerCheck && (0, ts_types_1.isBoolean)(cachedIsDevHub)) {
|
381 | return cachedIsDevHub;
|
382 | }
|
383 | if (this.isDevHubOrg()) {
|
384 | return true;
|
385 | }
|
386 | this.logger.debug('isDevHub is not cached - querying server...');
|
387 | const conn = this.getConnection();
|
388 | let isDevHub = false;
|
389 | try {
|
390 | await conn.query('SELECT Id FROM ScratchOrgInfo limit 1');
|
391 | isDevHub = true;
|
392 | }
|
393 | catch (err) {
|
394 |
|
395 | }
|
396 | const username = (0, ts_types_1.ensure)(this.getUsername());
|
397 | const authInfo = await authInfo_1.AuthInfo.create({ username });
|
398 | await authInfo.save({ isDevHub });
|
399 |
|
400 | this.connection = await connection_1.Connection.create({ authInfo });
|
401 | return isDevHub;
|
402 | }
|
403 | |
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 | isScratch() {
|
411 | const isScratch = this.getField(Org.Fields.IS_SCRATCH);
|
412 | if ((0, ts_types_1.isBoolean)(isScratch)) {
|
413 | return isScratch;
|
414 | }
|
415 | else {
|
416 | return false;
|
417 | }
|
418 | }
|
419 | |
420 |
|
421 |
|
422 |
|
423 | async tracksSource() {
|
424 |
|
425 | const tracksSource = this.getField(Org.Fields.TRACKS_SOURCE);
|
426 | if ((0, ts_types_1.isBoolean)(tracksSource)) {
|
427 | return tracksSource;
|
428 | }
|
429 |
|
430 | if (await this.determineIfScratch()) {
|
431 |
|
432 | await this.setTracksSource(true);
|
433 | return true;
|
434 | }
|
435 | if (await this.determineIfSandbox()) {
|
436 |
|
437 | const supportsSourceMembers = await this.supportsSourceTracking();
|
438 | await this.setTracksSource(supportsSourceMembers);
|
439 | return supportsSourceMembers;
|
440 | }
|
441 |
|
442 | await this.setTracksSource(false);
|
443 | return false;
|
444 | }
|
445 | |
446 |
|
447 |
|
448 |
|
449 |
|
450 | async setTracksSource(value) {
|
451 | const originalAuth = await authInfo_1.AuthInfo.create({ username: this.getUsername() });
|
452 | originalAuth.handleAliasAndDefaultSettings({ setDefault: false, setDefaultDevHub: false, setTracksSource: value });
|
453 | }
|
454 | |
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 | async determineIfScratch() {
|
462 | let cache = this.getField(Org.Fields.IS_SCRATCH);
|
463 | if (!cache) {
|
464 | await this.updateLocalInformation();
|
465 | cache = this.getField(Org.Fields.IS_SCRATCH);
|
466 | }
|
467 | return cache;
|
468 | }
|
469 | |
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 |
|
476 | async determineIfSandbox() {
|
477 | let cache = this.getField(Org.Fields.IS_SANDBOX);
|
478 | if (!cache) {
|
479 | await this.updateLocalInformation();
|
480 | cache = this.getField(Org.Fields.IS_SANDBOX);
|
481 | }
|
482 | return cache;
|
483 | }
|
484 | |
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 | async retrieveOrganizationInformation() {
|
491 | return this.getConnection().singleRecordQuery('SELECT Name, InstanceName, IsSandbox, TrialExpirationDate, NamespacePrefix FROM Organization');
|
492 | }
|
493 | |
494 |
|
495 |
|
496 |
|
497 | async updateLocalInformation() {
|
498 | const username = this.getUsername();
|
499 | if (username) {
|
500 | const organization = await this.retrieveOrganizationInformation();
|
501 | const isScratch = organization.IsSandbox && Boolean(organization.TrialExpirationDate);
|
502 | const isSandbox = organization.IsSandbox && !organization.TrialExpirationDate;
|
503 | const stateAggregator = await stateAggregator_1.StateAggregator.getInstance();
|
504 | stateAggregator.orgs.update(username, {
|
505 | [Org.Fields.NAME]: organization.Name,
|
506 | [Org.Fields.INSTANCE_NAME]: organization.InstanceName,
|
507 | [Org.Fields.NAMESPACE_PREFIX]: organization.NamespacePrefix,
|
508 | [Org.Fields.IS_SANDBOX]: isSandbox,
|
509 | [Org.Fields.IS_SCRATCH]: isScratch,
|
510 | [Org.Fields.TRIAL_EXPIRATION_DATE]: organization.TrialExpirationDate,
|
511 | });
|
512 | await stateAggregator.orgs.write(username);
|
513 | }
|
514 | }
|
515 | |
516 |
|
517 |
|
518 | async refreshAuth() {
|
519 | this.logger.debug('Refreshing auth for org.');
|
520 | const requestInfo = {
|
521 | url: this.getConnection().baseUrl(),
|
522 | method: 'GET',
|
523 | };
|
524 | const conn = this.getConnection();
|
525 | await conn.request(requestInfo);
|
526 | }
|
527 | |
528 |
|
529 |
|
530 | async readUserAuthFiles() {
|
531 | const config = await this.retrieveOrgUsersConfig();
|
532 | const contents = await config.read();
|
533 | const thisUsername = (0, ts_types_1.ensure)(this.getUsername());
|
534 | const usernames = (0, ts_types_1.ensureJsonArray)(contents.usernames ?? [thisUsername]);
|
535 | return Promise.all(usernames.map((username) => {
|
536 | if (username === thisUsername) {
|
537 | return authInfo_1.AuthInfo.create({
|
538 | username: this.getConnection().getUsername(),
|
539 | });
|
540 | }
|
541 | else {
|
542 | return authInfo_1.AuthInfo.create({ username: (0, ts_types_1.ensureString)(username) });
|
543 | }
|
544 | }));
|
545 | }
|
546 | |
547 |
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 | async addUsername(auth) {
|
564 | if (!auth) {
|
565 | throw new sfError_1.SfError('Missing auth info', 'MissingAuthInfo');
|
566 | }
|
567 | const authInfo = (0, ts_types_1.isString)(auth) ? await authInfo_1.AuthInfo.create({ username: auth }) : auth;
|
568 | this.logger.debug(`adding username ${authInfo.getFields().username}`);
|
569 | const orgConfig = await this.retrieveOrgUsersConfig();
|
570 | const contents = await orgConfig.read();
|
571 |
|
572 |
|
573 | const usernames = contents.usernames ?? [];
|
574 | if (!(0, ts_types_1.isArray)(usernames)) {
|
575 | throw new sfError_1.SfError('Usernames is not an array', 'UnexpectedDataFormat');
|
576 | }
|
577 | let shouldUpdate = false;
|
578 | const thisUsername = (0, ts_types_1.ensure)(this.getUsername());
|
579 | if (!usernames.includes(thisUsername)) {
|
580 | usernames.push(thisUsername);
|
581 | shouldUpdate = true;
|
582 | }
|
583 | const username = authInfo.getFields().username;
|
584 | if (username) {
|
585 | usernames.push(username);
|
586 | shouldUpdate = true;
|
587 | }
|
588 | if (shouldUpdate) {
|
589 | orgConfig.set('usernames', usernames);
|
590 | await orgConfig.write();
|
591 | }
|
592 | return this;
|
593 | }
|
594 | |
595 |
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 | async removeUsername(auth) {
|
602 | if (!auth) {
|
603 | throw new sfError_1.SfError('Missing auth info', 'MissingAuthInfoError');
|
604 | }
|
605 | const authInfo = (0, ts_types_1.isString)(auth) ? await authInfo_1.AuthInfo.create({ username: auth }) : auth;
|
606 | this.logger.debug(`removing username ${authInfo.getFields().username}`);
|
607 | const orgConfig = await this.retrieveOrgUsersConfig();
|
608 | const contents = await orgConfig.read();
|
609 | const targetUser = authInfo.getFields().username;
|
610 | const usernames = (contents.usernames ?? []);
|
611 | contents.usernames = usernames.filter((username) => username !== targetUser);
|
612 | await orgConfig.write();
|
613 | return this;
|
614 | }
|
615 | |
616 |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 | async setSandboxConfig(orgId, config) {
|
622 | (await stateAggregator_1.StateAggregator.getInstance()).sandboxes.set(orgId, config);
|
623 | return this;
|
624 | }
|
625 | |
626 |
|
627 |
|
628 |
|
629 |
|
630 | async getSandboxConfig(orgId) {
|
631 | return (await stateAggregator_1.StateAggregator.getInstance()).sandboxes.read(orgId);
|
632 | }
|
633 | |
634 |
|
635 |
|
636 |
|
637 |
|
638 | async retrieveMaxApiVersion() {
|
639 | return this.getConnection().retrieveMaxApiVersion();
|
640 | }
|
641 | |
642 |
|
643 |
|
644 | getUsername() {
|
645 | return this.getConnection().getUsername();
|
646 | }
|
647 | |
648 |
|
649 |
|
650 | getOrgId() {
|
651 | return this.orgId ?? this.getField(Org.Fields.ORG_ID);
|
652 | }
|
653 | |
654 |
|
655 |
|
656 | getConfigAggregator() {
|
657 | return this.configAggregator;
|
658 | }
|
659 | |
660 |
|
661 |
|
662 | getField(key) {
|
663 |
|
664 |
|
665 | const ownProp = this[key];
|
666 | if (ownProp && typeof ownProp !== 'function')
|
667 | return ownProp;
|
668 |
|
669 |
|
670 | return this.getConnection().getAuthInfoFields()[key];
|
671 | }
|
672 | |
673 |
|
674 |
|
675 | getFields(keys) {
|
676 | const json = {};
|
677 | return keys.reduce((map, key) => {
|
678 | map[key] = this.getField(key);
|
679 | return map;
|
680 | }, json);
|
681 | }
|
682 | |
683 |
|
684 |
|
685 | getConnection() {
|
686 | return this.connection;
|
687 | }
|
688 | async supportsSourceTracking() {
|
689 | if (this.isScratch()) {
|
690 | return true;
|
691 | }
|
692 | try {
|
693 | await this.getConnection().tooling.sobject('SourceMember').describe();
|
694 | return true;
|
695 | }
|
696 | catch (err) {
|
697 | if (err.message.includes('The requested resource does not exist')) {
|
698 | return false;
|
699 | }
|
700 | throw err;
|
701 | }
|
702 | }
|
703 | |
704 |
|
705 |
|
706 |
|
707 |
|
708 |
|
709 | async querySandboxProcessBySandboxName(name) {
|
710 | return this.querySandboxProcess(`SandboxName='${name}'`);
|
711 | }
|
712 | |
713 |
|
714 |
|
715 |
|
716 |
|
717 |
|
718 | async querySandboxProcessBySandboxInfoId(id) {
|
719 | return this.querySandboxProcess(`SandboxInfoId='${id}'`);
|
720 | }
|
721 | |
722 |
|
723 |
|
724 |
|
725 |
|
726 |
|
727 | async querySandboxProcessById(id) {
|
728 | return this.querySandboxProcess(`Id='${id}'`);
|
729 | }
|
730 | |
731 |
|
732 |
|
733 | async init() {
|
734 | const stateAggregator = await stateAggregator_1.StateAggregator.getInstance();
|
735 | this.logger = await logger_1.Logger.child('Org');
|
736 | this.configAggregator = this.options.aggregator ? this.options.aggregator : await configAggregator_1.ConfigAggregator.create();
|
737 | if (!this.options.connection) {
|
738 | if (this.options.aliasOrUsername == null) {
|
739 | this.configAggregator = this.getConfigAggregator();
|
740 | const aliasOrUsername = this.options.isDevHub
|
741 | ? this.configAggregator.getPropertyValue(orgConfigProperties_1.OrgConfigProperties.TARGET_DEV_HUB)
|
742 | : this.configAggregator.getPropertyValue(orgConfigProperties_1.OrgConfigProperties.TARGET_ORG);
|
743 | this.options.aliasOrUsername = aliasOrUsername || undefined;
|
744 | }
|
745 | const username = stateAggregator.aliases.resolveUsername(this.options.aliasOrUsername);
|
746 | if (!username) {
|
747 | throw messages.createError('noUsernameFound');
|
748 | }
|
749 | this.connection = await connection_1.Connection.create({
|
750 |
|
751 | authInfo: await authInfo_1.AuthInfo.create({ username, isDevHub: this.options.isDevHub }),
|
752 | });
|
753 | }
|
754 | else {
|
755 | this.connection = this.options.connection;
|
756 | }
|
757 | this.orgId = this.getField(Org.Fields.ORG_ID);
|
758 | }
|
759 | |
760 |
|
761 |
|
762 | getDefaultOptions() {
|
763 | throw new sfError_1.SfError('Not Supported', 'NotSupportedError');
|
764 | }
|
765 | async getLocalDataDir(orgDataPath) {
|
766 | const rootFolder = await config_1.Config.resolveRootFolder(false);
|
767 | return (0, path_1.join)(rootFolder, global_1.Global.SFDX_STATE_FOLDER, orgDataPath ? orgDataPath : 'orgs');
|
768 | }
|
769 | |
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 | async authWithRetriesByName(sandboxProcessName, options) {
|
777 | return this.authWithRetries(await this.queryLatestSandboxProcessBySandboxName(sandboxProcessName), options);
|
778 | }
|
779 | |
780 |
|
781 |
|
782 |
|
783 |
|
784 |
|
785 |
|
786 | async authWithRetries(sandboxProcessObj, options = {
|
787 | wait: kit_1.Duration.minutes(0),
|
788 | interval: kit_1.Duration.seconds(30),
|
789 | }) {
|
790 | const [wait, pollInterval] = this.validateWaitOptions(options);
|
791 | this.logger.debug(`AuthWithRetries sandboxProcessObj ${sandboxProcessObj}, max wait time of ${wait.minutes} minutes`);
|
792 | return this.pollStatusAndAuth({
|
793 | sandboxProcessObj,
|
794 | wait,
|
795 | pollInterval,
|
796 | });
|
797 | }
|
798 | |
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 | async queryLatestSandboxProcessBySandboxName(sandboxNameIn) {
|
805 | const { tooling } = this.getConnection();
|
806 | this.logger.debug('QueryLatestSandboxProcessBySandboxName called with SandboxName: %s ', sandboxNameIn);
|
807 | const queryStr = `SELECT Id, Status, SandboxName, SandboxInfoId, LicenseType, CreatedDate, CopyProgress, SandboxOrganization, SourceId, Description, EndDate FROM SandboxProcess WHERE SandboxName='${sandboxNameIn}' AND Status != 'D' ORDER BY CreatedDate DESC LIMIT 1`;
|
808 | const queryResult = await tooling.query(queryStr);
|
809 | this.logger.debug('Return from calling queryToolingApi: %s ', queryResult);
|
810 | if (queryResult?.records?.length === 1) {
|
811 | return queryResult.records[0];
|
812 | }
|
813 | else if (queryResult.records && queryResult.records.length > 1) {
|
814 | throw messages.createError('MultiSandboxProcessNotFoundBySandboxName', [sandboxNameIn]);
|
815 | }
|
816 | else {
|
817 | throw messages.createError('SandboxProcessNotFoundBySandboxName', [sandboxNameIn]);
|
818 | }
|
819 | }
|
820 | async queryProduction(org, field, value) {
|
821 | return org.connection.singleRecordQuery(`SELECT SandboxInfoId FROM SandboxProcess WHERE ${field} ='${value}' AND Status NOT IN ('D', 'E')`, { tooling: true });
|
822 | }
|
823 | async destroySandbox(org, id) {
|
824 | return org.getConnection().tooling.delete('SandboxInfo', id);
|
825 | }
|
826 | async destroyScratchOrg(org, id) {
|
827 | return org.getConnection().delete('ActiveScratchOrg', id);
|
828 | }
|
829 | |
830 |
|
831 |
|
832 |
|
833 |
|
834 |
|
835 | async deleteSandbox(prodOrg) {
|
836 | const sandbox = await this.getSandboxConfig(this.getOrgId());
|
837 | prodOrg ?? (prodOrg = await Org.create({
|
838 | aggregator: this.configAggregator,
|
839 | aliasOrUsername: sandbox?.prodOrgUsername,
|
840 | }));
|
841 | let sandboxInfoId = sandbox?.sandboxInfoId;
|
842 | if (!sandboxInfoId) {
|
843 | let result;
|
844 | try {
|
845 |
|
846 | const sandboxName = sandbox?.sandboxName ?? (this.getUsername() ?? '').split(`${prodOrg.getUsername()}.`)[1];
|
847 | if (!sandboxName) {
|
848 | this.logger.debug('Sandbox name is not available');
|
849 |
|
850 | throw new Error();
|
851 | }
|
852 | this.logger.debug(`attempting to locate sandbox with sandbox ${sandboxName}`);
|
853 | try {
|
854 | result = await this.queryProduction(prodOrg, 'SandboxName', sandboxName);
|
855 | }
|
856 | catch (err) {
|
857 | this.logger.debug(`Failed to find sandbox with sandbox name: ${sandboxName}`);
|
858 |
|
859 | throw err;
|
860 | }
|
861 | }
|
862 | catch {
|
863 |
|
864 | const trimmedId = sfdc_1.sfdc.trimTo15(this.getOrgId());
|
865 | this.logger.debug(`defaulting to trimming id from ${this.getOrgId()} to ${trimmedId}`);
|
866 | try {
|
867 | result = await this.queryProduction(prodOrg, 'SandboxOrganization', trimmedId);
|
868 | sandboxInfoId = result.SandboxInfoId;
|
869 | }
|
870 | catch {
|
871 |
|
872 |
|
873 | this.logger.debug(`Failed find a SandboxProcess for the sandbox org: ${this.getOrgId()}`);
|
874 | }
|
875 | }
|
876 | }
|
877 | if (sandboxInfoId) {
|
878 | const deleteResult = await this.destroySandbox(prodOrg, sandboxInfoId);
|
879 | this.logger.debug('Return from calling tooling.delete: ', deleteResult);
|
880 | }
|
881 |
|
882 | await this.remove();
|
883 | }
|
884 | |
885 |
|
886 |
|
887 |
|
888 |
|
889 |
|
890 | async deleteScratchOrg(devHub) {
|
891 |
|
892 | devHub ?? (devHub = await this.getDevHubOrg());
|
893 | if (!devHub) {
|
894 | throw messages.createError('noDevHubFound');
|
895 | }
|
896 | if (devHub.getOrgId() === this.getOrgId()) {
|
897 |
|
898 | throw messages.createError('deleteOrgHubError');
|
899 | }
|
900 | try {
|
901 | const devHubConn = devHub.getConnection();
|
902 | const username = this.getUsername();
|
903 | const activeScratchOrgRecordId = (await devHubConn.singleRecordQuery(`SELECT Id FROM ActiveScratchOrg WHERE SignupUsername='${username}'`)).Id;
|
904 | this.logger.trace(`found matching ActiveScratchOrg with SignupUsername: ${username}. Deleting...`);
|
905 | await this.destroyScratchOrg(devHub, activeScratchOrgRecordId);
|
906 | await this.remove();
|
907 | }
|
908 | catch (err) {
|
909 | this.logger.info(err instanceof Error ? err.message : err);
|
910 | if (err instanceof Error && (err.name === 'INVALID_TYPE' || err.name === 'INSUFFICIENT_ACCESS_OR_READONLY')) {
|
911 |
|
912 | this.logger.info('Insufficient privilege to access ActiveScratchOrgs.');
|
913 | throw messages.createError('insufficientAccessToDelete');
|
914 | }
|
915 | if (err instanceof Error && err.name === connection_1.SingleRecordQueryErrors.NoRecords) {
|
916 |
|
917 | this.logger.info('The above error can be the result of deleting an expired or already deleted org.');
|
918 | this.logger.info('attempting to cleanup the auth file');
|
919 | await this.removeAuth();
|
920 | throw messages.createError('scratchOrgNotFound');
|
921 | }
|
922 | throw err;
|
923 | }
|
924 | }
|
925 | |
926 |
|
927 |
|
928 |
|
929 | async removeAuth() {
|
930 | const stateAggregator = await stateAggregator_1.StateAggregator.getInstance();
|
931 | const username = this.getUsername();
|
932 |
|
933 |
|
934 | if (username) {
|
935 | this.logger.debug(`Removing auth for user: ${username}`);
|
936 | this.logger.debug(`Clearing auth cache for user: ${username}`);
|
937 | await stateAggregator.orgs.remove(username);
|
938 | }
|
939 | }
|
940 | |
941 |
|
942 |
|
943 | async removeUsersConfig() {
|
944 | const config = await this.retrieveOrgUsersConfig();
|
945 | if (await config.exists()) {
|
946 | this.logger.debug(`Removing org users config at: ${config.getPath()}`);
|
947 | await config.unlink();
|
948 | }
|
949 | }
|
950 | async manageDelete(cb, dirPath, throwWhenRemoveFails) {
|
951 | return cb().catch((e) => {
|
952 | if (throwWhenRemoveFails) {
|
953 | throw e;
|
954 | }
|
955 | else {
|
956 | this.logger.warn(`failed to read directory ${dirPath}`);
|
957 | return;
|
958 | }
|
959 | });
|
960 | }
|
961 | |
962 |
|
963 |
|
964 |
|
965 |
|
966 |
|
967 | async removeUsers(throwWhenRemoveFails) {
|
968 | const stateAggregator = await stateAggregator_1.StateAggregator.getInstance();
|
969 | this.logger.debug(`Removing users associate with org: ${this.getOrgId()}`);
|
970 | const config = await this.retrieveOrgUsersConfig();
|
971 | this.logger.debug(`using path for org users: ${config.getPath()}`);
|
972 | const authInfos = await this.readUserAuthFiles();
|
973 | await Promise.all(authInfos
|
974 | .map((auth) => auth.getFields().username)
|
975 | .map(async (username) => {
|
976 | const aliasKeys = (username && stateAggregator.aliases.getAll(username)) ?? [];
|
977 | stateAggregator.aliases.unsetAll(username);
|
978 | const orgForUser = username === this.getUsername()
|
979 | ? this
|
980 | : await Org.create({
|
981 | connection: await connection_1.Connection.create({ authInfo: await authInfo_1.AuthInfo.create({ username }) }),
|
982 | });
|
983 | const orgType = this.isDevHubOrg() ? orgConfigProperties_1.OrgConfigProperties.TARGET_DEV_HUB : orgConfigProperties_1.OrgConfigProperties.TARGET_ORG;
|
984 | const configInfo = orgForUser.configAggregator.getInfo(orgType);
|
985 | const needsConfigUpdate = (configInfo.isGlobal() || configInfo.isLocal()) &&
|
986 | (configInfo.value === username || aliasKeys.includes(configInfo.value));
|
987 | return [
|
988 | orgForUser.removeAuth(),
|
989 | needsConfigUpdate ? config_1.Config.update(configInfo.isGlobal(), orgType, undefined) : undefined,
|
990 | ].filter(Boolean);
|
991 | }));
|
992 | await stateAggregator.aliases.write();
|
993 | }
|
994 | async removeSandboxConfig() {
|
995 | const stateAggregator = await stateAggregator_1.StateAggregator.getInstance();
|
996 | await stateAggregator.sandboxes.remove(this.getOrgId());
|
997 | }
|
998 | async writeSandboxAuthFile(sandboxProcessObj, sandboxRes) {
|
999 | this.logger.debug(`writeSandboxAuthFile sandboxProcessObj: ${JSON.stringify(sandboxProcessObj)}, sandboxRes: ${JSON.stringify(sandboxRes)}`);
|
1000 | if (sandboxRes.authUserName) {
|
1001 | const productionAuthFields = this.connection.getAuthInfoFields();
|
1002 | this.logger.debug('Result from getAuthInfoFields: AuthFields', productionAuthFields);
|
1003 |
|
1004 | const oauth2Options = {
|
1005 | loginUrl: sandboxRes.loginUrl,
|
1006 | instanceUrl: sandboxRes.instanceUrl,
|
1007 | username: sandboxRes.authUserName,
|
1008 | };
|
1009 |
|
1010 | if (!productionAuthFields.privateKey) {
|
1011 | oauth2Options.redirectUri = `http://localhost:${await webOAuthServer_1.WebOAuthServer.determineOauthPort()}/OauthRedirect`;
|
1012 | oauth2Options.authCode = sandboxRes.authCode;
|
1013 | }
|
1014 | else {
|
1015 | oauth2Options.privateKey = productionAuthFields.privateKey;
|
1016 | oauth2Options.clientId = productionAuthFields.clientId;
|
1017 | }
|
1018 | const authInfo = await authInfo_1.AuthInfo.create({
|
1019 | username: sandboxRes.authUserName,
|
1020 | oauth2Options,
|
1021 | parentUsername: productionAuthFields.username,
|
1022 | });
|
1023 | this.logger.debug('Creating AuthInfo for sandbox', sandboxRes.authUserName, productionAuthFields.username, oauth2Options);
|
1024 |
|
1025 | await authInfo.save();
|
1026 | const sandboxOrgId = authInfo.getFields().orgId;
|
1027 | if (!sandboxOrgId) {
|
1028 | throw messages.createError('AuthInfoOrgIdUndefined');
|
1029 | }
|
1030 |
|
1031 | const sfSandbox = {
|
1032 | sandboxUsername: sandboxRes.authUserName,
|
1033 | sandboxOrgId,
|
1034 | prodOrgUsername: this.getUsername(),
|
1035 | sandboxName: sandboxProcessObj.SandboxName,
|
1036 | sandboxProcessId: sandboxProcessObj.Id,
|
1037 | sandboxInfoId: sandboxProcessObj.SandboxInfoId,
|
1038 | timestamp: new Date().toISOString(),
|
1039 | };
|
1040 | await this.setSandboxConfig(sandboxOrgId, sfSandbox);
|
1041 | (await stateAggregator_1.StateAggregator.getInstance()).sandboxes.write(sandboxOrgId);
|
1042 | await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_RESULT, {
|
1043 | sandboxProcessObj,
|
1044 | sandboxRes,
|
1045 | });
|
1046 | }
|
1047 | else {
|
1048 |
|
1049 | throw messages.createError('missingAuthUsername', [sandboxProcessObj.SandboxName]);
|
1050 | }
|
1051 | }
|
1052 | async pollStatusAndAuth(options) {
|
1053 | this.logger.debug('PollStatusAndAuth called with SandboxProcessObject', options.sandboxProcessObj, options.wait.minutes, options.pollInterval.seconds);
|
1054 | let remainingWait = options.wait;
|
1055 | let waitingOnAuth = false;
|
1056 | const pollingClient = await pollingClient_1.PollingClient.create({
|
1057 | poll: async () => {
|
1058 | const sandboxProcessObj = await this.querySandboxProcessBySandboxInfoId(options.sandboxProcessObj.SandboxInfoId);
|
1059 |
|
1060 | const sandboxInfo = await this.sandboxSignupComplete(sandboxProcessObj);
|
1061 | if (sandboxInfo) {
|
1062 | await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_AUTH, sandboxInfo);
|
1063 | try {
|
1064 | this.logger.debug('sandbox signup complete with', sandboxInfo);
|
1065 | await this.writeSandboxAuthFile(sandboxProcessObj, sandboxInfo);
|
1066 | return { completed: true, payload: sandboxProcessObj };
|
1067 | }
|
1068 | catch (err) {
|
1069 | const error = err;
|
1070 | this.logger.debug('Exception while calling writeSandboxAuthFile', err);
|
1071 | if (error?.name === 'JwtAuthError' && error?.stack?.includes("user hasn't approved")) {
|
1072 | waitingOnAuth = true;
|
1073 | }
|
1074 | else {
|
1075 | throw sfError_1.SfError.wrap(error);
|
1076 | }
|
1077 | }
|
1078 | }
|
1079 | await lifecycleEvents_1.Lifecycle.getInstance().emit(SandboxEvents.EVENT_STATUS, {
|
1080 | sandboxProcessObj,
|
1081 | remainingWait: remainingWait.seconds,
|
1082 | interval: options.pollInterval.seconds,
|
1083 | waitingOnAuth,
|
1084 | });
|
1085 | remainingWait = kit_1.Duration.seconds(remainingWait.seconds - options.pollInterval.seconds);
|
1086 | return { completed: false, payload: sandboxProcessObj };
|
1087 | },
|
1088 | frequency: options.pollInterval,
|
1089 | timeout: options.wait,
|
1090 | });
|
1091 | return pollingClient.subscribe();
|
1092 | }
|
1093 | |
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 |
|
1099 | async querySandboxProcess(where) {
|
1100 | const queryStr = `SELECT Id, Status, SandboxName, SandboxInfoId, LicenseType, CreatedDate, CopyProgress, SandboxOrganization, SourceId, Description, EndDate FROM SandboxProcess WHERE ${where} AND Status != 'D'`;
|
1101 | return this.connection.singleRecordQuery(queryStr, {
|
1102 | tooling: true,
|
1103 | });
|
1104 | }
|
1105 | |
1106 |
|
1107 |
|
1108 |
|
1109 |
|
1110 |
|
1111 | async sandboxSignupComplete(sandboxProcessObj) {
|
1112 | this.logger.debug('sandboxSignupComplete called with SandboxProcessObject', sandboxProcessObj);
|
1113 | if (!sandboxProcessObj.EndDate) {
|
1114 | return;
|
1115 | }
|
1116 | try {
|
1117 |
|
1118 | const authFields = this.connection.getAuthInfoFields();
|
1119 | const callbackUrl = `http://localhost:${await webOAuthServer_1.WebOAuthServer.determineOauthPort()}/OauthRedirect`;
|
1120 | const sandboxReq = {
|
1121 |
|
1122 | clientId: authFields.clientId,
|
1123 | sandboxName: sandboxProcessObj.SandboxName,
|
1124 | callbackUrl,
|
1125 | };
|
1126 | this.logger.debug('Calling sandboxAuth with SandboxUserAuthRequest', sandboxReq);
|
1127 | const url = `${this.connection.tooling._baseUrl()}/sandboxAuth`;
|
1128 | const params = {
|
1129 | method: 'POST',
|
1130 | url,
|
1131 | headers: { 'Content-Type': 'application/json' },
|
1132 | body: JSON.stringify(sandboxReq),
|
1133 | };
|
1134 | const result = await this.connection.tooling.request(params);
|
1135 | this.logger.debug('Result of calling sandboxAuth', result);
|
1136 | return result;
|
1137 | }
|
1138 | catch (err) {
|
1139 | const error = err;
|
1140 |
|
1141 |
|
1142 | if (error?.name === 'INVALID_STATUS') {
|
1143 | this.logger.debug('Error while authenticating the user', error?.toString());
|
1144 | }
|
1145 | else {
|
1146 |
|
1147 | throw sfError_1.SfError.wrap(error);
|
1148 | }
|
1149 | }
|
1150 | }
|
1151 | validateWaitOptions(options) {
|
1152 | const wait = options.wait ?? kit_1.Duration.minutes(30);
|
1153 | const interval = options.interval ?? kit_1.Duration.seconds(30);
|
1154 | let pollInterval = options.async ? kit_1.Duration.seconds(0) : interval;
|
1155 |
|
1156 | pollInterval = pollInterval.seconds > wait.seconds ? wait : pollInterval;
|
1157 | return [wait, pollInterval];
|
1158 | }
|
1159 | }
|
1160 | exports.Org = Org;
|
1161 | (function (Org) {
|
1162 | |
1163 |
|
1164 |
|
1165 | let Status;
|
1166 | (function (Status) {
|
1167 | |
1168 |
|
1169 |
|
1170 | Status["ACTIVE"] = "ACTIVE";
|
1171 | |
1172 |
|
1173 |
|
1174 | Status["EXPIRED"] = "EXPIRED";
|
1175 | |
1176 |
|
1177 |
|
1178 | Status["UNKNOWN"] = "UNKNOWN";
|
1179 | |
1180 |
|
1181 |
|
1182 | Status["MISSING"] = "MISSING";
|
1183 | })(Status = Org.Status || (Org.Status = {}));
|
1184 | |
1185 |
|
1186 |
|
1187 |
|
1188 |
|
1189 | let Fields;
|
1190 | (function (Fields) {
|
1191 | |
1192 |
|
1193 |
|
1194 |
|
1195 | Fields["ALIAS"] = "alias";
|
1196 | Fields["CREATED"] = "created";
|
1197 |
|
1198 | Fields["NAME"] = "name";
|
1199 | Fields["NAMESPACE_PREFIX"] = "namespacePrefix";
|
1200 | Fields["INSTANCE_NAME"] = "instanceName";
|
1201 | Fields["TRIAL_EXPIRATION_DATE"] = "trailExpirationDate";
|
1202 | |
1203 |
|
1204 |
|
1205 | Fields["CREATED_ORG_INSTANCE"] = "createdOrgInstance";
|
1206 | |
1207 |
|
1208 |
|
1209 | Fields["DEV_HUB_USERNAME"] = "devHubUsername";
|
1210 | |
1211 |
|
1212 |
|
1213 | Fields["INSTANCE_URL"] = "instanceUrl";
|
1214 | |
1215 |
|
1216 |
|
1217 | Fields["IS_DEV_HUB"] = "isDevHub";
|
1218 | |
1219 |
|
1220 |
|
1221 | Fields["IS_SCRATCH"] = "isScratch";
|
1222 | |
1223 |
|
1224 |
|
1225 | Fields["IS_SANDBOX"] = "isSandbox";
|
1226 | |
1227 |
|
1228 |
|
1229 | Fields["LOGIN_URL"] = "loginUrl";
|
1230 | |
1231 |
|
1232 |
|
1233 | Fields["ORG_ID"] = "orgId";
|
1234 | |
1235 |
|
1236 |
|
1237 | Fields["STATUS"] = "status";
|
1238 | |
1239 |
|
1240 |
|
1241 | Fields["SNAPSHOT"] = "snapshot";
|
1242 | |
1243 |
|
1244 |
|
1245 |
|
1246 | Fields["TRACKS_SOURCE"] = "tracksSource";
|
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 |
|
1253 |
|
1254 |
|
1255 |
|
1256 |
|
1257 |
|
1258 | })(Fields = Org.Fields || (Org.Fields = {}));
|
1259 | })(Org = exports.Org || (exports.Org = {}));
|
1260 |
|
\ | No newline at end of file |