@robinpath/sitemap 0.1.0
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/README.md +96 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/sitemap.d.ts +178 -0
- package/dist/sitemap.d.ts.map +1 -0
- package/dist/sitemap.js +200 -0
- package/dist/sitemap.js.map +1 -0
- package/package.json +13 -0
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# @robinpath/sitemap
|
|
2
|
+
|
|
3
|
+
> XML sitemap generation, parsing, validation, and manipulation with image/video/alternate support
|
|
4
|
+
|
|
5
|
+
   
|
|
6
|
+
|
|
7
|
+
## Why use this module?
|
|
8
|
+
|
|
9
|
+
The `sitemap` module lets you:
|
|
10
|
+
|
|
11
|
+
- Create XML sitemap
|
|
12
|
+
- Create sitemap index
|
|
13
|
+
- Parse XML sitemap
|
|
14
|
+
- Parse sitemap index
|
|
15
|
+
- Add URL to sitemap XML
|
|
16
|
+
|
|
17
|
+
All functions are callable directly from RobinPath scripts with a simple, consistent API.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @robinpath/sitemap
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
No credentials needed — start using it right away:
|
|
28
|
+
|
|
29
|
+
```robinpath
|
|
30
|
+
sitemap.createIndex [{"loc": "https://example.com/sitemap1.xml"}]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Available Functions
|
|
34
|
+
|
|
35
|
+
| Function | Description |
|
|
36
|
+
|----------|-------------|
|
|
37
|
+
| `sitemap.create` | Create XML sitemap |
|
|
38
|
+
| `sitemap.createIndex` | Create sitemap index |
|
|
39
|
+
| `sitemap.parse` | Parse XML sitemap |
|
|
40
|
+
| `sitemap.parseIndex` | Parse sitemap index |
|
|
41
|
+
| `sitemap.addUrl` | Add URL to sitemap XML |
|
|
42
|
+
| `sitemap.removeUrl` | Remove URL from sitemap XML |
|
|
43
|
+
| `sitemap.filterByChangefreq` | Filter URLs by change frequency |
|
|
44
|
+
| `sitemap.filterByPriority` | Filter URLs by priority range |
|
|
45
|
+
| `sitemap.sortByPriority` | Sort URLs by priority |
|
|
46
|
+
| `sitemap.sortByLastmod` | Sort URLs by last modified |
|
|
47
|
+
| `sitemap.count` | Count URLs in sitemap |
|
|
48
|
+
| `sitemap.extractLocs` | Extract all loc URLs |
|
|
49
|
+
| `sitemap.validate` | Validate sitemap XML |
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
### Create sitemap index
|
|
54
|
+
|
|
55
|
+
```robinpath
|
|
56
|
+
sitemap.createIndex [{"loc": "https://example.com/sitemap1.xml"}]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Parse XML sitemap
|
|
60
|
+
|
|
61
|
+
```robinpath
|
|
62
|
+
sitemap.parse $xml
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Parse sitemap index
|
|
66
|
+
|
|
67
|
+
```robinpath
|
|
68
|
+
sitemap.parseIndex $xml
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Integration with RobinPath
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { RobinPath } from "@wiredwp/robinpath";
|
|
75
|
+
import Module from "@robinpath/sitemap";
|
|
76
|
+
|
|
77
|
+
const rp = new RobinPath();
|
|
78
|
+
rp.registerModule(Module.name, Module.functions);
|
|
79
|
+
rp.registerModuleMeta(Module.name, Module.functionMetadata);
|
|
80
|
+
|
|
81
|
+
const result = await rp.executeScript(`
|
|
82
|
+
sitemap.createIndex [{"loc": "https://example.com/sitemap1.xml"}]
|
|
83
|
+
`);
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Full API Reference
|
|
87
|
+
|
|
88
|
+
See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples.
|
|
89
|
+
|
|
90
|
+
## Related Modules
|
|
91
|
+
|
|
92
|
+
- [`@robinpath/json`](../json) — JSON module for complementary functionality
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ModuleAdapter } from "@wiredwp/robinpath";
|
|
2
|
+
declare const SitemapModule: ModuleAdapter;
|
|
3
|
+
export default SitemapModule;
|
|
4
|
+
export { SitemapModule };
|
|
5
|
+
export { SitemapFunctions, SitemapFunctionMetadata, SitemapModuleMetadata } from "./sitemap.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,QAAA,MAAM,aAAa,EAAE,aAA+K,CAAC;AACrM,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SitemapFunctions, SitemapFunctionMetadata, SitemapModuleMetadata } from "./sitemap.js";
|
|
2
|
+
const SitemapModule = { name: "sitemap", functions: SitemapFunctions, functionMetadata: SitemapFunctionMetadata, moduleMetadata: SitemapModuleMetadata, global: false };
|
|
3
|
+
export default SitemapModule;
|
|
4
|
+
export { SitemapModule };
|
|
5
|
+
export { SitemapFunctions, SitemapFunctionMetadata, SitemapModuleMetadata } from "./sitemap.js";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChG,MAAM,aAAa,GAAkB,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,uBAA8B,EAAE,cAAc,EAAE,qBAA4B,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AACrM,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import type { BuiltinHandler } from "@wiredwp/robinpath";
|
|
2
|
+
export declare const SitemapFunctions: Record<string, BuiltinHandler>;
|
|
3
|
+
export declare const SitemapFunctionMetadata: {
|
|
4
|
+
create: {
|
|
5
|
+
description: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
name: string;
|
|
8
|
+
dataType: string;
|
|
9
|
+
description: string;
|
|
10
|
+
formInputType: string;
|
|
11
|
+
required: boolean;
|
|
12
|
+
}[];
|
|
13
|
+
returnType: string;
|
|
14
|
+
returnDescription: string;
|
|
15
|
+
example: string;
|
|
16
|
+
};
|
|
17
|
+
createIndex: {
|
|
18
|
+
description: string;
|
|
19
|
+
parameters: {
|
|
20
|
+
name: string;
|
|
21
|
+
dataType: string;
|
|
22
|
+
description: string;
|
|
23
|
+
formInputType: string;
|
|
24
|
+
required: boolean;
|
|
25
|
+
}[];
|
|
26
|
+
returnType: string;
|
|
27
|
+
returnDescription: string;
|
|
28
|
+
example: string;
|
|
29
|
+
};
|
|
30
|
+
parse: {
|
|
31
|
+
description: string;
|
|
32
|
+
parameters: {
|
|
33
|
+
name: string;
|
|
34
|
+
dataType: string;
|
|
35
|
+
description: string;
|
|
36
|
+
formInputType: string;
|
|
37
|
+
required: boolean;
|
|
38
|
+
}[];
|
|
39
|
+
returnType: string;
|
|
40
|
+
returnDescription: string;
|
|
41
|
+
example: string;
|
|
42
|
+
};
|
|
43
|
+
parseIndex: {
|
|
44
|
+
description: string;
|
|
45
|
+
parameters: {
|
|
46
|
+
name: string;
|
|
47
|
+
dataType: string;
|
|
48
|
+
description: string;
|
|
49
|
+
formInputType: string;
|
|
50
|
+
required: boolean;
|
|
51
|
+
}[];
|
|
52
|
+
returnType: string;
|
|
53
|
+
returnDescription: string;
|
|
54
|
+
example: string;
|
|
55
|
+
};
|
|
56
|
+
addUrl: {
|
|
57
|
+
description: string;
|
|
58
|
+
parameters: {
|
|
59
|
+
name: string;
|
|
60
|
+
dataType: string;
|
|
61
|
+
description: string;
|
|
62
|
+
formInputType: string;
|
|
63
|
+
required: boolean;
|
|
64
|
+
}[];
|
|
65
|
+
returnType: string;
|
|
66
|
+
returnDescription: string;
|
|
67
|
+
example: string;
|
|
68
|
+
};
|
|
69
|
+
removeUrl: {
|
|
70
|
+
description: string;
|
|
71
|
+
parameters: {
|
|
72
|
+
name: string;
|
|
73
|
+
dataType: string;
|
|
74
|
+
description: string;
|
|
75
|
+
formInputType: string;
|
|
76
|
+
required: boolean;
|
|
77
|
+
}[];
|
|
78
|
+
returnType: string;
|
|
79
|
+
returnDescription: string;
|
|
80
|
+
example: string;
|
|
81
|
+
};
|
|
82
|
+
filterByChangefreq: {
|
|
83
|
+
description: string;
|
|
84
|
+
parameters: {
|
|
85
|
+
name: string;
|
|
86
|
+
dataType: string;
|
|
87
|
+
description: string;
|
|
88
|
+
formInputType: string;
|
|
89
|
+
required: boolean;
|
|
90
|
+
}[];
|
|
91
|
+
returnType: string;
|
|
92
|
+
returnDescription: string;
|
|
93
|
+
example: string;
|
|
94
|
+
};
|
|
95
|
+
filterByPriority: {
|
|
96
|
+
description: string;
|
|
97
|
+
parameters: {
|
|
98
|
+
name: string;
|
|
99
|
+
dataType: string;
|
|
100
|
+
description: string;
|
|
101
|
+
formInputType: string;
|
|
102
|
+
required: boolean;
|
|
103
|
+
}[];
|
|
104
|
+
returnType: string;
|
|
105
|
+
returnDescription: string;
|
|
106
|
+
example: string;
|
|
107
|
+
};
|
|
108
|
+
sortByPriority: {
|
|
109
|
+
description: string;
|
|
110
|
+
parameters: {
|
|
111
|
+
name: string;
|
|
112
|
+
dataType: string;
|
|
113
|
+
description: string;
|
|
114
|
+
formInputType: string;
|
|
115
|
+
required: boolean;
|
|
116
|
+
}[];
|
|
117
|
+
returnType: string;
|
|
118
|
+
returnDescription: string;
|
|
119
|
+
example: string;
|
|
120
|
+
};
|
|
121
|
+
sortByLastmod: {
|
|
122
|
+
description: string;
|
|
123
|
+
parameters: {
|
|
124
|
+
name: string;
|
|
125
|
+
dataType: string;
|
|
126
|
+
description: string;
|
|
127
|
+
formInputType: string;
|
|
128
|
+
required: boolean;
|
|
129
|
+
}[];
|
|
130
|
+
returnType: string;
|
|
131
|
+
returnDescription: string;
|
|
132
|
+
example: string;
|
|
133
|
+
};
|
|
134
|
+
count: {
|
|
135
|
+
description: string;
|
|
136
|
+
parameters: {
|
|
137
|
+
name: string;
|
|
138
|
+
dataType: string;
|
|
139
|
+
description: string;
|
|
140
|
+
formInputType: string;
|
|
141
|
+
required: boolean;
|
|
142
|
+
}[];
|
|
143
|
+
returnType: string;
|
|
144
|
+
returnDescription: string;
|
|
145
|
+
example: string;
|
|
146
|
+
};
|
|
147
|
+
extractLocs: {
|
|
148
|
+
description: string;
|
|
149
|
+
parameters: {
|
|
150
|
+
name: string;
|
|
151
|
+
dataType: string;
|
|
152
|
+
description: string;
|
|
153
|
+
formInputType: string;
|
|
154
|
+
required: boolean;
|
|
155
|
+
}[];
|
|
156
|
+
returnType: string;
|
|
157
|
+
returnDescription: string;
|
|
158
|
+
example: string;
|
|
159
|
+
};
|
|
160
|
+
validate: {
|
|
161
|
+
description: string;
|
|
162
|
+
parameters: {
|
|
163
|
+
name: string;
|
|
164
|
+
dataType: string;
|
|
165
|
+
description: string;
|
|
166
|
+
formInputType: string;
|
|
167
|
+
required: boolean;
|
|
168
|
+
}[];
|
|
169
|
+
returnType: string;
|
|
170
|
+
returnDescription: string;
|
|
171
|
+
example: string;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
export declare const SitemapModuleMetadata: {
|
|
175
|
+
description: string;
|
|
176
|
+
methods: string[];
|
|
177
|
+
};
|
|
178
|
+
//# sourceMappingURL=sitemap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../src/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA2C,MAAM,oBAAoB,CAAC;AAuLlG,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAoK,CAAC;AAEjO,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcnC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;CAGjC,CAAC"}
|
package/dist/sitemap.js
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
function escapeXml(s) {
|
|
2
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3
|
+
}
|
|
4
|
+
const create = (args) => {
|
|
5
|
+
const urls = (Array.isArray(args[0]) ? args[0] : []);
|
|
6
|
+
const opts = (typeof args[1] === "object" && args[1] !== null ? args[1] : {});
|
|
7
|
+
const hasImages = urls.some((u) => u.images?.length);
|
|
8
|
+
const hasVideos = urls.some((u) => u.videos?.length);
|
|
9
|
+
const hasAlternates = urls.some((u) => u.alternates?.length);
|
|
10
|
+
let nsExtra = "";
|
|
11
|
+
if (hasImages)
|
|
12
|
+
nsExtra += ' xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"';
|
|
13
|
+
if (hasVideos)
|
|
14
|
+
nsExtra += ' xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"';
|
|
15
|
+
if (hasAlternates)
|
|
16
|
+
nsExtra += ' xmlns:xhtml="http://www.w3.org/1999/xhtml"';
|
|
17
|
+
const lines = [`<?xml version="1.0" encoding="UTF-8"?>`, `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${nsExtra}>`];
|
|
18
|
+
for (const u of urls) {
|
|
19
|
+
lines.push(" <url>");
|
|
20
|
+
lines.push(` <loc>${escapeXml(u.loc)}</loc>`);
|
|
21
|
+
if (u.lastmod)
|
|
22
|
+
lines.push(` <lastmod>${escapeXml(u.lastmod)}</lastmod>`);
|
|
23
|
+
if (u.changefreq)
|
|
24
|
+
lines.push(` <changefreq>${escapeXml(u.changefreq)}</changefreq>`);
|
|
25
|
+
if (u.priority !== undefined)
|
|
26
|
+
lines.push(` <priority>${u.priority}</priority>`);
|
|
27
|
+
if (u.images)
|
|
28
|
+
for (const img of u.images) {
|
|
29
|
+
lines.push(" <image:image>");
|
|
30
|
+
lines.push(` <image:loc>${escapeXml(img.loc)}</image:loc>`);
|
|
31
|
+
if (img.title)
|
|
32
|
+
lines.push(` <image:title>${escapeXml(img.title)}</image:title>`);
|
|
33
|
+
if (img.caption)
|
|
34
|
+
lines.push(` <image:caption>${escapeXml(img.caption)}</image:caption>`);
|
|
35
|
+
lines.push(" </image:image>");
|
|
36
|
+
}
|
|
37
|
+
if (u.videos)
|
|
38
|
+
for (const vid of u.videos) {
|
|
39
|
+
lines.push(" <video:video>");
|
|
40
|
+
lines.push(` <video:content_loc>${escapeXml(vid.contentLoc)}</video:content_loc>`);
|
|
41
|
+
if (vid.title)
|
|
42
|
+
lines.push(` <video:title>${escapeXml(vid.title)}</video:title>`);
|
|
43
|
+
if (vid.description)
|
|
44
|
+
lines.push(` <video:description>${escapeXml(vid.description)}</video:description>`);
|
|
45
|
+
if (vid.thumbnailLoc)
|
|
46
|
+
lines.push(` <video:thumbnail_loc>${escapeXml(vid.thumbnailLoc)}</video:thumbnail_loc>`);
|
|
47
|
+
lines.push(" </video:video>");
|
|
48
|
+
}
|
|
49
|
+
if (u.alternates)
|
|
50
|
+
for (const alt of u.alternates) {
|
|
51
|
+
lines.push(` <xhtml:link rel="alternate" hreflang="${escapeXml(alt.hreflang)}" href="${escapeXml(alt.href)}"/>`);
|
|
52
|
+
}
|
|
53
|
+
lines.push(" </url>");
|
|
54
|
+
}
|
|
55
|
+
lines.push("</urlset>");
|
|
56
|
+
return (opts.pretty === false) ? lines.join("") : lines.join("\n");
|
|
57
|
+
};
|
|
58
|
+
const createIndex = (args) => {
|
|
59
|
+
const sitemaps = (Array.isArray(args[0]) ? args[0] : []);
|
|
60
|
+
const lines = [`<?xml version="1.0" encoding="UTF-8"?>`, `<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">`];
|
|
61
|
+
for (const s of sitemaps) {
|
|
62
|
+
lines.push(" <sitemap>");
|
|
63
|
+
lines.push(` <loc>${escapeXml(s.loc)}</loc>`);
|
|
64
|
+
if (s.lastmod)
|
|
65
|
+
lines.push(` <lastmod>${escapeXml(s.lastmod)}</lastmod>`);
|
|
66
|
+
lines.push(" </sitemap>");
|
|
67
|
+
}
|
|
68
|
+
lines.push("</sitemapindex>");
|
|
69
|
+
return lines.join("\n");
|
|
70
|
+
};
|
|
71
|
+
const parse = (args) => {
|
|
72
|
+
const xml = String(args[0] ?? "");
|
|
73
|
+
const urls = [];
|
|
74
|
+
const urlBlocks = xml.split(/<url>/i).slice(1);
|
|
75
|
+
for (const block of urlBlocks) {
|
|
76
|
+
const endIdx = block.indexOf("</url>");
|
|
77
|
+
const content = endIdx >= 0 ? block.substring(0, endIdx) : block;
|
|
78
|
+
const loc = content.match(/<loc>(.*?)<\/loc>/i)?.[1] ?? "";
|
|
79
|
+
const lastmod = content.match(/<lastmod>(.*?)<\/lastmod>/i)?.[1];
|
|
80
|
+
const changefreq = content.match(/<changefreq>(.*?)<\/changefreq>/i)?.[1];
|
|
81
|
+
const priorityM = content.match(/<priority>(.*?)<\/priority>/i);
|
|
82
|
+
const priority = priorityM ? parseFloat(priorityM[1]) : undefined;
|
|
83
|
+
const images = [];
|
|
84
|
+
const imgRe = /<image:image>([\s\S]*?)<\/image:image>/gi;
|
|
85
|
+
let imgM;
|
|
86
|
+
while ((imgM = imgRe.exec(content)) !== null) {
|
|
87
|
+
images.push({
|
|
88
|
+
loc: imgM[1].match(/<image:loc>(.*?)<\/image:loc>/i)?.[1] ?? "",
|
|
89
|
+
title: imgM[1].match(/<image:title>(.*?)<\/image:title>/i)?.[1],
|
|
90
|
+
caption: imgM[1].match(/<image:caption>(.*?)<\/image:caption>/i)?.[1],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
urls.push({ loc, lastmod, changefreq, priority, images: images.length ? images : undefined });
|
|
94
|
+
}
|
|
95
|
+
return urls;
|
|
96
|
+
};
|
|
97
|
+
const parseIndex = (args) => {
|
|
98
|
+
const xml = String(args[0] ?? "");
|
|
99
|
+
const sitemaps = [];
|
|
100
|
+
const blocks = xml.split(/<sitemap>/i).slice(1);
|
|
101
|
+
for (const block of blocks) {
|
|
102
|
+
const endIdx = block.indexOf("</sitemap>");
|
|
103
|
+
const content = endIdx >= 0 ? block.substring(0, endIdx) : block;
|
|
104
|
+
sitemaps.push({
|
|
105
|
+
loc: content.match(/<loc>(.*?)<\/loc>/i)?.[1] ?? "",
|
|
106
|
+
lastmod: content.match(/<lastmod>(.*?)<\/lastmod>/i)?.[1],
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return sitemaps;
|
|
110
|
+
};
|
|
111
|
+
const addUrl = (args) => {
|
|
112
|
+
const xml = String(args[0] ?? "");
|
|
113
|
+
const url = (typeof args[1] === "object" && args[1] !== null ? args[1] : { loc: "" });
|
|
114
|
+
const single = create([[url]]);
|
|
115
|
+
const urlBlock = single.split("<url>")[1]?.split("</url>")[0] ?? "";
|
|
116
|
+
return xml.replace("</urlset>", ` <url>${urlBlock}</url>\n</urlset>`);
|
|
117
|
+
};
|
|
118
|
+
const removeUrl = (args) => {
|
|
119
|
+
const xml = String(args[0] ?? "");
|
|
120
|
+
const loc = String(args[1] ?? "");
|
|
121
|
+
const escaped = loc.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
122
|
+
return xml.replace(new RegExp(`\\s*<url>\\s*<loc>${escaped}</loc>[\\s\\S]*?</url>`, "i"), "");
|
|
123
|
+
};
|
|
124
|
+
const filterByChangefreq = (args) => {
|
|
125
|
+
const urls = (Array.isArray(args[0]) ? args[0] : []);
|
|
126
|
+
const freq = String(args[1] ?? "");
|
|
127
|
+
return urls.filter((u) => u.changefreq === freq);
|
|
128
|
+
};
|
|
129
|
+
const filterByPriority = (args) => {
|
|
130
|
+
const urls = (Array.isArray(args[0]) ? args[0] : []);
|
|
131
|
+
const min = Number(args[1] ?? 0);
|
|
132
|
+
const max = Number(args[2] ?? 1);
|
|
133
|
+
return urls.filter((u) => (u.priority ?? 0.5) >= min && (u.priority ?? 0.5) <= max);
|
|
134
|
+
};
|
|
135
|
+
const sortByPriority = (args) => {
|
|
136
|
+
const urls = (Array.isArray(args[0]) ? args[0] : []);
|
|
137
|
+
const desc = args[1] !== false;
|
|
138
|
+
return [...urls].sort((a, b) => desc ? (b.priority ?? 0.5) - (a.priority ?? 0.5) : (a.priority ?? 0.5) - (b.priority ?? 0.5));
|
|
139
|
+
};
|
|
140
|
+
const sortByLastmod = (args) => {
|
|
141
|
+
const urls = (Array.isArray(args[0]) ? args[0] : []);
|
|
142
|
+
const desc = args[1] !== false;
|
|
143
|
+
return [...urls].sort((a, b) => {
|
|
144
|
+
const da = a.lastmod ? new Date(a.lastmod).getTime() : 0;
|
|
145
|
+
const db = b.lastmod ? new Date(b.lastmod).getTime() : 0;
|
|
146
|
+
return desc ? db - da : da - db;
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
const count = (args) => {
|
|
150
|
+
const urls = Array.isArray(args[0]) ? args[0] : [];
|
|
151
|
+
return urls.length;
|
|
152
|
+
};
|
|
153
|
+
const extractLocs = (args) => {
|
|
154
|
+
const urls = (Array.isArray(args[0]) ? args[0] : []);
|
|
155
|
+
return urls.map((u) => u.loc);
|
|
156
|
+
};
|
|
157
|
+
const validate = (args) => {
|
|
158
|
+
const xml = String(args[0] ?? "");
|
|
159
|
+
const errors = [];
|
|
160
|
+
if (!xml.includes("<urlset"))
|
|
161
|
+
errors.push("Missing <urlset> root element");
|
|
162
|
+
if (!xml.includes('xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"'))
|
|
163
|
+
errors.push("Missing sitemap namespace");
|
|
164
|
+
const urls = parse([xml]);
|
|
165
|
+
if (urls.length === 0)
|
|
166
|
+
errors.push("No URLs found");
|
|
167
|
+
if (urls.length > 50000)
|
|
168
|
+
errors.push(`Exceeds 50,000 URL limit (found ${urls.length})`);
|
|
169
|
+
const validFreqs = ["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"];
|
|
170
|
+
for (const u of urls) {
|
|
171
|
+
if (!u.loc)
|
|
172
|
+
errors.push("URL missing <loc>");
|
|
173
|
+
if (u.changefreq && !validFreqs.includes(u.changefreq))
|
|
174
|
+
errors.push(`Invalid changefreq: ${u.changefreq}`);
|
|
175
|
+
if (u.priority !== undefined && (u.priority < 0 || u.priority > 1))
|
|
176
|
+
errors.push(`Invalid priority: ${u.priority}`);
|
|
177
|
+
}
|
|
178
|
+
return { valid: errors.length === 0, errors, urlCount: urls.length };
|
|
179
|
+
};
|
|
180
|
+
export const SitemapFunctions = { create, createIndex, parse, parseIndex, addUrl, removeUrl, filterByChangefreq, filterByPriority, sortByPriority, sortByLastmod, count, extractLocs, validate };
|
|
181
|
+
export const SitemapFunctionMetadata = {
|
|
182
|
+
create: { description: "Create XML sitemap", parameters: [{ name: "urls", dataType: "array", description: "Array of {loc, lastmod, changefreq, priority, images, videos, alternates}", formInputType: "text", required: true }, { name: "options", dataType: "object", description: "{pretty}", formInputType: "text", required: false }], returnType: "string", returnDescription: "XML sitemap", example: 'sitemap.create [{"loc": "https://example.com/", "priority": 1.0}]' },
|
|
183
|
+
createIndex: { description: "Create sitemap index", parameters: [{ name: "sitemaps", dataType: "array", description: "Array of {loc, lastmod}", formInputType: "text", required: true }], returnType: "string", returnDescription: "XML sitemap index", example: 'sitemap.createIndex [{"loc": "https://example.com/sitemap1.xml"}]' },
|
|
184
|
+
parse: { description: "Parse XML sitemap", parameters: [{ name: "xml", dataType: "string", description: "XML sitemap content", formInputType: "text", required: true }], returnType: "array", returnDescription: "Array of URL objects", example: 'sitemap.parse $xml' },
|
|
185
|
+
parseIndex: { description: "Parse sitemap index", parameters: [{ name: "xml", dataType: "string", description: "XML sitemap index", formInputType: "text", required: true }], returnType: "array", returnDescription: "Array of {loc, lastmod}", example: 'sitemap.parseIndex $xml' },
|
|
186
|
+
addUrl: { description: "Add URL to sitemap XML", parameters: [{ name: "xml", dataType: "string", description: "Existing sitemap XML", formInputType: "text", required: true }, { name: "url", dataType: "object", description: "URL object", formInputType: "text", required: true }], returnType: "string", returnDescription: "Updated XML", example: 'sitemap.addUrl $xml {"loc": "https://example.com/new"}' },
|
|
187
|
+
removeUrl: { description: "Remove URL from sitemap XML", parameters: [{ name: "xml", dataType: "string", description: "Sitemap XML", formInputType: "text", required: true }, { name: "loc", dataType: "string", description: "URL to remove", formInputType: "text", required: true }], returnType: "string", returnDescription: "Updated XML", example: 'sitemap.removeUrl $xml "https://example.com/old"' },
|
|
188
|
+
filterByChangefreq: { description: "Filter URLs by change frequency", parameters: [{ name: "urls", dataType: "array", description: "Parsed URLs", formInputType: "text", required: true }, { name: "changefreq", dataType: "string", description: "Frequency", formInputType: "text", required: true }], returnType: "array", returnDescription: "Filtered URLs", example: 'sitemap.filterByChangefreq $urls "daily"' },
|
|
189
|
+
filterByPriority: { description: "Filter URLs by priority range", parameters: [{ name: "urls", dataType: "array", description: "Parsed URLs", formInputType: "text", required: true }, { name: "min", dataType: "number", description: "Min priority", formInputType: "text", required: true }, { name: "max", dataType: "number", description: "Max priority", formInputType: "text", required: false }], returnType: "array", returnDescription: "Filtered URLs", example: 'sitemap.filterByPriority $urls 0.8 1.0' },
|
|
190
|
+
sortByPriority: { description: "Sort URLs by priority", parameters: [{ name: "urls", dataType: "array", description: "Parsed URLs", formInputType: "text", required: true }, { name: "descending", dataType: "boolean", description: "Descending (default true)", formInputType: "text", required: false }], returnType: "array", returnDescription: "Sorted URLs", example: 'sitemap.sortByPriority $urls' },
|
|
191
|
+
sortByLastmod: { description: "Sort URLs by last modified", parameters: [{ name: "urls", dataType: "array", description: "Parsed URLs", formInputType: "text", required: true }, { name: "descending", dataType: "boolean", description: "Descending (default true)", formInputType: "text", required: false }], returnType: "array", returnDescription: "Sorted URLs", example: 'sitemap.sortByLastmod $urls' },
|
|
192
|
+
count: { description: "Count URLs in sitemap", parameters: [{ name: "urls", dataType: "array", description: "Parsed URLs", formInputType: "text", required: true }], returnType: "number", returnDescription: "URL count", example: 'sitemap.count $urls' },
|
|
193
|
+
extractLocs: { description: "Extract all loc URLs", parameters: [{ name: "urls", dataType: "array", description: "Parsed URLs", formInputType: "text", required: true }], returnType: "array", returnDescription: "Array of URL strings", example: 'sitemap.extractLocs $urls' },
|
|
194
|
+
validate: { description: "Validate sitemap XML", parameters: [{ name: "xml", dataType: "string", description: "Sitemap XML", formInputType: "text", required: true }], returnType: "object", returnDescription: "{valid, errors[], urlCount}", example: 'sitemap.validate $xml' },
|
|
195
|
+
};
|
|
196
|
+
export const SitemapModuleMetadata = {
|
|
197
|
+
description: "XML sitemap generation, parsing, validation, and manipulation with image/video/alternate support",
|
|
198
|
+
methods: ["create", "createIndex", "parse", "parseIndex", "addUrl", "removeUrl", "filterByChangefreq", "filterByPriority", "sortByPriority", "sortByLastmod", "count", "extractLocs", "validate"],
|
|
199
|
+
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AU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,EAAE;IAC3P,WAAW,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,OAAO,EAAE,2BAA2B,EAAE;IAChR,QAAQ,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,6BAA6B,EAAE,OAAO,EAAE,uBAAuB,EAAE;CAClR,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,WAAW,EAAE,kGAAkG;IAC/G,OAAO,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,CAAC;CAClM,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@robinpath/sitemap",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"publishConfig": { "access": "public" },
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": { ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" } },
|
|
9
|
+
"files": ["dist"],
|
|
10
|
+
"scripts": { "build": "tsc", "test": "node --import tsx --test tests/*.test.ts" },
|
|
11
|
+
"peerDependencies": { "@wiredwp/robinpath": ">=0.20.0" },
|
|
12
|
+
"devDependencies": { "@wiredwp/robinpath": "^0.30.1", "tsx": "^4.19.0", "typescript": "^5.6.0" }
|
|
13
|
+
}
|