New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@useparagon/cli

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@useparagon/cli - npm Package Compare versions

Comparing version

to
1.0.8-canary.3

@@ -127,5 +127,10 @@ "use strict";

return `authorization: {
type: '${request_1.RequestAuthorizationType.CLIENT_CREDENTIAL}',
}
`;
type: '${request_1.RequestAuthorizationType.CLIENT_CREDENTIAL}',
}
`;
case request_1.RequestAuthorizationType.REFRESH_TOKEN:
return `authorization: {
type: '${request_1.RequestAuthorizationType.REFRESH_TOKEN}',
}
`;
default:

@@ -168,4 +173,15 @@ return '';

const oauthAccessTokenUrl = customIntegration.oauthAccessTokenUrl || source_codegen_1.EMPTY_TOKENIZED_SOURCE;
const audience = customIntegration.apiAuthorization &&
'audience' in customIntegration.apiAuthorization &&
customIntegration.apiAuthorization.audience
? customIntegration.apiAuthorization.audience
: undefined;
return `authenticationType: '${core_1.AuthenticationScheme.OAUTH_CLIENT_CREDENTIAL}',
accessTokenUrl:${(0, source_codegen_1.convertSourceToCode)(oauthAccessTokenUrl, dependencies)}
accessTokenUrl:${(0, source_codegen_1.convertSourceToCode)(oauthAccessTokenUrl, dependencies)},
apiBaseUrl: ${(0, source_codegen_1.convertSourceToCode)(apiBaseUrl, dependencies)},
testEndpointPath: ${(0, source_codegen_1.convertSourceToCode)(testEndpointPath, dependencies)},
${audience
? `audience: ${(0, source_codegen_1.convertSourceToCode)(audience, dependencies)},`
: ''}
${authorizationConfigToCode()}
`;

@@ -172,0 +188,0 @@ case core_1.AuthenticationScheme.OAUTH:

@@ -75,2 +75,6 @@ "use strict";

const convertInputSourceToCode = (source, dependencies) => {
if (source.fieldType === 'WORKFLOW_SETTING' &&
['clientId', 'clientSecret'].includes(source.inputId)) {
return `{{settings.${source.inputId === 'clientId' ? 'ClientID' : 'ClientSecret'}}}`;
}
const inputs = source.fieldType === 'SHARED_WORKFLOW_SETTING'

@@ -267,4 +271,7 @@ ? dependencies.sharedInputs

value.trim() &&
!(source.type === 'CONNECT_CREDENTIAL_FIELD' &&
source.fieldType === 'OAUTH_ACCESS_TOKEN'));
!((source.type === 'CONNECT_CREDENTIAL_FIELD' &&
source.fieldType === 'OAUTH_ACCESS_TOKEN') ||
(source.type === 'CONNECT_CREDENTIAL_FIELD' &&
source.fieldType === 'WORKFLOW_SETTING' &&
['clientId', 'clientSecret'].includes(source.inputId))));
if (shouldTreatAsVariable) {

@@ -271,0 +278,0 @@ value = '${' + value + '}';

@@ -285,8 +285,3 @@ "use strict";

case core_1.StepType.CRON:
const timezone = 'time' in step.parameters.schedule
? typeof step.parameters.schedule.time.timezone === 'string'
? step.parameters.schedule.time.timezone
: (0, source_codegen_1.convertSourceToCode)(step.parameters.schedule.time.timezone, dependencies).replaceAll('`', '')
: undefined;
const cronOptions = (0, cron_1.getCronOptions)(step.parameters.schedule, timezone);
const cronOptions = (0, cron_1.getCronOptions)(step.parameters.schedule);
varDeclarations.push(`

@@ -293,0 +288,0 @@ const ${variableName} = new CronStep(${(0, json_1.stringifyObject)(cronOptions)});

@@ -55,6 +55,2 @@ "use strict";

const resolveAuthorization = () => {
if (!(customIntegrationConfig.authenticationType === 'basic' ||
customIntegrationConfig.authenticationType === 'oauth')) {
return;
}
let authorization;

@@ -68,2 +64,7 @@ const userDefinedAuthorization = customIntegrationConfig.authorization;

password: (0, resolvers_1.resolveToTokenizedSource)(userDefinedAuthorization.password, resolvers_1.DataType.STRING),
...('audience' in customIntegrationConfig
? {
audience: (0, resolvers_1.resolveToTokenizedSource)(customIntegrationConfig.audience, resolvers_1.DataType.STRING),
}
: {}),
};

@@ -75,2 +76,7 @@ break;

headers: (0, resolvers_1.resolveParamsToSources)(userDefinedAuthorization.headers || {}, resolvers_1.DataType.STRING),
...('audience' in customIntegrationConfig
? {
audience: (0, resolvers_1.resolveToTokenizedSource)(customIntegrationConfig.audience, resolvers_1.DataType.STRING),
}
: {}),
};

@@ -82,2 +88,7 @@ break;

token: (0, resolvers_1.resolveToTokenizedSource)(userDefinedAuthorization.token, resolvers_1.DataType.STRING),
...('audience' in customIntegrationConfig
? {
audience: (0, resolvers_1.resolveToTokenizedSource)(customIntegrationConfig.audience, resolvers_1.DataType.STRING),
}
: {}),
};

@@ -88,4 +99,19 @@ break;

type: request_1.RequestAuthorizationType.CLIENT_CREDENTIAL,
...('audience' in customIntegrationConfig
? {
audience: (0, resolvers_1.resolveToTokenizedSource)(customIntegrationConfig.audience, resolvers_1.DataType.STRING),
}
: {}),
};
break;
case request_1.RequestAuthorizationType.REFRESH_TOKEN:
authorization = {
type: request_1.RequestAuthorizationType.REFRESH_TOKEN,
...('audience' in customIntegrationConfig
? {
audience: (0, resolvers_1.resolveToTokenizedSource)(customIntegrationConfig.audience, resolvers_1.DataType.STRING),
}
: {}),
};
break;
case request_1.RequestAuthorizationType.QUERY_PARAMS:

@@ -95,2 +121,7 @@ authorization = {

params: (0, resolvers_1.resolveParamsToSources)(userDefinedAuthorization.params || {}, resolvers_1.DataType.STRING),
...('audience' in customIntegrationConfig
? {
audience: (0, resolvers_1.resolveToTokenizedSource)(customIntegrationConfig.audience, resolvers_1.DataType.STRING),
}
: {}),
};

@@ -138,2 +169,5 @@ break;

oauthAccessTokenUrl: (0, resolvers_1.resolveToTokenizedSource)(customIntegrationConfig.accessTokenUrl, resolvers_1.DataType.STRING),
apiBaseUrl: (0, resolvers_1.resolveToTokenizedSource)(customIntegrationConfig.apiBaseUrl, resolvers_1.DataType.STRING),
testEndpointPath: (0, resolvers_1.resolveToTokenizedSource)(customIntegrationConfig.testEndpointPath, resolvers_1.DataType.STRING),
apiAuthorization: resolveAuthorization(),
};

@@ -140,0 +174,0 @@ break;

{
"name": "@useparagon/cli",
"version": "1.0.8-canary.2",
"version": "1.0.8-canary.3",
"description": "CLI for WaC (Workflows as Code)",

@@ -37,3 +37,3 @@ "repository": "https://github.com/useparagon/paragraph",

"uuid": "^9.0.0",
"@useparagon/core": "1.0.8-canary.2"
"@useparagon/core": "1.0.8-canary.3"
},

@@ -40,0 +40,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet