@toolproof-npm/shared 0.1.15 → 0.1.20
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
CHANGED
|
@@ -2,18 +2,16 @@ export declare const CONSTANTS: {
|
|
|
2
2
|
readonly SCHEMA: {
|
|
3
3
|
readonly FormatData: "FormatData";
|
|
4
4
|
readonly TypeData: "TypeData";
|
|
5
|
-
readonly SignatureData: "SignatureData";
|
|
6
|
-
readonly JobData: "JobData";
|
|
7
5
|
readonly Execution: "Execution";
|
|
8
6
|
readonly ResourceMap: "ResourceMap";
|
|
9
7
|
};
|
|
10
8
|
readonly STORAGE: {
|
|
11
9
|
readonly BUCKETS: {
|
|
12
|
-
readonly
|
|
10
|
+
readonly tp_archetypes: "tp-archetypes";
|
|
13
11
|
readonly tp_resources: "tp-resources";
|
|
14
12
|
};
|
|
15
13
|
readonly COLLECTIONS: {
|
|
16
|
-
readonly
|
|
14
|
+
readonly archetypes: "archetypes";
|
|
17
15
|
readonly resources: "resources";
|
|
18
16
|
};
|
|
19
17
|
readonly FILTER: {
|
|
@@ -21,11 +19,11 @@ export declare const CONSTANTS: {
|
|
|
21
19
|
readonly specials: "specials";
|
|
22
20
|
};
|
|
23
21
|
};
|
|
24
|
-
readonly
|
|
22
|
+
readonly ARCHETYPES: {
|
|
25
23
|
readonly formats: "formats";
|
|
26
24
|
readonly types: "types";
|
|
27
25
|
};
|
|
28
|
-
readonly
|
|
26
|
+
readonly ARCHETYPES_PSEUDO: {
|
|
29
27
|
readonly roles: "roles";
|
|
30
28
|
};
|
|
31
29
|
readonly RESOURCES: {
|
|
@@ -56,8 +54,8 @@ export declare const CONSTANTS: {
|
|
|
56
54
|
readonly TYPE_WorkflowSpec: "TYPE-WorkflowSpec";
|
|
57
55
|
readonly ROLE_BUILDER: "ROLE-Builder";
|
|
58
56
|
readonly JOB_Engine: "JOB-Engine";
|
|
59
|
-
readonly BOOLEAN_false: "RESOURCE-
|
|
60
|
-
readonly BOOLEAN_true: "RESOURCE-
|
|
57
|
+
readonly BOOLEAN_false: "RESOURCE-c2kAldyzgNhLdF79p0Vt";
|
|
58
|
+
readonly BOOLEAN_true: "RESOURCE-FHycY5TxwEBngKVhkv2j";
|
|
61
59
|
};
|
|
62
60
|
readonly TESTING: {
|
|
63
61
|
readonly Integer_Zero: "TYPE-Integer/3335e31095a13a9a2b0ea41ca7d92a458780cd5671dc0a440a72cc1b1c4f2c81";
|
package/dist/constants.js
CHANGED
|
@@ -2,18 +2,16 @@ export const CONSTANTS = {
|
|
|
2
2
|
SCHEMA: {
|
|
3
3
|
FormatData: 'FormatData',
|
|
4
4
|
TypeData: 'TypeData',
|
|
5
|
-
SignatureData: 'SignatureData',
|
|
6
|
-
JobData: 'JobData',
|
|
7
5
|
Execution: 'Execution',
|
|
8
6
|
ResourceMap: 'ResourceMap',
|
|
9
7
|
},
|
|
10
8
|
STORAGE: {
|
|
11
9
|
BUCKETS: {
|
|
12
|
-
|
|
10
|
+
tp_archetypes: 'tp-archetypes',
|
|
13
11
|
tp_resources: 'tp-resources',
|
|
14
12
|
},
|
|
15
13
|
COLLECTIONS: {
|
|
16
|
-
|
|
14
|
+
archetypes: 'archetypes',
|
|
17
15
|
resources: 'resources',
|
|
18
16
|
},
|
|
19
17
|
FILTER: {
|
|
@@ -21,11 +19,11 @@ export const CONSTANTS = {
|
|
|
21
19
|
specials: 'specials',
|
|
22
20
|
}
|
|
23
21
|
},
|
|
24
|
-
|
|
22
|
+
ARCHETYPES: {
|
|
25
23
|
formats: 'formats',
|
|
26
24
|
types: 'types',
|
|
27
25
|
},
|
|
28
|
-
|
|
26
|
+
ARCHETYPES_PSEUDO: {
|
|
29
27
|
roles: 'roles',
|
|
30
28
|
},
|
|
31
29
|
RESOURCES: {
|
|
@@ -56,8 +54,8 @@ export const CONSTANTS = {
|
|
|
56
54
|
TYPE_WorkflowSpec: 'TYPE-WorkflowSpec',
|
|
57
55
|
ROLE_BUILDER: 'ROLE-Builder',
|
|
58
56
|
JOB_Engine: 'JOB-Engine',
|
|
59
|
-
BOOLEAN_false: 'RESOURCE-
|
|
60
|
-
BOOLEAN_true: 'RESOURCE-
|
|
57
|
+
BOOLEAN_false: 'RESOURCE-c2kAldyzgNhLdF79p0Vt',
|
|
58
|
+
BOOLEAN_true: 'RESOURCE-FHycY5TxwEBngKVhkv2j',
|
|
61
59
|
},
|
|
62
60
|
TESTING: {
|
|
63
61
|
Integer_Zero: 'TYPE-Integer/3335e31095a13a9a2b0ea41ca7d92a458780cd5671dc0a440a72cc1b1c4f2c81',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TypeIdJson } from '@toolproof-npm/schema';
|
|
2
|
-
import type { FilterConst,
|
|
3
|
-
export declare function getNewId(identifiable:
|
|
4
|
-
export declare function
|
|
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
|
|
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.
|
|
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
|
|
10
|
+
export async function listArchetypesMeta(groupKey, filterConfig) {
|
|
11
11
|
const baseRef = dbAdmin
|
|
12
|
-
.collection(CONSTANTS.STORAGE.COLLECTIONS.
|
|
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
|
|
49
|
-
const bucket = storageAdmin.bucket(CONSTANTS.STORAGE.BUCKETS.
|
|
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.
|
|
4
|
-
export type CollectionConst = typeof CONSTANTS.STORAGE.COLLECTIONS.
|
|
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
|
|
7
|
-
export type RoleConst = typeof CONSTANTS.
|
|
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
|
|
20
|
-
export type
|
|
21
|
-
export type
|
|
22
|
-
export type
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolproof-npm/shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "Core library utilities for ToolProof",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"toolproof",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"typescript": "^5.9.3"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@toolproof-npm/schema": "^0.1.
|
|
58
|
+
"@toolproof-npm/schema": "^0.1.20",
|
|
59
59
|
"firebase-admin": "^13.6.0"
|
|
60
60
|
}
|
|
61
61
|
}
|