@nocobase/plugin-map 1.2.12-alpha → 1.3.0-alpha.20240710084543
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/package.json +2 -2
- package/dist/client/block/MapActionInitializers.d.ts +0 -16
- package/dist/client/block/MapBlock.Settings.d.ts +0 -78
- package/dist/client/block/MapBlock.d.ts +0 -10
- package/dist/client/block/MapBlockDesigner.d.ts +0 -10
- package/dist/client/block/MapBlockInitializer.d.ts +0 -10
- package/dist/client/block/MapBlockProvider.d.ts +0 -13
- package/dist/client/block/createMapBlockUISchema.d.ts +0 -14
- package/dist/client/block/index.d.ts +0 -10
- package/dist/client/block/utils.d.ts +0 -9
- package/dist/client/components/AMap/Block.d.ts +0 -10
- package/dist/client/components/AMap/Map.d.ts +0 -47
- package/dist/client/components/AMap/Search.d.ts +0 -15
- package/dist/client/components/AMap/index.d.ts +0 -10
- package/dist/client/components/Configuration.d.ts +0 -10
- package/dist/client/components/Designer.d.ts +0 -11
- package/dist/client/components/GoogleMaps/Block.d.ts +0 -10
- package/dist/client/components/GoogleMaps/Map.d.ts +0 -39
- package/dist/client/components/GoogleMaps/Search.d.ts +0 -16
- package/dist/client/components/GoogleMaps/index.d.ts +0 -10
- package/dist/client/components/GoogleMaps/utils.d.ts +0 -13
- package/dist/client/components/Map.d.ts +0 -15
- package/dist/client/components/MapBlock.d.ts +0 -10
- package/dist/client/components/MapComponent.d.ts +0 -10
- package/dist/client/components/ReadPretty.d.ts +0 -11
- package/dist/client/components/hook.d.ts +0 -9
- package/dist/client/components/index.d.ts +0 -14
- package/dist/client/constants.d.ts +0 -14
- package/dist/client/fields/circle.d.ts +0 -28
- package/dist/client/fields/fieldSettingsComponentMap.d.ts +0 -10
- package/dist/client/fields/index.d.ts +0 -10
- package/dist/client/fields/lineString.d.ts +0 -28
- package/dist/client/fields/point.d.ts +0 -28
- package/dist/client/fields/polygon.d.ts +0 -28
- package/dist/client/fields/schema.d.ts +0 -51
- package/dist/client/hooks/index.d.ts +0 -9
- package/dist/client/hooks/useMapConfiguration.d.ts +0 -11
- package/dist/client/index.d.ts +0 -13
- package/dist/client/index.js +0 -124
- package/dist/client/locale/index.d.ts +0 -12
- package/dist/client/types.d.ts +0 -9
- package/dist/client/utils.d.ts +0 -9
- package/dist/externalVersion.js +0 -28
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -48
- package/dist/locale/en-US.json +0 -51
- package/dist/locale/ko_KR.json +0 -51
- package/dist/locale/pt-BR.json +0 -45
- package/dist/locale/zh-CN.json +0 -51
- package/dist/server/actions/index.d.ts +0 -11
- package/dist/server/actions/index.js +0 -74
- package/dist/server/collections/mapConfiguration.d.ts +0 -10
- package/dist/server/collections/mapConfiguration.js +0 -60
- package/dist/server/constants.d.ts +0 -9
- package/dist/server/constants.js +0 -36
- package/dist/server/fields/circle.d.ts +0 -20
- package/dist/server/fields/circle.js +0 -77
- package/dist/server/fields/index.d.ts +0 -12
- package/dist/server/fields/index.js +0 -36
- package/dist/server/fields/lineString.d.ts +0 -20
- package/dist/server/fields/lineString.js +0 -84
- package/dist/server/fields/point.d.ts +0 -20
- package/dist/server/fields/point.js +0 -87
- package/dist/server/fields/polygon.d.ts +0 -20
- package/dist/server/fields/polygon.js +0 -83
- package/dist/server/helpers/index.d.ts +0 -14
- package/dist/server/helpers/index.js +0 -67
- package/dist/server/index.d.ts +0 -9
- package/dist/server/index.js +0 -42
- package/dist/server/interfaces/index.d.ts +0 -23
- package/dist/server/interfaces/index.js +0 -80
- package/dist/server/plugin.d.ts +0 -19
- package/dist/server/plugin.js +0 -100
- package/dist/server/value-parsers/index.d.ts +0 -21
- package/dist/server/value-parsers/index.js +0 -86
- package/dist/swagger/index.d.ts +0 -85
- package/dist/swagger/index.js +0 -109
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var polygon_exports = {};
|
|
28
|
-
__export(polygon_exports, {
|
|
29
|
-
PolygonField: () => PolygonField
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(polygon_exports);
|
|
32
|
-
var import_database = require("@nocobase/database");
|
|
33
|
-
var import_helpers = require("../helpers");
|
|
34
|
-
class Polygon extends import_database.DataTypes.ABSTRACT {
|
|
35
|
-
key = "Polygon";
|
|
36
|
-
}
|
|
37
|
-
class PolygonField extends import_database.Field {
|
|
38
|
-
constructor(options, context) {
|
|
39
|
-
const { name } = options;
|
|
40
|
-
super(
|
|
41
|
-
{
|
|
42
|
-
get() {
|
|
43
|
-
const value = this.getDataValue(name);
|
|
44
|
-
if ((0, import_helpers.isPg)(context)) {
|
|
45
|
-
return (0, import_helpers.toValue)(value);
|
|
46
|
-
} else if ((0, import_helpers.isMysql)(context)) {
|
|
47
|
-
return (value == null ? void 0 : value.coordinates[0].slice(0, -1)) || null;
|
|
48
|
-
} else {
|
|
49
|
-
return value;
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
set(value) {
|
|
53
|
-
if (!(value == null ? void 0 : value.length))
|
|
54
|
-
value = null;
|
|
55
|
-
else if ((0, import_helpers.isPg)(context)) {
|
|
56
|
-
value = (0, import_helpers.joinComma)(value.map((item) => (0, import_helpers.joinComma)(item)));
|
|
57
|
-
} else if ((0, import_helpers.isMysql)(context)) {
|
|
58
|
-
value = {
|
|
59
|
-
type: "Polygon",
|
|
60
|
-
coordinates: [value.concat([value[0]])]
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
this.setDataValue(name, value);
|
|
64
|
-
},
|
|
65
|
-
...options
|
|
66
|
-
},
|
|
67
|
-
context
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
get dataType() {
|
|
71
|
-
if ((0, import_helpers.isPg)(this.context)) {
|
|
72
|
-
return Polygon;
|
|
73
|
-
} else if ((0, import_helpers.isMysql)(this.context)) {
|
|
74
|
-
return import_database.DataTypes.GEOMETRY("POLYGON");
|
|
75
|
-
} else {
|
|
76
|
-
return import_database.DataTypes.JSON;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
-
0 && (module.exports = {
|
|
82
|
-
PolygonField
|
|
83
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export declare const joinComma: (value: any[]) => string;
|
|
10
|
-
export declare const toValue: (value?: string) => any;
|
|
11
|
-
export declare const getDialect: (ctx: any) => any;
|
|
12
|
-
export declare const isPg: (ctx: any) => boolean;
|
|
13
|
-
export declare const isSqlite: (ctx: any) => boolean;
|
|
14
|
-
export declare const isMysql: (ctx: any) => boolean;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var helpers_exports = {};
|
|
28
|
-
__export(helpers_exports, {
|
|
29
|
-
getDialect: () => getDialect,
|
|
30
|
-
isMysql: () => isMysql,
|
|
31
|
-
isPg: () => isPg,
|
|
32
|
-
isSqlite: () => isSqlite,
|
|
33
|
-
joinComma: () => joinComma,
|
|
34
|
-
toValue: () => toValue
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(helpers_exports);
|
|
37
|
-
const joinComma = (value) => {
|
|
38
|
-
if (!value)
|
|
39
|
-
return null;
|
|
40
|
-
return `(${value.join(",")})`;
|
|
41
|
-
};
|
|
42
|
-
const toValue = (value) => {
|
|
43
|
-
if (!value)
|
|
44
|
-
return null;
|
|
45
|
-
return JSON.parse(value.replace(/\(/g, "[").replace(/\)/g, "]"));
|
|
46
|
-
};
|
|
47
|
-
const getDialect = (ctx) => {
|
|
48
|
-
return (ctx.db || ctx.database).sequelize.getDialect();
|
|
49
|
-
};
|
|
50
|
-
const isPg = (ctx) => {
|
|
51
|
-
return getDialect(ctx) === "postgres";
|
|
52
|
-
};
|
|
53
|
-
const isSqlite = (ctx) => {
|
|
54
|
-
return getDialect(ctx) === "sqlite";
|
|
55
|
-
};
|
|
56
|
-
const isMysql = (ctx) => {
|
|
57
|
-
return getDialect(ctx) === "mysql";
|
|
58
|
-
};
|
|
59
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
-
0 && (module.exports = {
|
|
61
|
-
getDialect,
|
|
62
|
-
isMysql,
|
|
63
|
-
isPg,
|
|
64
|
-
isSqlite,
|
|
65
|
-
joinComma,
|
|
66
|
-
toValue
|
|
67
|
-
});
|
package/dist/server/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export { default } from './plugin';
|
package/dist/server/index.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var server_exports = {};
|
|
38
|
-
__export(server_exports, {
|
|
39
|
-
default: () => import_plugin.default
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(server_exports);
|
|
42
|
-
var import_plugin = __toESM(require("./plugin"));
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { BaseInterface } from '@nocobase/database';
|
|
10
|
-
export declare class PointInterface extends BaseInterface {
|
|
11
|
-
toValue(str: any, ctx?: any): Promise<any>;
|
|
12
|
-
toString(value: any, ctx?: any): any;
|
|
13
|
-
}
|
|
14
|
-
export declare class PolygonInterface extends BaseInterface {
|
|
15
|
-
toValue(str: any, ctx?: any): Promise<any>;
|
|
16
|
-
toString(value: any, ctx?: any): string;
|
|
17
|
-
}
|
|
18
|
-
export declare class LineStringInterface extends PolygonInterface {
|
|
19
|
-
}
|
|
20
|
-
export declare class CircleInterface extends BaseInterface {
|
|
21
|
-
toValue(str: any, ctx?: any): Promise<any>;
|
|
22
|
-
toString(value: any, ctx?: any): any;
|
|
23
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var interfaces_exports = {};
|
|
28
|
-
__export(interfaces_exports, {
|
|
29
|
-
CircleInterface: () => CircleInterface,
|
|
30
|
-
LineStringInterface: () => LineStringInterface,
|
|
31
|
-
PointInterface: () => PointInterface,
|
|
32
|
-
PolygonInterface: () => PolygonInterface
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(interfaces_exports);
|
|
35
|
-
var import_database = require("@nocobase/database");
|
|
36
|
-
class PointInterface extends import_database.BaseInterface {
|
|
37
|
-
async toValue(str, ctx) {
|
|
38
|
-
if (!str)
|
|
39
|
-
return null;
|
|
40
|
-
return str.split(",").map((v) => parseFloat(v));
|
|
41
|
-
}
|
|
42
|
-
toString(value, ctx) {
|
|
43
|
-
if (!value)
|
|
44
|
-
return null;
|
|
45
|
-
return value.join(",");
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
class PolygonInterface extends import_database.BaseInterface {
|
|
49
|
-
async toValue(str, ctx) {
|
|
50
|
-
if (!str)
|
|
51
|
-
return null;
|
|
52
|
-
return str.substring(1, str.length - 1).split("),(").map((v) => v.split(",").map((v2) => parseFloat(v2)));
|
|
53
|
-
}
|
|
54
|
-
toString(value, ctx) {
|
|
55
|
-
if (!value)
|
|
56
|
-
return null;
|
|
57
|
-
return `(${value.map((v) => v.join(",")).join("),(")})`;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
class LineStringInterface extends PolygonInterface {
|
|
61
|
-
}
|
|
62
|
-
class CircleInterface extends import_database.BaseInterface {
|
|
63
|
-
async toValue(str, ctx) {
|
|
64
|
-
if (!str)
|
|
65
|
-
return null;
|
|
66
|
-
return str.split(",").map((v) => parseFloat(v));
|
|
67
|
-
}
|
|
68
|
-
toString(value, ctx) {
|
|
69
|
-
if (!value)
|
|
70
|
-
return null;
|
|
71
|
-
return value.join(",");
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
-
0 && (module.exports = {
|
|
76
|
-
CircleInterface,
|
|
77
|
-
LineStringInterface,
|
|
78
|
-
PointInterface,
|
|
79
|
-
PolygonInterface
|
|
80
|
-
});
|
package/dist/server/plugin.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { InstallOptions, Plugin } from '@nocobase/server';
|
|
10
|
-
export declare class PluginMapServer extends Plugin {
|
|
11
|
-
afterAdd(): void;
|
|
12
|
-
beforeLoad(): void;
|
|
13
|
-
load(): Promise<void>;
|
|
14
|
-
install(options?: InstallOptions): Promise<void>;
|
|
15
|
-
afterEnable(): Promise<void>;
|
|
16
|
-
afterDisable(): Promise<void>;
|
|
17
|
-
remove(): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
export default PluginMapServer;
|
package/dist/server/plugin.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var plugin_exports = {};
|
|
38
|
-
__export(plugin_exports, {
|
|
39
|
-
PluginMapServer: () => PluginMapServer,
|
|
40
|
-
default: () => plugin_default
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(plugin_exports);
|
|
43
|
-
var import_server = require("@nocobase/server");
|
|
44
|
-
var import_path = __toESM(require("path"));
|
|
45
|
-
var import_actions = require("./actions");
|
|
46
|
-
var import_fields = require("./fields");
|
|
47
|
-
var import_value_parsers = require("./value-parsers");
|
|
48
|
-
var import_interfaces = require("./interfaces");
|
|
49
|
-
class PluginMapServer extends import_server.Plugin {
|
|
50
|
-
afterAdd() {
|
|
51
|
-
}
|
|
52
|
-
beforeLoad() {
|
|
53
|
-
const fields = {
|
|
54
|
-
point: import_fields.PointField,
|
|
55
|
-
polygon: import_fields.PolygonField,
|
|
56
|
-
lineString: import_fields.LineStringField,
|
|
57
|
-
circle: import_fields.CircleField
|
|
58
|
-
};
|
|
59
|
-
this.db.registerFieldTypes(fields);
|
|
60
|
-
this.db.registerFieldValueParsers({
|
|
61
|
-
point: import_value_parsers.PointValueParser,
|
|
62
|
-
polygon: import_value_parsers.PolygonValueParser,
|
|
63
|
-
lineString: import_value_parsers.LineStringValueParser,
|
|
64
|
-
circle: import_value_parsers.CircleValueParser
|
|
65
|
-
});
|
|
66
|
-
this.db.interfaceManager.registerInterfaceType("point", import_interfaces.PointInterface);
|
|
67
|
-
this.db.interfaceManager.registerInterfaceType("polygon", import_interfaces.PolygonInterface);
|
|
68
|
-
this.db.interfaceManager.registerInterfaceType("lineString", import_interfaces.LineStringInterface);
|
|
69
|
-
this.db.interfaceManager.registerInterfaceType("circle", import_interfaces.CircleInterface);
|
|
70
|
-
}
|
|
71
|
-
async load() {
|
|
72
|
-
await this.importCollections(import_path.default.resolve(__dirname, "collections"));
|
|
73
|
-
this.app.resource({
|
|
74
|
-
name: "map-configuration",
|
|
75
|
-
actions: {
|
|
76
|
-
get: import_actions.getConfiguration,
|
|
77
|
-
set: import_actions.setConfiguration
|
|
78
|
-
},
|
|
79
|
-
only: ["get", "set"]
|
|
80
|
-
});
|
|
81
|
-
this.app.acl.registerSnippet({
|
|
82
|
-
name: `pm.${this.name}.configuration`,
|
|
83
|
-
actions: ["map-configuration:set"]
|
|
84
|
-
});
|
|
85
|
-
this.app.acl.allow("map-configuration", "get", "loggedIn");
|
|
86
|
-
}
|
|
87
|
-
async install(options) {
|
|
88
|
-
}
|
|
89
|
-
async afterEnable() {
|
|
90
|
-
}
|
|
91
|
-
async afterDisable() {
|
|
92
|
-
}
|
|
93
|
-
async remove() {
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
var plugin_default = PluginMapServer;
|
|
97
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
-
0 && (module.exports = {
|
|
99
|
-
PluginMapServer
|
|
100
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { BaseValueParser } from '@nocobase/database';
|
|
10
|
-
export declare class PointValueParser extends BaseValueParser {
|
|
11
|
-
setValue(value: any): Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
export declare class PolygonValueParser extends BaseValueParser {
|
|
14
|
-
setValue(value: any): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
export declare class LineStringValueParser extends BaseValueParser {
|
|
17
|
-
setValue(value: any): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
export declare class CircleValueParser extends BaseValueParser {
|
|
20
|
-
setValue(value: any): Promise<void>;
|
|
21
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var value_parsers_exports = {};
|
|
28
|
-
__export(value_parsers_exports, {
|
|
29
|
-
CircleValueParser: () => CircleValueParser,
|
|
30
|
-
LineStringValueParser: () => LineStringValueParser,
|
|
31
|
-
PointValueParser: () => PointValueParser,
|
|
32
|
-
PolygonValueParser: () => PolygonValueParser
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(value_parsers_exports);
|
|
35
|
-
var import_database = require("@nocobase/database");
|
|
36
|
-
class PointValueParser extends import_database.BaseValueParser {
|
|
37
|
-
async setValue(value) {
|
|
38
|
-
if (Array.isArray(value)) {
|
|
39
|
-
this.value = value;
|
|
40
|
-
} else if (typeof value === "string") {
|
|
41
|
-
this.value = value.split(",");
|
|
42
|
-
} else {
|
|
43
|
-
this.errors.push("Value invalid");
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
class PolygonValueParser extends import_database.BaseValueParser {
|
|
48
|
-
async setValue(value) {
|
|
49
|
-
if (Array.isArray(value)) {
|
|
50
|
-
this.value = value;
|
|
51
|
-
} else if (typeof value === "string") {
|
|
52
|
-
this.value = value.substring(1, value.length - 1).split("),(").map((v) => v.split(","));
|
|
53
|
-
} else {
|
|
54
|
-
this.errors.push("Value invalid");
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
class LineStringValueParser extends import_database.BaseValueParser {
|
|
59
|
-
async setValue(value) {
|
|
60
|
-
if (Array.isArray(value)) {
|
|
61
|
-
this.value = value;
|
|
62
|
-
} else if (typeof value === "string") {
|
|
63
|
-
this.value = value.substring(1, value.length - 1).split("),(").map((v) => v.split(","));
|
|
64
|
-
} else {
|
|
65
|
-
this.errors.push("Value invalid");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
class CircleValueParser extends import_database.BaseValueParser {
|
|
70
|
-
async setValue(value) {
|
|
71
|
-
if (Array.isArray(value)) {
|
|
72
|
-
this.value = value;
|
|
73
|
-
} else if (typeof value === "string") {
|
|
74
|
-
this.value = value.split(",");
|
|
75
|
-
} else {
|
|
76
|
-
this.errors.push("Value invalid");
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
-
0 && (module.exports = {
|
|
82
|
-
CircleValueParser,
|
|
83
|
-
LineStringValueParser,
|
|
84
|
-
PointValueParser,
|
|
85
|
-
PolygonValueParser
|
|
86
|
-
});
|
package/dist/swagger/index.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
declare const _default: {
|
|
10
|
-
info: {
|
|
11
|
-
title: string;
|
|
12
|
-
};
|
|
13
|
-
paths: {
|
|
14
|
-
'/map-configuration:get': {
|
|
15
|
-
get: {
|
|
16
|
-
description: string;
|
|
17
|
-
tags: string[];
|
|
18
|
-
parameters: {
|
|
19
|
-
name: string;
|
|
20
|
-
in: string;
|
|
21
|
-
description: string;
|
|
22
|
-
required: boolean;
|
|
23
|
-
schema: {
|
|
24
|
-
type: string;
|
|
25
|
-
default: string;
|
|
26
|
-
enum: string[];
|
|
27
|
-
};
|
|
28
|
-
}[];
|
|
29
|
-
responses: {
|
|
30
|
-
200: {
|
|
31
|
-
description: string;
|
|
32
|
-
content: {
|
|
33
|
-
'application/json': {
|
|
34
|
-
schema: {
|
|
35
|
-
$ref: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
'/map-configuration:set': {
|
|
44
|
-
post: {
|
|
45
|
-
description: string;
|
|
46
|
-
tags: string[];
|
|
47
|
-
requestBody: {
|
|
48
|
-
content: {
|
|
49
|
-
'application/json': {
|
|
50
|
-
schema: {
|
|
51
|
-
$ref: string;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
responses: {
|
|
57
|
-
200: {
|
|
58
|
-
description: string;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
components: {
|
|
65
|
-
schemas: {
|
|
66
|
-
mapConfiguration: {
|
|
67
|
-
type: string;
|
|
68
|
-
properties: {
|
|
69
|
-
accessKey: {
|
|
70
|
-
type: string;
|
|
71
|
-
};
|
|
72
|
-
securityJsCode: {
|
|
73
|
-
type: string;
|
|
74
|
-
};
|
|
75
|
-
type: {
|
|
76
|
-
type: string;
|
|
77
|
-
default: string;
|
|
78
|
-
enum: string[];
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
export default _default;
|