@skaldapp/shared 1.2.25 → 1.2.26

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,9 +1,7 @@
1
1
  import type { FromSchema } from "json-schema-to-ts";
2
- import Credentials from "./schemas/credentials.js";
3
- import Log from "./schemas/log.js";
2
+ import Credential from "./schemas/credential.js";
4
3
  import Page from "./schemas/page.js";
5
- export type TCredentials = FromSchema<typeof Credentials>;
6
- export type TLog = FromSchema<typeof Log>;
4
+ export type TCredential = FromSchema<typeof Credential>;
7
5
  export type TPage = FromSchema<typeof Page> & {
8
6
  $children: TPage[];
9
7
  $index: number;
@@ -56,15 +54,4 @@ export declare const fetching: (input: string) => Promise<any>, sharedStore: {
56
54
  siblings: any[];
57
55
  to?: string;
58
56
  }[];
59
- credentials: TCredentials;
60
- log: {
61
- messages: {
62
- content: {
63
- type: string;
64
- text: string;
65
- }[];
66
- role: "user" | "assistant" | "system";
67
- }[];
68
- system: string;
69
- };
70
57
  };
package/dist/index.js CHANGED
@@ -4,23 +4,19 @@ import dynamicDefaults from "ajv-keywords/dist/definitions/dynamicDefaults.js";
4
4
  import { consola } from "consola/browser";
5
5
  import { ofetch } from "ofetch";
6
6
  import { generateSlug } from "random-word-slugs";
7
- import { reactive, ref, toRef, toRefs, watch } from "vue";
8
- import Credentials from "./schemas/credentials.js";
9
- import Log from "./schemas/log.js";
7
+ import { reactive, ref, toRef, watch } from "vue";
8
+ import Credential from "./schemas/credential.js";
10
9
  import Nodes from "./schemas/nodes.js";
11
10
  import Page from "./schemas/page.js";
12
11
  dynamicDefaults.DEFAULTS["uuid"] = () => generateSlug;
