@raisindb/client 0.5.10 → 0.5.11

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.mjs CHANGED
@@ -405,6 +405,7 @@ var RequestType = /* @__PURE__ */ ((RequestType2) => {
405
405
  RequestType2["NodeUpdate"] = "node_update";
406
406
  RequestType2["NodeDelete"] = "node_delete";
407
407
  RequestType2["NodeGet"] = "node_get";
408
+ RequestType2["NodeGetByLocalizedPath"] = "node_get_by_localized_path";
408
409
  RequestType2["NodeQuery"] = "node_query";
409
410
  RequestType2["NodeQueryByPath"] = "node_query_by_path";
410
411
  RequestType2["NodeQueryByProperty"] = "node_query_by_property";
@@ -1065,6 +1066,27 @@ var NodeOperations = class {
1065
1066
  const result = await this.sendRequest(payload, "node_history");
1066
1067
  return result ?? [];
1067
1068
  }
1069
+ /**
1070
+ * Get a node by its localized URL path (plan Phase 12).
1071
+ *
1072
+ * @param locale - Locale code (`fr`, `fr-CA`)
1073
+ * @param path - The node's path in that locale (`/produits/chaise`)
1074
+ * @returns The translated node with `canonical_path`,
1075
+ * `canonical_localized_path`, hreflang `alternates` and a `redirect`
1076
+ * hint, or `null` when nothing resolves (missing, hidden in the locale
1077
+ * or not readable — the same answer)
1078
+ *
1079
+ * @example
1080
+ * ```typescript
1081
+ * const hit = await ws.nodes().getByLocalizedPath('fr', '/produits/chaise');
1082
+ * if (hit?.redirect) redirect301(`/fr${hit.canonical_localized_path}`);
1083
+ * ```
1084
+ */
1085
+ async getByLocalizedPath(locale, path) {
1086
+ const payload = { locale, path };
1087
+ const result = await this.sendRequest(payload, "node_get_by_localized_path");
1088
+ return result ?? null;
1089
+ }
1068
1090
  /**
1069
1091
  * List a node's revision history by path (newest first).
1070
1092
  *