@veloxts/client 0.6.103 → 0.6.104
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/CHANGELOG.md +6 -0
- package/dist/client.js +12 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/client.js
CHANGED
|
@@ -98,29 +98,29 @@ function resolveRouteOverride(override, procedureName) {
|
|
|
98
98
|
* @internal
|
|
99
99
|
*/
|
|
100
100
|
function buildRestPath(namespace, procedureName, routes) {
|
|
101
|
-
// Check for explicit route
|
|
101
|
+
// 1. Check for explicit route override first
|
|
102
102
|
const override = routes?.[namespace]?.[procedureName];
|
|
103
103
|
if (override) {
|
|
104
104
|
const resolved = resolveRouteOverride(override, procedureName);
|
|
105
105
|
return resolved.path;
|
|
106
106
|
}
|
|
107
|
-
//
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
// 2. Convention inference — collection endpoints (no :id)
|
|
108
|
+
if (procedureName.startsWith('list') ||
|
|
109
|
+
procedureName.startsWith('find') ||
|
|
110
|
+
procedureName.startsWith('create') ||
|
|
111
|
+
procedureName.startsWith('add')) {
|
|
111
112
|
return `/${namespace}`;
|
|
112
113
|
}
|
|
113
|
-
//
|
|
114
|
+
// 3. Convention inference — single-resource endpoints (with :id)
|
|
114
115
|
if (procedureName.startsWith('get') ||
|
|
115
116
|
procedureName.startsWith('update') ||
|
|
116
|
-
procedureName.startsWith('
|
|
117
|
+
procedureName.startsWith('edit') ||
|
|
118
|
+
procedureName.startsWith('patch') ||
|
|
119
|
+
procedureName.startsWith('delete') ||
|
|
120
|
+
procedureName.startsWith('remove')) {
|
|
117
121
|
return `/${namespace}/:id`;
|
|
118
122
|
}
|
|
119
|
-
//
|
|
120
|
-
if (method === 'POST') {
|
|
121
|
-
return `/${namespace}`;
|
|
122
|
-
}
|
|
123
|
-
// Default: /namespace
|
|
123
|
+
// 4. Fallback: /{namespace}
|
|
124
124
|
return `/${namespace}`;
|
|
125
125
|
}
|
|
126
126
|
/**
|