13
- const schemas = [Credentials, Nodes, Page, Log], ajv = new AJV({
12
+ const schemas = [Nodes, Page], ajv = new AJV({
14
13
  code: { esm: true },
15
14
  coerceTypes: true,
16
15
  keywords: [dynamicDefaults()],
17
16
  removeAdditional: true,
18
17
  schemas,
19
18
  useDefaults: true,
20
- }), data = toRefs(reactive({
21
- credentials: {},
22
- log: {},
23
- })), immediate = true, nodes = "nodes", properties = {
19
+ }), immediate = true, nodes = "nodes", properties = {
24
20
  $children: {
25
21
  get() {
26
22
  return this.children.filter(({ frontmatter: { hidden } }) => !hidden);
@@ -71,14 +67,9 @@ export const fetching = async (input) => {
71
67
  consola.error(error);
72
68
  }
73
69
  }, sharedStore = reactive({
74
- ...data,
75
70
  tree,
76
71
  ...useFlatJsonTree(tree),
77
72
  });
78
- Object.keys(data).forEach((key) => {
79
- if (validate[key])
80
- watch(data[key], validate[key], { immediate });
81
- });
82
73
  watch(toRef(sharedStore, nodes), async (value) => {
83
74
  if (!(await validate[nodes]?.(value)))
84
75
  tree.value = [{}];
@@ -0,0 +1,32 @@
1
+ declare const _default: {
2
+ readonly $id: "credential";
3
+ readonly properties: {
4
+ readonly accessKeyId: {
5
+ readonly default: null;
6
+ readonly nullable: true;
7
+ readonly type: "string";
8
+ };
9
+ readonly Bucket: {
10
+ readonly default: null;
11
+ readonly nullable: true;
12
+ readonly type: "string";
13
+ };
14
+ readonly endpoint: {
15
+ readonly default: null;
16
+ readonly nullable: true;
17
+ readonly type: "string";
18
+ };
19
+ readonly region: {
20
+ readonly default: null;
21
+ readonly nullable: true;
22
+ readonly type: "string";
23
+ };
24
+ readonly secretAccessKey: {
25
+ readonly default: null;
26
+ readonly nullable: true;
27
+ readonly type: "string";
28
+ };
29
+ };
30
+ readonly type: "object";
31
+ };
32
+ export default _default;
@@ -0,0 +1,11 @@
1
+ export default {
2
+ $id: "credential",
3
+ properties: {
4
+ accessKeyId: { default: null, nullable: true, type: "string" },
5
+ Bucket: { default: null, nullable: true, type: "string" },
6
+ endpoint: { default: null, nullable: true, type: "string" },
7
+ region: { default: null, nullable: true, type: "string" },
8
+ secretAccessKey: { default: null, nullable: true, type: "string" },
9
+ },
10
+ type: "object",
11
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://www.schemastore.org/package",
3
3
  "name": "@skaldapp/shared",
4
- "version": "1.2.25",
4
+ "version": "1.2.26",
5
5
  "description": "A TypeScript library providing reactive data structures, JSON schema validation, and tree utilities for Vue-based applications in the skald ecosystem.",
6
6
  "keywords": [
7
7
  "vue",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "prettier": "@skaldapp/configs/prettierrc",
35
35
  "dependencies": {
36
- "@skaldapp/flat-json-tree": "^2.2.17",
36
+ "@skaldapp/flat-json-tree": "^2.2.18",
37
37
  "ajv": "^8.17.1",
38
38
  "ajv-keywords": "^5.1.0",
39
39
  "consola": "^3.4.2",
@@ -43,7 +43,7 @@
43
43
  "vue": "^3.5.26"
44
44
  },
45
45
  "devDependencies": {
46
- "@skaldapp/configs": "^1.2.41",
46
+ "@skaldapp/configs": "^1.2.43",
47
47
  "eslint": "^9.39.2"
48
48
  }
49
49
  }
@@ -1,35 +0,0 @@
1
- declare const _default: {
2
- readonly $id: "credentials";
3
- readonly additionalProperties: {
4
- readonly properties: {
5
- readonly accessKeyId: {
6
- readonly default: null;
7
- readonly nullable: true;
8
- readonly type: "string";
9
- };
10
- readonly Bucket: {
11
- readonly default: null;
12
- readonly nullable: true;
13
- readonly type: "string";
14
- };
15
- readonly endpoint: {
16
- readonly default: null;
17
- readonly nullable: true;
18
- readonly type: "string";
19
- };
20
- readonly region: {
21
- readonly default: null;
22
- readonly nullable: true;
23
- readonly type: "string";
24
- };
25
- readonly secretAccessKey: {
26
- readonly default: null;
27
- readonly nullable: true;
28
- readonly type: "string";
29
- };
30
- };
31
- readonly type: "object";
32
- };
33
- readonly type: "object";
34
- };
35
- export default _default;
@@ -1,14 +0,0 @@
1
- export default {
2
- $id: "credentials",
3
- additionalProperties: {
4
- properties: {
5
- accessKeyId: { default: null, nullable: true, type: "string" },
6
- Bucket: { default: null, nullable: true, type: "string" },
7
- endpoint: { default: null, nullable: true, type: "string" },
8
- region: { default: null, nullable: true, type: "string" },
9
- secretAccessKey: { default: null, nullable: true, type: "string" },
10
- },
11
- type: "object",
12
- },
13
- type: "object",
14
- };
@@ -1,45 +0,0 @@
1
- declare const _default: {
2
- readonly $id: "log";
3
- readonly additionalProperties: false;
4
- readonly properties: {
5
- readonly messages: {
6
- readonly default: readonly [];
7
- readonly items: {
8
- readonly additionalProperties: false;
9
- readonly properties: {
10
- readonly content: {
11
- readonly default: readonly [];
12
- readonly items: {
13
- readonly additionalProperties: false;
14
- readonly properties: {
15
- readonly text: {
16
- readonly default: "";
17
- readonly type: "string";
18
- };
19
- readonly type: {
20
- readonly default: "text";
21
- readonly type: "string";
22
- };
23
- };
24
- readonly type: "object";
25
- };
26
- readonly type: "array";
27
- };
28
- readonly role: {
29
- readonly default: "user";
30
- readonly enum: readonly ["user", "assistant", "system"];
31
- readonly type: "string";
32
- };
33
- };
34
- readonly type: "object";
35
- };
36
- readonly type: "array";
37
- };
38
- readonly system: {
39
- readonly default: "";
40
- readonly type: "string";
41
- };
42
- };
43
- readonly type: "object";
44
- };
45
- export default _default;
@@ -1,38 +0,0 @@
1
- export default {
2
- $id: "log",
3
- additionalProperties: false,
4
- properties: {
5
- messages: {
6
- default: [],
7
- items: {
8
- additionalProperties: false,
9
- properties: {
10
- content: {
11
- default: [],
12
- items: {
13
- additionalProperties: false,
14
- properties: {
15
- text: { default: "", type: "string" },
16
- type: {
17
- default: "text",
18
- type: "string",
19
- },
20
- },
21
- type: "object",
22
- },
23
- type: "array",
24
- },
25
- role: {
26
- default: "user",
27
- enum: ["user", "assistant", "system"],
28
- type: "string",
29
- },
30
- },
31
- type: "object",
32
- },
33
- type: "array",
34
- },
35
- system: { default: "", type: "string" },
36
- },
37
- type: "object",
38
- };