@paroicms/public-server-lib 0.42.0 → 0.44.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/dist/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
+ export type * from "../typeonly/common-schema-json-types.d.ts";
2
+ export type * from "../typeonly/configuration-types.d.ts";
3
+ export type * from "../typeonly/site-schema-json-types.d.ts";
4
+ export type * from "../typeonly/theme-json-types.d.ts";
1
5
  export type * from "../types/backend-plugin-types.d.ts";
2
6
  export * from "./api-error-handler.js";
3
- export * from "./esm-module.helper.js";
4
7
  export * from "./html-helpers.js";
5
8
  export * from "./obfuscate.helper.js";
6
9
  export * from "./server-image-cache-engine.helper.js";
7
10
  export * from "./simple-i18n.js";
8
- export * from "./vite-config.helper.js";
11
+ export * from "./typeonly-validator.js";
package/dist/index.js CHANGED
@@ -1,8 +1,7 @@
1
1
  export * from "./api-error-handler.js";
2
- export * from "./esm-module.helper.js";
3
2
  export * from "./html-helpers.js";
4
3
  export * from "./obfuscate.helper.js";
5
4
  export * from "./server-image-cache-engine.helper.js";
6
5
  export * from "./simple-i18n.js";
7
- export * from "./vite-config.helper.js";
6
+ export * from "./typeonly-validator.js";
8
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const siteSchemaFormatVersion = "9";
2
+ /**
3
+ * JSON types directory.
4
+ */
5
+ export declare const jtDir: string;
6
+ export declare const jsonTypeValidator: import("@typeonly/validator").TypeOnlyValidator;
@@ -0,0 +1,14 @@
1
+ import { esmDirName } from "@paroicms/script-lib";
2
+ import { createValidator } from "@typeonly/validator";
3
+ import { readFileSync } from "node:fs";
4
+ import { dirname, join } from "node:path";
5
+ const packageDir = dirname(esmDirName(import.meta.url));
6
+ export const siteSchemaFormatVersion = "9";
7
+ /**
8
+ * JSON types directory.
9
+ */
10
+ export const jtDir = join(packageDir, "typeonly");
11
+ export const jsonTypeValidator = createValidator({
12
+ bundle: JSON.parse(readFileSync(join(packageDir, "dist", "types.to.json"), "utf-8")),
13
+ });
14
+ //# sourceMappingURL=typeonly-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeonly-validator.js","sourceRoot":"","sources":["../src/typeonly-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAElD,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;IAC/C,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,OAAO,CAAC,CAAC;CACrF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"./common-schema-json-types":{"imports":[{"from":"./site-schema-json-types","namedMembers":[{"name":"JtFieldType"},{"name":"JtLabelLocales"}]}],"namedTypes":[{"name":"JtInternalCommonSchema","exported":true,"docComment":"The common schema is currently an internal file. Here is its typing.","kind":"interface","properties":[{"name":"ParoiCMSSiteSchemaFormatVersion","type":{"kind":"name","group":"primitive","refName":"string"},"docComment":"This is the version of the schema engine."},{"name":"languages","type":{"kind":"array","itemType":{"kind":"name","group":"primitive","refName":"string"}},"docComment":"Specify the list of 2-letters language codes that can be used in the websites.\n\n@example [\"en\", \"fr\"]`"},{"name":"siteFields","type":{"kind":"array","itemType":{"kind":"importedRef","refName":"JtFieldType"}},"docComment":"The common fields of any websites. They are currently: `[\"title\", \"contactEmail\", \"favicon\", \"ogImage\"]`."}]},{"name":"JtInternalCommonSchemaTranslations","exported":true,"kind":"interface","properties":[{"name":"languageLabel","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"siteFields","type":{"kind":"interface","indexSignature":{"keyName":"fieldName","keyType":"string","type":{"kind":"importedRef","refName":"JtLabelLocales"}}},"optional":true}]}]},"./configuration-types":{"namedTypes":[{"name":"JtConfiguration","exported":true,"kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtSingleSiteConfiguration"},{"kind":"localRef","refName":"JtMultisiteConfiguration"}]},{"name":"JtConfigurationBase","exported":true,"kind":"interface","properties":[{"name":"thisServer","type":{"kind":"localRef","refName":"JtDeprecatedThisServerConf"},"optional":true,"docComment":"@deprecated Move the sub-properties in the parent."},{"name":"port","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true,"docComment":"It is required except if the legacy `thisServer` is still used."},{"name":"hostname","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true},{"name":"publicProtocol","type":{"kind":"composite","op":"union","types":[{"kind":"literal","literal":"http"},{"kind":"literal","literal":"https"}]},"optional":true,"docComment":"Default is `\"http\"`."},{"name":"publicPort","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true},{"name":"boPort","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true,"docComment":"@deprecated Use adminUiPort instead."},{"name":"adminUiPort","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true},{"name":"allowRobots","type":{"kind":"name","group":"primitive","refName":"boolean"}},{"name":"enableCache","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"immutableAssets","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"cacheTimeToIdle","type":{"kind":"composite","op":"union","types":[{"kind":"name","group":"primitive","refName":"string"},{"kind":"literal","literal":"disabled"},{"kind":"literal","literal":"infinite"}]},"optional":true,"docComment":"For example: `\"14d\"`."},{"name":"clearCacheAfterStart","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"clearImageCacheAfterStart","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"log","type":{"kind":"localRef","refName":"JtLogConf"},"optional":true,"docComment":"@deprecated Replace `log.level` by `logLevel`, and `log.file` by `logFile`."},{"name":"logLevel","type":{"kind":"composite","op":"union","types":[{"kind":"literal","literal":"silent"},{"kind":"literal","literal":"error"},{"kind":"literal","literal":"warn"},{"kind":"literal","literal":"info"},{"kind":"literal","literal":"stats"},{"kind":"literal","literal":"debug"},{"kind":"literal","literal":"trace"}]},"optional":true},{"name":"logFile","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true,"docComment":"Omit for stdout."},{"name":"graphqlDevTools","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"generateMissingDatabases","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"googleAuth","type":{"kind":"localRef","refName":"JtGoogleAuthConf"},"optional":true},{"name":"awsSesMail","type":{"kind":"localRef","refName":"JtDeprecatedAwsSesMailConf"},"optional":true,"docComment":"@deprecated Use \"@paroicms/send-mail-aws-ses-plugin\" configuration instead"},{"name":"googleRecaptcha","type":{"kind":"localRef","refName":"JtDeprecatedGoogleRecaptchaConf"},"optional":true,"docComment":"@deprecated Use \"@paroicms/contact-form-plugin\" configuration instead"},{"name":"imageProcessor","type":{"kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtImageProcessorConf"},{"kind":"localRef","refName":"JtLegacyImageProcessorConf"}]},"optional":true},{"name":"devAccount","type":{"kind":"localRef","refName":"JtDevAccountConf"},"optional":true},{"name":"platformAdminAccounts","type":{"kind":"array","itemType":{"kind":"localRef","refName":"JtPlatformAdminAccountConf"}},"optional":true},{"name":"plugins","type":{"kind":"composite","op":"union","types":[{"kind":"array","itemType":{"kind":"localRef","refName":"JtPluginStaticConfiguration"}},{"kind":"localRef","refName":"JtDeprecatedPluginConfigurations"}]},"optional":true},{"name":"httpRedirections","type":{"kind":"array","itemType":{"kind":"localRef","refName":"JtHttpRedirection"}},"optional":true}]},{"name":"JtHttpRedirection","exported":true,"kind":"interface","properties":[{"name":"fromFqdn","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"to","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"mapPaths","type":{"kind":"interface","indexSignature":{"keyName":"fromRegex","keyType":"string","type":{"kind":"name","group":"primitive","refName":"string"}}},"optional":true},{"name":"preservePath","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true}]},{"name":"JtSingleSiteConfiguration","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtConfigurationBase"},{"kind":"interface","properties":[{"name":"singleSite","type":{"kind":"localRef","refName":"JtSingleSiteConf"}}]}]},{"name":"JtMultisiteConfiguration","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtConfigurationBase"},{"kind":"interface","properties":[{"name":"platform","type":{"kind":"interface","properties":[{"name":"dataDir","type":{"kind":"name","group":"primitive","refName":"string"}}]}},{"name":"sitePacks","type":{"kind":"array","itemType":{"kind":"localRef","refName":"JtSitePackOrLegacyConf"}}}]}]},{"name":"JtDeprecatedThisServerConf","exported":true,"kind":"interface","properties":[{"name":"port","type":{"kind":"name","group":"primitive","refName":"number"}},{"name":"publicPort","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true},{"name":"boPublicPort","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true},{"name":"hostName","type":{"kind":"composite","op":"union","types":[{"kind":"name","group":"primitive","refName":"string"},{"kind":"name","group":"primitive","refName":"null"}]},"optional":true},{"name":"https","type":{"kind":"name","group":"primitive","refName":"boolean"}}]},{"name":"JtLogConf","exported":true,"kind":"interface","properties":[{"name":"level","type":{"kind":"composite","op":"union","types":[{"kind":"literal","literal":"silent"},{"kind":"literal","literal":"error"},{"kind":"literal","literal":"warn"},{"kind":"literal","literal":"info"},{"kind":"literal","literal":"stats"},{"kind":"literal","literal":"debug"},{"kind":"literal","literal":"trace"}]}},{"name":"file","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true,"docComment":"Omit for stdout."}]},{"name":"JtSingleSiteConf","exported":true,"kind":"interface","properties":[{"name":"siteDir","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"dataDir","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"cacheDir","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"backupDir","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"fqdn","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"redirectWww","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"trusted","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true}]},{"name":"JtSitePackOrLegacyConf","exported":true,"kind":"composite","op":"union","types":[{"kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtSitePackConf"},{"kind":"localRef","refName":"JtLegacyFqdnSitePackConf"},{"kind":"localRef","refName":"JtLegacySubDomainSitePackConf"}]}]},{"name":"JtSitePackConf","exported":true,"kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtFqdnSitePackConf"},{"kind":"localRef","refName":"JtSubDomainSitePackConf"}]},{"name":"JtSitePackConfBase","exported":true,"kind":"interface","properties":[{"name":"packName","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"sitesDir","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true},{"name":"dataDir","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"cacheDir","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"backupDir","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"redirectWww","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"trusted","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true}]},{"name":"JtFqdnSitePackConf","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtSitePackConfBase"},{"kind":"interface","properties":[{"name":"serveOn","type":{"kind":"literal","literal":"fqdn"}}]}]},{"name":"JtSubDomainSitePackConf","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtSitePackConfBase"},{"kind":"interface","properties":[{"name":"serveOn","type":{"kind":"literal","literal":"subDomain"}},{"name":"parentDomain","type":{"kind":"name","group":"primitive","refName":"string"}}]}]},{"name":"JtLegacyFqdnSitePackConf","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtSitePackConfBase"},{"kind":"interface","properties":[{"name":"serveAs","type":{"kind":"literal","literal":"fqdn"},"docComment":"@deprecated Renamed to `serveOn`"}]}]},{"name":"JtLegacySubDomainSitePackConf","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtSitePackConfBase"},{"kind":"interface","properties":[{"name":"serveAs","type":{"kind":"literal","literal":"subDomain"},"docComment":"@deprecated Renamed to `serveOn`"},{"name":"parentDomain","type":{"kind":"name","group":"primitive","refName":"string"}}]}]},{"name":"JtGoogleAuthConf","exported":true,"kind":"interface","properties":[{"name":"disabled","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"fqdn","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"clientId","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"clientSecret","type":{"kind":"name","group":"primitive","refName":"string"}}]},{"name":"JtDeprecatedAwsSesMailConf","exported":true,"docComment":"@deprecated Use \"@paroicms/send-mail-aws-ses-plugin\" configuration instead","kind":"interface","properties":[{"name":"disabled","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"from","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"accessKeyId","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"secretAccessKey","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"region","type":{"kind":"name","group":"primitive","refName":"string"}}]},{"name":"JtDeprecatedGoogleRecaptchaConf","exported":true,"docComment":"@deprecated Use \"@paroicms/contact-form-plugin\" configuration instead","kind":"interface","properties":[{"name":"disabled","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"siteKey","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"secretKey","type":{"kind":"name","group":"primitive","refName":"string"}}]},{"name":"JtImageProcessorConf","exported":true,"kind":"interface","properties":[{"name":"cpuCoresPerFile","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true},{"name":"allowConcurrency","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true}]},{"name":"JtLegacyImageProcessorConf","exported":true,"kind":"interface","properties":[{"name":"cpuCoresPerFile","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true},{"name":"oneSharpAtATime","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true}]},{"name":"JtDevAccountConf","exported":true,"kind":"interface","properties":[{"name":"email","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"name","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"password","type":{"kind":"name","group":"primitive","refName":"string"}}]},{"name":"JtPlatformAdminAccountConf","exported":true,"kind":"interface","properties":[{"name":"email","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"name","type":{"kind":"name","group":"primitive","refName":"string"}}]},{"name":"JtPluginStaticConfiguration","exported":true,"kind":"interface","properties":[{"name":"name","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"disabled","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"platform","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"configuration","type":{"kind":"interface","indexSignature":{"keyName":"key","keyType":"string","type":{"kind":"name","group":"ts","refName":"unknown"}}},"optional":true}]},{"name":"JtDeprecatedPluginConfigurations","exported":true,"docComment":"@deprecated Use JtPluginConfiguration[] instead","kind":"interface","indexSignature":{"keyName":"pluginName","keyType":"string","type":{"kind":"interface","indexSignature":{"keyName":"key","keyType":"string","type":{"kind":"name","group":"ts","refName":"unknown"}}}}}]},"./site-schema-json-types":{"namedTypes":[{"name":"JtSiteSchema","exported":true,"docComment":"This properties are part of a site schema, and part of the internal library as well.","kind":"interface","properties":[{"name":"ParoiCMSSiteSchemaFormatVersion","type":{"kind":"literal","literal":"9"},"docComment":"This is the version of the schema engine."},{"name":"languages","type":{"kind":"array","itemType":{"kind":"name","group":"primitive","refName":"string"}},"docComment":"Specify the list of 2-letters language codes (ISO 639-1) of the website. Use 3-letters codes (ISO 639-3) for languages that doesn't have a 2-letters code (\"qya\", etc.). It's possible but not recommanded to use 5-letters codes with regions (IETF BCP 47, for example \"fr-FR\"). Every language is allowed. The first language is the primary language of the website.\n@example `[\"en\", \"fr\"]`"},{"name":"languageRoutingMode","type":{"kind":"composite","op":"union","types":[{"kind":"literal","literal":"prefixSecondary"},{"kind":"literal","literal":"prefixAll"},{"kind":"literal","literal":"auto"}]},"optional":true,"docComment":"Routing mode for multilingual sites. Default is \"auto\".\n- \"auto\": behaves like \"prefixSecondary\" for unilingual sites, \"prefixAll\" for multilingual sites\n- \"prefixAll\": all languages are prefixed in URLs\n- \"prefixSecondary\": all languages but the first are prefixed in URLs"},{"name":"plugins","type":{"kind":"array","itemType":{"kind":"composite","op":"union","types":[{"kind":"name","group":"primitive","refName":"string"},{"kind":"localRef","refName":"JtPluginRef"}]}},"optional":true,"docComment":"List of plugins that are used in the schema.\n@example [\"@paroicms/quill-editor-plugin\"]"},{"name":"configuration","type":{"kind":"localRef","refName":"JtSiteConfiguration"},"optional":true},{"name":"nodeTypes","type":{"kind":"array","itemType":{"kind":"localRef","refName":"JtNodeType"}},"optional":true,"docComment":"Types of documents, parts that will be handled on the site."},{"name":"fieldTypes","type":{"kind":"array","itemType":{"kind":"localRef","refName":"JtFieldType"}},"optional":true,"docComment":"A library of fields."},{"name":"mediaPolicies","type":{"kind":"array","itemType":{"kind":"localRef","refName":"JtMediaPolicy"}},"optional":true,"docComment":"Media policies"},{"name":"imageQualityPolicy","type":{"kind":"array","itemType":{"kind":"localRef","refName":"JtImageCompressionQualityPolicyStep"}},"optional":true,"docComment":"We can set the image compression quality here. The list must be ordered from the lowest area\nto the highest."}]},{"name":"JtPluginRef","exported":true,"kind":"interface","properties":[{"name":"name","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"disabled","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"configuration","type":{"kind":"localRef","refName":"JtPluginConfFromSchema"},"optional":true}]},{"name":"JtPluginConfFromSchema","exported":true,"kind":"interface","indexSignature":{"keyName":"key","keyType":"string","type":{"kind":"name","group":"ts","refName":"unknown"}}},{"name":"JtSiteConfiguration","exported":true,"kind":"interface","properties":[{"name":"adminUi","type":{"kind":"interface","properties":[{"name":"enableMetaKeywords","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true}]},"optional":true}]},{"name":"JtNodeType","exported":true,"kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtSiteType"},{"kind":"localRef","refName":"JtDocumentType"},{"kind":"localRef","refName":"JtPartType"}]},{"name":"JtSiteType","exported":true,"kind":"interface","properties":[{"name":"typeName","type":{"kind":"literal","literal":"_site"},"optional":true,"docComment":"Can be omitted. Its default value is `\"_site\"`."},{"name":"kind","type":{"kind":"literal","literal":"site"}},{"name":"fields","type":{"kind":"array","itemType":{"kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtFieldType"},{"kind":"name","group":"primitive","refName":"string"}]}},"optional":true,"docComment":"The site fields. They will be appended to the required fields: `[\"access\", \"title\", \"contactEmail\", \"favicon\", \"ogImage\"]`.\n\n@example `[\"logo\", \"slogan\", \"phone\"]`"}]},{"name":"JtDocumentType","exported":true,"docComment":"A document is another name for a web page, with a path in the URL.","kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtRoutingDocumentType"},{"kind":"localRef","refName":"JtRegularDocumentType"}]},{"name":"JtDocumentTypeBase","exported":true,"kind":"interface","properties":[{"name":"typeName","type":{"kind":"name","group":"primitive","refName":"string"},"docComment":"The type name is the identifier of the document type."},{"name":"kind","type":{"kind":"literal","literal":"document"}},{"name":"ogType","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true,"docComment":"@see [Open Graph Protocol](https://ogp.me/)\n@example `\"article\"`"},{"name":"withFeaturedImage","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true,"docComment":"If `true`, the document will have a featured image. Most of the time, documents like\nsearch-page, contact-page, the home page, don't need a featured image. But other documents\ndoes."},{"name":"fields","type":{"kind":"array","itemType":{"kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtFieldType"},{"kind":"name","group":"primitive","refName":"string"}]}},"optional":true,"docComment":"The fields in the document. Items in this list can be either field types or predefined field\ntype names."},{"name":"mediaPolicy","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true,"docComment":"The name of the media policy."},{"name":"lists","type":{"kind":"array","itemType":{"kind":"localRef","refName":"JtListType"}},"optional":true,"docComment":"Lists of parts in the document."},{"name":"routingChildren","type":{"kind":"array","itemType":{"kind":"name","group":"primitive","refName":"string"}},"optional":true,"docComment":"Type names of child routing documents."},{"name":"regularChildren","type":{"kind":"array","itemType":{"kind":"name","group":"primitive","refName":"string"}},"optional":true,"docComment":"Type names of child regular documents."},{"name":"regularChildrenSorting","type":{"kind":"localRef","refName":"JtSorting"},"optional":true,"docComment":"The sorting order of regular children. It is required when `children` is defined.\nExamples: `\"title asc\"`, `\"publishDate desc\"`, `\"manual\"`."},{"name":"childLimit","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true,"docComment":"The maximum number of children."},{"name":"hasFrontendApp","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true,"docComment":"If `true`, the document will serve a SPA. It means that all the child routes will be handled by\nthe document.\n\nThis property is not compatible with `routingChildren`, `regularChildren`, `redirectTo`\nproperties. Also, if the document type is regular, then sibling regular document types must not\nhave routing or regular children."},{"name":"useUrlQuery","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true,"docComment":"If `true`, then the url query will be exposed to the liquid templates. By default it's better\nto not enable it, then the same content will be served from the cache for all the URL query\nvalues."},{"name":"adminUi","type":{"kind":"localRef","refName":"JtDocumentAdminUiSettings"},"optional":true}]},{"name":"JtSorting","exported":true,"kind":"composite","op":"union","types":[{"kind":"array","itemType":{"kind":"name","group":"primitive","refName":"string"}},{"kind":"literal","literal":"manual"},{"kind":"name","group":"primitive","refName":"string"}]},{"name":"JtRoutingDocumentType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtDocumentTypeBase"},{"kind":"interface","properties":[{"name":"documentKind","type":{"kind":"literal","literal":"routing"}},{"name":"redirectTo","type":{"kind":"literal","literal":"parent"},"optional":true,"docComment":"Value `\"parent\"` means that the document is just a hierarchy parent for other documents. But it\nhas no content itself.\n\nThis value is ignored in the home page type."},{"name":"route","type":{"kind":"composite","op":"union","types":[{"kind":"name","group":"primitive","refName":"string"},{"kind":"localRef","refName":"JtTranslatedStrings"}]},"optional":true,"docComment":"The `route` of a routing document contains a kind of _directory name_ (one per language) that\nwill be the last part of the document URL path.\n\nThis value is ignored in the home page type."}]}]},{"name":"JtTranslatedStrings","exported":true,"kind":"interface","indexSignature":{"keyName":"language","keyType":"string","type":{"kind":"name","group":"primitive","refName":"string"}}},{"name":"JtDocumentAdminUiSettings","exported":true,"kind":"interface","properties":[{"name":"defaultTab","type":{"kind":"localRef","refName":"JtDocumentTabName"},"optional":true,"docComment":"Default value is `\"auto\"`."},{"name":"menuPlacement","type":{"kind":"composite","op":"union","types":[{"kind":"literal","literal":"default"},{"kind":"literal","literal":"popup"}]},"optional":true,"docComment":"Used by routing documents only. Default value is `\"default\"`."}]},{"name":"JtDocumentTabName","exported":true,"kind":"composite","op":"union","types":[{"kind":"literal","literal":"auto"},{"kind":"literal","literal":"edit"},{"kind":"literal","literal":"childDocuments"},{"kind":"literal","literal":"parts"}]},{"name":"JtRegularDocumentType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtDocumentTypeBase"},{"kind":"interface","properties":[{"name":"documentKind","type":{"kind":"literal","literal":"regular"}},{"name":"route","type":{"kind":"name","group":"primitive","refName":"string"},"docComment":"Available values are: `\":relativeId-:slug\"` and `\":yyyy/:mm/:dd/:relativeId-:slug\"`."},{"name":"relativeIdGenerator","type":{"kind":"localRef","refName":"JtRelativeIdGeneratorType"},"optional":true},{"name":"autoPublish","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true,"docComment":"Value `true` means that the document will be automatically published without being a\ndraft before. Useful for taxonomy terms, like tags or categories."}]}]},{"name":"JtRelativeIdGeneratorType","exported":true,"kind":"array","itemType":{"kind":"name","group":"ts","refName":"any"}},{"name":"JtSubListType","exported":true,"kind":"interface","properties":[{"name":"parts","type":{"kind":"array","itemType":{"kind":"name","group":"primitive","refName":"string"}},"docComment":"Type names of the parts in the list."},{"name":"sorting","type":{"kind":"localRef","refName":"JtSorting"},"docComment":"How to sort the list. Example: `\"manual\"`."},{"name":"limit","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true,"docComment":"The maximum number of parts in the list."}]},{"name":"JtListType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtSubListType"},{"kind":"interface","properties":[{"name":"listName","type":{"kind":"name","group":"primitive","refName":"string"}}]}]},{"name":"JtPartType","exported":true,"kind":"interface","properties":[{"name":"typeName","type":{"kind":"name","group":"primitive","refName":"string"},"docComment":"The type name is the identifier of the part type."},{"name":"kind","type":{"kind":"literal","literal":"part"}},{"name":"fields","type":{"kind":"array","itemType":{"kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtFieldType"},{"kind":"name","group":"primitive","refName":"string"}]}},"optional":true},{"name":"list","type":{"kind":"localRef","refName":"JtSubListType"},"optional":true,"docComment":"If the part type can have children parts, then it's a sub-list."},{"name":"mediaPolicy","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true}]},{"name":"JtFieldType","exported":true,"kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtMainDbFieldType"},{"kind":"localRef","refName":"JtMediaDbFieldType"},{"kind":"localRef","refName":"JtLabelingFieldType"}]},{"name":"JtFieldTypeBase","exported":true,"kind":"interface","properties":[{"name":"name","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"withGallery","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"useAsDefaultImage","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true},{"name":"renderAs","type":{"kind":"literal","literal":"html"},"optional":true},{"name":"useAsExcerpt","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true},{"name":"plugin","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true,"docComment":"A plugin name. For example: `@paroicms/quill-editor-plugin`."},{"name":"adminUi","type":{"kind":"localRef","refName":"JtFieldAdminUiSettings"},"optional":true,"docComment":"UI settings in the admin-ui."}]},{"name":"JtFieldAdminUiSettings","exported":true,"kind":"interface","properties":[{"name":"showInCard","type":{"kind":"composite","op":"union","types":[{"kind":"name","group":"primitive","refName":"boolean"},{"kind":"literal","literal":"auto"}]},"optional":true,"docComment":"Default is `\"auto\"`."}],"indexSignature":{"keyName":"key","keyType":"string","type":{"kind":"name","group":"ts","refName":"any"}}},{"name":"JtLocalizableFieldTypeBase","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtFieldTypeBase"},{"kind":"interface","properties":[{"name":"localized","type":{"kind":"name","group":"primitive","refName":"boolean"},"docComment":"If `true`, then each translation will have its own value. Otherwise, the value is shared\nbetween all translations."},{"name":"normalizeTypography","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true,"docComment":"This property should be set to `true` for real textual field types, like an html body or a\nlabel.\n\nNote: Its value has no effect when `localized` is `false`."}]}]},{"name":"JtLabelingFieldType","exported":true,"docComment":"The field type represents a labeling link between the current node, and a term from a taxonomy.","kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtFieldTypeBase"},{"kind":"interface","properties":[{"name":"localized","type":{"kind":"literal","literal":false}},{"name":"storedAs","type":{"kind":"literal","literal":"labeling"}},{"name":"taxonomy","type":{"kind":"name","group":"primitive","refName":"string"},"docComment":"It's the type name of a routing document. Regular documents that are child of this routing\ndocument will be the terms of the taxonomy.\n\nNotice: Any routing point can be used as a taxonomy. Terms are always regular documents."},{"name":"multiple","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true,"docComment":"If `true`, multiple terms can be selected. Otherwise, only one term can be selected."}]}]},{"name":"JtMainDbFieldType","exported":true,"kind":"composite","op":"union","types":[{"kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtNumberFieldType"},{"kind":"localRef","refName":"JtBooleanFieldType"},{"kind":"localRef","refName":"JtDateFieldType"},{"kind":"localRef","refName":"JtDateTimeFieldType"},{"kind":"localRef","refName":"JtTimeFieldType"},{"kind":"localRef","refName":"JtStringFieldType"},{"kind":"localRef","refName":"JtJsonFieldType"}]}]},{"name":"JtNumberFieldType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtLocalizableFieldTypeBase"},{"kind":"interface","properties":[{"name":"storedAs","type":{"kind":"literal","literal":"varchar"}},{"name":"dataType","type":{"kind":"literal","literal":"number"}},{"name":"currency","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true},{"name":"enum","type":{"kind":"array","itemType":{"kind":"name","group":"primitive","refName":"number"}},"optional":true}]}]},{"name":"JtBooleanFieldType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtLocalizableFieldTypeBase"},{"kind":"interface","properties":[{"name":"storedAs","type":{"kind":"literal","literal":"varchar"}},{"name":"dataType","type":{"kind":"literal","literal":"boolean"}}]}]},{"name":"JtDateFieldType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtLocalizableFieldTypeBase"},{"kind":"interface","properties":[{"name":"storedAs","type":{"kind":"literal","literal":"varchar"}},{"name":"dataType","type":{"kind":"literal","literal":"date"}}]}]},{"name":"JtDateTimeFieldType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtLocalizableFieldTypeBase"},{"kind":"interface","properties":[{"name":"storedAs","type":{"kind":"literal","literal":"varchar"}},{"name":"dataType","type":{"kind":"literal","literal":"dateTime"}}]}]},{"name":"JtTimeFieldType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtLocalizableFieldTypeBase"},{"kind":"interface","properties":[{"name":"storedAs","type":{"kind":"literal","literal":"varchar"}},{"name":"dataType","type":{"kind":"literal","literal":"time"}}]}]},{"name":"JtStringFieldType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtLocalizableFieldTypeBase"},{"kind":"interface","properties":[{"name":"storedAs","type":{"kind":"composite","op":"union","types":[{"kind":"literal","literal":"text"},{"kind":"literal","literal":"varchar"}]}},{"name":"dataType","type":{"kind":"literal","literal":"string"}},{"name":"multiline","type":{"kind":"name","group":"primitive","refName":"boolean"},"optional":true},{"name":"enum","type":{"kind":"array","itemType":{"kind":"name","group":"primitive","refName":"string"}},"optional":true}]}]},{"name":"JtJsonFieldType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtLocalizableFieldTypeBase"},{"kind":"interface","properties":[{"name":"storedAs","type":{"kind":"composite","op":"union","types":[{"kind":"literal","literal":"text"},{"kind":"literal","literal":"varchar"}]}},{"name":"dataType","type":{"kind":"literal","literal":"json"}}]}]},{"name":"JtMediaDbFieldType","exported":true,"kind":"composite","op":"union","types":[{"kind":"localRef","refName":"JtGalleryFieldType"},{"kind":"localRef","refName":"JtMediaFieldType"}]},{"name":"JtGalleryFieldType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtLocalizableFieldTypeBase"},{"kind":"interface","properties":[{"name":"storedAs","type":{"kind":"literal","literal":"mediaHandle"}},{"name":"dataType","type":{"kind":"literal","literal":"gallery"}},{"name":"accept","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"refuse","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true}]}]},{"name":"JtMediaFieldType","exported":true,"kind":"composite","op":"intersection","types":[{"kind":"localRef","refName":"JtLocalizableFieldTypeBase"},{"kind":"interface","properties":[{"name":"storedAs","type":{"kind":"literal","literal":"mediaHandle"}},{"name":"dataType","type":{"kind":"literal","literal":"media"}},{"name":"accept","type":{"kind":"name","group":"primitive","refName":"string"}},{"name":"refuse","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true}]}]},{"name":"JtMediaPolicy","exported":true,"docComment":"These properties define the rules that are applied to medias.","kind":"interface","properties":[{"name":"policyName","type":{"kind":"name","group":"primitive","refName":"string"},"docComment":"The internal name of the policy.\n@example `\"myPolicyName\"`"},{"name":"mediaLimitPerDocument","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true,"docComment":"Max media limit uploaded in a document.\n@example `10`"},{"name":"mediaLimitPerPart","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true,"docComment":"Max media limit uploaded in a part.\n@example `10`"},{"name":"attachedDocument","type":{"kind":"localRef","refName":"JtAttachedDocumentPolicy"},"optional":true,"docComment":"Rules about non-image medias (like PDF files)."},{"name":"image","type":{"kind":"localRef","refName":"JtImagePolicy"},"optional":true,"docComment":"Rules about images."}]},{"name":"JtAttachedDocumentPolicy","exported":true,"docComment":"These properties define the rules that are applied to\ndocument uploaded in document and document part","kind":"interface","properties":[{"name":"siteWeightLimitB","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true,"docComment":"Size limit in bytes.\n@example `2000000`"}]},{"name":"JtImagePolicy","exported":true,"docComment":"These properties define the rules that are applied to\nimages contained in document and document part","kind":"interface","properties":[{"name":"weightLimitB","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true,"docComment":"Size limit in bytes.\n@example `2000000`"},{"name":"areaLimitPx","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true,"docComment":"Maximum area (width × height, in pixels) of an image.\n@example `2000000`"}]},{"name":"JtImageCompressionQualityPolicyStep","exported":true,"docComment":"These properties define the rules applied to image\ncompression across all sites","kind":"interface","properties":[{"name":"areaLimitPx","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true,"docComment":"The quality will apply for image with area smaller than this value.\n@example `600000`"},{"name":"quality","type":{"kind":"name","group":"primitive","refName":"number"},"docComment":"Webp quality loss, in percents.\n@example `80`"}]},{"name":"JtSiteSchemaTranslations","exported":true,"kind":"interface","properties":[{"name":"siteTheme","type":{"kind":"name","group":"primitive","refName":"string"},"optional":true},{"name":"nodeTypes","type":{"kind":"interface","indexSignature":{"keyName":"typeName","keyType":"string","type":{"kind":"localRef","refName":"JtLabelLocales"}}},"optional":true},{"name":"fieldTypes","type":{"kind":"interface","indexSignature":{"keyName":"fieldName","keyType":"string","type":{"kind":"localRef","refName":"JtLabelLocales"}}},"optional":true}]},{"name":"JtLabelLocales","exported":true,"kind":"interface","indexSignature":{"keyName":"key","keyType":"string","type":{"kind":"composite","op":"union","types":[{"kind":"name","group":"primitive","refName":"string"},{"kind":"localRef","refName":"JtLabelLocales"}]}}}]},"./theme-json-types":{"namedTypes":[{"name":"JtThemeConf","exported":true,"kind":"interface","properties":[{"name":"pixelRatio","type":{"kind":"name","group":"primitive","refName":"number"},"optional":true,"docComment":"Default value is `1`."},{"name":"fTextImages","type":{"kind":"array","itemType":{"kind":"name","group":"primitive","refName":"string"}}}]}]}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paroicms/public-server-lib",
3
- "version": "0.42.0",
3
+ "version": "0.44.0",
4
4
  "description": "Common utilitaries for paroicms plugins (backend side).",
