@erxes/plugin-sdk 0.1.0-v2.6 → 0.1.0-v2.7
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/index.d.ts +13 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,19 @@
|
|
|
29
29
|
* // An invoice may list what it pays for; `plugin` names another plugin's line (it gets the events):
|
|
30
30
|
* // lines: [{ productId, quantity: 1, unitPrice: 150000 }, { name: 'Delivery', quantity: 1, unitPrice: 10000, plugin: 'tms' }]
|
|
31
31
|
*
|
|
32
|
+
* Fields on customers and companies (rollups; scope `fields:write`): declare them in the manifest,
|
|
33
|
+
* then write their values. Members see them read-only and filter by them; no timeline entry or event.
|
|
34
|
+
*
|
|
35
|
+
* fields: [{ code: 'total_spent', contentType: 'customer', label: 'Total spent', type: 'number' }],
|
|
36
|
+
* await core.forOrg(orgId).fields.setPluginValues({
|
|
37
|
+
* contentType: 'customer', values: [{ recordId: customerId, code: 'total_spent', value: 150000 }],
|
|
38
|
+
* }); // → { written, skipped }; up to 500, value null clears
|
|
39
|
+
*
|
|
40
|
+
* Segments (scope `views:read`): a shared view members built in core is the audience.
|
|
41
|
+
*
|
|
42
|
+
* const { data } = await core.forOrg(orgId).views.list({ recordType: 'customer' }); // shared only
|
|
43
|
+
* const { recordIds } = await core.forOrg(orgId).views.matches({ viewId, recordIds: [customerId] });
|
|
44
|
+
*
|
|
32
45
|
* Customers (a shop, tracking, booking): core signs them in; the plugin never builds sign-up or
|
|
33
46
|
* sign-in. Declare `customerApp: { origins: ['https://{subdomain}.shop.example.com'] }` in the
|
|
34
47
|
* manifest. The app's own form makes two calls to core: `POST /core/v1/customer-auth/code`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@erxes/plugin-sdk",
|
|
3
|
-
"version": "0.1.0-v2.
|
|
3
|
+
"version": "0.1.0-v2.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "For erxes plugin servers: a typed core client with automatic plugin tokens, verification of members' plugin session tokens and of core's deliveries, and plugin jobs",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@orpc/openapi-client": "1.16.2",
|
|
33
33
|
"jose": "^6.2.17",
|
|
34
34
|
"zod": "^4.6.7",
|
|
35
|
-
"@erxes/core-contract": "0.1.0-v2.
|
|
35
|
+
"@erxes/core-contract": "0.1.0-v2.8"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"drizzle-orm": "0.45.4"
|