@simpleapps-com/augur-api 0.2.3 → 0.2.5
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 +100 -0
- package/dist/cjs/client.d.ts +181 -0
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +449 -0
- package/dist/cjs/client.js.map +1 -1
- package/dist/cjs/core/base-client.d.ts +104 -0
- package/dist/cjs/core/base-client.d.ts.map +1 -1
- package/dist/cjs/core/base-client.js +201 -0
- package/dist/cjs/core/base-client.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/services/agr-site/client.d.ts +522 -2
- package/dist/cjs/services/agr-site/client.d.ts.map +1 -1
- package/dist/cjs/services/agr-site/client.js +565 -12
- package/dist/cjs/services/agr-site/client.js.map +1 -1
- package/dist/cjs/services/items/client.d.ts +2 -2
- package/dist/cjs/services/items/schemas/categories.d.ts +20 -20
- package/dist/cjs/services/joomla/client.d.ts +644 -99
- package/dist/cjs/services/joomla/client.d.ts.map +1 -1
- package/dist/cjs/services/joomla/client.js +467 -98
- package/dist/cjs/services/joomla/client.js.map +1 -1
- package/dist/cjs/services/nexus/client.d.ts +1096 -22
- package/dist/cjs/services/nexus/client.d.ts.map +1 -1
- package/dist/cjs/services/nexus/client.js +754 -22
- package/dist/cjs/services/nexus/client.js.map +1 -1
- package/dist/cjs/services/orders/client.d.ts +3 -3
- package/dist/cjs/services/orders/schemas/orders.d.ts +12 -12
- package/dist/cjs/services/orders/schemas/purchase-orders.d.ts +22 -22
- package/dist/cjs/services/p21-core/client.d.ts +627 -0
- package/dist/cjs/services/p21-core/client.d.ts.map +1 -0
- package/dist/cjs/services/p21-core/client.js +704 -0
- package/dist/cjs/services/p21-core/client.js.map +1 -0
- package/dist/cjs/services/p21-core/index.d.ts +3 -0
- package/dist/cjs/services/p21-core/index.d.ts.map +1 -0
- package/dist/cjs/services/p21-core/index.js +21 -0
- package/dist/cjs/services/p21-core/index.js.map +1 -0
- package/dist/cjs/services/p21-core/schemas/address.d.ts +88 -0
- package/dist/cjs/services/p21-core/schemas/address.d.ts.map +1 -0
- package/dist/cjs/services/p21-core/schemas/address.js +45 -0
- package/dist/cjs/services/p21-core/schemas/address.js.map +1 -0
- package/dist/cjs/services/p21-core/schemas/cash-drawer.d.ts +96 -0
- package/dist/cjs/services/p21-core/schemas/cash-drawer.d.ts.map +1 -0
- package/dist/cjs/services/p21-core/schemas/cash-drawer.js +39 -0
- package/dist/cjs/services/p21-core/schemas/cash-drawer.js.map +1 -0
- package/dist/cjs/services/p21-core/schemas/codes.d.ts +54 -0
- package/dist/cjs/services/p21-core/schemas/codes.d.ts.map +1 -0
- package/dist/cjs/services/p21-core/schemas/codes.js +25 -0
- package/dist/cjs/services/p21-core/schemas/codes.js.map +1 -0
- package/dist/cjs/services/p21-core/schemas/company.d.ts +80 -0
- package/dist/cjs/services/p21-core/schemas/company.d.ts.map +1 -0
- package/dist/cjs/services/p21-core/schemas/company.js +35 -0
- package/dist/cjs/services/p21-core/schemas/company.js.map +1 -0
- package/dist/cjs/services/p21-core/schemas/health.d.ts +46 -0
- package/dist/cjs/services/p21-core/schemas/health.d.ts.map +1 -0
- package/dist/cjs/services/p21-core/schemas/health.js +7 -0
- package/dist/cjs/services/p21-core/schemas/health.js.map +1 -0
- package/dist/cjs/services/p21-core/schemas/index.d.ts +8 -0
- package/dist/cjs/services/p21-core/schemas/index.d.ts.map +1 -0
- package/dist/cjs/services/p21-core/schemas/index.js +25 -0
- package/dist/cjs/services/p21-core/schemas/index.js.map +1 -0
- package/dist/cjs/services/p21-core/schemas/location.d.ts +84 -0
- package/dist/cjs/services/p21-core/schemas/location.d.ts.map +1 -0
- package/dist/cjs/services/p21-core/schemas/location.js +35 -0
- package/dist/cjs/services/p21-core/schemas/location.js.map +1 -0
- package/dist/cjs/services/p21-core/schemas/payment-types.d.ts +39 -0
- package/dist/cjs/services/p21-core/schemas/payment-types.d.ts.map +1 -0
- package/dist/cjs/services/p21-core/schemas/payment-types.js +26 -0
- package/dist/cjs/services/p21-core/schemas/payment-types.js.map +1 -0
- package/dist/cjs/services/p21-core/schemas.d.ts +2 -0
- package/dist/cjs/services/p21-core/schemas.d.ts.map +1 -0
- package/dist/cjs/services/p21-core/schemas.js +19 -0
- package/dist/cjs/services/p21-core/schemas.js.map +1 -0
- package/dist/cjs/services/vmi/schemas/inventory.d.ts +6 -6
- package/dist/cjs/services/vmi/schemas/products.d.ts +6 -6
- package/dist/cjs/services/vmi/schemas/restock.d.ts +12 -12
- package/dist/esm/client.d.ts +181 -0
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +449 -0
- package/dist/esm/client.js.map +1 -1
- package/dist/esm/core/base-client.d.ts +104 -0
- package/dist/esm/core/base-client.d.ts.map +1 -1
- package/dist/esm/core/base-client.js +201 -0
- package/dist/esm/core/base-client.js.map +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/services/agr-site/client.d.ts +522 -2
- package/dist/esm/services/agr-site/client.d.ts.map +1 -1
- package/dist/esm/services/agr-site/client.js +565 -12
- package/dist/esm/services/agr-site/client.js.map +1 -1
- package/dist/esm/services/items/client.d.ts +2 -2
- package/dist/esm/services/items/schemas/categories.d.ts +20 -20
- package/dist/esm/services/joomla/client.d.ts +644 -99
- package/dist/esm/services/joomla/client.d.ts.map +1 -1
- package/dist/esm/services/joomla/client.js +467 -98
- package/dist/esm/services/joomla/client.js.map +1 -1
- package/dist/esm/services/nexus/client.d.ts +1096 -22
- package/dist/esm/services/nexus/client.d.ts.map +1 -1
- package/dist/esm/services/nexus/client.js +754 -22
- package/dist/esm/services/nexus/client.js.map +1 -1
- package/dist/esm/services/orders/client.d.ts +3 -3
- package/dist/esm/services/orders/schemas/orders.d.ts +12 -12
- package/dist/esm/services/orders/schemas/purchase-orders.d.ts +22 -22
- package/dist/esm/services/p21-core/client.d.ts +627 -0
- package/dist/esm/services/p21-core/client.d.ts.map +1 -0
- package/dist/esm/services/p21-core/client.js +700 -0
- package/dist/esm/services/p21-core/client.js.map +1 -0
- package/dist/esm/services/p21-core/index.d.ts +3 -0
- package/dist/esm/services/p21-core/index.d.ts.map +1 -0
- package/dist/esm/services/p21-core/index.js +3 -0
- package/dist/esm/services/p21-core/index.js.map +1 -0
- package/dist/esm/services/p21-core/schemas/address.d.ts +88 -0
- package/dist/esm/services/p21-core/schemas/address.d.ts.map +1 -0
- package/dist/esm/services/p21-core/schemas/address.js +42 -0
- package/dist/esm/services/p21-core/schemas/address.js.map +1 -0
- package/dist/esm/services/p21-core/schemas/cash-drawer.d.ts +96 -0
- package/dist/esm/services/p21-core/schemas/cash-drawer.d.ts.map +1 -0
- package/dist/esm/services/p21-core/schemas/cash-drawer.js +36 -0
- package/dist/esm/services/p21-core/schemas/cash-drawer.js.map +1 -0
- package/dist/esm/services/p21-core/schemas/codes.d.ts +54 -0
- package/dist/esm/services/p21-core/schemas/codes.d.ts.map +1 -0
- package/dist/esm/services/p21-core/schemas/codes.js +22 -0
- package/dist/esm/services/p21-core/schemas/codes.js.map +1 -0
- package/dist/esm/services/p21-core/schemas/company.d.ts +80 -0
- package/dist/esm/services/p21-core/schemas/company.d.ts.map +1 -0
- package/dist/esm/services/p21-core/schemas/company.js +32 -0
- package/dist/esm/services/p21-core/schemas/company.js.map +1 -0
- package/dist/esm/services/p21-core/schemas/health.d.ts +46 -0
- package/dist/esm/services/p21-core/schemas/health.d.ts.map +1 -0
- package/dist/esm/services/p21-core/schemas/health.js +4 -0
- package/dist/esm/services/p21-core/schemas/health.js.map +1 -0
- package/dist/esm/services/p21-core/schemas/index.d.ts +8 -0
- package/dist/esm/services/p21-core/schemas/index.d.ts.map +1 -0
- package/dist/esm/services/p21-core/schemas/index.js +9 -0
- package/dist/esm/services/p21-core/schemas/index.js.map +1 -0
- package/dist/esm/services/p21-core/schemas/location.d.ts +84 -0
- package/dist/esm/services/p21-core/schemas/location.d.ts.map +1 -0
- package/dist/esm/services/p21-core/schemas/location.js +32 -0
- package/dist/esm/services/p21-core/schemas/location.js.map +1 -0
- package/dist/esm/services/p21-core/schemas/payment-types.d.ts +39 -0
- package/dist/esm/services/p21-core/schemas/payment-types.d.ts.map +1 -0
- package/dist/esm/services/p21-core/schemas/payment-types.js +23 -0
- package/dist/esm/services/p21-core/schemas/payment-types.js.map +1 -0
- package/dist/esm/services/p21-core/schemas.d.ts +2 -0
- package/dist/esm/services/p21-core/schemas.d.ts.map +1 -0
- package/dist/esm/services/p21-core/schemas.js +3 -0
- package/dist/esm/services/p21-core/schemas.js.map +1 -0
- package/dist/esm/services/vmi/schemas/inventory.d.ts +6 -6
- package/dist/esm/services/vmi/schemas/products.d.ts +6 -6
- package/dist/esm/services/vmi/schemas/restock.d.ts +12 -12
- package/dist/types/client.d.ts +181 -0
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/core/base-client.d.ts +104 -0
- package/dist/types/core/base-client.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/services/agr-site/client.d.ts +522 -2
- package/dist/types/services/agr-site/client.d.ts.map +1 -1
- package/dist/types/services/items/client.d.ts +2 -2
- package/dist/types/services/items/schemas/categories.d.ts +20 -20
- package/dist/types/services/joomla/client.d.ts +644 -99
- package/dist/types/services/joomla/client.d.ts.map +1 -1
- package/dist/types/services/nexus/client.d.ts +1096 -22
- package/dist/types/services/nexus/client.d.ts.map +1 -1
- package/dist/types/services/orders/client.d.ts +3 -3
- package/dist/types/services/orders/schemas/orders.d.ts +12 -12
- package/dist/types/services/orders/schemas/purchase-orders.d.ts +22 -22
- package/dist/types/services/p21-core/client.d.ts +627 -0
- package/dist/types/services/p21-core/client.d.ts.map +1 -0
- package/dist/types/services/p21-core/index.d.ts +3 -0
- package/dist/types/services/p21-core/index.d.ts.map +1 -0
- package/dist/types/services/p21-core/schemas/address.d.ts +88 -0
- package/dist/types/services/p21-core/schemas/address.d.ts.map +1 -0
- package/dist/types/services/p21-core/schemas/cash-drawer.d.ts +96 -0
- package/dist/types/services/p21-core/schemas/cash-drawer.d.ts.map +1 -0
- package/dist/types/services/p21-core/schemas/codes.d.ts +54 -0
- package/dist/types/services/p21-core/schemas/codes.d.ts.map +1 -0
- package/dist/types/services/p21-core/schemas/company.d.ts +80 -0
- package/dist/types/services/p21-core/schemas/company.d.ts.map +1 -0
- package/dist/types/services/p21-core/schemas/health.d.ts +46 -0
- package/dist/types/services/p21-core/schemas/health.d.ts.map +1 -0
- package/dist/types/services/p21-core/schemas/index.d.ts +8 -0
- package/dist/types/services/p21-core/schemas/index.d.ts.map +1 -0
- package/dist/types/services/p21-core/schemas/location.d.ts +84 -0
- package/dist/types/services/p21-core/schemas/location.d.ts.map +1 -0
- package/dist/types/services/p21-core/schemas/payment-types.d.ts +39 -0
- package/dist/types/services/p21-core/schemas/payment-types.d.ts.map +1 -0
- package/dist/types/services/p21-core/schemas.d.ts +2 -0
- package/dist/types/services/p21-core/schemas.d.ts.map +1 -0
- package/dist/types/services/vmi/schemas/inventory.d.ts +6 -6
- package/dist/types/services/vmi/schemas/products.d.ts +6 -6
- package/dist/types/services/vmi/schemas/restock.d.ts +12 -12
- package/package.json +1 -1
|
@@ -33,50 +33,91 @@ export class JoomlaClient extends BaseServiceClient {
|
|
|
33
33
|
this.content = {
|
|
34
34
|
/**
|
|
35
35
|
* Retrieve a paginated list of content items
|
|
36
|
-
* @description Returns
|
|
36
|
+
* @description Returns articles, documents, and content with filtering, pagination, and edge caching capabilities
|
|
37
|
+
* @fullPath api.joomla.content.list
|
|
38
|
+
* @service joomla
|
|
39
|
+
* @domain content-management
|
|
40
|
+
* @dataMethod listData() - returns only the content array without metadata
|
|
41
|
+
* @pagination Uses count, total, totalResults for pagination metadata. Supports limit/offset parameters.
|
|
42
|
+
* @caching Supports edgeCache parameter (1-8 hours) for improved performance on content that changes infrequently
|
|
43
|
+
* @discoverable true
|
|
44
|
+
* @searchTerms ["content", "articles", "list content", "cms content", "documents", "blog posts"]
|
|
45
|
+
* @relatedEndpoints ["api.joomla.content.get", "api.joomla.content.getDoc", "api.joomla.tags.list"]
|
|
46
|
+
* @commonPatterns ["list articles", "get content", "blog content", "cms articles", "filter content"]
|
|
37
47
|
* @param params Optional filtering, pagination, and caching parameters
|
|
38
|
-
* @param params.
|
|
39
|
-
* @
|
|
48
|
+
* @param params.categoryIdList Comma-separated list of category IDs to filter content (e.g., '1,2,3')
|
|
49
|
+
* @param params.q Search query for filtering content by title/text
|
|
50
|
+
* @param params.limit Maximum number of content items to return (default: 20, max: 100)
|
|
51
|
+
* @param params.offset Number of items to skip for pagination (default: 0)
|
|
52
|
+
* @param params.edgeCache Cache duration in hours (1, 2, 3, 4, 5, 8) - recommended for content
|
|
53
|
+
* @returns BaseResponse<ContentItem[]> with pagination metadata and content array
|
|
40
54
|
* @throws ValidationError When parameters are invalid or response is malformed
|
|
41
55
|
* @example
|
|
42
56
|
* ```typescript
|
|
43
|
-
* // Get all content
|
|
44
|
-
* const
|
|
57
|
+
* // Get all content with full response metadata
|
|
58
|
+
* const response = await api.joomla.content.list();
|
|
59
|
+
* console.log(`Found ${response.total} articles, showing ${response.data.length}`);
|
|
45
60
|
*
|
|
46
|
-
* //
|
|
47
|
-
* const filtered = await
|
|
61
|
+
* // Filter content by categories with search
|
|
62
|
+
* const filtered = await api.joomla.content.list({
|
|
48
63
|
* categoryIdList: '1,2,3',
|
|
49
|
-
*
|
|
50
|
-
*
|
|
64
|
+
* q: 'product review',
|
|
65
|
+
* limit: 10
|
|
51
66
|
* });
|
|
52
67
|
*
|
|
53
|
-
* // Get content
|
|
54
|
-
* const
|
|
55
|
-
*
|
|
56
|
-
* categoryIdList: '1,2,3',
|
|
68
|
+
* // Get just content data without metadata
|
|
69
|
+
* const articles = await api.joomla.content.listData({
|
|
70
|
+
* categoryIdList: '5',
|
|
57
71
|
* limit: 20
|
|
58
72
|
* });
|
|
73
|
+
* articles.forEach(article => console.log(article.title, article.alias));
|
|
74
|
+
*
|
|
75
|
+
* // Use aggressive caching for content (recommended)
|
|
76
|
+
* const cachedContent = await api.joomla.content.list({
|
|
77
|
+
* edgeCache: 4, // Cache for 4 hours - content changes infrequently
|
|
78
|
+
* categoryIdList: '1,2,3'
|
|
79
|
+
* });
|
|
59
80
|
* ```
|
|
60
81
|
*/
|
|
61
82
|
list: this.createListMethod('/content', ContentListParamsSchema, ContentListResponseSchema),
|
|
62
83
|
/**
|
|
63
|
-
* Get content details by ID
|
|
64
|
-
* @description Returns a single content item by its ID or alias with optional edge caching
|
|
65
|
-
* @
|
|
84
|
+
* Get content details by ID or alias
|
|
85
|
+
* @description Returns a single content item by its ID or alias with optional edge caching and full content metadata
|
|
86
|
+
* @fullPath api.joomla.content.get
|
|
87
|
+
* @service joomla
|
|
88
|
+
* @domain content-management
|
|
89
|
+
* @dataMethod getData(contentId, params) - returns only the content object without metadata
|
|
90
|
+
* @caching Supports edgeCache parameter (1-8 hours) for improved performance
|
|
91
|
+
* @aliasLookup Supports alias-based lookup by using contentId=0 with params.alias
|
|
92
|
+
* @discoverable true
|
|
93
|
+
* @searchTerms ["get content", "content details", "article details", "content by id", "single content"]
|
|
94
|
+
* @relatedEndpoints ["api.joomla.content.list", "api.joomla.content.getDoc", "api.joomla.tags.list"]
|
|
95
|
+
* @commonPatterns ["get content by id", "fetch article", "content details lookup", "get by alias"]
|
|
96
|
+
* @param contentId Content ID (number) or use 0 for alias lookup
|
|
66
97
|
* @param params Optional parameters for alias lookup and caching
|
|
67
|
-
* @param params.
|
|
68
|
-
* @
|
|
98
|
+
* @param params.alias Content alias for lookup when contentId is 0
|
|
99
|
+
* @param params.catid Category ID for alias lookup specificity
|
|
100
|
+
* @param params.edgeCache Cache duration in hours (1, 2, 3, 4, 5, 8) for improved performance
|
|
101
|
+
* @returns BaseResponse<ContentItem> with complete content details and metadata
|
|
69
102
|
* @throws ValidationError When parameters are invalid or response is malformed
|
|
70
103
|
* @example
|
|
71
104
|
* ```typescript
|
|
72
|
-
* // Get by ID
|
|
73
|
-
* const
|
|
105
|
+
* // Get content by ID with full response metadata
|
|
106
|
+
* const response = await api.joomla.content.get(123);
|
|
107
|
+
* console.log('Article:', response.data.title, 'Status:', response.status);
|
|
108
|
+
*
|
|
109
|
+
* // Get content by alias
|
|
110
|
+
* const byAlias = await api.joomla.content.get(0, {
|
|
111
|
+
* alias: 'my-article',
|
|
112
|
+
* catid: 45
|
|
113
|
+
* });
|
|
74
114
|
*
|
|
75
|
-
* // Get
|
|
76
|
-
* const
|
|
115
|
+
* // Get just content data without metadata
|
|
116
|
+
* const article = await api.joomla.content.getData(123);
|
|
117
|
+
* console.log(article.title, article.introtext, article.fulltext);
|
|
77
118
|
*
|
|
78
|
-
* //
|
|
79
|
-
* const cachedContent = await
|
|
119
|
+
* // Use edge caching for frequently accessed content
|
|
120
|
+
* const cachedContent = await api.joomla.content.get(123, { edgeCache: 8 });
|
|
80
121
|
* ```
|
|
81
122
|
*/
|
|
82
123
|
get: async (contentId, params) => {
|
|
@@ -100,6 +141,40 @@ export class JoomlaClient extends BaseServiceClient {
|
|
|
100
141
|
* ```
|
|
101
142
|
*/
|
|
102
143
|
getDoc: this.createDocMethod('/content/{id}/doc', ContentDocumentResponseSchema),
|
|
144
|
+
/**
|
|
145
|
+
* Retrieve a paginated list of content items (data only)
|
|
146
|
+
* @description Returns only the data array from content items response
|
|
147
|
+
* @param params Optional filtering, pagination, and caching parameters
|
|
148
|
+
* @returns Array of content items (data only)
|
|
149
|
+
* @throws ValidationError When parameters are invalid or response is malformed
|
|
150
|
+
*/
|
|
151
|
+
listData: async (params) => {
|
|
152
|
+
const response = await this.content.list(params);
|
|
153
|
+
return response.data;
|
|
154
|
+
},
|
|
155
|
+
/**
|
|
156
|
+
* Get content details by ID (data only)
|
|
157
|
+
* @description Returns only the data from content item details response
|
|
158
|
+
* @param contentId Content ID (number) or alias lookup (use 0 with params.alias)
|
|
159
|
+
* @param params Optional parameters for alias lookup and caching
|
|
160
|
+
* @returns Content item details (data only)
|
|
161
|
+
* @throws ValidationError When parameters are invalid or response is malformed
|
|
162
|
+
*/
|
|
163
|
+
getData: async (contentId, params) => {
|
|
164
|
+
const response = await this.content.get(contentId, params);
|
|
165
|
+
return response.data;
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* Get content documentation (data only)
|
|
169
|
+
* @description Returns only the data from enhanced content document response
|
|
170
|
+
* @param contentId Content ID (number) or alias lookup (use 0 with query params)
|
|
171
|
+
* @returns Enhanced content document (data only)
|
|
172
|
+
* @throws ValidationError When response is malformed
|
|
173
|
+
*/
|
|
174
|
+
getDocData: async (contentId) => {
|
|
175
|
+
const response = await this.content.getDoc(contentId);
|
|
176
|
+
return response.data;
|
|
177
|
+
},
|
|
103
178
|
};
|
|
104
179
|
/**
|
|
105
180
|
* User endpoints
|
|
@@ -108,43 +183,80 @@ export class JoomlaClient extends BaseServiceClient {
|
|
|
108
183
|
this.users = {
|
|
109
184
|
/**
|
|
110
185
|
* Retrieve a paginated list of users
|
|
111
|
-
* @description Returns all users with optional filtering, pagination, and edge caching
|
|
186
|
+
* @description Returns all users with optional filtering, pagination, and edge caching for user management operations
|
|
187
|
+
* @fullPath api.joomla.users.list
|
|
188
|
+
* @service joomla
|
|
189
|
+
* @domain user-management
|
|
190
|
+
* @dataMethod listData() - returns only the user array without metadata
|
|
191
|
+
* @pagination Uses count, total, totalResults for pagination metadata. Supports limit/offset parameters.
|
|
192
|
+
* @caching Supports edgeCache parameter (1-8 hours) for improved performance
|
|
193
|
+
* @discoverable true
|
|
194
|
+
* @searchTerms ["users", "list users", "get users", "user management", "accounts", "profiles"]
|
|
195
|
+
* @relatedEndpoints ["api.joomla.userGroups.list", "api.customers.customer.list", "api.joomla.users.get"]
|
|
196
|
+
* @commonPatterns ["list all users", "search users", "paginate users", "filter users"]
|
|
112
197
|
* @param params Optional filtering, pagination, and caching parameters
|
|
113
|
-
* @param params.
|
|
114
|
-
* @
|
|
198
|
+
* @param params.q Search query for filtering users by username/email
|
|
199
|
+
* @param params.limit Maximum number of users to return (default: 20, max: 100)
|
|
200
|
+
* @param params.offset Number of users to skip for pagination (default: 0)
|
|
201
|
+
* @param params.edgeCache Cache duration in hours (1, 2, 3, 4, 5, 8) for improved performance
|
|
202
|
+
* @returns BaseResponse<User[]> with pagination metadata and user array
|
|
115
203
|
* @throws ValidationError When parameters are invalid or response is malformed
|
|
116
204
|
* @example
|
|
117
205
|
* ```typescript
|
|
118
|
-
* // Get all users
|
|
119
|
-
* const
|
|
120
|
-
* console.log(`Found ${
|
|
206
|
+
* // Get all users with full response metadata
|
|
207
|
+
* const response = await api.joomla.users.list();
|
|
208
|
+
* console.log(`Found ${response.total} users, showing ${response.data.length}`);
|
|
209
|
+
* console.log('Pagination:', { count: response.count, total: response.total });
|
|
121
210
|
*
|
|
122
|
-
* // Search users
|
|
123
|
-
* const searchResults = await
|
|
211
|
+
* // Search users with filtering
|
|
212
|
+
* const searchResults = await api.joomla.users.list({
|
|
213
|
+
* q: 'admin',
|
|
214
|
+
* limit: 10,
|
|
215
|
+
* offset: 0
|
|
216
|
+
* });
|
|
124
217
|
*
|
|
125
|
-
* // Get
|
|
126
|
-
* const
|
|
218
|
+
* // Get just user data without metadata (using data method)
|
|
219
|
+
* const users = await api.joomla.users.listData({ limit: 20 });
|
|
220
|
+
* users.forEach(user => console.log(user.username, user.email));
|
|
221
|
+
*
|
|
222
|
+
* // Use edge caching for performance
|
|
223
|
+
* const cachedUsers = await api.joomla.users.list({
|
|
127
224
|
* edgeCache: 2, // Cache for 2 hours
|
|
128
|
-
* limit:
|
|
225
|
+
* limit: 50
|
|
129
226
|
* });
|
|
130
227
|
* ```
|
|
131
228
|
*/
|
|
132
229
|
list: this.createListMethod('/users', UserListParamsSchema, UserListResponseSchema),
|
|
133
230
|
/**
|
|
134
231
|
* Get user details by ID
|
|
135
|
-
* @description Returns detailed information for a specific user
|
|
136
|
-
* @
|
|
232
|
+
* @description Returns detailed information for a specific user including profile data and metadata
|
|
233
|
+
* @fullPath api.joomla.users.get
|
|
234
|
+
* @service joomla
|
|
235
|
+
* @domain user-management
|
|
236
|
+
* @dataMethod getData(userId, params) - returns only the user object without metadata
|
|
237
|
+
* @caching Supports edgeCache parameter (1-8 hours) for improved performance
|
|
238
|
+
* @discoverable true
|
|
239
|
+
* @searchTerms ["get user", "user details", "user profile", "user by id", "single user"]
|
|
240
|
+
* @relatedEndpoints ["api.joomla.users.list", "api.joomla.users.getDoc", "api.joomla.users.getTrinityDoc"]
|
|
241
|
+
* @commonPatterns ["get user by id", "fetch user profile", "user details lookup"]
|
|
242
|
+
* @param userId User ID (number or string) - the unique identifier for the user
|
|
137
243
|
* @param params Optional caching parameters
|
|
138
|
-
* @param params.edgeCache
|
|
139
|
-
* @returns User details
|
|
140
|
-
* @throws ValidationError When response is malformed
|
|
244
|
+
* @param params.edgeCache Cache duration in hours (1, 2, 3, 4, 5, 8) for improved performance
|
|
245
|
+
* @returns BaseResponse<User> with complete user details and metadata
|
|
246
|
+
* @throws ValidationError When userId is invalid or response is malformed
|
|
141
247
|
* @example
|
|
142
248
|
* ```typescript
|
|
143
|
-
*
|
|
249
|
+
* // Get user with full response metadata
|
|
250
|
+
* const response = await api.joomla.users.get(123);
|
|
251
|
+
* console.log('User:', response.data.username, response.data.email);
|
|
252
|
+
* console.log('Status:', response.status, response.message);
|
|
253
|
+
*
|
|
254
|
+
* // Get just user data without metadata
|
|
255
|
+
* const user = await api.joomla.users.getData(123);
|
|
144
256
|
* console.log(user.username, user.email, user.registerDate);
|
|
145
257
|
*
|
|
146
|
-
* //
|
|
147
|
-
* const cachedUser = await
|
|
258
|
+
* // Use edge caching for frequently accessed users
|
|
259
|
+
* const cachedUser = await api.joomla.users.get(123, { edgeCache: 1 });
|
|
148
260
|
* ```
|
|
149
261
|
*/
|
|
150
262
|
get: this.createGetMethod('/users/{id}', UserResponseSchema),
|
|
@@ -198,15 +310,32 @@ export class JoomlaClient extends BaseServiceClient {
|
|
|
198
310
|
*/
|
|
199
311
|
groups: {
|
|
200
312
|
/**
|
|
201
|
-
* Get user's
|
|
202
|
-
* @description Returns all groups that a specific user belongs to
|
|
203
|
-
* @
|
|
313
|
+
* Get user's group memberships
|
|
314
|
+
* @description Returns all groups that a specific user belongs to with membership details
|
|
315
|
+
* @fullPath api.joomla.users.groups.list
|
|
316
|
+
* @service joomla
|
|
317
|
+
* @domain user-management
|
|
318
|
+
* @dataMethod listData(userId, params) - returns only the group memberships array without metadata
|
|
319
|
+
* @discoverable true
|
|
320
|
+
* @searchTerms ["user groups", "group membership", "user permissions", "user roles"]
|
|
321
|
+
* @relatedEndpoints ["api.joomla.userGroups.list", "api.joomla.users.groups.createMapping", "api.joomla.users.get"]
|
|
322
|
+
* @commonPatterns ["get user groups", "user permissions", "group membership", "user roles"]
|
|
323
|
+
* @param userId User ID (string) - the unique identifier for the user
|
|
204
324
|
* @param params Optional pagination parameters
|
|
205
|
-
* @
|
|
325
|
+
* @param params.limit Maximum number of group memberships to return (default: 20)
|
|
326
|
+
* @param params.offset Number of memberships to skip for pagination (default: 0)
|
|
327
|
+
* @returns BaseResponse<UserGroupMembership[]> with group membership details and metadata
|
|
206
328
|
* @throws ValidationError When response is malformed
|
|
207
329
|
* @example
|
|
208
330
|
* ```typescript
|
|
209
|
-
*
|
|
331
|
+
* // Get user's groups with full response metadata
|
|
332
|
+
* const response = await api.joomla.users.groups.list('123');
|
|
333
|
+
* response.data.forEach(group => {
|
|
334
|
+
* console.log(`Group: ${group.title} (ID: ${group.groupId})`);
|
|
335
|
+
* });
|
|
336
|
+
*
|
|
337
|
+
* // Get just group memberships data without metadata
|
|
338
|
+
* const groups = await api.joomla.users.groups.listData('123');
|
|
210
339
|
* groups.forEach(group => console.log(group.title, group.groupId));
|
|
211
340
|
* ```
|
|
212
341
|
*/
|
|
@@ -259,29 +388,88 @@ export class JoomlaClient extends BaseServiceClient {
|
|
|
259
388
|
responseSchema: UserGroupMappingResponseSchema,
|
|
260
389
|
}, request, { id: String(userId) });
|
|
261
390
|
},
|
|
391
|
+
/**
|
|
392
|
+
* Get user's groups (data only)
|
|
393
|
+
* @description Returns only the data array from user group memberships response
|
|
394
|
+
* @param userId User ID (string)
|
|
395
|
+
* @param params Optional pagination parameters
|
|
396
|
+
* @returns Array of user group memberships (data only)
|
|
397
|
+
* @throws ValidationError When response is malformed
|
|
398
|
+
*/
|
|
399
|
+
listData: async (userId, params) => {
|
|
400
|
+
const response = await this.users.groups.list(userId, params);
|
|
401
|
+
return response.data;
|
|
402
|
+
},
|
|
403
|
+
/**
|
|
404
|
+
* Get specific user group membership (data only)
|
|
405
|
+
* @description Returns only the data from user group membership details response
|
|
406
|
+
* @param userId User ID (string)
|
|
407
|
+
* @param groupId Group ID (number or string)
|
|
408
|
+
* @returns User group membership details (data only)
|
|
409
|
+
* @throws ValidationError When response is malformed
|
|
410
|
+
*/
|
|
411
|
+
getData: async (userId, groupId) => {
|
|
412
|
+
const response = await this.users.groups.get(userId, groupId);
|
|
413
|
+
return response.data;
|
|
414
|
+
},
|
|
415
|
+
/**
|
|
416
|
+
* Create or update user group mapping (data only)
|
|
417
|
+
* @description Returns only the data from created/updated group mapping response
|
|
418
|
+
* @param userId User ID (number or string)
|
|
419
|
+
* @param request Group mapping request data
|
|
420
|
+
* @returns Group mapping information (data only)
|
|
421
|
+
* @throws ValidationError When request is invalid or response is malformed
|
|
422
|
+
*/
|
|
423
|
+
createMappingData: async (userId, request) => {
|
|
424
|
+
const response = await this.users.groups.createMapping(userId, request);
|
|
425
|
+
return response.data;
|
|
426
|
+
},
|
|
262
427
|
},
|
|
263
428
|
/**
|
|
264
|
-
* Verify user
|
|
265
|
-
* @description Verifies
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
* @
|
|
273
|
-
* @
|
|
274
|
-
*
|
|
429
|
+
* Verify user credentials and authenticate
|
|
430
|
+
* @description Verifies username/password combination and returns authentication token, supports cross-site authentication
|
|
431
|
+
* @fullPath api.joomla.users.verifyPassword
|
|
432
|
+
* @service joomla
|
|
433
|
+
* @domain authentication
|
|
434
|
+
* @dataMethod verifyPasswordData(request) - returns only the verification result without metadata
|
|
435
|
+
* @crossSite Supports authentication across multiple sites when called from 'augur_info' site
|
|
436
|
+
* @discoverable true
|
|
437
|
+
* @searchTerms ["verify password", "authenticate", "login", "user authentication", "credentials", "sign in"]
|
|
438
|
+
* @relatedEndpoints ["api.joomla.users.get", "api.joomla.users.create", "api.customers.customer.get"]
|
|
439
|
+
* @commonPatterns ["user login", "authenticate user", "verify credentials", "password check"]
|
|
440
|
+
* @param request Authentication request containing username, password, and optional siteId
|
|
441
|
+
* @param request.username User's username for authentication
|
|
442
|
+
* @param request.password User's password for verification
|
|
443
|
+
* @param request.siteId Optional site ID for cross-site authentication (when using augur_info)
|
|
444
|
+
* @returns BaseResponse<VerifyPasswordResult> with verification status, user info, and JWT token
|
|
445
|
+
* @throws ValidationError When credentials are invalid or request is malformed
|
|
275
446
|
* @example
|
|
276
|
-
*
|
|
277
|
-
*
|
|
447
|
+
* ```typescript
|
|
448
|
+
* // Standard authentication with full response
|
|
449
|
+
* const response = await api.joomla.users.verifyPassword({
|
|
450
|
+
* username: 'johndoe',
|
|
451
|
+
* password: 'securePassword123'
|
|
452
|
+
* });
|
|
278
453
|
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
454
|
+
* if (response.data.verified) {
|
|
455
|
+
* console.log('Login successful:', response.data.username);
|
|
456
|
+
* console.log('JWT Token:', response.data.token);
|
|
457
|
+
* console.log('User ID:', response.data.userId);
|
|
458
|
+
* }
|
|
459
|
+
*
|
|
460
|
+
* // Cross-site authentication (when using augur_info site)
|
|
461
|
+
* const crossSiteAuth = await api.joomla.users.verifyPassword({
|
|
462
|
+
* username: 'johndoe',
|
|
463
|
+
* password: 'securePassword123',
|
|
283
464
|
* siteId: 'customer_site_1'
|
|
284
465
|
* });
|
|
466
|
+
*
|
|
467
|
+
* // Get just verification data without metadata
|
|
468
|
+
* const authResult = await api.joomla.users.verifyPasswordData({
|
|
469
|
+
* username: 'johndoe',
|
|
470
|
+
* password: 'securePassword123'
|
|
471
|
+
* });
|
|
472
|
+
* ```
|
|
285
473
|
*/
|
|
286
474
|
verifyPassword: async (request) => {
|
|
287
475
|
return this.executeRequest({
|
|
@@ -292,20 +480,43 @@ export class JoomlaClient extends BaseServiceClient {
|
|
|
292
480
|
}, request);
|
|
293
481
|
},
|
|
294
482
|
/**
|
|
295
|
-
* Create a new user
|
|
296
|
-
* @description Creates a new user account in the system
|
|
483
|
+
* Create a new user account
|
|
484
|
+
* @description Creates a new user account in the system with username, email, name, and password
|
|
485
|
+
* @fullPath api.joomla.users.create
|
|
486
|
+
* @service joomla
|
|
487
|
+
* @domain user-management
|
|
488
|
+
* @dataMethod createData(request) - returns only the created user object without metadata
|
|
489
|
+
* @discoverable true
|
|
490
|
+
* @searchTerms ["create user", "new user", "user registration", "add user", "register user"]
|
|
491
|
+
* @relatedEndpoints ["api.joomla.users.list", "api.joomla.users.get", "api.joomla.users.verifyPassword"]
|
|
492
|
+
* @commonPatterns ["register new user", "create account", "add user account", "user signup"]
|
|
297
493
|
* @param request User creation request data including username, email, name, and password
|
|
298
|
-
* @
|
|
494
|
+
* @param request.username Unique username for the new user (required)
|
|
495
|
+
* @param request.email Valid email address for the user (required)
|
|
496
|
+
* @param request.name Full display name for the user (required)
|
|
497
|
+
* @param request.password Secure password for the user (required, minimum 8 characters)
|
|
498
|
+
* @returns BaseResponse<User> with created user information including ID, username, and email
|
|
299
499
|
* @throws ValidationError When request is invalid or response is malformed
|
|
300
500
|
* @example
|
|
301
501
|
* ```typescript
|
|
302
|
-
*
|
|
502
|
+
* // Create new user with full response metadata
|
|
503
|
+
* const response = await api.joomla.users.create({
|
|
303
504
|
* username: 'newuser',
|
|
304
505
|
* email: 'user@example.com',
|
|
305
506
|
* name: 'New User',
|
|
306
507
|
* password: 'SecurePass123!'
|
|
307
508
|
* });
|
|
308
|
-
* console.log('Created user:',
|
|
509
|
+
* console.log('Created user:', response.data.id, response.data.username);
|
|
510
|
+
* console.log('Status:', response.status, response.message);
|
|
511
|
+
*
|
|
512
|
+
* // Get just created user data without metadata
|
|
513
|
+
* const newUser = await api.joomla.users.createData({
|
|
514
|
+
* username: 'johndoe',
|
|
515
|
+
* email: 'john@example.com',
|
|
516
|
+
* name: 'John Doe',
|
|
517
|
+
* password: 'MySecurePassword123!'
|
|
518
|
+
* });
|
|
519
|
+
* console.log('New user ID:', newUser.id, 'Email:', newUser.email);
|
|
309
520
|
* ```
|
|
310
521
|
*/
|
|
311
522
|
create: this.createCreateMethod('/users', CreateUserRequestSchema, CreateUserResponseSchema),
|
|
@@ -342,6 +553,96 @@ export class JoomlaClient extends BaseServiceClient {
|
|
|
342
553
|
* ```
|
|
343
554
|
*/
|
|
344
555
|
block: this.createDeleteMethod('/users/{id}', BlockUserResponseSchema),
|
|
556
|
+
/**
|
|
557
|
+
* Retrieve a paginated list of users (data only)
|
|
558
|
+
* @description Returns only the data array from users response
|
|
559
|
+
* @param params Optional filtering, pagination, and caching parameters
|
|
560
|
+
* @returns Array of users (data only)
|
|
561
|
+
* @throws ValidationError When parameters are invalid or response is malformed
|
|
562
|
+
*/
|
|
563
|
+
listData: async (params) => {
|
|
564
|
+
const response = await this.users.list(params);
|
|
565
|
+
return response.data;
|
|
566
|
+
},
|
|
567
|
+
/**
|
|
568
|
+
* Get user details by ID (data only)
|
|
569
|
+
* @description Returns only the data from user details response
|
|
570
|
+
* @param userId User ID (number or string)
|
|
571
|
+
* @param params Optional caching parameters
|
|
572
|
+
* @returns User details (data only)
|
|
573
|
+
* @throws ValidationError When response is malformed
|
|
574
|
+
*/
|
|
575
|
+
getData: async (userId, params) => {
|
|
576
|
+
const response = await this.users.get(userId, params);
|
|
577
|
+
return response.data;
|
|
578
|
+
},
|
|
579
|
+
/**
|
|
580
|
+
* Get user documentation (data only)
|
|
581
|
+
* @description Returns only the data from enhanced user document response
|
|
582
|
+
* @param userId User ID (number or string)
|
|
583
|
+
* @returns Enhanced user document (data only)
|
|
584
|
+
* @throws ValidationError When response is malformed
|
|
585
|
+
*/
|
|
586
|
+
getDocData: async (userId) => {
|
|
587
|
+
const response = await this.users.getDoc(userId);
|
|
588
|
+
return response.data;
|
|
589
|
+
},
|
|
590
|
+
/**
|
|
591
|
+
* Get Trinity user documentation (data only)
|
|
592
|
+
* @description Returns only the data from specialized Trinity business logic document response
|
|
593
|
+
* @param userId User ID (number or string)
|
|
594
|
+
* @param params Optional filtering and pagination parameters
|
|
595
|
+
* @returns Trinity document (data only)
|
|
596
|
+
* @throws ValidationError When parameters are invalid or response is malformed
|
|
597
|
+
*/
|
|
598
|
+
getTrinityDocData: async (userId, params) => {
|
|
599
|
+
const response = await this.users.getTrinityDoc(userId, params);
|
|
600
|
+
return response.data;
|
|
601
|
+
},
|
|
602
|
+
/**
|
|
603
|
+
* Verify user password (data only)
|
|
604
|
+
* @description Returns only the data from password verification response
|
|
605
|
+
* @param request Object containing username, password, and optional siteId for cross-site auth
|
|
606
|
+
* @returns Verification result (data only)
|
|
607
|
+
*/
|
|
608
|
+
verifyPasswordData: async (request) => {
|
|
609
|
+
const response = await this.users.verifyPassword(request);
|
|
610
|
+
return response.data;
|
|
611
|
+
},
|
|
612
|
+
/**
|
|
613
|
+
* Create a new user (data only)
|
|
614
|
+
* @description Returns only the data from created user response
|
|
615
|
+
* @param request User creation request data including username, email, name, and password
|
|
616
|
+
* @returns Created user information (data only)
|
|
617
|
+
* @throws ValidationError When request is invalid or response is malformed
|
|
618
|
+
*/
|
|
619
|
+
createData: async (request) => {
|
|
620
|
+
const response = await this.users.create(request);
|
|
621
|
+
return response.data;
|
|
622
|
+
},
|
|
623
|
+
/**
|
|
624
|
+
* Update an existing user (data only)
|
|
625
|
+
* @description Returns only the data from updated user response
|
|
626
|
+
* @param userId User ID (number or string)
|
|
627
|
+
* @param request User update data with optional fields to modify
|
|
628
|
+
* @returns Updated user object (data only)
|
|
629
|
+
* @throws ValidationError When request is invalid or response is malformed
|
|
630
|
+
*/
|
|
631
|
+
updateData: async (userId, request) => {
|
|
632
|
+
const response = await this.users.update(userId, request);
|
|
633
|
+
return response.data;
|
|
634
|
+
},
|
|
635
|
+
/**
|
|
636
|
+
* Block (deactivate) a user (data only)
|
|
637
|
+
* @description Returns only the data from user blocking response
|
|
638
|
+
* @param userId User ID (number or string)
|
|
639
|
+
* @returns Blocking operation result (data only)
|
|
640
|
+
* @throws ValidationError When response is malformed
|
|
641
|
+
*/
|
|
642
|
+
blockData: async (userId) => {
|
|
643
|
+
const response = await this.users.block(userId);
|
|
644
|
+
return response.data;
|
|
645
|
+
},
|
|
345
646
|
};
|
|
346
647
|
/**
|
|
347
648
|
* User Groups endpoints
|
|
@@ -349,31 +650,47 @@ export class JoomlaClient extends BaseServiceClient {
|
|
|
349
650
|
*/
|
|
350
651
|
this.userGroups = {
|
|
351
652
|
/**
|
|
352
|
-
* Get user groups
|
|
353
|
-
* @description Returns
|
|
653
|
+
* Get hierarchical list of user groups
|
|
654
|
+
* @description Returns system-wide user groups with hierarchy information, filtering, and caching
|
|
655
|
+
* @fullPath api.joomla.userGroups.list
|
|
656
|
+
* @service joomla
|
|
657
|
+
* @domain user-management
|
|
658
|
+
* @dataMethod listData(params) - returns only the user groups array without metadata
|
|
659
|
+
* @hierarchy Returns groups with level and parent relationship information
|
|
660
|
+
* @caching Supports edgeCache parameter (1-8 hours) - recommended since groups rarely change
|
|
661
|
+
* @discoverable true
|
|
662
|
+
* @searchTerms ["user groups", "groups", "permissions", "roles", "group hierarchy", "user roles"]
|
|
663
|
+
* @relatedEndpoints ["api.joomla.users.groups.list", "api.joomla.users.list", "api.joomla.users.groups.createMapping"]
|
|
664
|
+
* @commonPatterns ["list user groups", "get groups", "group permissions", "user roles", "group hierarchy"]
|
|
354
665
|
* @param params Optional filtering, ordering, and caching parameters
|
|
355
|
-
* @param params.
|
|
356
|
-
* @
|
|
666
|
+
* @param params.orderBy Sort order (e.g., 'title|ASC', 'title|DESC', 'level|ASC')
|
|
667
|
+
* @param params.parentIdList Comma-separated list of parent group IDs to filter (e.g., '1,2')
|
|
668
|
+
* @param params.edgeCache Cache duration in hours (1-8) - highly recommended since groups rarely change
|
|
669
|
+
* @returns BaseResponse<UserGroup[]> with hierarchy metadata and groups array
|
|
357
670
|
* @throws ValidationError When parameters are invalid or response is malformed
|
|
358
671
|
* @example
|
|
359
672
|
* ```typescript
|
|
360
|
-
* // Get all user groups
|
|
361
|
-
* const
|
|
673
|
+
* // Get all user groups with hierarchy information
|
|
674
|
+
* const response = await api.joomla.userGroups.list();
|
|
675
|
+
* response.data.forEach(group => {
|
|
676
|
+
* console.log(`${group.title} (Level: ${group.level}, Parent: ${group.parentId})`);
|
|
677
|
+
* });
|
|
362
678
|
*
|
|
363
|
-
* //
|
|
364
|
-
* const
|
|
365
|
-
* orderBy: 'title|
|
|
679
|
+
* // Filter and order groups
|
|
680
|
+
* const ordered = await api.joomla.userGroups.list({
|
|
681
|
+
* orderBy: 'title|ASC',
|
|
366
682
|
* parentIdList: '1,2'
|
|
367
683
|
* });
|
|
368
684
|
*
|
|
369
|
-
* // Get groups
|
|
370
|
-
* const
|
|
371
|
-
*
|
|
372
|
-
* orderBy: 'title|ASC'
|
|
685
|
+
* // Get just groups data without metadata
|
|
686
|
+
* const groups = await api.joomla.userGroups.listData({
|
|
687
|
+
* orderBy: 'level|ASC'
|
|
373
688
|
* });
|
|
374
689
|
*
|
|
375
|
-
* groups
|
|
376
|
-
*
|
|
690
|
+
* // Use long caching since groups rarely change
|
|
691
|
+
* const cachedGroups = await api.joomla.userGroups.list({
|
|
692
|
+
* edgeCache: 8, // Cache for 8 hours - groups change very infrequently
|
|
693
|
+
* orderBy: 'title|ASC'
|
|
377
694
|
* });
|
|
378
695
|
* ```
|
|
379
696
|
*/
|
|
@@ -385,6 +702,17 @@ export class JoomlaClient extends BaseServiceClient {
|
|
|
385
702
|
responseSchema: UserGroupListResponseSchema,
|
|
386
703
|
}, params);
|
|
387
704
|
},
|
|
705
|
+
/**
|
|
706
|
+
* Get user groups (data only)
|
|
707
|
+
* @description Returns only the data array from user groups response
|
|
708
|
+
* @param params Optional filtering, ordering, and caching parameters
|
|
709
|
+
* @returns Array of user groups (data only)
|
|
710
|
+
* @throws ValidationError When parameters are invalid or response is malformed
|
|
711
|
+
*/
|
|
712
|
+
listData: async (params) => {
|
|
713
|
+
const response = await this.userGroups.list(params);
|
|
714
|
+
return response.data;
|
|
715
|
+
},
|
|
388
716
|
};
|
|
389
717
|
/**
|
|
390
718
|
* Tags endpoints
|
|
@@ -392,36 +720,66 @@ export class JoomlaClient extends BaseServiceClient {
|
|
|
392
720
|
*/
|
|
393
721
|
this.tags = {
|
|
394
722
|
/**
|
|
395
|
-
* Get tags
|
|
396
|
-
* @description Returns
|
|
723
|
+
* Get hierarchical list of content tags
|
|
724
|
+
* @description Returns content tags with hierarchy, usage information, filtering, search, and edge caching
|
|
725
|
+
* @fullPath api.joomla.tags.list
|
|
726
|
+
* @service joomla
|
|
727
|
+
* @domain content-management
|
|
728
|
+
* @dataMethod listData(params) - returns only the tags array without metadata
|
|
729
|
+
* @hierarchy Returns tags with level and parent relationship information
|
|
730
|
+
* @caching Supports edgeCache parameter (1-8 hours) - recommended for reference data
|
|
731
|
+
* @discoverable true
|
|
732
|
+
* @searchTerms ["tags", "content tags", "taxonomy", "categories", "tag hierarchy"]
|
|
733
|
+
* @relatedEndpoints ["api.joomla.content.list", "api.joomla.content.get", "api.joomla.userGroups.list"]
|
|
734
|
+
* @commonPatterns ["list tags", "get tags", "search tags", "content taxonomy", "tag filtering"]
|
|
397
735
|
* @param params Optional filtering, search, and caching parameters
|
|
398
|
-
* @param params.
|
|
399
|
-
* @
|
|
736
|
+
* @param params.q Search query for filtering tags by title
|
|
737
|
+
* @param params.catId Category ID to filter tags by category
|
|
738
|
+
* @param params.limit Maximum number of tags to return (default: 20, max: 100)
|
|
739
|
+
* @param params.offset Number of tags to skip for pagination (default: 0)
|
|
740
|
+
* @param params.edgeCache Cache duration in hours (1-8) - recommended for reference data
|
|
741
|
+
* @returns BaseResponse<Tag[]> with hierarchy metadata and tags array
|
|
400
742
|
* @throws ValidationError When parameters are invalid or response is malformed
|
|
401
743
|
* @example
|
|
402
744
|
* ```typescript
|
|
403
|
-
* // Get all tags
|
|
404
|
-
* const
|
|
745
|
+
* // Get all tags with hierarchy information
|
|
746
|
+
* const response = await api.joomla.tags.list();
|
|
747
|
+
* response.data.forEach(tag => {
|
|
748
|
+
* console.log(`${tag.title} (${tag.hits} hits, Level: ${tag.level})`);
|
|
749
|
+
* });
|
|
405
750
|
*
|
|
406
|
-
* // Search tags
|
|
407
|
-
* const searchTags = await
|
|
751
|
+
* // Search tags by keyword
|
|
752
|
+
* const searchTags = await api.joomla.tags.list({
|
|
408
753
|
* q: 'technology',
|
|
409
754
|
* catId: 1,
|
|
410
755
|
* limit: 10
|
|
411
756
|
* });
|
|
412
757
|
*
|
|
413
|
-
* // Get tags
|
|
414
|
-
* const
|
|
415
|
-
* edgeCache: 5, // Cache for 5 hours
|
|
758
|
+
* // Get just tags data without metadata
|
|
759
|
+
* const tags = await api.joomla.tags.listData({
|
|
416
760
|
* limit: 50
|
|
417
761
|
* });
|
|
762
|
+
* tags.forEach(tag => console.log(tag.title, tag.alias));
|
|
418
763
|
*
|
|
419
|
-
*
|
|
420
|
-
*
|
|
764
|
+
* // Use caching for reference data (recommended)
|
|
765
|
+
* const cachedTags = await api.joomla.tags.list({
|
|
766
|
+
* edgeCache: 5, // Cache for 5 hours - tags are reference data
|
|
767
|
+
* limit: 100
|
|
421
768
|
* });
|
|
422
769
|
* ```
|
|
423
770
|
*/
|
|
424
771
|
list: this.createListMethod('/tags', TagListParamsSchema, TagListResponseSchema),
|
|
772
|
+
/**
|
|
773
|
+
* Get tags (data only)
|
|
774
|
+
* @description Returns only the data array from tags response
|
|
775
|
+
* @param params Optional filtering, search, and caching parameters
|
|
776
|
+
* @returns Array of tags (data only)
|
|
777
|
+
* @throws ValidationError When parameters are invalid or response is malformed
|
|
778
|
+
*/
|
|
779
|
+
listData: async (params) => {
|
|
780
|
+
const response = await this.tags.list(params);
|
|
781
|
+
return response.data;
|
|
782
|
+
},
|
|
425
783
|
};
|
|
426
784
|
/**
|
|
427
785
|
* Menu endpoints
|
|
@@ -448,6 +806,17 @@ export class JoomlaClient extends BaseServiceClient {
|
|
|
448
806
|
responseSchema: ContentDocumentResponseSchema,
|
|
449
807
|
}, undefined, { id: menuId });
|
|
450
808
|
},
|
|
809
|
+
/**
|
|
810
|
+
* Get menu documentation (data only)
|
|
811
|
+
* @description Returns only the data from enhanced menu item document response
|
|
812
|
+
* @param menuId Menu item ID (string)
|
|
813
|
+
* @returns Menu document (data only)
|
|
814
|
+
* @throws ValidationError When response is malformed
|
|
815
|
+
*/
|
|
816
|
+
getDocData: async (menuId) => {
|
|
817
|
+
const response = await this.menu.getDoc(menuId);
|
|
818
|
+
return response.data;
|
|
819
|
+
},
|
|
451
820
|
};
|
|
452
821
|
/**
|
|
453
822
|
* Check service health (no bearer token required)
|