5
5
  "author": "Paroi Team",
6
6
  "repository": {
@@ -13,25 +13,31 @@
13
13
  "main": "dist/index.js",
14
14
  "types": "dist/index.d.ts",
15
15
  "scripts": {
16
- "build": "tsc",
16
+ "build": "npm run typeonly && npm run tsc",
17
+ "tsc": "tsc",
18
+ "typeonly": "typeonly --bundle dist/types.to.json -s ./typeonly",
17
19
  "test:watch": "vitest",
18
20
  "test": "vitest run",
19
21
  "clear": "rimraf dist/*",
20
22
  "dev": "tsc --watch --preserveWatchOutput"
21
23
  },
22
24
  "dependencies": {
23
- "@paroicms/internal-anywhere-lib": "1.32.0",
24
- "@paroicms/public-anywhere-lib": "0.33.0",
25
+ "@paroicms/internal-anywhere-lib": "1.33.0",
26
+ "@paroicms/public-anywhere-lib": "0.34.0",
27
+ "@paroicms/script-lib": "0.2.0",
28
+ "@typeonly/validator": "~1.1.2",
25
29
  "arktype": "~2.1.20"
26
30
  },
27
31
  "devDependencies": {
28
32
  "@types/node": "~24.0.1",
29
33
  "rimraf": "~6.0.1",
34
+ "typeonly": "~1.1.3",
30
35
  "typescript": "~5.8.3",
31
36
  "vitest": "~3.2.3"
32
37
  },
33
38
  "files": [
34
39
  "dist",
35
- "types"
40
+ "types",
41
+ "typeonly"
36
42
  ]
37
43
  }
