@collabland/common
Advanced tools
Comparing version 0.41.1 to 0.42.0
@@ -69,3 +69,7 @@ import type { AnyType } from '../types.js'; | ||
*/ | ||
SQSRedPacketClaimsQueue = "SQSRedPacketClaimsQueue" | ||
SQSRedPacketClaimsQueue = "SQSRedPacketClaimsQueue", | ||
/** | ||
* Token claims queue name | ||
*/ | ||
SQSTokenClaimsQueue = "SQSTokenClaimsQueue" | ||
} | ||
@@ -228,2 +232,14 @@ /** | ||
export declare function getJobServerType(): string; | ||
/** | ||
* API server types | ||
*/ | ||
export declare enum APIServerType { | ||
main = "main", | ||
claim = "claim" | ||
} | ||
/** | ||
* Get the api server type from the env var | ||
* @returns | ||
*/ | ||
export declare function getAPIServerType(): string; | ||
export declare function getCommandCenterURL(): string; | ||
@@ -230,0 +246,0 @@ /** |
@@ -7,3 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getWalletConnectionDomain = exports.getWalletConnectionURL = exports.getApiServerURL = exports.getCommandCenterURL = exports.getJobServerType = exports.JobServerType = exports.ServerType = exports.getResourceName = exports.unsetEnvVar = exports.setEnvVar = exports.getEnvVarAsObject = exports.getEnvVarAsBoolean = exports.getEnvVarAsNumber = exports.getEnvVar = exports.isDevelopment = exports.isProduction = exports.setEnv = exports.getEnv = exports.getEnvName = exports.AWSResources = exports.ResourceType = exports.EnvType = void 0; | ||
exports.getWalletConnectionDomain = exports.getWalletConnectionURL = exports.getApiServerURL = exports.getCommandCenterURL = exports.getAPIServerType = exports.APIServerType = exports.getJobServerType = exports.JobServerType = exports.ServerType = exports.getResourceName = exports.unsetEnvVar = exports.setEnvVar = exports.getEnvVarAsObject = exports.getEnvVarAsBoolean = exports.getEnvVarAsNumber = exports.getEnvVar = exports.isDevelopment = exports.isProduction = exports.setEnv = exports.getEnv = exports.getEnvName = exports.AWSResources = exports.ResourceType = exports.EnvType = void 0; | ||
const lodash_1 = require("lodash"); | ||
@@ -77,2 +77,6 @@ /** | ||
ResourceType["SQSRedPacketClaimsQueue"] = "SQSRedPacketClaimsQueue"; | ||
/** | ||
* Token claims queue name | ||
*/ | ||
ResourceType["SQSTokenClaimsQueue"] = "SQSTokenClaimsQueue"; | ||
})(ResourceType = exports.ResourceType || (exports.ResourceType = {})); | ||
@@ -144,2 +148,11 @@ /** | ||
}, | ||
SQSTokenClaimsQueue: { | ||
template: 'collabland-token-claims-${evnName}', | ||
mappedNames: { | ||
[EnvType.PROD]: 'collabland-token-claims-prod', | ||
[EnvType.STAGING]: 'collabland-token-claims-staging', | ||
[EnvType.QA]: 'collabland-token-claims-qa', | ||
}, | ||
envVarName: 'COLLABLAND_TOKEN_CLAIMS_QUEUE_NAME', | ||
}, | ||
KMSKeyAlias: { | ||
@@ -411,2 +424,25 @@ template: 'alias/collabland-api-key-${envName}', | ||
exports.getJobServerType = getJobServerType; | ||
/** | ||
* API server types | ||
*/ | ||
var APIServerType; | ||
(function (APIServerType) { | ||
APIServerType["main"] = "main"; | ||
APIServerType["claim"] = "claim"; | ||
})(APIServerType = exports.APIServerType || (exports.APIServerType = {})); | ||
/** | ||
* Get the api server type from the env var | ||
* @returns | ||
*/ | ||
function getAPIServerType() { | ||
const apiServerType = getEnvVar('COLLABLAND_API_SERVER_TYPE', APIServerType.main); | ||
switch (apiServerType.toLowerCase()) { | ||
case APIServerType.main: | ||
case APIServerType.claim: | ||
return apiServerType; | ||
default: | ||
return APIServerType.main; | ||
} | ||
} | ||
exports.getAPIServerType = getAPIServerType; | ||
function getCommandCenterURL() { | ||
@@ -413,0 +449,0 @@ const url = isProduction() |
{ | ||
"name": "@collabland/common", | ||
"version": "0.41.1", | ||
"version": "0.42.0", | ||
"description": "CollabLand common utilities", | ||
@@ -69,3 +69,3 @@ "main": "dist/index.js", | ||
"author": "Abridged, Inc.", | ||
"gitHead": "9c1f316621173811fa5e15026ebb9121a496741d" | ||
"gitHead": "5d10d713e283474c3ca908150c903f0fd5910a31" | ||
} |
@@ -80,2 +80,6 @@ // Copyright Abridged, Inc. 2021. All Rights Reserved. | ||
SQSRedPacketClaimsQueue = 'SQSRedPacketClaimsQueue', | ||
/** | ||
* Token claims queue name | ||
*/ | ||
SQSTokenClaimsQueue = 'SQSTokenClaimsQueue', | ||
} | ||
@@ -171,2 +175,11 @@ | ||
}, | ||
SQSTokenClaimsQueue: { | ||
template: 'collabland-token-claims-${evnName}', | ||
mappedNames: { | ||
[EnvType.PROD]: 'collabland-token-claims-prod', | ||
[EnvType.STAGING]: 'collabland-token-claims-staging', | ||
[EnvType.QA]: 'collabland-token-claims-qa', | ||
}, | ||
envVarName: 'COLLABLAND_TOKEN_CLAIMS_QUEUE_NAME', | ||
}, | ||
KMSKeyAlias: { | ||
@@ -489,2 +502,28 @@ template: 'alias/collabland-api-key-${envName}', | ||
/** | ||
* API server types | ||
*/ | ||
export enum APIServerType { | ||
main = 'main', | ||
claim = 'claim', | ||
} | ||
/** | ||
* Get the api server type from the env var | ||
* @returns | ||
*/ | ||
export function getAPIServerType() { | ||
const apiServerType = getEnvVar( | ||
'COLLABLAND_API_SERVER_TYPE', | ||
APIServerType.main, | ||
); | ||
switch (apiServerType.toLowerCase()) { | ||
case APIServerType.main: | ||
case APIServerType.claim: | ||
return apiServerType; | ||
default: | ||
return APIServerType.main; | ||
} | ||
} | ||
export function getCommandCenterURL() { | ||
@@ -491,0 +530,0 @@ const url = isProduction() |
Sorry, the diff of this file is not supported yet
254397
6191