Skip to content
Permalink
Browse files

Deprecate lower case enum values

[changelog:deprecated] [changelog:changed]
  • Loading branch information...
cdupuis committed Jan 24, 2019
1 parent a4f5adf commit f5562590f51caaaa3c97340b31efe544ea71bcc6
Showing with 15 additions and 6 deletions.
  1. +9 −0 lib/api/registration/ParametersDefinition.ts
  2. +6 −6 test/api/registration/commandRegistration.test.ts
@@ -36,8 +36,17 @@ export type ParametersObject<PARAMS, K extends keyof PARAMS = keyof PARAMS>
= Record<K, ParametersObjectValue | MappedParameterOrSecretObjectValue>;

export enum DeclarationType {
/**
* @deprecated use Mapped
*/
mapped = "mapped",
/**
* @deprecated use Secret
*/
secret = "secret",

Mapped = "mapped",
Secret = "secret",
}

export interface MappedParameterOrSecretDeclaration {
@@ -160,8 +160,8 @@ describe("command registrations", () => {
{
foo: {},
bar: { required: true },
x: { declarationType: DeclarationType.secret, uri: "http://thing1" },
y: { declarationType: DeclarationType.mapped, uri: "http://thing2", required: false },
x: { declarationType: DeclarationType.Secret, uri: "http://thing1" },
y: { declarationType: DeclarationType.Mapped, uri: "http://thing2", required: false },
},
listener: async ci => {
return ci.addressChannels(ci.parameters.foo + ci.parameters.bar);
@@ -187,17 +187,17 @@ describe("command registrations", () => {
it("parameter builder should set mapped parameter and secret via indexed property, with spread", () => {
const halfOfParameters: ParametersObject<{bar: string, x1: string, y1: string}> = {
bar: { required: true },
x1: { declarationType: DeclarationType.secret, uri: "http://thing1" },
y1: { declarationType: DeclarationType.mapped, uri: "http://thing2", required: false },
x1: { declarationType: DeclarationType.Secret, uri: "http://thing1" },
y1: { declarationType: DeclarationType.Mapped, uri: "http://thing2", required: false },

};
const reg: CommandHandlerRegistration<any> = {
name: "test",
parameters:
{
foo: {},
x2: { declarationType: DeclarationType.secret, uri: "http://thing1" },
y2: { declarationType: DeclarationType.mapped, uri: "http://thing2", required: false },
x2: { declarationType: DeclarationType.Secret, uri: "http://thing1" },
y2: { declarationType: DeclarationType.Mapped, uri: "http://thing2", required: false },
...halfOfParameters,
},
listener: async ci => {

0 comments on commit f556259

Please sign in to comment.
You can’t perform that action at this time.