@toolproof-npm/schema 0.1.22 → 0.1.26

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.
@@ -111,27 +111,27 @@ export type Execution = Identifiable & {
111
111
  * This interface was referenced by `GenesisJson`'s JSON-Schema
112
112
  * via the `definition` "ExecutionId".
113
113
  */
114
- export type ExecutionId = `EXECUTION-${string}`;
114
+ export type ExecutionId = string;
115
115
  /**
116
116
  * This interface was referenced by `GenesisJson`'s JSON-Schema
117
117
  * via the `definition` "ResourceId".
118
118
  */
119
- export type ResourceId = `RESOURCE-${string}`;
119
+ export type ResourceId = string;
120
120
  /**
121
121
  * This interface was referenced by `GenesisJson`'s JSON-Schema
122
122
  * via the `definition` "WorkStepId".
123
123
  */
124
- export type WorkStepId = `WORKSTEP-${string}`;
124
+ export type WorkStepId = string;
125
125
  /**
126
126
  * This interface was referenced by `GenesisJson`'s JSON-Schema
127
127
  * via the `definition` "BranchStepId".
128
128
  */
129
- export type BranchStepId = `BRANCHSTEP-${string}`;
129
+ export type BranchStepId = string;
130
130
  /**
131
131
  * This interface was referenced by `GenesisJson`'s JSON-Schema
132
132
  * via the `definition` "RoleId".
133
133
  */
134
- export type RoleId = `ROLE-${string}`;
134
+ export type RoleId = string;
135
135
  /**
136
136
  * This interface was referenced by `GenesisJson`'s JSON-Schema
137
137
  * via the `definition` "Documented".
@@ -226,7 +226,7 @@ export type ForStep = Identifiable &
226
226
  * This interface was referenced by `GenesisJson`'s JSON-Schema
227
227
  * via the `definition` "ForStepId".
228
228
  */
229
- export type ForStepId = `FORSTEP-${string}`;
229
+ export type ForStepId = string;
230
230
  /**
231
231
  * This interface was referenced by `GenesisJson`'s JSON-Schema
232
232
  * via the `definition` "FormatBase".
@@ -243,7 +243,7 @@ export type IdentifiableDocumented = Identifiable & Documented;
243
243
  * This interface was referenced by `GenesisJson`'s JSON-Schema
244
244
  * via the `definition` "FormatId".
245
245
  */
246
- export type FormatId = `FORMAT-${string}`;
246
+ export type FormatId = string;
247
247
  /**
248
248
  * This interface was referenced by `GenesisJson`'s JSON-Schema
249
249
  * via the `definition` "FormatData".
@@ -307,7 +307,7 @@ export type ResourceBase = Identifiable & {
307
307
  * This interface was referenced by `GenesisJson`'s JSON-Schema
308
308
  * via the `definition` "TypeId".
309
309
  */
310
- export type TypeId = `TYPE-${string}`;
310
+ export type TypeId = string;
311
311
  export type ResourceCanonicalMeta = ResourceBase &
312
312
  ResourceKind & {
313
313
  kind: "realized";
@@ -379,7 +379,7 @@ export type WhileStep = Identifiable &
379
379
  * This interface was referenced by `GenesisJson`'s JSON-Schema
380
380
  * via the `definition` "WhileStepId".
381
381
  */
382
- export type WhileStepId = `WHILESTEP-${string}`;
382
+ export type WhileStepId = string;
383
383
  /**
384
384
  * This interface was referenced by `GenesisJson`'s JSON-Schema
385
385
  * via the `definition` "StepId".
@@ -417,7 +417,7 @@ export type Workflow = Identifiable & {
417
417
  * This interface was referenced by `GenesisJson`'s JSON-Schema
418
418
  * via the `definition` "WorkflowId".
419
419
  */
420
- export type WorkflowId = `WORKFLOW-${string}`;
420
+ export type WorkflowId = string;
421
421
  /**
422
422
  * This interface was referenced by `GenesisJson`'s JSON-Schema
423
423
  * via the `definition` "WorkflowSpec".
@@ -431,7 +431,7 @@ export type WorkflowSpec = Identifiable & {
431
431
  * This interface was referenced by `GenesisJson`'s JSON-Schema
432
432
  * via the `definition` "WorkflowSpecId".
433
433
  */
434
- export type WorkflowSpecId = `WORKFLOWSPEC-${string}`;
434
+ export type WorkflowSpecId = string;
435
435
  /**
436
436
  * This interface was referenced by `GenesisJson`'s JSON-Schema
437
437
  * via the `definition` "ResourceCanonicalMeta".
@@ -620,7 +620,7 @@ export interface Timestamp {
620
620
  * This interface was referenced by `GenesisJson`'s JSON-Schema
621
621
  * via the `definition` "ResourceMap".
622
622
  */
623
- export type ResourceMap = Record<ExecutionId, Record<RoleId, ResourcePotential | ResourceData>>;
623
+ export type ResourceMap = Record<ExecutionId, Record<RoleId, ResourcePotentialInput | ResourcePotentialOutput | ResourceData>>;
624
624
  /**
625
625
  * This interface was referenced by `GenesisJson`'s JSON-Schema
626
626
  * via the `definition` "RoleBindingsOuter".
@@ -1,17 +1,17 @@
1
1
  import type { ExecutionId, ResourceId, WorkStepId, BranchStepId, ForStepId, FormatId, TypeId, RoleId, WhileStepId, WorkflowId, WorkflowSpecId } from "../_lib/types/types.js";
2
2
  /** Generic unsafe brand helper when a bespoke factory is not available. */
3
3
  export declare function unsafeBrand<T extends string>(s: string): T;
4
- export declare const asTypeId: (s: string) => `TYPE-${string}`;
5
- export declare const asRoleId: (s: string) => `ROLE-${string}`;
6
- export declare const asExecutionId: (s: string) => `EXECUTION-${string}`;
7
- export declare const asResourceId: (s: string) => `RESOURCE-${string}`;
8
- export declare const asWorkStepId: (s: string) => `WORKSTEP-${string}`;
9
- export declare const asBranchStepId: (s: string) => `BRANCHSTEP-${string}`;
10
- export declare const asForStepId: (s: string) => `FORSTEP-${string}`;
11
- export declare const asFormatId: (s: string) => `FORMAT-${string}`;
12
- export declare const asWhileStepId: (s: string) => `WHILESTEP-${string}`;
13
- export declare const asWorkflowId: (s: string) => `WORKFLOW-${string}`;
14
- export declare const asWorkflowSpecId: (s: string) => `WORKFLOWSPEC-${string}`;
4
+ export declare const asTypeId: (s: string) => string;
5
+ export declare const asRoleId: (s: string) => string;
6
+ export declare const asExecutionId: (s: string) => string;
7
+ export declare const asResourceId: (s: string) => string;
8
+ export declare const asWorkStepId: (s: string) => string;
9
+ export declare const asBranchStepId: (s: string) => string;
10
+ export declare const asForStepId: (s: string) => string;
11
+ export declare const asFormatId: (s: string) => string;
12
+ export declare const asWhileStepId: (s: string) => string;
13
+ export declare const asWorkflowId: (s: string) => string;
14
+ export declare const asWorkflowSpecId: (s: string) => string;
15
15
  export declare const asTypeIds: (xs: string[]) => TypeId[];
16
16
  export declare const asRoleIds: (xs: string[]) => RoleId[];
17
17
  export declare const asExecutionIds: (xs: string[]) => ExecutionId[];
@@ -325,7 +325,7 @@ async function main() {
325
325
  const tmpl = idTemplates[typeName];
326
326
  return `${p1}${typeName}${p3}${tmpl ?? 'string'};`;
327
327
  });
328
- ts = ts.replace(/^(export\s+type\s+)([A-Za-z_][A-Za-z0-9_]*Id)(\s*=\s*)string\s*;$/gm, (_m, p1, typeName, p3) => {
328
+ ts = ts.replace(/^(export\s+type\s+)([A-Za-z_][A-ZaZ0-9_]*Id)(\s*=\s*)string\s*;$/gm, (_m, p1, typeName, p3) => {
329
329
  const tmpl = idTemplates[typeName];
330
330
  return `${p1}${typeName}${p3}${tmpl ?? 'string'};`;
331
331
  });
@@ -333,7 +333,7 @@ async function main() {
333
333
  // Replace index-signature interfaces with Record<IdType, ValueType> so object literal keys are checked.
334
334
  ts = ts.replace(/export interface RoleMap\s*{[^}]*}/g, 'export type RoleMap = Record<RoleId, RoleLiteral>;');
335
335
  ts = ts.replace(/export interface RoleBindingMap\s*{[^}]*}/g, 'export type RoleBindingMap = Record<RoleId, ResourceId>;');
336
- ts = ts.replace(/export interface ResourceMap\s*\{[^}]*\{[^}]*\}[^}]*\}/gs, 'export type ResourceMap = Record<ExecutionId, Record<RoleId, ResourcePotential | ResourceData>>;');
336
+ ts = ts.replace(/export interface ResourceMap\s*\{[^}]*\{[^}]*\}[^}]*\}/gs, 'export type ResourceMap = Record<ExecutionId, Record<RoleId, ResourcePotentialInput | ResourcePotentialOutput | ResourceData>>;');
337
337
  parts.push(ts);
338
338
  let output = parts.join('\n');
339
339
  // Final guard: strip any lingering `[k: string]: unknown;` that might have been
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolproof-npm/schema",
3
- "version": "0.1.22",
3
+ "version": "0.1.26",
4
4
  "description": "JSON schemas and TypeScript types for ToolProof",
5
5
  "keywords": ["toolproof", "schemas", "json-schema", "typescript"],
6
6
  "author": "ToolProof Team",