@regojs/erp-sdk 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -38,13 +38,13 @@
38
38
  "url": "git+https://github.com/rego-solution/erp-sdk"
39
39
  },
40
40
  "scripts": {
41
- "build:browser": "tsc --noEmit && APP=\"browser\" bun run ./app.build.ts && tsc --emitDeclarationOnly",
42
- "build:server": "tsc --noEmit && APP=\"server\" bun run ./app.build.ts && tsc --emitDeclarationOnly",
41
+ "build:browser": "tsc --emitDeclarationOnly && APP=\"browser\" bun run --check ./app.build.ts",
42
+ "build:server": "tsc --emitDeclarationOnly && APP=\"server\" bun run --check ./app.build.ts",
43
43
  "format": "prettier \"./src/**/*.ts\" --write",
44
44
  "test": "bun --hot run __test/index.ts"
45
45
  },
46
46
  "types": "./dist/index.d.ts",
47
- "version": "1.1.7",
47
+ "version": "1.1.8",
48
48
  "exports": {
49
49
  ".": {
50
50
  "import": "./dist/index.js",
@@ -216,6 +216,13 @@ export class RegoProvider implements IRegoProvider {
216
216
  return;
217
217
  }
218
218
 
219
+ case "ogTitle": {
220
+ this.#metadataElements
221
+ .get(key)
222
+ ?.setAttribute("content", value?.trim() || "");
223
+ return;
224
+ }
225
+
219
226
  case "ogDescription": {
220
227
  this.#metadataElements
221
228
  .get(key)
@@ -1 +0,0 @@
1
- export * as Vanilla from "./vanilla";
@@ -1,6 +0,0 @@
1
- export declare enum EScriptIds {
2
- routes = "rego-routes",
3
- data = "rego-data",
4
- metadata = "rego-metadata",
5
- staticData = "rego-static-data"
6
- }
@@ -1 +0,0 @@
1
- export * as Enums from "./enums";
@@ -1,8 +0,0 @@
1
- export * from "./constants";
2
- export * from "./providers";
3
- export * from "./types";
4
- export * from "./validators";
5
- export type * from "./constants";
6
- export type * from "./providers";
7
- export type * from "./types";
8
- export type * from "./validators";
@@ -1 +0,0 @@
1
- export { RegoProvider } from "./regoProvider";
@@ -1,16 +0,0 @@
1
- import type { IRegoProvider } from "../types";
2
- export declare class RegoProvider implements IRegoProvider {
3
- #private;
4
- private readonly window;
5
- constructor(window: Window);
6
- setMetadataToElement(...[key, value]: Parameters<IRegoProvider["setMetadataToElement"]>): void;
7
- inferMetadata(payload: Parameters<IRegoProvider["inferMetadata"]>[number]): void;
8
- fetchRoute({ cache, ...payload }: Parameters<IRegoProvider["fetchRoute"]>[number]): ReturnType<IRegoProvider["fetchRoute"]>;
9
- get routes(): {
10
- path: string;
11
- component: string;
12
- }[] | undefined;
13
- get staticData(): unknown[] | Record<string, unknown> | null | undefined;
14
- get data(): Record<string, unknown> | null | undefined;
15
- get metadata(): Record<string, string | null | undefined> | null | undefined;
16
- }
@@ -1 +0,0 @@
1
- export type * from "./regoProvider";
@@ -1,19 +0,0 @@
1
- import type { TData, TFullData, TMetadata, TRoute, TStaticData } from "../validators";
2
- export type TMedataKeys = "title" | "description" | "keywords" | "canonical" | "ogType" | "ogTitle" | "ogDescription" | "ogImage" | "ogUrl";
3
- export interface IRegoProvider {
4
- routes: Array<TRoute> | undefined;
5
- staticData: TStaticData;
6
- data: TData;
7
- metadata: TMetadata;
8
- fetchRoute(payload: {
9
- origin: string;
10
- pathname: string;
11
- search: string;
12
- cache?: boolean;
13
- } | {
14
- url: URL;
15
- cache?: boolean;
16
- }): Promise<Readonly<TFullData> | undefined>;
17
- setMetadataToElement(key: TMedataKeys, value: string | null | undefined): void;
18
- inferMetadata(payload: Record<string, string | null | undefined>): void;
19
- }
@@ -1,3 +0,0 @@
1
- import type { output } from "zod";
2
- export declare const dataSchema: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
3
- export type TData = output<typeof dataSchema>;
@@ -1,7 +0,0 @@
1
- import type { output } from "zod";
2
- export declare const fullDataSchema: import("zod").ZodObject<{
3
- metadata: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>>>>;
4
- data: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
5
- staticData: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodUnion<readonly [import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>, import("zod").ZodArray<import("zod").ZodUnknown>]>>>;
6
- }, import("zod/v4/core").$strip>;
7
- export type TFullData = output<typeof fullDataSchema>;
@@ -1,10 +0,0 @@
1
- export * from "./data";
2
- export * from "./fullData";
3
- export * from "./metadata";
4
- export * from "./routes";
5
- export * from "./staticData";
6
- export type * from "./data";
7
- export type * from "./fullData";
8
- export type * from "./metadata";
9
- export type * from "./routes";
10
- export type * from "./staticData";
@@ -1,3 +0,0 @@
1
- import type { output } from "zod";
2
- export declare const metadataSchema: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>>>>;
3
- export type TMetadata = output<typeof metadataSchema>;
@@ -1,6 +0,0 @@
1
- import type { output } from "zod";
2
- export declare const routeSchema: import("zod").ZodObject<{
3
- path: import("zod").ZodString;
4
- component: import("zod").ZodString;
5
- }, import("zod/v4/core").$strip>;
6
- export type TRoute = output<typeof routeSchema>;
@@ -1,3 +0,0 @@
1
- import type { output } from "zod";
2
- export declare const staticDataSchema: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodUnion<readonly [import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>, import("zod").ZodArray<import("zod").ZodUnknown>]>>>;
3
- export type TStaticData = output<typeof staticDataSchema>;