@almaclaine/cdk
Advanced tools
Comparing version 0.0.45 to 0.0.46
{ | ||
"name": "@almaclaine/cdk", | ||
"version": "0.0.44", | ||
"version": "0.0.45", | ||
"type": "commonjs", | ||
@@ -9,3 +9,4 @@ "main": "cjs/src/index.js", | ||
"dependencies": { | ||
"@almaclaine/constants": "0.0.6", | ||
"zod": "^3.21.4", | ||
"@almaclaine/constants": "0.0.7", | ||
"@almaclaine/core": "0.0.2", | ||
@@ -16,3 +17,4 @@ "@almaclaine/is": "0.0.8", | ||
"@almaclaine/string": "0.0.2", | ||
"@almaclaine/types": "0.0.14" | ||
"@almaclaine/types": "0.0.17", | ||
"@almaclaine/zod": "0.0.1" | ||
}, | ||
@@ -19,0 +21,0 @@ "exports": { |
@@ -1,2 +0,2 @@ | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, STAGES, TAG_STAGE, } from './lib/constants'; | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, StagesEnum, StageValues, StageSchema, TAG_STAGE, } from './lib/constants'; | ||
export type { Stages } from './lib/constants'; | ||
@@ -30,1 +30,2 @@ export type { ConstructDefaultTypes, DashJoined, JoinedString, } from './lib/types'; | ||
export { generateQueueStackName, generateUserStackName, generateS3StackName, generateDynamoStackName, } from './lib/utils/generate-stack-names'; | ||
export { CfnOutput } from './lib/constructs/cfn-output'; |
@@ -15,5 +15,11 @@ "use strict"; | ||
}, | ||
STAGES: function() { | ||
return _constants.STAGES; | ||
StagesEnum: function() { | ||
return _constants.StagesEnum; | ||
}, | ||
StageValues: function() { | ||
return _constants.StageValues; | ||
}, | ||
StageSchema: function() { | ||
return _constants.StageSchema; | ||
}, | ||
TAG_STAGE: function() { | ||
@@ -165,2 +171,5 @@ return _constants.TAG_STAGE; | ||
return _generatestacknames.generateDynamoStackName; | ||
}, | ||
CfnOutput: function() { | ||
return _cfnoutput.CfnOutput; | ||
} | ||
@@ -188,3 +197,4 @@ }); | ||
const _generatestacknames = require("./lib/utils/generate-stack-names"); | ||
const _cfnoutput = require("./lib/constructs/cfn-output"); | ||
//# sourceMappingURL=index.js.map |
@@ -1,12 +0,10 @@ | ||
import type { ObjectValues } from '@almaclaine/types'; | ||
import { z } from 'zod'; | ||
declare const DYNAMO_PRIMARY_KEY_NAME = "PK"; | ||
declare const DYNAMO_SORT_KEY_NAME = "SK"; | ||
declare const TAG_STAGE = "stage"; | ||
declare const STAGES: { | ||
readonly DEV: "deve"; | ||
readonly TEST: "test"; | ||
readonly PROD: "prod"; | ||
}; | ||
type Stages = ObjectValues<typeof STAGES>; | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, STAGES, TAG_STAGE }; | ||
declare const StageValues: readonly ["DEVE", "TEST", "PROD"]; | ||
declare const StageSchema: z.ZodEnum<["DEVE", "TEST", "PROD"]>; | ||
type Stages = z.infer<typeof StageSchema>; | ||
declare const StagesEnum: import("../../../../dist/libs/types/cjs/src/lib/literal-enum").LiteralEnum<"DEVE" | "TEST" | "PROD">; | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, TAG_STAGE, StagesEnum, StageValues, StageSchema, }; | ||
export type { Stages }; |
@@ -15,18 +15,28 @@ "use strict"; | ||
}, | ||
STAGES: function() { | ||
return STAGES; | ||
}, | ||
TAG_STAGE: function() { | ||
return TAG_STAGE; | ||
}, | ||
StagesEnum: function() { | ||
return StagesEnum; | ||
}, | ||
StageValues: function() { | ||
return StageValues; | ||
}, | ||
StageSchema: function() { | ||
return StageSchema; | ||
} | ||
}); | ||
const _zod = require("zod"); | ||
const _zod1 = require("@almaclaine/zod"); | ||
const DYNAMO_PRIMARY_KEY_NAME = 'PK'; | ||
const DYNAMO_SORT_KEY_NAME = 'SK'; | ||
const TAG_STAGE = 'stage'; | ||
const STAGES = { | ||
DEV: 'deve', | ||
TEST: 'test', | ||
PROD: 'prod' | ||
}; | ||
const StageValues = [ | ||
'DEVE', | ||
'TEST', | ||
'PROD' | ||
]; | ||
const StageSchema = _zod.z.enum(StageValues); | ||
const StagesEnum = (0, _zod1.castEnum)(StageSchema); | ||
//# sourceMappingURL=constants.js.map |
import type { Construct } from 'constructs'; | ||
import type { TagManager } from 'aws-cdk-lib'; | ||
import type { Option } from '@almaclaine/option'; | ||
import type { Stages } from '../constants'; | ||
declare class Tags extends Map<string, string> { | ||
@@ -9,2 +10,3 @@ constructor(struct: Construct); | ||
getOrError(key: string): string; | ||
getStage(): Stages; | ||
static getMap(tags: TagManager): Map<string, string>; | ||
@@ -11,0 +13,0 @@ static staticGetProp(tags: TagManager, key: string): Option<string>; |
@@ -10,2 +10,3 @@ "use strict"; | ||
const _option = require("@almaclaine/option"); | ||
const _constants = require("../constants"); | ||
let Tags = class Tags extends Map { | ||
@@ -33,2 +34,9 @@ static setToMap(tags, map) { | ||
} | ||
getStage() { | ||
const value = this.get(_constants.TAG_STAGE); | ||
if (!value) { | ||
throw new Error(`stage was not added as a tag`); | ||
} | ||
return _constants.StageSchema.parse(value); | ||
} | ||
static getMap(tags) { | ||
@@ -35,0 +43,0 @@ const map = new Map(); |
{ | ||
"name": "@almaclaine/cdk", | ||
"version": "0.0.44", | ||
"version": "0.0.45", | ||
"type": "commonjs", | ||
@@ -9,3 +9,4 @@ "main": "cjs/src/index.js", | ||
"dependencies": { | ||
"@almaclaine/constants": "0.0.6", | ||
"zod": "^3.21.4", | ||
"@almaclaine/constants": "0.0.7", | ||
"@almaclaine/core": "0.0.2", | ||
@@ -16,3 +17,4 @@ "@almaclaine/is": "0.0.8", | ||
"@almaclaine/string": "0.0.2", | ||
"@almaclaine/types": "0.0.14" | ||
"@almaclaine/types": "0.0.17", | ||
"@almaclaine/zod": "0.0.1" | ||
}, | ||
@@ -19,0 +21,0 @@ "exports": { |
@@ -1,2 +0,2 @@ | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, STAGES, TAG_STAGE, } from './lib/constants'; | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, StagesEnum, StageValues, StageSchema, TAG_STAGE, } from './lib/constants'; | ||
export type { Stages } from './lib/constants'; | ||
@@ -30,1 +30,2 @@ export type { ConstructDefaultTypes, DashJoined, JoinedString, } from './lib/types'; | ||
export { generateQueueStackName, generateUserStackName, generateS3StackName, generateDynamoStackName, } from './lib/utils/generate-stack-names'; | ||
export { CfnOutput } from './lib/constructs/cfn-output'; |
@@ -15,5 +15,11 @@ "use strict"; | ||
}, | ||
STAGES: function() { | ||
return _constants.STAGES; | ||
StagesEnum: function() { | ||
return _constants.StagesEnum; | ||
}, | ||
StageValues: function() { | ||
return _constants.StageValues; | ||
}, | ||
StageSchema: function() { | ||
return _constants.StageSchema; | ||
}, | ||
TAG_STAGE: function() { | ||
@@ -165,2 +171,5 @@ return _constants.TAG_STAGE; | ||
return _generatestacknames.generateDynamoStackName; | ||
}, | ||
CfnOutput: function() { | ||
return _cfnoutput.CfnOutput; | ||
} | ||
@@ -188,3 +197,4 @@ }); | ||
const _generatestacknames = require("./lib/utils/generate-stack-names"); | ||
const _cfnoutput = require("./lib/constructs/cfn-output"); | ||
//# sourceMappingURL=index.js.map |
@@ -1,12 +0,10 @@ | ||
import type { ObjectValues } from '@almaclaine/types'; | ||
import { z } from 'zod'; | ||
declare const DYNAMO_PRIMARY_KEY_NAME = "PK"; | ||
declare const DYNAMO_SORT_KEY_NAME = "SK"; | ||
declare const TAG_STAGE = "stage"; | ||
declare const STAGES: { | ||
readonly DEV: "deve"; | ||
readonly TEST: "test"; | ||
readonly PROD: "prod"; | ||
}; | ||
type Stages = ObjectValues<typeof STAGES>; | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, STAGES, TAG_STAGE }; | ||
declare const StageValues: readonly ["DEVE", "TEST", "PROD"]; | ||
declare const StageSchema: z.ZodEnum<["DEVE", "TEST", "PROD"]>; | ||
type Stages = z.infer<typeof StageSchema>; | ||
declare const StagesEnum: import("../../../../dist/libs/types/esm/src/lib/literal-enum").LiteralEnum<"DEVE" | "TEST" | "PROD">; | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, TAG_STAGE, StagesEnum, StageValues, StageSchema, }; | ||
export type { Stages }; |
@@ -15,18 +15,28 @@ "use strict"; | ||
}, | ||
STAGES: function() { | ||
return STAGES; | ||
}, | ||
TAG_STAGE: function() { | ||
return TAG_STAGE; | ||
}, | ||
StagesEnum: function() { | ||
return StagesEnum; | ||
}, | ||
StageValues: function() { | ||
return StageValues; | ||
}, | ||
StageSchema: function() { | ||
return StageSchema; | ||
} | ||
}); | ||
const _zod = require("zod"); | ||
const _zod1 = require("@almaclaine/zod"); | ||
const DYNAMO_PRIMARY_KEY_NAME = 'PK'; | ||
const DYNAMO_SORT_KEY_NAME = 'SK'; | ||
const TAG_STAGE = 'stage'; | ||
const STAGES = { | ||
DEV: 'deve', | ||
TEST: 'test', | ||
PROD: 'prod' | ||
}; | ||
const StageValues = [ | ||
'DEVE', | ||
'TEST', | ||
'PROD' | ||
]; | ||
const StageSchema = _zod.z.enum(StageValues); | ||
const StagesEnum = (0, _zod1.castEnum)(StageSchema); | ||
//# sourceMappingURL=constants.js.map |
import type { Construct } from 'constructs'; | ||
import type { TagManager } from 'aws-cdk-lib'; | ||
import type { Option } from '@almaclaine/option'; | ||
import type { Stages } from '../constants'; | ||
declare class Tags extends Map<string, string> { | ||
@@ -9,2 +10,3 @@ constructor(struct: Construct); | ||
getOrError(key: string): string; | ||
getStage(): Stages; | ||
static getMap(tags: TagManager): Map<string, string>; | ||
@@ -11,0 +13,0 @@ static staticGetProp(tags: TagManager, key: string): Option<string>; |
@@ -10,2 +10,3 @@ "use strict"; | ||
const _option = require("@almaclaine/option"); | ||
const _constants = require("../constants"); | ||
let Tags = class Tags extends Map { | ||
@@ -33,2 +34,9 @@ static setToMap(tags, map) { | ||
} | ||
getStage() { | ||
const value = this.get(_constants.TAG_STAGE); | ||
if (!value) { | ||
throw new Error(`stage was not added as a tag`); | ||
} | ||
return _constants.StageSchema.parse(value); | ||
} | ||
static getMap(tags) { | ||
@@ -35,0 +43,0 @@ const map = new Map(); |
{ | ||
"name": "@almaclaine/cdk", | ||
"version": "0.0.45", | ||
"version": "0.0.46", | ||
"type": "commonjs", | ||
@@ -9,3 +9,4 @@ "main": "cjs/src/index.js", | ||
"dependencies": { | ||
"@almaclaine/constants": "0.0.6", | ||
"zod": "^3.21.4", | ||
"@almaclaine/constants": "0.0.7", | ||
"@almaclaine/core": "0.0.2", | ||
@@ -16,4 +17,5 @@ "@almaclaine/is": "0.0.8", | ||
"@almaclaine/string": "0.0.2", | ||
"@almaclaine/types": "0.0.14" | ||
"@almaclaine/types": "0.0.17", | ||
"@almaclaine/zod": "0.0.1" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, STAGES, TAG_STAGE, } from './lib/constants'; | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, StagesEnum, StageValues, StageSchema, TAG_STAGE, } from './lib/constants'; | ||
export type { Stages } from './lib/constants'; | ||
@@ -30,1 +30,2 @@ export type { ConstructDefaultTypes, DashJoined, JoinedString, } from './lib/types'; | ||
export { generateQueueStackName, generateUserStackName, generateS3StackName, generateDynamoStackName, } from './lib/utils/generate-stack-names'; | ||
export { CfnOutput } from './lib/constructs/cfn-output'; |
@@ -15,5 +15,11 @@ "use strict"; | ||
}, | ||
STAGES: function() { | ||
return _constants.STAGES; | ||
StagesEnum: function() { | ||
return _constants.StagesEnum; | ||
}, | ||
StageValues: function() { | ||
return _constants.StageValues; | ||
}, | ||
StageSchema: function() { | ||
return _constants.StageSchema; | ||
}, | ||
TAG_STAGE: function() { | ||
@@ -165,2 +171,5 @@ return _constants.TAG_STAGE; | ||
return _generatestacknames.generateDynamoStackName; | ||
}, | ||
CfnOutput: function() { | ||
return _cfnoutput.CfnOutput; | ||
} | ||
@@ -188,3 +197,4 @@ }); | ||
const _generatestacknames = require("./lib/utils/generate-stack-names"); | ||
const _cfnoutput = require("./lib/constructs/cfn-output"); | ||
//# sourceMappingURL=index.js.map |
@@ -1,12 +0,10 @@ | ||
import type { ObjectValues } from '@almaclaine/types'; | ||
import { z } from 'zod'; | ||
declare const DYNAMO_PRIMARY_KEY_NAME = "PK"; | ||
declare const DYNAMO_SORT_KEY_NAME = "SK"; | ||
declare const TAG_STAGE = "stage"; | ||
declare const STAGES: { | ||
readonly DEV: "deve"; | ||
readonly TEST: "test"; | ||
readonly PROD: "prod"; | ||
}; | ||
type Stages = ObjectValues<typeof STAGES>; | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, STAGES, TAG_STAGE }; | ||
declare const StageValues: readonly ["DEVE", "TEST", "PROD"]; | ||
declare const StageSchema: z.ZodEnum<["DEVE", "TEST", "PROD"]>; | ||
type Stages = z.infer<typeof StageSchema>; | ||
declare const StagesEnum: import("../../../../dist/libs/types/src/lib/literal-enum").LiteralEnum<"DEVE" | "TEST" | "PROD">; | ||
export { DYNAMO_PRIMARY_KEY_NAME, DYNAMO_SORT_KEY_NAME, TAG_STAGE, StagesEnum, StageValues, StageSchema, }; | ||
export type { Stages }; |
@@ -15,18 +15,28 @@ "use strict"; | ||
}, | ||
STAGES: function() { | ||
return STAGES; | ||
}, | ||
TAG_STAGE: function() { | ||
return TAG_STAGE; | ||
}, | ||
StagesEnum: function() { | ||
return StagesEnum; | ||
}, | ||
StageValues: function() { | ||
return StageValues; | ||
}, | ||
StageSchema: function() { | ||
return StageSchema; | ||
} | ||
}); | ||
const _zod = require("zod"); | ||
const _zod1 = require("@almaclaine/zod"); | ||
const DYNAMO_PRIMARY_KEY_NAME = 'PK'; | ||
const DYNAMO_SORT_KEY_NAME = 'SK'; | ||
const TAG_STAGE = 'stage'; | ||
const STAGES = { | ||
DEV: 'deve', | ||
TEST: 'test', | ||
PROD: 'prod' | ||
}; | ||
const StageValues = [ | ||
'DEVE', | ||
'TEST', | ||
'PROD' | ||
]; | ||
const StageSchema = _zod.z.enum(StageValues); | ||
const StagesEnum = (0, _zod1.castEnum)(StageSchema); | ||
//# sourceMappingURL=constants.js.map |
import type { Construct } from 'constructs'; | ||
import type { TagManager } from 'aws-cdk-lib'; | ||
import type { Option } from '@almaclaine/option'; | ||
import type { Stages } from '../constants'; | ||
declare class Tags extends Map<string, string> { | ||
@@ -9,2 +10,3 @@ constructor(struct: Construct); | ||
getOrError(key: string): string; | ||
getStage(): Stages; | ||
static getMap(tags: TagManager): Map<string, string>; | ||
@@ -11,0 +13,0 @@ static staticGetProp(tags: TagManager, key: string): Option<string>; |
@@ -10,2 +10,3 @@ "use strict"; | ||
const _option = require("@almaclaine/option"); | ||
const _constants = require("../constants"); | ||
let Tags = class Tags extends Map { | ||
@@ -33,2 +34,9 @@ static setToMap(tags, map) { | ||
} | ||
getStage() { | ||
const value = this.get(_constants.TAG_STAGE); | ||
if (!value) { | ||
throw new Error(`stage was not added as a tag`); | ||
} | ||
return _constants.StageSchema.parse(value); | ||
} | ||
static getMap(tags) { | ||
@@ -35,0 +43,0 @@ const map = new Map(); |
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
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
Sorry, the diff of this file is not supported yet
403361
268
5070
9
+ Added@almaclaine/zod@0.0.1
+ Addedzod@^3.21.4
+ Added@almaclaine/constants@0.0.7(transitive)
+ Added@almaclaine/types@0.0.17(transitive)
+ Added@almaclaine/zod@0.0.1(transitive)
+ Added@swc/helpers@0.5.1(transitive)
+ Addedzod@3.24.2(transitive)
Updated@almaclaine/constants@0.0.7
Updated@almaclaine/types@0.0.17