Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"node": {
"extensions": [".js", ".ts"]
}
}
},
"import/core-modules": ["auth0/legacy"]
},
"rules": {
"max-len": 0,
Expand Down
65 changes: 56 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"homepage": "https://github.com/auth0/auth0-deploy-cli#readme",
"dependencies": {
"ajv": "^6.12.6",
"auth0": "^4.32.0",
"auth0": "^5.0.0",
"dot-prop": "^5.3.0",
"fs-extra": "^10.1.0",
"js-yaml": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/context/directory/handlers/clientGrants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import fs from 'fs-extra';
import { Client, ResourceServer } from 'auth0';
import { Client, ResourceServer } from 'auth0/legacy';
import { constants, keywordReplace } from '../../../tools';

import {
Expand Down
2 changes: 1 addition & 1 deletion src/context/directory/handlers/resourceServers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, ResourceServer } from 'auth0';
import { Client, ResourceServer } from 'auth0/legacy';
import path from 'path';
import fs from 'fs-extra';
import { constants } from '../../../tools';
Expand Down
2 changes: 1 addition & 1 deletion src/context/directory/handlers/userAttributeProfiles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import fs from 'fs-extra';
import { UserAttributeProfile } from 'auth0';
import { UserAttributeProfile } from 'auth0/legacy';
import { constants } from '../../../tools';
import DirectoryContext from '..';
import { dumpJSON, existsMustBeDir, getFiles, loadJSON, sanitize } from '../../../utils';
Expand Down
2 changes: 1 addition & 1 deletion src/context/directory/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as path from 'path';
import { ManagementClient } from 'auth0';
import { ManagementClient } from 'auth0/legacy';
import { loadFileAndReplaceKeywords, Auth0 } from '../../tools';
import pagedClient from '../../tools/auth0/client';

Expand Down
20 changes: 9 additions & 11 deletions src/context/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lstatSync, readdirSync, readFileSync, existsSync } from 'fs';
import path from 'path';
import { AuthenticationClient, ManagementClient } from 'auth0';
import { AuthenticationClient, ManagementClient } from 'auth0/legacy';
import YAMLContext from './yaml';
import DirectoryContext from './directory';

Expand Down Expand Up @@ -127,8 +127,7 @@ export const setupContext = async (
});
if (usedDeprecatedParams.length > 0) {
log.warn(
`Usage of the ${usedDeprecatedParams.join(', ')} exclusion ${
usedDeprecatedParams.length > 1 ? 'params are' : 'param is'
`Usage of the ${usedDeprecatedParams.join(', ')} exclusion ${usedDeprecatedParams.length > 1 ? 'params are' : 'param is'
} deprecated and may be removed from future major versions. See: https://github.com/auth0/auth0-deploy-cli/issues/451#user-content-deprecated-exclusion-props for details.`
);
}
Expand All @@ -138,10 +137,9 @@ export const setupContext = async (
// Check if experimental early access features are enabled
if (config.AUTH0_EXPERIMENTAL_EA) {
log.warn(
`Experimental early access ${
EA_FEATURES.length === 1
? 'feature [' + EA_FEATURES.join('') + '] is'
: 'features [' + EA_FEATURES.join(',') + '] are'
`Experimental early access ${EA_FEATURES.length === 1
? 'feature [' + EA_FEATURES.join('') + '] is'
: 'features [' + EA_FEATURES.join(',') + '] are'
} enabled. These are in a pre-release state and may change in future release.`
);
} else {
Expand Down Expand Up @@ -250,7 +248,7 @@ export const setupContext = async (

export const filterOnlyIncludedResourceTypes =
(includedAssetTypes: AssetTypes[] | undefined) =>
([handlerName, _]: [AssetTypes, any]) => {
if (includedAssetTypes === undefined) return true;
return includedAssetTypes.includes(handlerName);
};
([handlerName, _]: [AssetTypes, any]) => {
if (includedAssetTypes === undefined) return true;
return includedAssetTypes.includes(handlerName);
};
2 changes: 1 addition & 1 deletion src/context/yaml/handlers/clientGrants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client } from 'auth0';
import { Client } from 'auth0/legacy';
import { convertClientIdToName } from '../../../utils';
import { YAMLHandler } from '.';
import YAMLContext from '..';
Expand Down
2 changes: 1 addition & 1 deletion src/context/yaml/handlers/prompts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import { ensureDirSync, writeFileSync } from 'fs-extra';
import { GetRendering200Response } from 'auth0';
import { GetRendering200Response } from 'auth0/legacy';
import { YAMLHandler } from '.';
import YAMLContext from '..';
import { constants } from '../../../tools';
Expand Down
2 changes: 1 addition & 1 deletion src/context/yaml/handlers/resourceServers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, ResourceServer } from 'auth0';
import { Client, ResourceServer } from 'auth0/legacy';
import { YAMLHandler } from '.';
import YAMLContext from '..';
import { ParsedAsset } from '../../../types';
Expand Down
2 changes: 1 addition & 1 deletion src/context/yaml/handlers/userAttributeProfiles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserAttributeProfile } from 'auth0';
import { UserAttributeProfile } from 'auth0/legacy';
import { YAMLHandler } from '.';
import YAMLContext from '..';
import { ParsedAsset } from '../../../types';
Expand Down
2 changes: 1 addition & 1 deletion src/context/yaml/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs-extra';
import yaml from 'js-yaml';
import path from 'path';
import { ManagementClient } from 'auth0';
import { ManagementClient } from 'auth0/legacy';
import {
loadFileAndReplaceKeywords,
keywordReplace,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PromisePoolExecutor } from 'promise-pool-executor';
import _ from 'lodash';

import { JSONApiResponse, ManagementClient } from 'auth0';
import { JSONApiResponse, ManagementClient } from 'auth0/legacy';
import { flatten } from '../utils';
import {
Asset,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/actions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import { GetActions200ResponseActionsInner, PostActionRequest } from 'auth0';
import { GetActions200ResponseActionsInner, PostActionRequest } from 'auth0/legacy';
import DefaultAPIHandler, { order } from './default';
import log from '../../../logger';
import { areArraysEquals, sleep } from '../../utils';
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/branding.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomDomain, GetBranding200Response, GetUniversalLogin200ResponseOneOf } from 'auth0';
import { CustomDomain, GetBranding200Response, GetUniversalLogin200ResponseOneOf } from 'auth0/legacy';
import DefaultHandler, { order } from './default';
import constants from '../../constants';
import log from '../../../logger';
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/clientGrants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, ClientGrantSubjectTypeEnum } from 'auth0';
import { Client, ClientGrantSubjectTypeEnum } from 'auth0/legacy';
import DefaultHandler, { order } from './default';
import { convertClientNamesToIds } from '../../utils';
import { Assets, CalculatedChanges } from '../../../types';
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/connections.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dotProp from 'dot-prop';
import _ from 'lodash';
import { Client, Connection, GetConnectionsStrategyEnum, PatchClientsRequestInner } from 'auth0';
import { Client, Connection, GetConnectionsStrategyEnum, PatchClientsRequestInner } from 'auth0/legacy';
import DefaultAPIHandler, { order } from './default';
import { filterExcluded, convertClientNameToId, getEnabledClients, sleep } from '../../utils';
import { CalculatedChanges, Asset, Assets, Auth0APIClient } from '../../../types';
Expand Down
4 changes: 2 additions & 2 deletions src/tools/auth0/handlers/customDomains.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomDomain } from 'auth0';
import { CustomDomain } from 'auth0/legacy';
import DefaultAPIHandler, { order } from './default';
import { Asset, Assets } from '../../../types';
import log from '../../../logger';
Expand Down Expand Up @@ -95,7 +95,7 @@ export default class CustomDomainsHadnler extends DefaultAPIHandler {
if (
err.statusCode === 403 &&
err.message ===
'The account is not allowed to perform this operation, please contact our support team'
'The account is not allowed to perform this operation, please contact our support team'
) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/databases.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, Connection, GetConnectionsStrategyEnum } from 'auth0';
import { Client, Connection, GetConnectionsStrategyEnum } from 'auth0/legacy';
import DefaultAPIHandler, { order } from './default';
import constants from '../../constants';
import { filterExcluded, getEnabledClients } from '../../utils';
Expand Down
12 changes: 5 additions & 7 deletions src/tools/auth0/handlers/default.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONApiResponse } from 'auth0';
import { JSONApiResponse } from 'auth0/legacy';
import ValidationError from '../../validationError';

import {
Expand Down Expand Up @@ -195,9 +195,8 @@ export default class APIHandler {
const duplicateIDs = duplicateItems(typeAssets, this.id);
if (duplicateIDs.length > 0) {
const formatted = duplicateIDs.map((dups) => dups.map((d) => `${d[this.id]}`));
throw new ValidationError(`There are multiple ${
this.type
} for the following stage-order combinations
throw new ValidationError(`There are multiple ${this.type
} for the following stage-order combinations
${convertJsonToString(formatted)}.
Only one rule must be defined for the same order number in a stage.`);
}
Expand Down Expand Up @@ -226,9 +225,8 @@ export default class APIHandler {
(this.type === 'rules' || this.type === 'resourceServers');
const shouldDelete = allowDelete || byExtension;
if (!shouldDelete) {
log.warn(`Detected the following ${
this.type
} should be deleted. Doing so may be destructive.\nYou can enable deletes by setting 'AUTH0_ALLOW_DELETE' to true in the config
log.warn(`Detected the following ${this.type
} should be deleted. Doing so may be destructive.\nYou can enable deletes by setting 'AUTH0_ALLOW_DELETE' to true in the config
\n${changes.del.map((i) => this.objString(i)).join('\n')}
`);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/emailProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EmailProviderCreate } from 'auth0';
import { EmailProviderCreate } from 'auth0/legacy';
import { isEmpty } from 'lodash';
import DefaultHandler, { order } from './default';
import { Asset, Assets } from '../../../types';
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/flowVaultConnections.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
GetFlowsVaultConnections200ResponseOneOfInner,
PatchFlowsVaultConnectionsByIdRequest,
} from 'auth0';
} from 'auth0/legacy';
import { isArray, isEmpty } from 'lodash';
import DefaultHandler, { order } from './default';
import { Asset, Assets, CalculatedChanges } from '../../../types';
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/flows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
GetFlows200ResponseOneOfInner,
GetFlowsVaultConnections200ResponseOneOfInner,
PostFlows201Response,
} from 'auth0';
} from 'auth0/legacy';
import dotProp from 'dot-prop';
import DefaultHandler, { order } from './default';
import { Asset, Assets, CalculatedChanges } from '../../../types';
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
GetFlows200ResponseOneOfInner,
GetForms200ResponseOneOfInner,
PostForms201Response,
} from 'auth0';
} from 'auth0/legacy';
import dotProp from 'dot-prop';
import { isEmpty } from 'lodash';
import DefaultHandler, { order } from './default';
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/guardianFactorTemplates.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TemplateMessages } from 'auth0';
import { TemplateMessages } from 'auth0/legacy';
import DefaultHandler from './default';
import constants from '../../constants';
import { Assets, Asset } from '../../../types';
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/guardianFactors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Factor, FactorNameEnum } from 'auth0';
import { Factor, FactorNameEnum } from 'auth0/legacy';
import DefaultHandler from './default';
import constants from '../../constants';
import { Asset, Assets } from '../../../types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetMessageTypes200Response } from 'auth0';
import { GetMessageTypes200Response } from 'auth0/legacy';
import DefaultHandler from './default';
import constants from '../../constants';
import { Asset, Assets } from '../../../types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GetPhoneProviders200Response } from 'auth0';
import { GetPhoneProviders200Response } from 'auth0/legacy';
import DefaultHandler from './default';
import constants from '../../constants';
import { Asset, Assets } from '../../../types';
Expand Down
2 changes: 1 addition & 1 deletion src/tools/auth0/handlers/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Hook } from 'auth0';
import { Hook } from 'auth0/legacy';
import DefaultHandler from './default';
import constants from '../../constants';
import { Asset, Assets, CalculatedChanges } from '../../../types';
Expand Down
Loading