@toolproof-npm/shared 0.1.14 → 0.1.18

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/README.md CHANGED
@@ -1,55 +1,56 @@
1
- # @toolproof-npm/shared
2
-
3
- Core library utilities for ToolProof.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- pnpm add @toolproof-npm/shared
9
- # or
10
- npm install @toolproof-npm/shared
11
- # or
12
- yarn add @toolproof-npm/shared
13
- ```
14
-
15
- ## Usage
16
-
17
- ### Basic Import
18
-
19
- ```typescript
20
- import { /* your exports */ } from '@toolproof-npm/shared';
21
- ```
22
-
23
- ### Constants
24
-
25
- ```typescript
26
- import { /* constants */ } from '@toolproof-npm/shared/constants';
27
- ```
28
-
29
- ### Types
30
-
31
- ```typescript
32
- import { /* types */ } from '@toolproof-npm/shared/types';
33
- ```
34
-
35
- ### Server Utilities (Node.js only)
36
-
37
- ```typescript
38
- import { /* server utilities */ } from '@toolproof-npm/shared/server';
39
- ```
40
-
41
- ## Features
42
-
43
- - TypeScript support with full type definitions
44
- - ESM module format
45
- - Tree-shakeable exports
46
- - Server-side utilities for Firestore admin operations
47
-
48
- ## Requirements
49
-
50
- - Node.js 16+
51
- - TypeScript 4.5+ (for TypeScript projects)
52
-
53
- ## License
54
-
55
- MIT
1
+ # @toolproof-npm/shared
2
+
3
+ Core library utilities for ToolProof.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @toolproof-npm/shared
9
+ # or
10
+ npm install @toolproof-npm/shared
11
+ # or
12
+ yarn add @toolproof-npm/shared
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ### Basic Import
18
+
19
+ ```typescript
20
+ import { /* your exports */ } from '@toolproof-npm/shared';
21
+ ```
22
+
23
+ ### Constants
24
+
25
+ ```typescript
26
+ import { /* constants */ } from '@toolproof-npm/shared/constants';
27
+ ```
28
+
29
+ ### Types
30
+
31
+ ```typescript
32
+ import { /* types */ } from '@toolproof-npm/shared/types';
33
+ ```
34
+
35
+ ### Server Utilities (Node.js only)
36
+
37
+ ```typescript
38
+ import { /* server utilities */ } from '@toolproof-npm/shared/server';
39
+ ```
40
+
41
+ ## Features
42
+
43
+ - TypeScript support with full type definitions
44
+ - ESM module format
45
+ - Tree-shakeable exports
46
+ - Server-side utilities for Firestore admin operations
47
+
48
+ ## Requirements
49
+
50
+ - Node.js 16+
51
+ - TypeScript 4.5+ (for TypeScript projects)
52
+
53
+ ## License
54
+
55
+ MIT
56
+
@@ -9,11 +9,11 @@ export declare const CONSTANTS: {
9
9
  };
10
10
  readonly STORAGE: {
11
11
  readonly BUCKETS: {
12
- readonly tp_shapes: "tp-shapes";
12
+ readonly tp_archetypes: "tp-archetypes";
13
13
  readonly tp_resources: "tp-resources";
14
14
  };
15
15
  readonly COLLECTIONS: {
16
- readonly shapes: "shapes";
16
+ readonly archetypes: "archetypes";
17
17
  readonly resources: "resources";
18
18
  };
19
19
  readonly FILTER: {
@@ -21,11 +21,11 @@ export declare const CONSTANTS: {
21
21
  readonly specials: "specials";
22
22
  };
23
23
  };
24
- readonly SHAPES: {
24
+ readonly ARCHETYPES: {
25
25
  readonly formats: "formats";
26
26
  readonly types: "types";
27
27
  };
28
- readonly SHAPES_PSEUDO: {
28
+ readonly ARCHETYPES_PSEUDO: {
29
29
  readonly roles: "roles";
30
30
  };
31
31
  readonly RESOURCES: {
package/dist/constants.js CHANGED
@@ -9,11 +9,11 @@ export const CONSTANTS = {
9
9
  },
10
10
  STORAGE: {
11
11
  BUCKETS: {
12
- tp_shapes: 'tp-shapes',
12
+ tp_archetypes: 'tp-archetypes',
13
13
  tp_resources: 'tp-resources',
14
14
  },
15
15
  COLLECTIONS: {
16
- shapes: 'shapes',
16
+ archetypes: 'archetypes',
17
17
  resources: 'resources',
18
18
  },
19
19
  FILTER: {
@@ -21,11 +21,11 @@ export const CONSTANTS = {
21
21
  specials: 'specials',
22
22
  }
23
23
  },
24
- SHAPES: {
24
+ ARCHETYPES: {
25
25
  formats: 'formats',
26
26
  types: 'types',
27
27
  },
28
- SHAPES_PSEUDO: {
28
+ ARCHETYPES_PSEUDO: {
29
29
  roles: 'roles',
30
30
  },
31
31
  RESOURCES: {
@@ -1,7 +1,7 @@
1
1
  import type { TypeIdJson } from '@toolproof-npm/schema';
2
- import type { FilterConst, ShapeConst, RoleConst, StepConst, WorkflowConst, ShapeMeta, ShapeData, ShapeMetaMap, ShapeDataMap, ResourceMetaMap, ResourceDataMap, ResourceConst } from './types.d.ts';
3
- export declare function getNewId(identifiable: ShapeConst | RoleConst | ResourceConst | StepConst | WorkflowConst): string;
4
- export declare function listShapesMeta<T extends ShapeMeta>(groupKey: ShapeConst, filterConfig: Record<FilterConst, boolean>): Promise<ShapeMetaMap<T>>;
2
+ import type { FilterConst, ArchetypeConst, RoleConst, StepConst, WorkflowConst, ArchetypeMeta, ArchetypeData, ArchetypeMetaMap, ArchetypeDataMap, ResourceMetaMap, ResourceDataMap, ResourceConst } from './types.d.ts';
3
+ export declare function getNewId(identifiable: ArchetypeConst | RoleConst | ResourceConst | StepConst | WorkflowConst): string;
4
+ export declare function listArchetypesMeta<T extends ArchetypeMeta>(groupKey: ArchetypeConst, filterConfig: Record<FilterConst, boolean>): Promise<ArchetypeMetaMap<T>>;
5
5
  export declare function listResourcesMeta(typeIds: TypeIdJson[]): Promise<ResourceMetaMap>;
6
- export declare function listShapesData<T extends ShapeData>(groupKey: ShapeConst, filterConfig: Record<FilterConst, boolean>): Promise<ShapeDataMap<T>>;
6
+ export declare function listArchetypesData<T extends ArchetypeData>(groupKey: ArchetypeConst, filterConfig: Record<FilterConst, boolean>): Promise<ArchetypeDataMap<T>>;
7
7
  export declare function listResourcesData(typeIds: TypeIdJson[]): Promise<ResourceDataMap>;
@@ -4,12 +4,12 @@ export function getNewId(identifiable) {
4
4
  const base = identifiable.toUpperCase();
5
5
  const normalized = base.endsWith('S') ? base.slice(0, -1) : base;
6
6
  const prefix = normalized + '-';
7
- const docRef = dbAdmin.collection(CONSTANTS.STORAGE.COLLECTIONS.shapes).doc(identifiable).collection(CONSTANTS.STORAGE.FILTER.members).doc();
7
+ const docRef = dbAdmin.collection(CONSTANTS.STORAGE.COLLECTIONS.archetypes).doc(identifiable).collection(CONSTANTS.STORAGE.FILTER.members).doc();
8
8
  return prefix + docRef.id;
9
9
  }
10
- export async function listShapesMeta(groupKey, filterConfig) {
10
+ export async function listArchetypesMeta(groupKey, filterConfig) {
11
11
  const baseRef = dbAdmin
12
- .collection(CONSTANTS.STORAGE.COLLECTIONS.shapes)
12
+ .collection(CONSTANTS.STORAGE.COLLECTIONS.archetypes)
13
13
  .doc(groupKey);
14
14
  const entries = await Promise.all([
15
15
  filterConfig.members
@@ -45,8 +45,8 @@ export async function listResourcesMeta(typeIds) {
45
45
  }));
46
46
  return Object.fromEntries(entries);
47
47
  }
48
- export async function listShapesData(groupKey, filterConfig) {
49
- const bucket = storageAdmin.bucket(CONSTANTS.STORAGE.BUCKETS.tp_shapes);
48
+ export async function listArchetypesData(groupKey, filterConfig) {
49
+ const bucket = storageAdmin.bucket(CONSTANTS.STORAGE.BUCKETS.tp_archetypes);
50
50
  const prefix = `${groupKey}/`;
51
51
  const [files] = await bucket.getFiles({ prefix });
52
52
  const result = {
package/dist/types.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { ResourceIdJson, ExecutionIdJson, RoleIdJson, RoleLiteralJson, TypeIdJson, FormatMetaJson, FormatDataJson, TypeMetaJson, TypeDataJson, ResourceMetaJson, ResourceDataJson } from '@toolproof-npm/schema';
2
2
  import { CONSTANTS } from './constants.js';
3
- export type BucketConst = typeof CONSTANTS.STORAGE.BUCKETS.tp_shapes | typeof CONSTANTS.STORAGE.BUCKETS.tp_resources;
4
- export type CollectionConst = typeof CONSTANTS.STORAGE.COLLECTIONS.shapes | typeof CONSTANTS.STORAGE.COLLECTIONS.resources;
3
+ export type BucketConst = typeof CONSTANTS.STORAGE.BUCKETS.tp_archetypes | typeof CONSTANTS.STORAGE.BUCKETS.tp_resources;
4
+ export type CollectionConst = typeof CONSTANTS.STORAGE.COLLECTIONS.archetypes | typeof CONSTANTS.STORAGE.COLLECTIONS.resources;
5
5
  export type FilterConst = typeof CONSTANTS.STORAGE.FILTER.members | typeof CONSTANTS.STORAGE.FILTER.specials;
6
- export type ShapeConst = typeof CONSTANTS.SHAPES.formats | typeof CONSTANTS.SHAPES.types;
7
- export type RoleConst = typeof CONSTANTS.SHAPES_PSEUDO.roles;
6
+ export type ArchetypeConst = typeof CONSTANTS.ARCHETYPES.formats | typeof CONSTANTS.ARCHETYPES.types;
7
+ export type RoleConst = typeof CONSTANTS.ARCHETYPES_PSEUDO.roles;
8
8
  export type ResourceConst = typeof CONSTANTS.RESOURCES.resources;
9
9
  export type StepConst = typeof CONSTANTS.STEP.work | typeof CONSTANTS.STEP.branch | typeof CONSTANTS.STEP.while | typeof CONSTANTS.STEP.for;
10
10
  export type WorkflowConst = typeof CONSTANTS.WORKFLOW.workflow | typeof CONSTANTS.WORKFLOW.workflowSpec | typeof CONSTANTS.WORKFLOW.execution;
@@ -16,10 +16,10 @@ export interface DryRunManagerType {
16
16
  export type Role = {
17
17
  id: RoleIdJson;
18
18
  } & RoleLiteralJson;
19
- export type ShapeData = FormatDataJson | TypeDataJson;
20
- export type ShapeMeta = FormatMetaJson | TypeMetaJson;
21
- export type ShapeDataMap<T extends ShapeData> = Record<FilterConst, T[]>;
22
- export type ShapeMetaMap<T extends ShapeMeta> = Record<FilterConst, T[]>;
19
+ export type ArchetypeData = FormatDataJson | TypeDataJson;
20
+ export type ArchetypeMeta = FormatMetaJson | TypeMetaJson;
21
+ export type ArchetypeDataMap<T extends ArchetypeData> = Record<FilterConst, T[]>;
22
+ export type ArchetypeMetaMap<T extends ArchetypeMeta> = Record<FilterConst, T[]>;
23
23
  export type ResourceMetaMap = Record<TypeIdJson, ResourceMetaJson[]>;
24
24
  export type ResourceDataMap = Record<TypeIdJson, ResourceDataJson[]>;
25
25
  export type ExternallyProvidedResourceMeta = {
package/package.json CHANGED
@@ -1,61 +1,61 @@
1
- {
2
- "name": "@toolproof-npm/shared",
3
- "version": "0.1.14",
4
- "description": "Core library utilities for ToolProof",
5
- "keywords": [
6
- "toolproof",
7
- "utilities",
8
- "library"
9
- ],
10
- "author": "ToolProof Team",
11
- "license": "MIT",
12
- "repository": {
13
- "type": "git",
14
- "url": "https://github.com/ToolProof/core.git",
15
- "directory": "packages/_lib"
16
- },
17
- "homepage": "https://github.com/ToolProof/core#readme",
18
- "bugs": {
19
- "url": "https://github.com/ToolProof/core/issues"
20
- },
21
- "type": "module",
22
- "main": "dist/index.js",
23
- "types": "dist/index.d.ts",
24
- "sideEffects": false,
25
- "exports": {
26
- ".": {
27
- "import": "./dist/index.js",
28
- "types": "./dist/index.d.ts"
29
- },
30
- "./constants": {
31
- "import": "./dist/constants.js",
32
- "types": "./dist/constants.d.ts"
33
- },
34
- "./types": {
35
- "import": "./dist/types.js",
36
- "types": "./dist/types.d.ts"
37
- },
38
- "./server": {
39
- "node": "./dist/firestoreAdminHelpers.js",
40
- "types": "./dist/firestoreAdminHelpers.d.ts"
41
- }
42
- },
43
- "scripts": {
44
- "build": "tsc -b"
45
- },
46
- "files": [
47
- "dist",
48
- "README.md"
49
- ],
50
- "devDependencies": {
51
- "@google-cloud/storage": "^7.17.3",
52
- "@types/node": "^20.19.25",
53
- "json-schema-to-typescript": "^15.0.4",
54
- "ts-node": "^10.9.2",
55
- "typescript": "^5.9.3"
56
- },
57
- "dependencies": {
58
- "@toolproof-npm/schema": "^0.1.12",
59
- "firebase-admin": "^13.6.0"
60
- }
1
+ {
2
+ "name": "@toolproof-npm/shared",
3
+ "version": "0.1.18",
4
+ "description": "Core library utilities for ToolProof",
5
+ "keywords": [
6
+ "toolproof",
7
+ "utilities",
8
+ "library"
9
+ ],
10
+ "author": "ToolProof Team",
11
+ "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/ToolProof/core.git",
15
+ "directory": "packages/_lib"
16
+ },
17
+ "homepage": "https://github.com/ToolProof/core#readme",
18
+ "bugs": {
19
+ "url": "https://github.com/ToolProof/core/issues"
20
+ },
21
+ "type": "module",
22
+ "main": "dist/index.js",
23
+ "types": "dist/index.d.ts",
24
+ "sideEffects": false,
25
+ "exports": {
26
+ ".": {
27
+ "import": "./dist/index.js",
28
+ "types": "./dist/index.d.ts"
29
+ },
30
+ "./constants": {
31
+ "import": "./dist/constants.js",
32
+ "types": "./dist/constants.d.ts"
33
+ },
34
+ "./types": {
35
+ "import": "./dist/types.js",
36
+ "types": "./dist/types.d.ts"
37
+ },
38
+ "./server": {
39
+ "node": "./dist/firestoreAdminHelpers.js",
40
+ "types": "./dist/firestoreAdminHelpers.d.ts"
41
+ }
42
+ },
43
+ "scripts": {
44
+ "build": "tsc -b"
45
+ },
46
+ "files": [
47
+ "dist",
48
+ "README.md"
49
+ ],
50
+ "devDependencies": {
51
+ "@google-cloud/storage": "^7.17.3",
52
+ "@types/node": "^20.19.25",
53
+ "json-schema-to-typescript": "^15.0.4",
54
+ "ts-node": "^10.9.2",
55
+ "typescript": "^5.9.3"
56
+ },
57
+ "dependencies": {
58
+ "@toolproof-npm/schema": "^0.1.20",
59
+ "firebase-admin": "^13.6.0"
60
+ }
61
61
  }