@toolproof-npm/shared 0.1.88 → 0.1.90
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 +56 -56
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/firebaseAdminHelpers.js +5 -1
- package/package.json +59 -59
package/README.md
CHANGED
|
@@ -1,56 +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
|
|
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
|
|
56
|
+
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -9,8 +9,12 @@ export function getNewIdentity(identifiable) {
|
|
|
9
9
|
}
|
|
10
10
|
export async function listResources(// ATTENTION: must clean up
|
|
11
11
|
resourceTypeRefs) {
|
|
12
|
-
const
|
|
12
|
+
const bucket_resources = storageAdmin.bucket(CONSTANTS.STORAGE.BUCKETS.tp_resources);
|
|
13
|
+
const bucket_strategies = storageAdmin.bucket(CONSTANTS.STORAGE.BUCKETS.tp_strategies);
|
|
13
14
|
async function fetchFilesUnder(resourceTypeRef) {
|
|
15
|
+
const bucket = resourceTypeRef === CONSTANTS.SPECIALS.TYPE_StatefulStrategy
|
|
16
|
+
? bucket_strategies
|
|
17
|
+
: bucket_resources;
|
|
14
18
|
const prefix = `${resourceTypeRef}/`;
|
|
15
19
|
const [found] = await bucket.getFiles({ prefix });
|
|
16
20
|
const files = found.filter(f => {
|
package/package.json
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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"
|
|
2
|
+
"name": "@toolproof-npm/shared",
|
|
3
|
+
"version": "0.1.90",
|
|
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/shared"
|
|
29
16
|
},
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
"homepage": "https://github.com/ToolProof/core#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/ToolProof/core/issues"
|
|
33
20
|
},
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
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/_lib/types.js",
|
|
36
|
+
"types": "./dist/_lib/types.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./utils": {
|
|
39
|
+
"import": "./dist/_lib/utils/utils.js",
|
|
40
|
+
"types": "./dist/_lib/utils/utils.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./server": {
|
|
43
|
+
"node": "./dist/firebaseAdminHelpers.js",
|
|
44
|
+
"types": "./dist/firebaseAdminHelpers.d.ts"
|
|
45
|
+
}
|
|
37
46
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
"types": "./dist/_lib/utils/utils.d.ts"
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsc -b"
|
|
41
49
|
},
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
"files": [
|
|
51
|
+
"dist",
|
|
52
|
+
"README.md"
|
|
53
|
+
],
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@google-cloud/storage": "^7.17.3",
|
|
56
|
+
"@types/node": "^20.19.25",
|
|
57
|
+
"json-schema-to-typescript": "^15.0.4",
|
|
58
|
+
"ts-node": "^10.9.2",
|
|
59
|
+
"typescript": "^5.9.3"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@toolproof-npm/schema": "^0.1.65",
|
|
63
|
+
"firebase-admin": "^13.6.0"
|
|
45
64
|
}
|
|
46
|
-
|
|
47
|
-
"files": [
|
|
48
|
-
"dist",
|
|
49
|
-
"README.md"
|
|
50
|
-
],
|
|
51
|
-
"devDependencies": {
|
|
52
|
-
"@google-cloud/storage": "^7.17.3",
|
|
53
|
-
"@types/node": "^20.19.25",
|
|
54
|
-
"json-schema-to-typescript": "^15.0.4",
|
|
55
|
-
"ts-node": "^10.9.2",
|
|
56
|
-
"typescript": "^5.9.3"
|
|
57
|
-
},
|
|
58
|
-
"dependencies": {
|
|
59
|
-
"@toolproof-npm/schema": "^0.1.65",
|
|
60
|
-
"firebase-admin": "^13.6.0"
|
|
61
|
-
},
|
|
62
|
-
"scripts": {
|
|
63
|
-
"build": "tsc -b"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
65
|
+
}
|