@toolproof-npm/shared 0.1.114 → 0.1.115

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.
@@ -2,7 +2,7 @@ import type { ResourceJson, ResourceRoleIdentityJson, ResourceRoleValueJson, Res
2
2
  import { CONSTANTS } from '../constants.js';
3
3
  export type BucketConst = typeof CONSTANTS.STORAGE.BUCKETS.tp_resources;
4
4
  export type CollectionConst = keyof typeof CONSTANTS.STORAGE.COLLECTIONS;
5
- export type IDENTITY_PREFIX = keyof typeof CONSTANTS.IDENTITY_PREFIXES;
5
+ export type IdentityPrefix = keyof typeof CONSTANTS.IDENTITY_PREFIXES;
6
6
  export type StepConst = keyof typeof CONSTANTS.STEPS;
7
7
  export type Role = {
8
8
  identity: ResourceRoleIdentityJson;
@@ -1,6 +1,6 @@
1
1
  import type { ExecutionJson, StatefulStrategyJson, StrategyRunJson, StrategyRunStatusJson, StrategyStateJson } from '@toolproof-npm/schema';
2
- import type { IDENTITY_PREFIX } from '../types.js';
3
- export type GetNewIdentity = (identifiable: IDENTITY_PREFIX) => string | Promise<string>;
2
+ import type { IdentityPrefix } from '../types.js';
3
+ export type GetNewIdentity = (identifiable: IdentityPrefix) => string | Promise<string>;
4
4
  export declare function normalizeExecutionInputBindingMap(execution: ExecutionJson, strategyState: StrategyStateJson): ExecutionJson;
5
5
  export declare function createStrategyRun(statefulStrategy: StatefulStrategyJson, opts?: {
6
6
  getNewIdentity: GetNewIdentity;
@@ -1,12 +1,12 @@
1
1
  import type { BranchStepIdentityJson, ExecutionIdentityJson, ForStepIdentityJson, IdentityByPrefix, ResourceTypeIdentityJson, WhileStepIdentityJson, WorkStepIdentityJson } from '@toolproof-npm/schema';
2
- import type { ResourceMap, IDENTITY_PREFIX } from './_lib/types.js';
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;
5
5
  type IdentityPrefixFor<T extends string> = StripTrailingS<Uppercase<T>>;
6
6
  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
- type AnyIdentityPrefix = IDENTITY_PREFIX | StepIdentityPrefix;
9
+ type AnyIdentityPrefix = IdentityPrefix | StepIdentityPrefix;
10
10
  export type NewIdentity<T extends AnyIdentityPrefix = AnyIdentityPrefix> = T extends keyof IdentityByPrefix ? IdentityByPrefix[T] : T extends StepIdentityPrefix ? StepIdentityForPrefix<T> : `${IdentityPrefixFor<T>}-${string}`;
11
11
  export declare function getNewIdentity<T extends AnyIdentityPrefix>(identifiable: T): NewIdentity<T>;
12
12
  export declare function getNewStepIdentityPrefix<K extends StepKind>(kind: K): (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.114",
3
+ "version": "0.1.115",
4
4
  "description": "Core library utilities for ToolProof",
5
5
  "keywords": [
6
6
  "toolproof",