@@ -0,0 +1,26 @@
1
+ import type { JtFieldType, JtLabelLocales } from "./site-schema-json-types.d.ts";
2
+
3
+ /**
4
+ * The common schema is currently an internal file. Here is its typing.
5
+ */
6
+ export interface JtInternalCommonSchema {
7
+ /**
8
+ * This is the version of the schema engine.
9
+ */
10
+ ParoiCMSSiteSchemaFormatVersion: string;
11
+ /**
12
+ * Specify the list of 2-letters language codes that can be used in the websites.
13
+ *
14
+ * @example ["en", "fr"]`
15
+ */
16
+ languages: string[];
17
+ /**
18
+ * The common fields of any websites. They are currently: `["title", "contactEmail", "favicon", "ogImage"]`.
19
+ */
20
+ siteFields: JtFieldType[];
21
+ }
22
+
23
+ export interface JtInternalCommonSchemaTranslations {
24
+ languageLabel: string;
25
+ siteFields?: { [fieldName: string]: JtLabelLocales };
26
+ }
@@ -0,0 +1,199 @@
1
+ export type JtConfiguration = JtSingleSiteConfiguration | JtMultisiteConfiguration;
2
+
3
+ export interface JtConfigurationBase {
4
+ /**
5
+ * @deprecated Move the sub-properties in the parent.
6
+ */
7
+ thisServer?: JtDeprecatedThisServerConf;
8
+ /**
9
+ * It is required except if the legacy `thisServer` is still used.
10
+ */
11
+ port?: number;
12
+ hostname?: string;
13
+ /**
14
+ * Default is `"http"`.
15
+ */
16
+ publicProtocol?: "http" | "https";
17
+ publicPort?: number;
18
+ /**
19
+ * @deprecated Use adminUiPort instead.
20
+ */
21
+ boPort?: number;
22
+ adminUiPort?: number;
23
+
24
+ allowRobots: boolean;
25
+ enableCache?: boolean;
26
+ immutableAssets?: boolean;
27
+ /**
28
+ * For example: `"14d"`.
29
+ */
30
+ cacheTimeToIdle?: string | "disabled" | "infinite";
31
+ clearCacheAfterStart?: boolean;
32
+ clearImageCacheAfterStart?: boolean;
33
+ /**
34
+ * @deprecated Replace `log.level` by `logLevel`, and `log.file` by `logFile`.
35
+ */
36
+ log?: JtLogConf;
37
+ logLevel?: "silent" | "error" | "warn" | "info" | "stats" | "debug" | "trace";
38
+ /**
39
+ * Omit for stdout.
40
+ */
41
+ logFile?: string;
42
+ graphqlDevTools?: boolean;
43
+ generateMissingDatabases?: boolean;
44
+ googleAuth?: JtGoogleAuthConf;
45
+ /** @deprecated Use "@paroicms/send-mail-aws-ses-plugin" configuration instead */
46
+ awsSesMail?: JtDeprecatedAwsSesMailConf;
47
+ /** @deprecated Use "@paroicms/contact-form-plugin" configuration instead */
48
+ googleRecaptcha?: JtDeprecatedGoogleRecaptchaConf;
49
+ imageProcessor?: JtImageProcessorConf | JtLegacyImageProcessorConf;
50
+ devAccount?: JtDevAccountConf;
51
+ platformAdminAccounts?: JtPlatformAdminAccountConf[];
52
+ plugins?: JtPluginStaticConfiguration[] | JtDeprecatedPluginConfigurations;
53
+ httpRedirections?: JtHttpRedirection[];
54
+ }
55
+
56
+ export interface JtHttpRedirection {
57
+ fromFqdn: string;
58
+ to: string;
59
+ mapPaths?: {
60
+ [fromRegex: string]: string;
61
+ };
62
+ preservePath?: boolean;
63
+ }
64
+
65
+ export interface JtSingleSiteConfiguration extends JtConfigurationBase {
66
+ singleSite: JtSingleSiteConf;
67
+ }
68
+
69
+ export interface JtMultisiteConfiguration extends JtConfigurationBase {
70
+ platform: {
71
+ dataDir: string;
72
+ };
73
+ sitePacks: JtSitePackOrLegacyConf[];
74
+ }
75
+
76
+ export interface JtDeprecatedThisServerConf {
77
+ port: number;
78
+ publicPort?: number;
79
+ boPublicPort?: number;
80
+ hostName?: string | null;
81
+ https: boolean;
82
+ }
83
+
84
+ export interface JtLogConf {
85
+ level: "silent" | "error" | "warn" | "info" | "stats" | "debug" | "trace";
86
+ /**
87
+ * Omit for stdout.
88
+ */
89
+ file?: string;
90
+ }
91
+
92
+ export interface JtSingleSiteConf {
93
+ siteDir: string;
94
+ dataDir: string;
95
+ cacheDir: string;
96
+ backupDir: string;
97
+ fqdn: string;
98
+ redirectWww?: boolean;
99
+ /* Default value is `true`. */
100
+ trusted?: boolean;
101
+ }
102
+
103
+ export type JtSitePackOrLegacyConf =
104
+ | JtSitePackConf
105
+ | JtLegacyFqdnSitePackConf
106
+ | JtLegacySubDomainSitePackConf;
107
+
108
+ export type JtSitePackConf = JtFqdnSitePackConf | JtSubDomainSitePackConf;
109
+
110
+ export interface JtSitePackConfBase {
111
+ packName: string;
112
+ sitesDir?: string;
113
+ dataDir: string;
114
+ cacheDir: string;
115
+ backupDir: string;
116
+ redirectWww?: boolean;
117
+ /* Default value is `true`. */
118
+ trusted?: boolean;
119
+ }
120
+
121
+ export interface JtFqdnSitePackConf extends JtSitePackConfBase {
122
+ serveOn: "fqdn";
123
+ }
124
+
125
+ export interface JtSubDomainSitePackConf extends JtSitePackConfBase {
126
+ serveOn: "subDomain";
127
+ parentDomain: string;
128
+ }
129
+
130
+ export interface JtLegacyFqdnSitePackConf extends JtSitePackConfBase {
131
+ /** @deprecated Renamed to `serveOn` */
132
+ serveAs: "fqdn";
133
+ }
134
+
135
+ export interface JtLegacySubDomainSitePackConf extends JtSitePackConfBase {
136
+ /** @deprecated Renamed to `serveOn` */
137
+ serveAs: "subDomain";
138
+ parentDomain: string;
139
+ }
140
+
141
+ export interface JtGoogleAuthConf {
142
+ disabled?: boolean;
143
+ fqdn: string;
144
+ clientId: string;
145
+ clientSecret: string;
146
+ }
147
+
148
+ /** @deprecated Use "@paroicms/send-mail-aws-ses-plugin" configuration instead */
149
+ export interface JtDeprecatedAwsSesMailConf {
150
+ disabled?: boolean;
151
+ from: string;
152
+ accessKeyId: string;
153
+ secretAccessKey: string;
154
+ region: string;
155
+ }
156
+
157
+ /** @deprecated Use "@paroicms/contact-form-plugin" configuration instead */
158
+ export interface JtDeprecatedGoogleRecaptchaConf {
159
+ disabled?: boolean;
160
+ siteKey: string;
161
+ secretKey: string;
162
+ }
163
+
164
+ export interface JtImageProcessorConf {
165
+ cpuCoresPerFile?: number;
166
+ allowConcurrency?: boolean;
167
+ }
168
+
169
+ export interface JtLegacyImageProcessorConf {
170
+ cpuCoresPerFile?: number;
171
+ oneSharpAtATime?: boolean;
172
+ }
173
+
174
+ export interface JtDevAccountConf {
175
+ email: string;
176
+ name: string;
177
+ password: string;
178
+ }
179
+
180
+ export interface JtPlatformAdminAccountConf {
181
+ email: string;
182
+ name: string;
183
+ }
184
+
185
+ export interface JtPluginStaticConfiguration {
186
+ name: string;
187
+ disabled?: boolean;
188
+ platform?: boolean;
189
+ configuration?: {
190
+ [key: string]: unknown;
191
+ };
192
+ }
193
+
194
+ /** @deprecated Use JtPluginConfiguration[] instead */
195
+ export interface JtDeprecatedPluginConfigurations {
196
+ [pluginName: string]: {
197
+ [key: string]: unknown;
198
+ };
199
+ }
@@ -0,0 +1,437 @@
1
+ // ----- SITE SCHEMA -----
2
+
3
+ /**
4
+ * This properties are part of a site schema, and part of the internal library as well.
5
+ */
6
+ export interface JtSiteSchema {
7
+ /**
8
+ * This is the version of the schema engine.
9
+ */
10
+ ParoiCMSSiteSchemaFormatVersion: "9";
11
+ /**
12
+ * Specify the list of 2-letters language codes (ISO 639-1) of the website. Use 3-letters codes (ISO 639-3) for languages that doesn't have a 2-letters code ("qya", etc.). It's possible but not recommanded to use 5-letters codes with regions (IETF BCP 47, for example "fr-FR"). Every language is allowed. The first language is the primary language of the website.
13
+ * @example `["en", "fr"]`
14
+ */
15
+ languages: string[];
16
+ /**
17
+ * Routing mode for multilingual sites. Default is "auto".
18
+ * - "auto": behaves like "prefixSecondary" for unilingual sites, "prefixAll" for multilingual sites
19
+ * - "prefixAll": all languages are prefixed in URLs
20
+ * - "prefixSecondary": all languages but the first are prefixed in URLs
21
+ */
22
+ languageRoutingMode?: "prefixSecondary" | "prefixAll" | "auto";
23
+ /**
24
+ * List of plugins that are used in the schema.
25
+ * @example ["@paroicms/quill-editor-plugin"]
26
+ */
27
+ plugins?: (string | JtPluginRef)[];
28
+ configuration?: JtSiteConfiguration;
29
+ /**
30
+ * Types of documents, parts that will be handled on the site.
31
+ */
32
+ nodeTypes?: JtNodeType[];
33
+ /**
34
+ * A library of fields.
35
+ */
36
+ fieldTypes?: JtFieldType[];
37
+ /**
38
+ * Media policies
39
+ */
40
+ mediaPolicies?: JtMediaPolicy[];
41
+ /**
42
+ * We can set the image compression quality here. The list must be ordered from the lowest area
43
+ * to the highest.
44
+ */
45
+ imageQualityPolicy?: JtImageCompressionQualityPolicyStep[];
46
+ }
47
+
48
+ export interface JtPluginRef {
49
+ name: string;
50
+ disabled?: boolean;
51
+ configuration?: JtPluginConfFromSchema;
52
+ }
53
+
54
+ export interface JtPluginConfFromSchema {
55
+ [key: string]: unknown;
56
+ }
57
+
58
+ export interface JtSiteConfiguration {
59
+ adminUi?: {
60
+ enableMetaKeywords?: boolean;
61
+ };
62
+ }
63
+
64
+ // ----- NODE TYPES -----
65
+
66
+ export type JtNodeType = JtSiteType | JtDocumentType | JtPartType;
67
+
68
+ export interface JtSiteType {
69
+ /**
70
+ * Can be omitted. Its default value is `"_site"`.
71
+ */
72
+ typeName?: "_site";
73
+ kind: "site";
74
+ /**
75
+ * The site fields. They will be appended to the required fields: `["access", "title", "contactEmail", "favicon", "ogImage"]`.
76
+ *
77
+ * @example `["logo", "slogan", "phone"]`
78
+ */
79
+ fields?: (JtFieldType | string)[];
80
+ }
81
+
82
+ /**
83
+ * A document is another name for a web page, with a path in the URL.
84
+ */
85
+ export type JtDocumentType = JtRoutingDocumentType | JtRegularDocumentType;
86
+
87
+ export interface JtDocumentTypeBase {
88
+ /**
89
+ * The type name is the identifier of the document type.
90
+ */
91
+ typeName: string;
92
+ kind: "document";
93
+ /**
94
+ * @see [Open Graph Protocol](https://ogp.me/)
95
+ * @example `"article"`
96
+ */
97
+ ogType?: string;
98
+ /**
99
+ * If `true`, the document will have a featured image. Most of the time, documents like
100
+ * search-page, contact-page, the home page, don't need a featured image. But other documents
101
+ * does.
102
+ */
103
+ withFeaturedImage?: boolean;
104
+ /**
105
+ * The fields in the document. Items in this list can be either field types or predefined field
106
+ * type names.
107
+ */
108
+ fields?: (JtFieldType | string)[];
109
+ /**
110
+ * The name of the media policy.
111
+ */
112
+ mediaPolicy?: string;
113
+ /**
114
+ * Lists of parts in the document.
115
+ */
116
+ lists?: JtListType[];
117
+ /**
118
+ * Type names of child routing documents.
119
+ */
120
+ routingChildren?: string[];
121
+ /**
122
+ * Type names of child regular documents.
123
+ */
124
+ regularChildren?: string[];
125
+ /**
126
+ * The sorting order of regular children. It is required when `children` is defined.
127
+ * Examples: `"title asc"`, `"publishDate desc"`, `"manual"`.
128
+ */
129
+ regularChildrenSorting?: JtSorting;
130
+ /**
131
+ * The maximum number of children.
132
+ */
133
+ childLimit?: number;
134
+ /**
135
+ * If `true`, the document will serve a SPA. It means that all the child routes will be handled by
136
+ * the document.
137
+ *
138
+ * This property is not compatible with `routingChildren`, `regularChildren`, `redirectTo`
139
+ * properties. Also, if the document type is regular, then sibling regular document types must not
140
+ * have routing or regular children.
141
+ */
142
+ hasFrontendApp?: boolean;
143
+ /**
144
+ * If `true`, then the url query will be exposed to the liquid templates. By default it's better
145
+ * to not enable it, then the same content will be served from the cache for all the URL query
146
+ * values.
147
+ */
148
+ useUrlQuery?: boolean;
149
+ adminUi?: JtDocumentAdminUiSettings;
150
+ }
151
+
152
+ export type JtSorting = string[] | "manual" | string;
153
+
154
+ export interface JtRoutingDocumentType extends JtDocumentTypeBase {
155
+ documentKind: "routing";
156
+ /**
157
+ * Value `"parent"` means that the document is just a hierarchy parent for other documents. But it
158
+ * has no content itself.
159
+ *
160
+ * This value is ignored in the home page type.
161
+ */
162
+ redirectTo?: "parent";
163
+ /**
164
+ * The `route` of a routing document contains a kind of _directory name_ (one per language) that
165
+ * will be the last part of the document URL path.
166
+ *
167
+ * This value is ignored in the home page type.
168
+ */
169
+ route?: string | JtTranslatedStrings;
170
+ }
171
+
172
+ export interface JtTranslatedStrings {
173
+ [language: string]: string;
174
+ }
175
+
176
+ export interface JtDocumentAdminUiSettings {
177
+ /** Default value is `"auto"`. */
178
+ defaultTab?: JtDocumentTabName;
179
+ /** Used by routing documents only. Default value is `"default"`. */
180
+ menuPlacement?: "default" | "popup";
181
+ }
182
+
183
+ export type JtDocumentTabName = "auto" | "edit" | "childDocuments" | "parts";
184
+
185
+ export interface JtRegularDocumentType extends JtDocumentTypeBase {
186
+ documentKind: "regular";
187
+ /**
188
+ * Available values are: `":relativeId-:slug"` and `":yyyy/:mm/:dd/:relativeId-:slug"`.
189
+ */
190
+ route: string;
191
+ relativeIdGenerator?: JtRelativeIdGeneratorType;
192
+ /**
193
+ * Value `true` means that the document will be automatically published without being a
194
+ * draft before. Useful for taxonomy terms, like tags or categories.
195
+ */
196
+ autoPublish?: boolean;
197
+ }
198
+
199
+ export type JtRelativeIdGeneratorType = any[]; // [makerName: string, ...args: any[]]
200
+
201
+ // ----- PART TYPES -----
202
+
203
+ export interface JtSubListType {
204
+ /** Type names of the parts in the list. */
205
+ parts: string[];
206
+ /** How to sort the list. Example: `"manual"`. */
207
+ sorting: JtSorting;
208
+ /**
209
+ * The maximum number of parts in the list.
210
+ */
211
+ limit?: number;
212
+ }
213
+
214
+ export interface JtListType extends JtSubListType {
215
+ listName: string;
216
+ }
217
+
218
+ export interface JtPartType {
219
+ /** The type name is the identifier of the part type. */
220
+ typeName: string;
221
+ kind: "part";
222
+ fields?: (JtFieldType | string)[];
223
+ /** If the part type can have children parts, then it's a sub-list. */
224
+ list?: JtSubListType;
225
+ mediaPolicy?: string;
226
+ }
227
+
228
+ // ----- FIELD TYPES -----
229
+
230
+ export type JtFieldType = JtMainDbFieldType | JtMediaDbFieldType | JtLabelingFieldType;
231
+
232
+ export interface JtFieldTypeBase {
233
+ name: string;
234
+ withGallery?: boolean;
235
+ useAsDefaultImage?: number;
236
+ renderAs?: "html";
237
+ useAsExcerpt?: number;
238
+ /** A plugin name. For example: `@paroicms/quill-editor-plugin`. */
239
+ plugin?: string;
240
+ /**
241
+ * UI settings in the admin-ui.
242
+ */
243
+ adminUi?: JtFieldAdminUiSettings;
244
+ }
245
+
246
+ export interface JtFieldAdminUiSettings {
247
+ /** Default is `"auto"`. */
248
+ showInCard?: boolean | "auto";
249
+ [key: string]: any;
250
+ }
251
+
252
+ export interface JtLocalizableFieldTypeBase extends JtFieldTypeBase {
253
+ /**
254
+ * If `true`, then each translation will have its own value. Otherwise, the value is shared
255
+ * between all translations.
256
+ */
257
+ localized: boolean;
258
+ /**
259
+ * This property should be set to `true` for real textual field types, like an html body or a
260
+ * label.
261
+ *
262
+ * Note: Its value has no effect when `localized` is `false`.
263
+ */
264
+ normalizeTypography?: boolean;
265
+ }
266
+
267
+ /**
268
+ * The field type represents a labeling link between the current node, and a term from a taxonomy.
269
+ */
270
+ export interface JtLabelingFieldType extends JtFieldTypeBase {
271
+ localized: false;
272
+ storedAs: "labeling";
273
+ /**
274
+ * It's the type name of a routing document. Regular documents that are child of this routing
275
+ * document will be the terms of the taxonomy.
276
+ *
277
+ * Notice: Any routing point can be used as a taxonomy. Terms are always regular documents.
278
+ */
279
+ taxonomy: string;
280
+ /**
281
+ * If `true`, multiple terms can be selected. Otherwise, only one term can be selected.
282
+ */
283
+ multiple?: boolean;
284
+ }
285
+
286
+ export type JtMainDbFieldType =
287
+ | JtNumberFieldType
288
+ | JtBooleanFieldType
289
+ | JtDateFieldType
290
+ | JtDateTimeFieldType
291
+ | JtTimeFieldType
292
+ | JtStringFieldType
293
+ | JtJsonFieldType;
294
+
295
+ export interface JtNumberFieldType extends JtLocalizableFieldTypeBase {
296
+ storedAs: "varchar";
297
+ dataType: "number";
298
+ currency?: string;
299
+ enum?: number[];
300
+ }
301
+
302
+ export interface JtBooleanFieldType extends JtLocalizableFieldTypeBase {
303
+ storedAs: "varchar";
304
+ dataType: "boolean";
305
+ }
306
+
307
+ export interface JtDateFieldType extends JtLocalizableFieldTypeBase {
308
+ storedAs: "varchar";
309
+ dataType: "date";
310
+ }
311
+
312
+ export interface JtDateTimeFieldType extends JtLocalizableFieldTypeBase {
313
+ storedAs: "varchar";
314
+ dataType: "dateTime";
315
+ }
316
+
317
+ export interface JtTimeFieldType extends JtLocalizableFieldTypeBase {
318
+ storedAs: "varchar";
319
+ dataType: "time";
320
+ }
321
+
322
+ export interface JtStringFieldType extends JtLocalizableFieldTypeBase {
323
+ storedAs: "text" | "varchar";
324
+ dataType: "string";
325
+ multiline?: boolean;
326
+ enum?: string[];
327
+ }
328
+
329
+ export interface JtJsonFieldType extends JtLocalizableFieldTypeBase {
330
+ storedAs: "text" | "varchar";
331
+ dataType: "json";
332
+ }
333
+
334
+ export type JtMediaDbFieldType = JtGalleryFieldType | JtMediaFieldType;
335
+
336
+ export interface JtGalleryFieldType extends JtLocalizableFieldTypeBase {
337
+ storedAs: "mediaHandle";
338
+ dataType: "gallery";
339
+ accept: string;
340
+ refuse?: string;
341
+ }
342
+
343
+ export interface JtMediaFieldType extends JtLocalizableFieldTypeBase {
344
+ storedAs: "mediaHandle";
345
+ dataType: "media";
346
+ accept: string;
347
+ refuse?: string;
348
+ }
349
+
350
+ // ----- MEDIA POLICIES -----
351
+
352
+ /**
353
+ * These properties define the rules that are applied to medias.
354
+ */
355
+ export interface JtMediaPolicy {
356
+ /**
357
+ * The internal name of the policy.
358
+ * @example `"myPolicyName"`
359
+ */
360
+ policyName: string;
361
+ /**
362
+ * Max media limit uploaded in a document.
363
+ * @example `10`
364
+ */
365
+ mediaLimitPerDocument?: number;
366
+ /**
367
+ * Max media limit uploaded in a part.
368
+ * @example `10`
369
+ */
370
+ mediaLimitPerPart?: number;
371
+ /**
372
+ * Rules about non-image medias (like PDF files).
373
+ */
374
+ attachedDocument?: JtAttachedDocumentPolicy;
375
+ /**
376
+ * Rules about images.
377
+ */
378
+ image?: JtImagePolicy;
379
+ }
380
+
381
+ /**
382
+ * These properties define the rules that are applied to
383
+ * document uploaded in document and document part
384
+ */
385
+ export interface JtAttachedDocumentPolicy {
386
+ /**
387
+ * Size limit in bytes.
388
+ * @example `2000000`
389
+ */
390
+ siteWeightLimitB?: number;
391
+ }
392
+
393
+ /**
394
+ * These properties define the rules that are applied to
395
+ * images contained in document and document part
396
+ */
397
+ export interface JtImagePolicy {
398
+ /**
399
+ * Size limit in bytes.
400
+ * @example `2000000`
401
+ */
402
+ weightLimitB?: number;
403
+ /**
404
+ * Maximum area (width × height, in pixels) of an image.
405
+ * @example `2000000`
406
+ */
407
+ areaLimitPx?: number;
408
+ }
409
+
410
+ /**
411
+ * These properties define the rules applied to image
412
+ * compression across all sites
413
+ */
414
+ export interface JtImageCompressionQualityPolicyStep {
415
+ /**
416
+ * The quality will apply for image with area smaller than this value.
417
+ * @example `600000`
418
+ */
419
+ areaLimitPx?: number;
420
+ /**
421
+ * Webp quality loss, in percents.
422
+ * @example `80`
423
+ */
424
+ quality: number;
425
+ }
426
+
427
+ // ----- LOCALIZATION -----
428
+
429
+ export interface JtSiteSchemaTranslations {
430
+ siteTheme?: string;
431
+ nodeTypes?: { [typeName: string]: JtLabelLocales };
432
+ fieldTypes?: { [fieldName: string]: JtLabelLocales };
433
+ }
434
+
435
+ export interface JtLabelLocales {
436
+ [key: string]: string | JtLabelLocales;
437
+ }
@@ -0,0 +1,7 @@
1
+ export interface JtThemeConf {
2
+ /**
3
+ * Default value is `1`.
4
+ */
5
+ pixelRatio?: number;
6
+ fTextImages: string[];
7
+ }
@@ -74,15 +74,10 @@ export interface PaHttpResponse {
74
74
 
75
75
  export interface ParoiCmsPlugin {
76
76
  version: string;
77
- /**
78
- * The slug of the plugin. It must be unique among all plugins. When it is not provided, then it
79
- * is generated from the plugin name.
80
- */
81
- slug?: string;
82
77
  siteInit?: (service: BackendPluginInitService) => void | Promise<void>;
83
78
  }
84
79
 
85
- export interface BackendPluginInitService {
80
+ export interface BackendPluginInitService extends PluginStaticConfiguration {
86
81
  logger: AppLogger;
87
82
  setPublicAssetsDirectory(directory: string): void;
88
83
  setAdminUiAssetsDirectory(directory: string): void;
@@ -119,13 +114,13 @@ export interface BackendPluginInitService {
119
114
  UpdateFieldValue
120
115
  >,
121
116
  ): void;
117
+ registerHook(hookName: "sendMail", handler: BackendHookHandler<MailData, undefined, void>): void;
122
118
  registerRenderingHook(hookName: "fieldPreprocessor", handler: RenderingHookHandler): void;
123
119
  setPublicApiHandler(handler: PublicApiHandler): void;
124
120
  /** @deprecated Use `registerHeadTags` instead. */
125
121
  addHeadTag(...htmlTags: string[]): void;
126
122
  registerHeadTags(handler: HeadTagsHandler): void;
127
123
  registeredSite: RegisteredSite;
128
- configuration: PluginConfiguration;
129
124
  pluginAssetsUrl: string;
130
125
  }
131
126
 
@@ -182,13 +177,12 @@ export type PublicApiHandler = (
182
177
  relativePath: string,
183
178
  ) => Promise<void> | void;
184
179
 
185
- export interface BackendPluginService {
180
+ export interface BackendPluginService extends PluginStaticConfiguration {
186
181
  fqdn: string;
187
182
  siteUrl: string;
188
183
  siteSchema: ScSiteSchema;
189
184
  themeConf: ThemeConf;
190
185
  logger: AppLogger;
191
- validateRecaptchaResponse: (gRecaptchaResponse: string | undefined) => Promise<boolean>;
192
186
  sendMail: ({ subject, html, replyTo, to }: MailData) => Promise<void>;
193
187
  executeHook(
194
188
  hookName: string,
@@ -198,10 +192,9 @@ export interface BackendPluginService {
198
192
  },
199
193
  ): Promise<unknown> | unknown;
200
194
  registeredSite: RegisteredSite;
201
- configuration: PluginConfiguration;
202
195
  pluginAssetsUrl: string;
203
196
  /** This is the connector of the running instance of ParoiCMS. */
204
- connector: RunningInstanceConnector;
197
+ connector: RunningServerConnector;
205
198
  getSiteFieldValue: (options: {
206
199
  fieldName: string;
207
200
  language?: string;
@@ -293,14 +286,20 @@ export interface PublicDocument {
293
286
  publishDate: string;
294
287
  }
295
288
 
296
- export interface PluginConfigurations {
297
- [pluginName: string]: PluginConfiguration;
289
+ export interface PluginStaticConfigurations {
290
+ [pluginName: string]: PluginStaticConfiguration | undefined;
298
291
  }
299
292
 
300
- export interface PluginConfiguration {
301
- [key: string]: unknown;
302
- adminUi?: Obj;
303
- googleRecaptchaSiteKey?: string;
293
+ /**
294
+ * This is the configuration of a plugin that is statically defined in the app configuration, or in
295
+ * the site schema.
296
+ */
297
+ export interface PluginStaticConfiguration {
298
+ platform: boolean;
299
+ configuration: {
300
+ [key: string]: unknown;
301
+ adminUi?: Obj;
302
+ };
304
303
  }
305
304
 
306
305
  export interface MailData {
@@ -364,7 +363,7 @@ export interface SubDomainSitePackConfiguration extends SitePackConfigurationBas
364
363
 
365
364
  /* Running instance types */
366
365
 
367
- export interface RunningInstanceConnector {
366
+ export interface RunningServerConnector {
368
367
  getSitePackConf(packName: string): SitePackConfiguration;
369
368
  loadSiteSchemaAndIds(fqdn: string): Promise<RiSiteSchemaAndIds>;
370
369
  createAccount(
@@ -396,6 +395,13 @@ export interface RunningInstanceConnector {
396
395
  ): Promise<ParsedLNodeId[]>;
397
396
  registerNewSite: (options: NewSiteOptions) => Promise<RegisteredSite>;
398
397
  removeSite: (fqdn: string) => Promise<void>;
398
+ migrateSiteSchemas(): Promise<void>;
399
+ createBlankSiteFromExisting(options: CreateBlankSiteOptions): Promise<void>;
400
+ }
401
+
402
+ export interface CreateBlankSiteOptions {
403
+ siteDir: string;
404
+ languages: string[];
399
405
  }
400
406
 
401
407
  export interface RiSiteSchemaAndIds {
@@ -1,3 +0,0 @@
1
- export declare function resolveModuleDirectory(moduleUrl: string, { parent }?: {
2
- parent?: boolean | undefined;
3
- }): string;
@@ -1,7 +0,0 @@
1
- import { dirname, resolve } from "node:path";
2
- import { fileURLToPath } from "node:url";
3
- export function resolveModuleDirectory(moduleUrl, { parent = false } = {}) {
4
- const dir = resolve(dirname(fileURLToPath(moduleUrl)));
5
- return parent ? dirname(dir) : dir;
6
- }
7
- //# sourceMappingURL=esm-module.helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"esm-module.helper.js","sourceRoot":"","sources":["../src/esm-module.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,sBAAsB,CAAC,SAAiB,EAAE,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,EAAE;IAC/E,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AACrC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function esmDirName(url: string): string;
2
- export declare function getSolidJsVersion(dirName: string): string;
@@ -1,18 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import { dirname, resolve } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- export function esmDirName(url) {
5
- return dirname(fileURLToPath(url));
6
- }
7
- export function getSolidJsVersion(dirName) {
8
- const packageJsonPath = resolve(dirName, "package.json");
9
- const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
10
- const version = packageJson.devDependencies["solid-js"];
11
- if (!version)
12
- throw new Error("missing 'solid-js' dependency");
13
- if (!version.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) {
14
- throw new Error(`invalid solid-js version: "${version}" (please use an exact x.x.x version)`);
15
- }
16
- return version;
17
- }
18
- //# sourceMappingURL=vite-config.helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite-config.helper.js","sourceRoot":"","sources":["../src/vite-config.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IACzD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;IACvE,MAAM,OAAO,GAAG,WAAW,CAAC,eAAe,CAAC,UAAU,CAAuB,CAAC;IAC9E,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC/D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,8BAA8B,OAAO,uCAAuC,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}