fluentcart-developer 2.3.0 → 2.3.1

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.
Files changed (49) hide show
  1. package/README.md +59 -59
  2. package/dist/cards/fluentcart/tools.d.ts.map +1 -1
  3. package/dist/cards/fluentcart/tools.js +2301 -2161
  4. package/dist/cards/fluentcart/tools.js.map +1 -1
  5. package/dist/skills/fluentcart-developer/.claude-plugin/plugin.json +12 -12
  6. package/dist/skills/fluentcart-developer/.mcp.json +11 -11
  7. package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
  8. package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
  9. package/dist/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
  10. package/dist/skills/fluentcart-developer/references/action-hooks-cart-checkout.md +1355 -1355
  11. package/dist/skills/fluentcart-developer/references/action-hooks-customers-users.md +266 -266
  12. package/dist/skills/fluentcart-developer/references/action-hooks-licenses.md +855 -855
  13. package/dist/skills/fluentcart-developer/references/action-hooks-orders.md +631 -631
  14. package/dist/skills/fluentcart-developer/references/action-hooks-payments-integrations.md +963 -963
  15. package/dist/skills/fluentcart-developer/references/action-hooks-products-coupons.md +585 -585
  16. package/dist/skills/fluentcart-developer/references/action-hooks-subscriptions.md +661 -661
  17. package/dist/skills/fluentcart-developer/references/database-models-query-builder.md +194 -194
  18. package/dist/skills/fluentcart-developer/references/database-models-reference.md +604 -604
  19. package/dist/skills/fluentcart-developer/references/engineering-notes.md +154 -154
  20. package/dist/skills/fluentcart-developer/references/fee-system-guide.md +449 -449
  21. package/dist/skills/fluentcart-developer/references/filter-hooks-cart-checkout.md +1202 -1202
  22. package/dist/skills/fluentcart-developer/references/filter-hooks-integrations-advanced.md +1598 -1598
  23. package/dist/skills/fluentcart-developer/references/filter-hooks-products-pricing.md +628 -628
  24. package/dist/skills/fluentcart-developer/references/filter-hooks-settings-configuration.md +1177 -1177
  25. package/dist/skills/fluentcart-developer/references/fluentcart-developer-guide.md +154 -154
  26. package/dist/skills/fluentcart-developer/references/ghost-product-selling.md +458 -458
  27. package/dist/skills/fluentcart-developer/references/modules-and-extensions-reference.md +224 -224
  28. package/dist/skills/fluentcart-developer/references/payment-gateway-integration.md +761 -761
  29. package/dist/skills/fluentcart-developer/references/rest-api-customer-profile.md +190 -190
  30. package/dist/skills/fluentcart-developer/references/rest-api-customers.md +1121 -1121
  31. package/dist/skills/fluentcart-developer/references/rest-api-dashboard-utilities.md +219 -219
  32. package/dist/skills/fluentcart-developer/references/rest-api-email-notifications.md +619 -619
  33. package/dist/skills/fluentcart-developer/references/rest-api-files.md +290 -290
  34. package/dist/skills/fluentcart-developer/references/rest-api-integrations.md +324 -324
  35. package/dist/skills/fluentcart-developer/references/rest-api-labels-attributes.md +321 -321
  36. package/dist/skills/fluentcart-developer/references/rest-api-order-bumps.md +200 -200
  37. package/dist/skills/fluentcart-developer/references/rest-api-overview.md +131 -131
  38. package/dist/skills/fluentcart-developer/references/rest-api-public-shop.md +172 -172
  39. package/dist/skills/fluentcart-developer/references/rest-api-reference.md +552 -552
  40. package/dist/skills/fluentcart-developer/references/rest-api-reports.md +377 -377
  41. package/dist/skills/fluentcart-developer/references/rest-api-roles-permissions.md +147 -147
  42. package/dist/skills/fluentcart-developer/references/rest-api-settings.md +528 -528
  43. package/dist/skills/fluentcart-developer/references/rest-api-shipping.md +799 -799
  44. package/dist/skills/fluentcart-developer/references/rest-api-tax.md +356 -356
  45. package/dist/skills/fluentcart-developer/references/subscription-customization.md +197 -197
  46. package/dist/skills/fluentcart-developer/scripts/cli.js +1 -1
  47. package/dist/version.d.ts +1 -1
  48. package/dist/version.js +1 -1
  49. package/package.json +65 -65
