@meshtrade/api-node 1.30.2 → 1.31.0
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/meshtrade/compliance/client/v1/client_pb.d.ts +17 -9
- package/dist/meshtrade/compliance/client/v1/client_pb.js +1 -1
- package/dist/meshtrade/compliance/client/v1/service_node_meshts.d.ts +46 -21
- package/dist/meshtrade/compliance/client/v1/service_node_meshts.js +98 -56
- package/dist/meshtrade/config/index.d.ts +160 -0
- package/dist/meshtrade/config/index.js +210 -0
- package/dist/meshtrade/iam/api_user/v1/api_user_pb.d.ts +12 -4
- package/dist/meshtrade/iam/api_user/v1/api_user_pb.js +1 -1
- package/dist/meshtrade/iam/api_user/v1/service_node_meshts.d.ts +46 -21
- package/dist/meshtrade/iam/api_user/v1/service_node_meshts.js +149 -65
- package/dist/meshtrade/iam/group/v1/group_pb.d.ts +8 -0
- package/dist/meshtrade/iam/group/v1/group_pb.js +1 -1
- package/dist/meshtrade/iam/group/v1/service_node_meshts.d.ts +46 -21
- package/dist/meshtrade/iam/group/v1/service_node_meshts.js +114 -58
- package/dist/meshtrade/iam/user/v1/service_node_meshts.d.ts +46 -21
- package/dist/meshtrade/iam/user/v1/service_node_meshts.js +141 -64
- package/dist/meshtrade/iam/user/v1/user_pb.d.ts +10 -2
- package/dist/meshtrade/iam/user/v1/user_pb.js +1 -1
- package/dist/meshtrade/{common/connectInterceptors.d.ts → interceptors/index.d.ts} +6 -64
- package/dist/meshtrade/{common/connectInterceptors.js → interceptors/index.js} +20 -90
- package/dist/meshtrade/ledger/transaction/v1/service_node_meshts.d.ts +46 -21
- package/dist/meshtrade/ledger/transaction/v1/service_node_meshts.js +90 -55
- package/dist/meshtrade/market_data/price/v1/service_node_meshts.d.ts +46 -21
- package/dist/meshtrade/market_data/price/v1/service_node_meshts.js +82 -54
- package/dist/meshtrade/reporting/account_report/v1/service_node_meshts.d.ts +46 -21
- package/dist/meshtrade/reporting/account_report/v1/service_node_meshts.js +90 -55
- package/dist/meshtrade/studio/instrument/v1/instrument_pb.d.ts +8 -0
- package/dist/meshtrade/studio/instrument/v1/instrument_pb.js +1 -1
- package/dist/meshtrade/trading/limit_order/v1/limit_order_pb.d.ts +16 -8
- package/dist/meshtrade/trading/limit_order/v1/limit_order_pb.js +1 -1
- package/dist/meshtrade/trading/limit_order/v1/service_node_meshts.d.ts +46 -21
- package/dist/meshtrade/trading/limit_order/v1/service_node_meshts.js +133 -63
- package/dist/meshtrade/trading/market_order/v1/service_node_meshts.d.ts +46 -21
- package/dist/meshtrade/trading/market_order/v1/service_node_meshts.js +82 -54
- package/dist/meshtrade/wallet/account/v1/account_pb.d.ts +8 -0
- package/dist/meshtrade/wallet/account/v1/account_pb.js +1 -1
- package/dist/meshtrade/wallet/account/v1/service_node_meshts.d.ts +46 -21
- package/dist/meshtrade/wallet/account/v1/service_node_meshts.js +149 -65
- package/package.json +19 -2
- package/dist/meshtrade/common/config.d.ts +0 -50
- package/dist/meshtrade/common/config.js +0 -34
- package/dist/meshtrade/common/validation.d.ts +0 -62
- package/dist/meshtrade/common/validation.js +0 -77
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Generic validation utilities for Meshtrade API resource names and identifiers.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isValidULID = isValidULID;
|
|
7
|
-
exports.isValidGroupResourceName = isValidGroupResourceName;
|
|
8
|
-
exports.validateRequest = validateRequest;
|
|
9
|
-
/**
|
|
10
|
-
* Validates if a string is a valid ULID (Universally Unique Lexicographically Sortable Identifier).
|
|
11
|
-
*
|
|
12
|
-
* Note: This implementation uses a simplified character set for ULIDs that includes
|
|
13
|
-
* all uppercase letters A-Z and digits 0-9, unlike the standard ULID specification
|
|
14
|
-
* which excludes certain ambiguous characters (I, L, O, U).
|
|
15
|
-
*
|
|
16
|
-
* ULIDs in this system are 26-character identifiers that are:
|
|
17
|
-
* - Lexicographically sortable
|
|
18
|
-
* - Uppercase alphanumeric only
|
|
19
|
-
* - Contain timestamp information for natural ordering
|
|
20
|
-
*
|
|
21
|
-
* @param ulid - The string to validate as a ULID
|
|
22
|
-
* @returns true if the string is a valid ULID format, false otherwise
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* isValidULID('01ARZ3NDEKTSV4YWVF8F5BH32'); // true
|
|
27
|
-
* isValidULID('invalid'); // false
|
|
28
|
-
* isValidULID('01arz3ndektsv4ywvf8f5bh32'); // false (lowercase)
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
function isValidULID(ulid) {
|
|
32
|
-
return /^[0-9A-Z]{26}$/.test(ulid);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Validates if a resource name follows the groups/{ulid} format.
|
|
36
|
-
*
|
|
37
|
-
* Group resource names in the Meshtrade API follow the pattern "groups/{ulid}"
|
|
38
|
-
* where {ulid} is a 26-character ULID identifier.
|
|
39
|
-
*
|
|
40
|
-
* @param resourceName - The resource name string to validate
|
|
41
|
-
* @returns true if the resource name is a valid group resource name, false otherwise
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* isValidGroupResourceName('groups/01ARZ3NDEKTSV4YWVF8F5BH32'); // true
|
|
46
|
-
* isValidGroupResourceName('groups/invalid'); // false
|
|
47
|
-
* isValidGroupResourceName('users/01ARZ3NDEKTSV4YWVF8F5BH32'); // false
|
|
48
|
-
* isValidGroupResourceName('01ARZ3NDEKTSV4YWVF8F5BH32'); // false
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
function isValidGroupResourceName(resourceName) {
|
|
52
|
-
return /^groups\/[0-9A-Z]{26}$/.test(resourceName);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Validates a protobuf request message before sending to the server.
|
|
56
|
-
*
|
|
57
|
-
* This function serves as a client-side validation hook that can be extended
|
|
58
|
-
* to include protovalidate integration or other validation logic.
|
|
59
|
-
*
|
|
60
|
-
* Currently performs basic null/undefined checks. Future enhancements may include
|
|
61
|
-
* protovalidate integration for comprehensive message validation.
|
|
62
|
-
*
|
|
63
|
-
* @param request - The protobuf request message to validate
|
|
64
|
-
* @throws {Error} If the request is null or undefined
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* ```typescript
|
|
68
|
-
* validateRequest(myRequest); // Throws if request is invalid
|
|
69
|
-
* ```
|
|
70
|
-
*/
|
|
71
|
-
function validateRequest(request) {
|
|
72
|
-
if (request === null || request === undefined) {
|
|
73
|
-
throw new Error("Request cannot be null or undefined");
|
|
74
|
-
}
|
|
75
|
-
// Future: Integrate protovalidate for comprehensive message validation
|
|
76
|
-
// For now, basic validation is sufficient as the server also validates
|
|
77
|
-
}
|