quidproquo-actionprocessor-node 0.0.201 → 0.0.202
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 +88 -88
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
# quidproquo-actionprocessor-node
|
|
2
|
-
|
|
3
|
-
The `quidproquo-actionprocessor-node` library provides a set of generic action processors for the `quidproquo` framework, allowing you to easily integrate common functionality into your Node.js-based applications.
|
|
4
|
-
|
|
5
|
-
## Key Features
|
|
6
|
-
|
|
7
|
-
1. **Comprehensive Action Processors**: This library includes a wide range of action processors that cover various common use cases, such as date/time operations, error handling, event processing, GUID generation, logging, math operations, network requests, platform-specific functionality (e.g., delays), and system-level actions.
|
|
8
|
-
|
|
9
|
-
2. **Extensibility**: The action processor architecture is designed to be highly extensible, allowing you to easily add custom action processors to meet your specific requirements.
|
|
10
|
-
|
|
11
|
-
3. **Dependency Injection**: The action processors are integrated with the `quidproquo` dependency injection system, making it easy to compose and test your application components.
|
|
12
|
-
|
|
13
|
-
4. **Testability**: The action-oriented architecture and asynchronous execution model of `quidproquo-actionprocessor-node` make it highly testable, with support for unit, integration, and end-to-end testing.
|
|
14
|
-
|
|
15
|
-
5. **Portability**: While the `quidproquo-actionprocessor-node` library is designed to run on Node.js, the underlying `quidproquo-core` library is platform-agnostic, allowing you to potentially use these action processors in other environments as well.
|
|
16
|
-
|
|
17
|
-
## Getting Started
|
|
18
|
-
|
|
19
|
-
To use the `quidproquo-actionprocessor-node` library, you'll need to install the package and its dependencies. You can do this using your preferred package manager, such as npm or yarn:
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
npm install quidproquo-actionprocessor-node
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Once you have the package installed, you can start using the provided action processors in your `quidproquo`-based application. The library exports a set of action processors that you can import and use in your code.
|
|
26
|
-
|
|
27
|
-
## Action Processors
|
|
28
|
-
|
|
29
|
-
The `quidproquo-actionprocessor-node` library provides the following action processors:
|
|
30
|
-
|
|
31
|
-
1. **Date/Time Action Processors**:
|
|
32
|
-
- `DateNowActionProcessor`: Retrieves the current date and time as an ISO string.
|
|
33
|
-
|
|
34
|
-
2. **Error Action Processors**:
|
|
35
|
-
- `ErrorThrowErrorActionProcessor`: Throws a custom error with a specified type, text, and stack trace.
|
|
36
|
-
|
|
37
|
-
3. **Event Action Processors**:
|
|
38
|
-
- (No event-specific action processors are currently implemented)
|
|
39
|
-
|
|
40
|
-
4. **GUID Action Processors**:
|
|
41
|
-
- `GuidNewActionProcessor`: Generates a new UUID.
|
|
42
|
-
|
|
43
|
-
5. **Logging Action Processors**:
|
|
44
|
-
- `LogCreateActionProcessor`: Logs a message with a specified log level and optional data.
|
|
45
|
-
|
|
46
|
-
6. **Math Action Processors**:
|
|
47
|
-
- `MathRandomNumberActionProcessor`: Generates a random number.
|
|
48
|
-
|
|
49
|
-
7. **Network Action Processors**:
|
|
50
|
-
- `NetworkRequestActionProcessor`: Performs an HTTP request with various options (method, headers, body, etc.).
|
|
51
|
-
|
|
52
|
-
8. **Platform Action Processors**:
|
|
53
|
-
- `PlatformDelayActionProcessor`: Delays the execution for a specified number of milliseconds.
|
|
54
|
-
|
|
55
|
-
9. **System Action Processors**:
|
|
56
|
-
- `SystemBatchActionProcessor`: Executes a batch of actions and returns the results.
|
|
57
|
-
|
|
58
|
-
10. **User Directory Action Processors**:
|
|
59
|
-
- (No user directory-specific action processors are currently implemented)
|
|
60
|
-
|
|
61
|
-
## Usage
|
|
62
|
-
|
|
63
|
-
To use the action processors provided by `quidproquo-actionprocessor-node`, you can import them into your `quidproquo`-based application and integrate them with your action processor configuration. Here's an example of how you might use the `DateNowActionProcessor`:
|
|
64
|
-
|
|
65
|
-
```typescript
|
|
66
|
-
import { DateNowActionProcessor, actionResult, DateActionType } from 'quidproquo-actionprocessor-node';
|
|
67
|
-
|
|
68
|
-
const processDateNow: DateNowActionProcessor = async () => {
|
|
69
|
-
return actionResult(new Date().toISOString());
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export default {
|
|
73
|
-
[DateActionType.Now]: processDateNow,
|
|
74
|
-
};
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
In this example, we define a `DateNowActionProcessor` function that returns the current date and time as an ISO string. We then export this processor under the `DateActionType.Now` action type, which can be used in our `quidproquo`-based application.
|
|
78
|
-
|
|
79
|
-
## Contribution and Development
|
|
80
|
-
|
|
81
|
-
If you'd like to contribute to the development of `quidproquo-actionprocessor-node`, please refer to the [contributing guidelines](https://github.com/joe-coady/quidproquo/blob/main/CONTRIBUTING.md) for more information.
|
|
82
|
-
|
|
83
|
-
## License
|
|
84
|
-
|
|
85
|
-
`quidproquo-actionprocessor-node` is licensed under the [MIT License](https://github.com/joe-coady/quidproquo/blob/main/LICENSE).
|
|
86
|
-
|
|
87
|
-
## Warning: Not for Production
|
|
88
|
-
|
|
1
|
+
# quidproquo-actionprocessor-node
|
|
2
|
+
|
|
3
|
+
The `quidproquo-actionprocessor-node` library provides a set of generic action processors for the `quidproquo` framework, allowing you to easily integrate common functionality into your Node.js-based applications.
|
|
4
|
+
|
|
5
|
+
## Key Features
|
|
6
|
+
|
|
7
|
+
1. **Comprehensive Action Processors**: This library includes a wide range of action processors that cover various common use cases, such as date/time operations, error handling, event processing, GUID generation, logging, math operations, network requests, platform-specific functionality (e.g., delays), and system-level actions.
|
|
8
|
+
|
|
9
|
+
2. **Extensibility**: The action processor architecture is designed to be highly extensible, allowing you to easily add custom action processors to meet your specific requirements.
|
|
10
|
+
|
|
11
|
+
3. **Dependency Injection**: The action processors are integrated with the `quidproquo` dependency injection system, making it easy to compose and test your application components.
|
|
12
|
+
|
|
13
|
+
4. **Testability**: The action-oriented architecture and asynchronous execution model of `quidproquo-actionprocessor-node` make it highly testable, with support for unit, integration, and end-to-end testing.
|
|
14
|
+
|
|
15
|
+
5. **Portability**: While the `quidproquo-actionprocessor-node` library is designed to run on Node.js, the underlying `quidproquo-core` library is platform-agnostic, allowing you to potentially use these action processors in other environments as well.
|
|
16
|
+
|
|
17
|
+
## Getting Started
|
|
18
|
+
|
|
19
|
+
To use the `quidproquo-actionprocessor-node` library, you'll need to install the package and its dependencies. You can do this using your preferred package manager, such as npm or yarn:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
npm install quidproquo-actionprocessor-node
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Once you have the package installed, you can start using the provided action processors in your `quidproquo`-based application. The library exports a set of action processors that you can import and use in your code.
|
|
26
|
+
|
|
27
|
+
## Action Processors
|
|
28
|
+
|
|
29
|
+
The `quidproquo-actionprocessor-node` library provides the following action processors:
|
|
30
|
+
|
|
31
|
+
1. **Date/Time Action Processors**:
|
|
32
|
+
- `DateNowActionProcessor`: Retrieves the current date and time as an ISO string.
|
|
33
|
+
|
|
34
|
+
2. **Error Action Processors**:
|
|
35
|
+
- `ErrorThrowErrorActionProcessor`: Throws a custom error with a specified type, text, and stack trace.
|
|
36
|
+
|
|
37
|
+
3. **Event Action Processors**:
|
|
38
|
+
- (No event-specific action processors are currently implemented)
|
|
39
|
+
|
|
40
|
+
4. **GUID Action Processors**:
|
|
41
|
+
- `GuidNewActionProcessor`: Generates a new UUID.
|
|
42
|
+
|
|
43
|
+
5. **Logging Action Processors**:
|
|
44
|
+
- `LogCreateActionProcessor`: Logs a message with a specified log level and optional data.
|
|
45
|
+
|
|
46
|
+
6. **Math Action Processors**:
|
|
47
|
+
- `MathRandomNumberActionProcessor`: Generates a random number.
|
|
48
|
+
|
|
49
|
+
7. **Network Action Processors**:
|
|
50
|
+
- `NetworkRequestActionProcessor`: Performs an HTTP request with various options (method, headers, body, etc.).
|
|
51
|
+
|
|
52
|
+
8. **Platform Action Processors**:
|
|
53
|
+
- `PlatformDelayActionProcessor`: Delays the execution for a specified number of milliseconds.
|
|
54
|
+
|
|
55
|
+
9. **System Action Processors**:
|
|
56
|
+
- `SystemBatchActionProcessor`: Executes a batch of actions and returns the results.
|
|
57
|
+
|
|
58
|
+
10. **User Directory Action Processors**:
|
|
59
|
+
- (No user directory-specific action processors are currently implemented)
|
|
60
|
+
|
|
61
|
+
## Usage
|
|
62
|
+
|
|
63
|
+
To use the action processors provided by `quidproquo-actionprocessor-node`, you can import them into your `quidproquo`-based application and integrate them with your action processor configuration. Here's an example of how you might use the `DateNowActionProcessor`:
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
import { DateNowActionProcessor, actionResult, DateActionType } from 'quidproquo-actionprocessor-node';
|
|
67
|
+
|
|
68
|
+
const processDateNow: DateNowActionProcessor = async () => {
|
|
69
|
+
return actionResult(new Date().toISOString());
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default {
|
|
73
|
+
[DateActionType.Now]: processDateNow,
|
|
74
|
+
};
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
In this example, we define a `DateNowActionProcessor` function that returns the current date and time as an ISO string. We then export this processor under the `DateActionType.Now` action type, which can be used in our `quidproquo`-based application.
|
|
78
|
+
|
|
79
|
+
## Contribution and Development
|
|
80
|
+
|
|
81
|
+
If you'd like to contribute to the development of `quidproquo-actionprocessor-node`, please refer to the [contributing guidelines](https://github.com/joe-coady/quidproquo/blob/main/CONTRIBUTING.md) for more information.
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
`quidproquo-actionprocessor-node` is licensed under the [MIT License](https://github.com/joe-coady/quidproquo/blob/main/LICENSE).
|
|
86
|
+
|
|
87
|
+
## Warning: Not for Production
|
|
88
|
+
|
|
89
89
|
**This project is currently under active development and should not be used in production environments. The APIs and functionality are subject to change without notice.**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-actionprocessor-node",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.202",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"@anthropic-ai/sdk": "^0.19.1",
|
|
33
33
|
"axios": "^1.2.1",
|
|
34
34
|
"mime-types": "^2.1.35",
|
|
35
|
-
"quidproquo-core": "0.0.
|
|
35
|
+
"quidproquo-core": "0.0.202",
|
|
36
36
|
"uuid": "^9.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/mime-types": "^2.1.1",
|
|
40
40
|
"@types/uuid": "^9.0.0",
|
|
41
|
-
"quidproquo-tsconfig": "0.0.
|
|
41
|
+
"quidproquo-tsconfig": "0.0.202",
|
|
42
42
|
"typescript": "^4.9.3"
|
|
43
43
|
}
|
|
44
44
|
}
|