create-erxes 0.1.27 → 0.1.29

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.js CHANGED
@@ -9,7 +9,7 @@ import { mkdir, readFile, readdir, symlink, writeFile } from "node:fs/promises";
9
9
  import { homedir } from "node:os";
10
10
  import { fileURLToPath } from "node:url";
11
11
  // package.json
12
- var version = "0.1.27";
12
+ var version = "0.1.29";
13
13
  // src/existing-plugins.ts
14
14
  /** The old erxes plugins a new-core plugin can be migrated from (`backend/plugins/<name>_api`). */
15
15
  const OLD_PLUGINS = [
@@ -58,7 +58,10 @@ without line-by-line review.
58
58
  call token, checked with `verifyPluginCall`. The same procedures are REST at `/api/v1` for
59
59
  scripts, which get the token from core with an API key; `/api/openapi/member.json`
60
60
  documents them (`pluginOpenApi`), and core's Settings › Developer › API reference
61
- shows it. Routes for employees in the plugin's own app, customers or a website get
61
+ shows it. The assistant finds and calls those member routes as the member, with no
62
+ step in between, so check the member's permission in every procedure. One that takes
63
+ or returns a credential is never offered. Give a read `method: 'GET'`: after any other
64
+ call web reads the page's data again. Routes for employees in the plugin's own app, customers or a website get
62
65
  their own document with that `audience`, listed in the manifest's `api.docs`. Renaming a procedure breaks those scripts. A caller outside erxes (a webhook) reaches a path
63
66
  the manifest's `publicPaths` lists through core, which names the organisation:
64
67
  check it with `verifyPublicCall` (`@erxes/plugin-sdk`'s overview has the route).
@@ -81,6 +81,18 @@ Node 26 runs the TypeScript directly; imports carry `.ts` and `#/` is `src/`.
81
81
  build in core. Store its id; `views.list({ recordType })` lists the shared
82
82
  ones and `views.matches({ viewId, recordIds })` says which records it
83
83
  matches now (scope `views:read`, up to 500 ids).
84
+ - Members import the plugin's records from CSV or Excel and export them through
85
+ core's import and export, at Contacts › Settings › Import & export
86
+ (`/contacts/settings/import-export`). Declare each record type in the
87
+ manifest's `transfer` (`type: '__id__:<record>'`, `label`, `columns`, and
88
+ `exportPermission` and `importPermission` from its `permissions`). Core keeps
89
+ the file, the mapping, the check and the jobs, and asks the API: POST
90
+ `/api/transfer/export` wants up to `limit` rows after `cursor`, answered
91
+ `{ rows, cursor }` (rows keyed by column, cursor null on the last page);
92
+ POST `/api/transfer/import` sends `rows` of `{ rowNumber, values }`, answered
93
+ `{ rows: [{ rowNumber, action, recordId?, error? }] }`, changing nothing when
94
+ `dryRun`. Check each with `verifyCoreTransfer` and answer as its `userId` may
95
+ see and change. A retried batch keeps its `requestId`: write it once.
84
96
  - Tests: `vite-plus/test`, run with `call(procedure, input, { context: { member } })`.
85
97
  `src/test/setup.ts` gives each file its own database, owned by a role without
86
98
  BYPASSRLS, so row-level security is real in tests.
@@ -21,8 +21,8 @@
21
21
  "db:check": "drizzle-kit check"
22
22
  },
23
23
  "dependencies": {
24
- "@erxes/core-contract": "0.1.0-v2.28",
25
- "@erxes/plugin-sdk": "0.1.0-v2.27",
24
+ "@erxes/core-contract": "0.1.0-v2.30",
25
+ "@erxes/plugin-sdk": "0.1.0-v2.29",
26
26
  "@opentelemetry/instrumentation-express": "^0.73.0",
27
27
  "@opentelemetry/instrumentation-http": "^0.301.1",
28
28
  "@opentelemetry/instrumentation-pg": "^0.78.0",
@@ -8,12 +8,12 @@
8
8
  "build": "rsbuild build"
9
9
  },
10
10
  "dependencies": {
11
- "@erxes/core-contract": "0.1.0-v2.28",
11
+ "@erxes/core-contract": "0.1.0-v2.30",
12
12
  "@orpc/client": "1.16.2",
13
13
  "@orpc/tanstack-query": "1.16.2",
14
14
  "@tabler/icons-react": "3.34.0",
15
15
  "@tanstack/react-query": "^5.107.1",
16
- "erxes-ui": "npm:@erxes/ui@4.0.0-v2.25",
16
+ "erxes-ui": "npm:@erxes/ui@4.0.0-v2.28",
17
17
  "jotai": "^3.0.2",
18
18
  "nuqs": "^2.10.3",
19
19
  "react": "19.3.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-erxes",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "private": false,
5
5
  "description": "Create an erxes plugin for the new core, or migrate an old erxes plugin onto it: pnpm create erxes",
6
6
  "license": "MIT",