@@ -1,147 +1,147 @@
1
- # Roles & Permissions API (Pro)
2
-
3
- Manage custom store roles (`super_admin`, `manager`, `worker`, `accountant`), assign capabilities to WordPress users, search eligible users, and inspect role permission matrices in FluentCart Pro.
4
-
5
- **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2/roles`
6
- **Policy:** `AdminPolicy` (Requires WordPress `manage_options` / `is_super_admin` capability)
7
-
8
- ---
9
-
10
- ## Endpoints Overview
11
-
12
- | Method | Endpoint | Description |
13
- |--------|----------|-------------|
14
- | GET | `/roles/managers` | List all WordPress users assigned a FluentCart shop role |
15
- | GET | `/roles/user-list` | Search WordPress users eligible for role assignment (excludes WP admins) |
16
- | GET | `/roles` | List available FluentCart role definitions (titles & descriptions) |
17
- | POST | `/roles` | Assign a shop role to a WordPress user (grants `fluent_cart_admin` capability) |
18
- | GET | `/roles/{key}` | Placeholder: Get role details |
19
- | POST | `/roles/{key}` | Placeholder: Update role definition |
20
- | DELETE | `/roles/{key}` | Remove a shop role assignment from a user (removes `fluent_cart_admin`) |
21
-
22
- ---
23
-
24
- ## 1. List & Search Users
25
-
26
- ### List Managers
27
-
28
- `GET /fluent-cart/v2/roles/managers`
29
-
30
- Retrieve all WordPress users who have been assigned a shop role along with their permissions array.
31
-
32
- #### Response
33
-
34
- ```json
35
- {
36
- "managers": [
37
- {
38
- "id": 5,
39
- "email": "manager@example.com",
40
- "display_name": "Jane Manager",
41
- "username": "janemanager",
42
- "shop_role": "manager",
43
- "description": "With All Permissions Except Sensitive Settings",
44
- "registered_at": "2025-03-10 08:00:00",
45
- "role_permissions": [
46
- "store/settings",
47
- "products/view",
48
- "orders/view",
49
- "orders/manage",
50
- "reports/view"
51
- ]
52
- }
53
- ]
54
- }
55
- ```
56
-
57
- ---
58
-
59
- ### Search Eligible Users
60
-
61
- `GET /fluent-cart/v2/roles/user-list`
62
-
63
- Search for WordPress users who can be assigned a shop role.
64
-
65
- > **Exclusion Rule:** WordPress site Administrators (`manage_options`) are automatically excluded from search results since they already possess full store capabilities.
66
-
67
- #### Parameters
68
-
69
- | Parameter | Type | Location | Required | Description |
70
- |-----------|------|----------|----------|-------------|
71
- | `search` | string | query | No | Partial search by display name or email address |
72
- | `user_ids` | string/array | query | No | Include specific user IDs regardless of search term |
73
-
74
- ---
75
-
76
- ## 2. Role Assignments & Definitions
77
-
78
- ### List Roles
79
-
80
- `GET /fluent-cart/v2/roles`
81
-
82
- Retrieve built-in role titles and descriptions (`super_admin`, `manager`, `worker`, `accountant`).
83
-
84
- ---
85
-
86
- ### Assign Role
87
-
88
- `POST /fluent-cart/v2/roles`
89
-
90
- Assigns a role to a user. The user is granted the `fluent_cart_admin` capability and the role key is stored in user meta.
91
-
92
- #### Parameters
93
-
94
- | Parameter | Type | Required | Description |
95
- |-----------|------|----------|-------------|
96
- | `user_id` | integer | Yes | WordPress user ID |
97
- | `role_key` | string | Yes | Role slug (`super_admin`, `manager`, `worker`, `accountant`) |
98
-
99
- #### Response
100
-
101
- ```json
102
- {
103
- "message": "Role synced successfully",
104
- "is_updated": true
105
- }
106
- ```
107
-
108
- ---
109
-
110
- ### Delete Role Assignment
111
-
112
- `DELETE /fluent-cart/v2/roles/{key}`
113
-
114
- Removes the shop role from the specified user and strips the `fluent_cart_admin` capability.
115
-
116
- #### Parameters
117
-
118
- | Parameter | Type | Required | Description |
119
- |-----------|------|----------|-------------|
120
- | `key` | string | Yes (Path) | Role key being removed |
121
- | `user_id` | integer | Yes (Body/Query) | WordPress user ID |
122
-
123
- ---
124
-
125
- ## 3. Built-In Role Definitions & Capability Matrix
126
-
127
- | Role | Key Permissions Included | Key Restrictions |
128
- |------|--------------------------|------------------|
129
- | **Super Admin** | `store/settings`, `store/sensitive`, `products/*`, `customers/*`, `orders/*`, `subscriptions/*`, `licenses/*`, `coupons/*`, `reports/*`, `integrations/*`, `labels/*`, `dashboard_stats/view` | None (Full Access) |
130
- | **Manager** | All Super Admin permissions except sensitive store settings | Excludes `store/sensitive` |
131
- | **Worker** | View access for products, customers, orders, subscriptions, licenses, integrations; manage order statuses; view & manage coupons | No product/customer editing, no report access |
132
- | **Accountant** | View access for products, customers, orders, subscriptions, licenses, coupons, integrations; view & export orders and reports | Read-only with export rights; no management actions |
133
-
134
- ---
135
-
136
- ## Hooks & Extension Filters
137
-
138
- ```php
139
- // Extend or customize available role definitions
140
- add_filter('fluent_cart/permission/all_roles', function($roles) {
141
- $roles['fulfillment_agent'] = [
142
- 'title' => 'Fulfillment Agent',
143
- 'description' => 'Manage orders and shipping statuses only'
144
- ];
145
- return $roles;
146
- });
147
- ```
1
+ # Roles & Permissions API (Pro)
2
+
3
+ Manage custom store roles (`super_admin`, `manager`, `worker`, `accountant`), assign capabilities to WordPress users, search eligible users, and inspect role permission matrices in FluentCart Pro.
4
+
5
+ **Base URL:** `https://your-site.com/wp-json/fluent-cart/v2/roles`
6
+ **Policy:** `AdminPolicy` (Requires WordPress `manage_options` / `is_super_admin` capability)
7
+
8
+ ---
9
+
10
+ ## Endpoints Overview
11
+
12
+ | Method | Endpoint | Description |
13
+ |--------|----------|-------------|
14
+ | GET | `/roles/managers` | List all WordPress users assigned a FluentCart shop role |
15
+ | GET | `/roles/user-list` | Search WordPress users eligible for role assignment (excludes WP admins) |
16
+ | GET | `/roles` | List available FluentCart role definitions (titles & descriptions) |
17
+ | POST | `/roles` | Assign a shop role to a WordPress user (grants `fluent_cart_admin` capability) |
18
+ | GET | `/roles/{key}` | Placeholder: Get role details |
19
+ | POST | `/roles/{key}` | Placeholder: Update role definition |
20
+ | DELETE | `/roles/{key}` | Remove a shop role assignment from a user (removes `fluent_cart_admin`) |
21
+
22
+ ---
23
+
24
+ ## 1. List & Search Users
25
+
26
+ ### List Managers
27
+
28
+ `GET /fluent-cart/v2/roles/managers`
29
+
30
+ Retrieve all WordPress users who have been assigned a shop role along with their permissions array.
31
+
32
+ #### Response
33
+
34
+ ```json
35
+ {
36
+ "managers": [
37
+ {
38
+ "id": 5,
39
+ "email": "manager@example.com",
40
+ "display_name": "Jane Manager",
41
+ "username": "janemanager",
42
+ "shop_role": "manager",
43
+ "description": "With All Permissions Except Sensitive Settings",
44
+ "registered_at": "2025-03-10 08:00:00",
45
+ "role_permissions": [
46
+ "store/settings",
47
+ "products/view",
48
+ "orders/view",
49
+ "orders/manage",
50
+ "reports/view"
51
+ ]
52
+ }
53
+ ]
54
+ }
55
+ ```
56
+
57
+ ---
58
+
59
+ ### Search Eligible Users
60
+
61
+ `GET /fluent-cart/v2/roles/user-list`
62
+
63
+ Search for WordPress users who can be assigned a shop role.
64
+
65
+ > **Exclusion Rule:** WordPress site Administrators (`manage_options`) are automatically excluded from search results since they already possess full store capabilities.
66
+
67
+ #### Parameters
68
+
69
+ | Parameter | Type | Location | Required | Description |
70
+ |-----------|------|----------|----------|-------------|
71
+ | `search` | string | query | No | Partial search by display name or email address |
72
+ | `user_ids` | string/array | query | No | Include specific user IDs regardless of search term |
73
+
74
+ ---
75
+
76
+ ## 2. Role Assignments & Definitions
77
+
78
+ ### List Roles
79
+
80
+ `GET /fluent-cart/v2/roles`
81
+
82
+ Retrieve built-in role titles and descriptions (`super_admin`, `manager`, `worker`, `accountant`).
83
+
84
+ ---
85
+
86
+ ### Assign Role
87
+
88
+ `POST /fluent-cart/v2/roles`
89
+
90
+ Assigns a role to a user. The user is granted the `fluent_cart_admin` capability and the role key is stored in user meta.
91
+
92
+ #### Parameters
93
+
94
+ | Parameter | Type | Required | Description |
95
+ |-----------|------|----------|-------------|
96
+ | `user_id` | integer | Yes | WordPress user ID |
97
+ | `role_key` | string | Yes | Role slug (`super_admin`, `manager`, `worker`, `accountant`) |
98
+
99
+ #### Response
100
+
101
+ ```json
102
+ {
103
+ "message": "Role synced successfully",
104
+ "is_updated": true
105
+ }
106
+ ```
107
+
108
+ ---
109
+
110
+ ### Delete Role Assignment
111
+
112
+ `DELETE /fluent-cart/v2/roles/{key}`
113
+
114
+ Removes the shop role from the specified user and strips the `fluent_cart_admin` capability.
115
+
116
+ #### Parameters
117
+
118
+ | Parameter | Type | Required | Description |
119
+ |-----------|------|----------|-------------|
120
+ | `key` | string | Yes (Path) | Role key being removed |
121
+ | `user_id` | integer | Yes (Body/Query) | WordPress user ID |
122
+
123
+ ---
124
+
125
+ ## 3. Built-In Role Definitions & Capability Matrix
126
+
127
+ | Role | Key Permissions Included | Key Restrictions |
128
+ |------|--------------------------|------------------|
129
+ | **Super Admin** | `store/settings`, `store/sensitive`, `products/*`, `customers/*`, `orders/*`, `subscriptions/*`, `licenses/*`, `coupons/*`, `reports/*`, `integrations/*`, `labels/*`, `dashboard_stats/view` | None (Full Access) |
130
+ | **Manager** | All Super Admin permissions except sensitive store settings | Excludes `store/sensitive` |
131
+ | **Worker** | View access for products, customers, orders, subscriptions, licenses, integrations; manage order statuses; view & manage coupons | No product/customer editing, no report access |
132
+ | **Accountant** | View access for products, customers, orders, subscriptions, licenses, coupons, integrations; view & export orders and reports | Read-only with export rights; no management actions |
133
+
134
+ ---
135
+
136
+ ## Hooks & Extension Filters
137
+
138
+ ```php
139
+ // Extend or customize available role definitions
140
+ add_filter('fluent_cart/permission/all_roles', function($roles) {
141
+ $roles['fulfillment_agent'] = [
142
+ 'title' => 'Fulfillment Agent',
143
+ 'description' => 'Manage orders and shipping statuses only'
144
+ ];
145
+ return $roles;
146
+ });
147
+ ```