@xwiki/cristal-xwiki-utils 0.21.0 → 0.22.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/CHANGELOG.md +6 -0
- package/api-extractor.json +4 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/etc/cristal-xwiki-utils.api.md +14 -0
- package/package.json +10 -8
- package/src/index.ts +1 -0
- package/vitest.config.ts +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport type { WikiConfig } from \"@xwiki/cristal-api\";\n\n/**\n * Returns URL to XWiki spaces rest API for a given document.\n *\n * @param wikiConfig - the current wiki configuration\n * @param documentId - the id of the document\n * @returns the crafted URL\n * @since 0.9\n */\nexport function getRestSpacesApiUrl(\n wikiConfig: WikiConfig,\n documentId: string,\n): string {\n const splittedDocumentId = documentId.split(\":\");\n const wiki = splittedDocumentId.length > 1 ? splittedDocumentId[0] : \"xwiki\";\n const doc =\n splittedDocumentId.length > 1\n ? splittedDocumentId[1]\n : splittedDocumentId[0];\n return `${wikiConfig.baseURL}/rest/wikis/${wiki}/spaces/${encodeURIComponent(\n doc,\n )\n .replace(/((?:%5C%5C)*)%5C\\./g, \"$1%2E\") // Unescape dots in identifiers\n .replace(/%5C%5C/g, \"%5C\") // Unescape backslashes in identifiers\n .replace(/\\.(?=.*\\.)/g, \"/spaces/\") // Transform separators to spaces endpoints\n .replace(/\\./, \"/pages/\")}`; // Transform last separator to pages endpoint\n}\n"],"names":["getRestSpacesApiUrl","wikiConfig","documentId","splittedDocumentId","wiki","doc"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport type { WikiConfig } from \"@xwiki/cristal-api\";\n\n/**\n * Returns URL to XWiki spaces rest API for a given document.\n *\n * @param wikiConfig - the current wiki configuration\n * @param documentId - the id of the document\n * @returns the crafted URL\n * @since 0.9\n * @beta\n */\nexport function getRestSpacesApiUrl(\n wikiConfig: WikiConfig,\n documentId: string,\n): string {\n const splittedDocumentId = documentId.split(\":\");\n const wiki = splittedDocumentId.length > 1 ? splittedDocumentId[0] : \"xwiki\";\n const doc =\n splittedDocumentId.length > 1\n ? splittedDocumentId[1]\n : splittedDocumentId[0];\n return `${wikiConfig.baseURL}/rest/wikis/${wiki}/spaces/${encodeURIComponent(\n doc,\n )\n .replace(/((?:%5C%5C)*)%5C\\./g, \"$1%2E\") // Unescape dots in identifiers\n .replace(/%5C%5C/g, \"%5C\") // Unescape backslashes in identifiers\n .replace(/\\.(?=.*\\.)/g, \"/spaces/\") // Transform separators to spaces endpoints\n .replace(/\\./, \"/pages/\")}`; // Transform last separator to pages endpoint\n}\n"],"names":["getRestSpacesApiUrl","wikiConfig","documentId","splittedDocumentId","wiki","doc"],"mappings":"AA+BO,SAASA,EACdC,GACAC,GACQ;AACR,QAAMC,IAAqBD,EAAW,MAAM,GAAG,GACzCE,IAAOD,EAAmB,SAAS,IAAIA,EAAmB,CAAC,IAAI,SAC/DE,IACJF,EAAmB,SAAS,IACxBA,EAAmB,CAAC,IACpBA,EAAmB,CAAC;AAC1B,SAAO,GAAGF,EAAW,OAAO,eAAeG,CAAI,WAAW;AAAA,IACxDC;AAAA,EAAA,EAEC,QAAQ,uBAAuB,OAAO,EACtC,QAAQ,WAAW,KAAK,EACxB,QAAQ,eAAe,UAAU,EACjC,QAAQ,MAAM,SAAS,CAAC;AAC7B;"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["cristal_xwiki-utils"]={}))})(this,function(e){"use strict";function t(n,s){const i=s.split(":"),o=i.length>1?i[0]:"xwiki",p=i.length>1?i[1]:i[0];return`${n.baseURL}/rest/wikis/${o}/spaces/${encodeURIComponent(p).replace(/((?:%5C%5C)*)%5C\./g,"$1%2E").replace(/%5C%5C/g,"%5C").replace(/\.(?=.*\.)/g,"/spaces/").replace(/\./,"/pages/")}`}e.getRestSpacesApiUrl=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["cristal_xwiki-utils"]={}))})(this,(function(e){"use strict";function t(n,s){const i=s.split(":"),o=i.length>1?i[0]:"xwiki",p=i.length>1?i[1]:i[0];return`${n.baseURL}/rest/wikis/${o}/spaces/${encodeURIComponent(p).replace(/((?:%5C%5C)*)%5C\./g,"$1%2E").replace(/%5C%5C/g,"%5C").replace(/\.(?=.*\.)/g,"/spaces/").replace(/\./,"/pages/")}`}e.getRestSpacesApiUrl=t,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport type { WikiConfig } from \"@xwiki/cristal-api\";\n\n/**\n * Returns URL to XWiki spaces rest API for a given document.\n *\n * @param wikiConfig - the current wiki configuration\n * @param documentId - the id of the document\n * @returns the crafted URL\n * @since 0.9\n */\nexport function getRestSpacesApiUrl(\n wikiConfig: WikiConfig,\n documentId: string,\n): string {\n const splittedDocumentId = documentId.split(\":\");\n const wiki = splittedDocumentId.length > 1 ? splittedDocumentId[0] : \"xwiki\";\n const doc =\n splittedDocumentId.length > 1\n ? splittedDocumentId[1]\n : splittedDocumentId[0];\n return `${wikiConfig.baseURL}/rest/wikis/${wiki}/spaces/${encodeURIComponent(\n doc,\n )\n .replace(/((?:%5C%5C)*)%5C\\./g, \"$1%2E\") // Unescape dots in identifiers\n .replace(/%5C%5C/g, \"%5C\") // Unescape backslashes in identifiers\n .replace(/\\.(?=.*\\.)/g, \"/spaces/\") // Transform separators to spaces endpoints\n .replace(/\\./, \"/pages/\")}`; // Transform last separator to pages endpoint\n}\n"],"names":["getRestSpacesApiUrl","wikiConfig","documentId","splittedDocumentId","wiki","doc"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["/**\n * See the LICENSE file distributed with this work for additional\n * information regarding copyright ownership.\n *\n * This is free software; you can redistribute it and/or modify it\n * under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation; either version 2.1 of\n * the License, or (at your option) any later version.\n *\n * This software is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n * Lesser General Public License for more details.\n *\n * You should have received a copy of the GNU Lesser General Public\n * License along with this software; if not, write to the Free\n * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n * 02110-1301 USA, or see the FSF site: http://www.fsf.org.\n */\n\nimport type { WikiConfig } from \"@xwiki/cristal-api\";\n\n/**\n * Returns URL to XWiki spaces rest API for a given document.\n *\n * @param wikiConfig - the current wiki configuration\n * @param documentId - the id of the document\n * @returns the crafted URL\n * @since 0.9\n * @beta\n */\nexport function getRestSpacesApiUrl(\n wikiConfig: WikiConfig,\n documentId: string,\n): string {\n const splittedDocumentId = documentId.split(\":\");\n const wiki = splittedDocumentId.length > 1 ? splittedDocumentId[0] : \"xwiki\";\n const doc =\n splittedDocumentId.length > 1\n ? splittedDocumentId[1]\n : splittedDocumentId[0];\n return `${wikiConfig.baseURL}/rest/wikis/${wiki}/spaces/${encodeURIComponent(\n doc,\n )\n .replace(/((?:%5C%5C)*)%5C\\./g, \"$1%2E\") // Unescape dots in identifiers\n .replace(/%5C%5C/g, \"%5C\") // Unescape backslashes in identifiers\n .replace(/\\.(?=.*\\.)/g, \"/spaces/\") // Transform separators to spaces endpoints\n .replace(/\\./, \"/pages/\")}`; // Transform last separator to pages endpoint\n}\n"],"names":["getRestSpacesApiUrl","wikiConfig","documentId","splittedDocumentId","wiki","doc"],"mappings":"+OA+BO,SAASA,EACdC,EACAC,EACQ,CACR,MAAMC,EAAqBD,EAAW,MAAM,GAAG,EACzCE,EAAOD,EAAmB,OAAS,EAAIA,EAAmB,CAAC,EAAI,QAC/DE,EACJF,EAAmB,OAAS,EACxBA,EAAmB,CAAC,EACpBA,EAAmB,CAAC,EAC1B,MAAO,GAAGF,EAAW,OAAO,eAAeG,CAAI,WAAW,mBACxDC,CAAA,EAEC,QAAQ,sBAAuB,OAAO,EACtC,QAAQ,UAAW,KAAK,EACxB,QAAQ,cAAe,UAAU,EACjC,QAAQ,KAAM,SAAS,CAAC,EAC7B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## API Report File for "@xwiki/cristal-xwiki-utils"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { WikiConfig } from '@xwiki/cristal-api';
|
|
8
|
+
|
|
9
|
+
// @beta
|
|
10
|
+
export function getRestSpacesApiUrl(wikiConfig: WikiConfig, documentId: string): string;
|
|
11
|
+
|
|
12
|
+
// (No @packageDocumentation comment for this package)
|
|
13
|
+
|
|
14
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xwiki/cristal-xwiki-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"license": "LGPL 2.1",
|
|
5
5
|
"author": "XWiki Org Community <contact@xwiki.org>",
|
|
6
6
|
"homepage": "https://cristal.xwiki.org/",
|
|
@@ -26,17 +26,19 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"main": "./dist/index.es.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"typescript": "5.9.2",
|
|
31
|
-
"vite": "7.
|
|
32
|
-
"@xwiki/cristal-api": "0.
|
|
33
|
-
"@xwiki/cristal-dev-config": "0.
|
|
32
|
+
"vite": "7.1.5",
|
|
33
|
+
"@xwiki/cristal-api": "0.22.0",
|
|
34
|
+
"@xwiki/cristal-dev-config": "0.22.0"
|
|
34
35
|
},
|
|
35
36
|
"scripts": {
|
|
36
|
-
"
|
|
37
|
+
"api-extractor:local": "api-extractor run --local",
|
|
38
|
+
"build": "vite build",
|
|
37
39
|
"clean": "rimraf dist",
|
|
38
40
|
"lint": "eslint \"./src/**/*.{ts,tsx,vue}\" --max-warnings=0",
|
|
39
|
-
"test": "vitest --run"
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
"test": "vitest --run",
|
|
42
|
+
"typecheck": "tsc"
|
|
43
|
+
}
|
|
42
44
|
}
|
package/src/index.ts
CHANGED
package/vitest.config.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import localConfig from "./vite.config";
|
|
22
|
-
import defaultConfig from "@xwiki/cristal-dev-config
|
|
22
|
+
import { vitestVue as defaultConfig } from "@xwiki/cristal-dev-config";
|
|
23
23
|
import { mergeConfig } from "vitest/config";
|
|
24
24
|
|
|
25
25
|
export default mergeConfig(defaultConfig, localConfig);
|