@adminforth/bulk-ai-flow 1.27.1 → 1.27.3

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 (3) hide show
  1. package/dist/index.js +0 -22
  2. package/index.ts +0 -27
  3. package/package.json +5 -1
package/dist/index.js CHANGED
@@ -811,28 +811,6 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
811
811
  return `${this.pluginOptions.actionName}`;
812
812
  }
813
813
  setupEndpoints(server) {
814
- server.endpoint({
815
- method: 'POST',
816
- path: `/plugin/${this.pluginInstanceId}/get_records`,
817
- request_schema: getRecordsBodySchema,
818
- handler: (_a) => __awaiter(this, [_a], void 0, function* ({ body, response }) {
819
- const data = body;
820
- if (!Array.isArray(data.record)) {
821
- return { records: [] };
822
- }
823
- let records = [];
824
- const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
825
- records = yield this.adminforth.resource(this.resourceConfig.resourceId).list([Filters.IN(primaryKeyColumn.name, data.record)]);
826
- for (const [index, record] of records.entries()) {
827
- records[index]._label = this.resourceConfig.recordLabel(records[index]);
828
- }
829
- const order = Object.fromEntries(data.record.map((id, i) => [id, i]));
830
- const sortedRecords = records.sort((a, b) => order[a.id] - order[b.id]);
831
- return {
832
- records: sortedRecords,
833
- };
834
- })
835
- });
836
814
  server.endpoint({
837
815
  method: 'POST',
838
816
  path: `/plugin/${this.pluginInstanceId}/get_old_data`,
package/index.ts CHANGED
@@ -829,33 +829,6 @@ export default class BulkAiFlowPlugin extends AdminForthPlugin {
829
829
  }
830
830
 
831
831
  setupEndpoints(server: IHttpServer) {
832
- server.endpoint({
833
- method: 'POST',
834
- path: `/plugin/${this.pluginInstanceId}/get_records`,
835
- request_schema: getRecordsBodySchema,
836
- handler: async ({ body, response }) => {
837
- const data = body as z.infer<typeof getRecordsBodySchema>;
838
- if (!Array.isArray(data.record)) {
839
- return { records: [] };
840
- }
841
- let records = [];
842
- const primaryKeyColumn = this.resourceConfig.columns.find((col) => col.primaryKey);
843
- records = await this.adminforth.resource(this.resourceConfig.resourceId).list([Filters.IN(primaryKeyColumn.name, data.record)]);
844
- for( const [index, record] of records.entries() ) {
845
- records[index]._label = this.resourceConfig.recordLabel(records[index]);
846
- }
847
- const order = Object.fromEntries(data.record.map((id, i) => [id, i]));
848
-
849
- const sortedRecords = records.sort(
850
- (a, b) => order[a.id] - order[b.id]
851
- );
852
- return {
853
- records: sortedRecords,
854
- };
855
- }
856
- });
857
-
858
-
859
832
  server.endpoint({
860
833
  method: 'POST',
861
834
  path: `/plugin/${this.pluginInstanceId}/get_old_data`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/bulk-ai-flow",
3
- "version": "1.27.1",
3
+ "version": "1.27.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -8,6 +8,10 @@
8
8
  "types": "dist/index.d.ts",
9
9
  "type": "module",
10
10
  "homepage": "https://adminforth.dev/docs/tutorial/Plugins/bulk-ai-flow/",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/devforth/adminforth-bulk-ai-flow.git"
14
+ },
11
15
  "scripts": {
12
16
  "build": "tsc && rsync -av --exclude 'node_modules' custom dist/"
13
17
  },