@contrail/util 1.0.37 → 1.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface ActionDefinitionIdentifierParts {
|
|
2
2
|
appIdentifier: string;
|
|
3
3
|
versionId: string;
|
|
4
|
-
|
|
4
|
+
actionNameIdentifier: string;
|
|
5
5
|
}
|
|
6
6
|
export declare const IDENTIFIER_VALIDATION_NO_IDENTIFIER = "Action definition has no identifier. An identifier is required.";
|
|
7
7
|
export declare const IDENTIFIER_VALIDATION_START_WITH_AT = "Invalid action identifier. Action definition identifier must conform with '@appIdentifier@versionId:actionIdentifier";
|
|
@@ -11,4 +11,5 @@ export declare class BadIdentifierException extends Error {
|
|
|
11
11
|
}
|
|
12
12
|
export declare class AppUtil {
|
|
13
13
|
static parseActionIdentifier(actionIdentifier: string): ActionDefinitionIdentifierParts;
|
|
14
|
+
static createActionIdentifier(actionDefinitionParts: ActionDefinitionIdentifierParts): string;
|
|
14
15
|
}
|
package/lib/app-util/app-util.js
CHANGED
|
@@ -31,9 +31,12 @@ class AppUtil {
|
|
|
31
31
|
return {
|
|
32
32
|
appIdentifier: `@${identifierParts[1]}`,
|
|
33
33
|
versionId: identifierParts[2],
|
|
34
|
-
|
|
34
|
+
actionNameIdentifier: identifierParts[3]
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
static createActionIdentifier(actionDefinitionParts) {
|
|
39
|
+
return `${actionDefinitionParts.appIdentifier}@${actionDefinitionParts.versionId}:${actionDefinitionParts.actionNameIdentifier}`;
|
|
40
|
+
}
|
|
38
41
|
}
|
|
39
42
|
exports.AppUtil = AppUtil;
|