Skip to content

Commit

Permalink
fix: remove older stats and error types
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumarrs committed Dec 8, 2022
1 parent 2dd0aa6 commit eef0382
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 263 deletions.
66 changes: 0 additions & 66 deletions src/v0/util/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,74 +8,8 @@ const AUTH_CACHE_TTL = process.env.MARKETO_AUTH_CACHE_TTL

const API_CALL = "api_call_count";

const TRANSFORMER_METRIC = {
MEASUREMENT: {
INTEGRATION_ERROR_METRIC: "integration_error_metric"
},
// The location at which the error stat was sent
ERROR_AT: {
// processor transformation
PROC: "proc",
// router transformation
RT: "rt",
// batch transformation
BATCH: "batch",
// /proxy endpoint(delivery to destination)
PROXY: "proxy",
// Default
UNKNOWN: "unknown"
},
TRANSFORMER_STAGE: {
TRANSFORM: "transform",
RESPONSE_TRANSFORM: "responseTransform"
},
MEASUREMENT_TYPE: {
API: {
SCOPE: "api",
META: {
ABORTABLE: "abortable",
RETRYABLE: "retryable",
THROTTLED: "throttled",
SUCCESS: "success",
/**
* This meta needs to be used when the response is not an expected one from the destination's API
* This can be during transformation or response handling(during delivery of event)
*/
UNHANDLED: "unhandled"
}
},
TRANSFORMATION: {
SCOPE: "transformation",
META: {
BAD_EVENT: "badEvent",
BAD_PARAM: "badParam",
INSTRUMENTATION: "instrumentation",
CONFIGURATION: "configuration",
/**
* Basically this means that the error is an expected error(thrown during transformation)
* This meta will be used for CustomError thrown during transformations
*/
HANDLED: "handled"
}
},
AUTHENTICATION: {
SCOPE: "authentication"
},
EXCEPTION: {
SCOPE: "exception"
},
CDK: {
SCOPE: "cdk"
},
DEFAULT: {
SCOPE: "default"
}
}
};

module.exports = {
API_CALL,
AUTH_CACHE_TTL,
TRANSFORMER_METRIC,
USER_LEAD_CACHE_TTL
};
107 changes: 0 additions & 107 deletions src/v0/util/error.js

This file was deleted.

25 changes: 0 additions & 25 deletions src/v0/util/errors/api.js

This file was deleted.

27 changes: 0 additions & 27 deletions src/v0/util/errors/base.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/v0/util/errors/index.js

This file was deleted.

20 changes: 0 additions & 20 deletions src/v0/util/errors/transformation.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/v0/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@ const flattenMap = collection => _.flatMap(collection, x => x);
// GENERIC UTLITY
// ========================================================================

class CustomError extends Error {
constructor(message, statusCode, metadata) {
super(message);
// *Note*: This schema is being used by other endpoints like /poll, /fileUpload etc,.
// Apart from destination transformation
this.response = { status: statusCode || 400, metadata };
}
}

const getEventTime = message => {
return new Date(message.timestamp).toISOString();
};
Expand Down

0 comments on commit eef0382

Please sign in to comment.