@toolproof-npm/shared 0.1.32 → 0.1.35
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
package/dist/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ResourceTypeIdJson } from '@toolproof-npm/schema';
|
|
2
|
-
import type { FilterConst, ResourceShapeConst,
|
|
3
|
-
export declare function getNewId(identifiable: ResourceShapeConst |
|
|
4
|
-
export declare function listResourceShapesMeta<T extends
|
|
2
|
+
import type { FilterConst, ResourceShapeConst, ResourceRoleConst, StepConst, WorkflowConst, ShapesMeta, ShapesData, ShapesMetaMap, ShapesDataMap, ResourceMetaMap, ResourceDataMap, ResourceConst } from './types.d.ts';
|
|
3
|
+
export declare function getNewId(identifiable: ResourceShapeConst | ResourceRoleConst | ResourceConst | StepConst | WorkflowConst): string;
|
|
4
|
+
export declare function listResourceShapesMeta<T extends ShapesMeta>(groupKey: ResourceShapeConst, filterConfig: Record<FilterConst, boolean>): Promise<ShapesMetaMap<T>>;
|
|
5
5
|
export declare function listResourcesMeta(resourceTypeIds: ResourceTypeIdJson[]): Promise<ResourceMetaMap>;
|
|
6
|
-
export declare function listResourceShapesData<T extends
|
|
6
|
+
export declare function listResourceShapesData<T extends ShapesData>(groupKey: ResourceShapeConst, filterConfig: Record<FilterConst, boolean>): Promise<ShapesDataMap<T>>;
|
|
7
7
|
export declare function listResourcesData(resourceTypeIds: ResourceTypeIdJson[]): Promise<ResourceDataMap>;
|
|
@@ -46,7 +46,7 @@ export async function listResourcesMeta(resourceTypeIds) {
|
|
|
46
46
|
return Object.fromEntries(entries);
|
|
47
47
|
}
|
|
48
48
|
export async function listResourceShapesData(groupKey, filterConfig) {
|
|
49
|
-
const bucket = storageAdmin.bucket(CONSTANTS.STORAGE.BUCKETS.
|
|
49
|
+
const bucket = storageAdmin.bucket(CONSTANTS.STORAGE.BUCKETS.tp_shapes);
|
|
50
50
|
const prefix = `${groupKey}/`;
|
|
51
51
|
const [files] = await bucket.getFiles({ prefix });
|
|
52
52
|
const result = {
|
package/dist/types.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { ResourceIdJson, ExecutionIdJson, ResourceRoleIdJson,
|
|
1
|
+
import type { ResourceIdJson, ExecutionIdJson, ResourceRoleIdJson, ResourceRoleValueJson, ResourceTypeIdJson, ResourceFormatMetaJson, ResourceFormatDataJson, ResourceTypeMetaJson, ResourceTypeDataJson, ResourceMetaJson, ResourceDataJson } from '@toolproof-npm/schema';
|
|
2
2
|
import { CONSTANTS } from './constants.js';
|
|
3
|
-
export type BucketConst = typeof CONSTANTS.STORAGE.BUCKETS.
|
|
3
|
+
export type BucketConst = typeof CONSTANTS.STORAGE.BUCKETS.tp_shapes | typeof CONSTANTS.STORAGE.BUCKETS.tp_resources;
|
|
4
4
|
export type CollectionConst = typeof CONSTANTS.STORAGE.COLLECTIONS.resourceshapes | typeof CONSTANTS.STORAGE.COLLECTIONS.resources;
|
|
5
5
|
export type FilterConst = typeof CONSTANTS.STORAGE.FILTER.members | typeof CONSTANTS.STORAGE.FILTER.specials;
|
|
6
6
|
export type ResourceShapeConst = typeof CONSTANTS.RESOURCESHAPES.formats | typeof CONSTANTS.RESOURCESHAPES.types;
|
|
7
|
-
export type
|
|
7
|
+
export type ResourceRoleConst = typeof CONSTANTS.RESOURCESHAPES_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;
|
|
11
11
|
export type Role = {
|
|
12
12
|
id: ResourceRoleIdJson;
|
|
13
|
-
} &
|
|
14
|
-
export type
|
|
15
|
-
export type
|
|
16
|
-
export type
|
|
17
|
-
export type
|
|
13
|
+
} & ResourceRoleValueJson;
|
|
14
|
+
export type ShapesData = ResourceFormatDataJson | ResourceTypeDataJson;
|
|
15
|
+
export type ShapesMeta = ResourceFormatMetaJson | ResourceTypeMetaJson;
|
|
16
|
+
export type ShapesDataMap<T extends ShapesData> = Record<FilterConst, T[]>;
|
|
17
|
+
export type ShapesMetaMap<T extends ShapesMeta> = Record<FilterConst, T[]>;
|
|
18
18
|
export type ResourceMetaMap = Record<ResourceTypeIdJson, ResourceMetaJson[]>;
|
|
19
19
|
export type ResourceDataMap = Record<ResourceTypeIdJson, ResourceDataJson[]>;
|
|
20
20
|
export type ExternallyProvidedResourceMeta = {
|