@toolproof-npm/shared 0.1.115 → 0.1.117
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.
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +2 -0
- package/dist/firebaseAdminHelpers.d.ts +14 -2
- package/package.json +2 -2
package/dist/constants.d.ts
CHANGED
|
@@ -59,6 +59,8 @@ export declare const CONSTANTS: {
|
|
|
59
59
|
readonly TYPE_Error: "TYPE-Error";
|
|
60
60
|
readonly TYPE_StatelessStrategy: "TYPE-StatelessStrategy";
|
|
61
61
|
readonly TYPE_StatefulStrategy: "TYPE-StatefulStrategy";
|
|
62
|
+
readonly TYPE_StrategyRun: "TYPE-StrategyRun";
|
|
63
|
+
readonly TYPE_RunRecording: "TYPE-RunRecording";
|
|
62
64
|
readonly ROLE_Manual: "ROLE-Manual";
|
|
63
65
|
readonly ROLE_Iteration: "ROLE-Iteration";
|
|
64
66
|
readonly ROLE_ErrorOutput: "ROLE-ErrorOutput";
|
package/dist/constants.js
CHANGED
|
@@ -59,6 +59,8 @@ export const CONSTANTS = {
|
|
|
59
59
|
TYPE_Error: 'TYPE-Error',
|
|
60
60
|
TYPE_StatelessStrategy: 'TYPE-StatelessStrategy',
|
|
61
61
|
TYPE_StatefulStrategy: 'TYPE-StatefulStrategy',
|
|
62
|
+
TYPE_StrategyRun: 'TYPE-StrategyRun',
|
|
63
|
+
TYPE_RunRecording: 'TYPE-RunRecording',
|
|
62
64
|
ROLE_Manual: 'ROLE-Manual',
|
|
63
65
|
ROLE_Iteration: 'ROLE-Iteration',
|
|
64
66
|
ROLE_ErrorOutput: 'ROLE-ErrorOutput',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BranchStepIdentityJson, ExecutionIdentityJson, ForStepIdentityJson,
|
|
1
|
+
import type { BranchStepIdentityJson, ExecutionIdentityJson, ForStepIdentityJson, JobIdentityJson, ResourceFormatIdentityJson, ResourceIdentityJson, ResourceRoleIdentityJson, ResourceTypeIdentityJson, StatefulStrategyIdentityJson, StatelessStrategyIdentityJson, StrategyRunIdentityJson, StrategyThreadIdentityJson, WhileStepIdentityJson, WorkStepIdentityJson } from '@toolproof-npm/schema';
|
|
2
2
|
import type { ResourceMap, IdentityPrefix } from './_lib/types.js';
|
|
3
3
|
import { CONSTANTS } from './constants.js';
|
|
4
4
|
type StripTrailingS<S extends string> = S extends `${infer Rest}S` ? Rest : S;
|
|
@@ -7,7 +7,19 @@ export type StepKind = keyof typeof CONSTANTS.STEPS;
|
|
|
7
7
|
export type StepIdentityPrefix = (typeof CONSTANTS.STEP_IDENTITY_PREFIX_BY_KIND)[StepKind];
|
|
8
8
|
type StepIdentityForPrefix<P extends StepIdentityPrefix> = P extends 'workstep' ? WorkStepIdentityJson : P extends 'branchstep' ? BranchStepIdentityJson : P extends 'forstep' ? ForStepIdentityJson : P extends 'whilestep' ? WhileStepIdentityJson : never;
|
|
9
9
|
type AnyIdentityPrefix = IdentityPrefix | StepIdentityPrefix;
|
|
10
|
-
|
|
10
|
+
type IdentityJsonByPrefix = {
|
|
11
|
+
format: ResourceFormatIdentityJson;
|
|
12
|
+
type: ResourceTypeIdentityJson;
|
|
13
|
+
role: ResourceRoleIdentityJson;
|
|
14
|
+
job: JobIdentityJson;
|
|
15
|
+
execution: ExecutionIdentityJson;
|
|
16
|
+
resource: ResourceIdentityJson;
|
|
17
|
+
stateless_strategy: StatelessStrategyIdentityJson;
|
|
18
|
+
stateful_strategy: StatefulStrategyIdentityJson;
|
|
19
|
+
strategy_thread: StrategyThreadIdentityJson;
|
|
20
|
+
strategy_run: StrategyRunIdentityJson;
|
|
21
|
+
};
|
|
22
|
+
export type NewIdentity<T extends AnyIdentityPrefix = AnyIdentityPrefix> = T extends keyof IdentityJsonByPrefix ? IdentityJsonByPrefix[T] : T extends StepIdentityPrefix ? StepIdentityForPrefix<T> : `${IdentityPrefixFor<T>}-${string}`;
|
|
11
23
|
export declare function getNewIdentity<T extends AnyIdentityPrefix>(identifiable: T): NewIdentity<T>;
|
|
12
24
|
export declare function getNewStepIdentityPrefix<K extends StepKind>(kind: K): (typeof CONSTANTS.STEP_IDENTITY_PREFIX_BY_KIND)[K];
|
|
13
25
|
export declare function getNewStepIdentity<K extends StepKind>(kind: K): Promise<StepIdentityForPrefix<(typeof CONSTANTS.STEP_IDENTITY_PREFIX_BY_KIND)[K]>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolproof-npm/shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.117",
|
|
4
4
|
"description": "Core library utilities for ToolProof",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"toolproof",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"typescript": "^5.9.3"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@toolproof-npm/schema": "^0.1.
|
|
59
|
+
"@toolproof-npm/schema": "^0.1.82",
|
|
60
60
|
"firebase-admin": "^13.6.0"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|