codify-schemas 1.0.44 → 1.0.45

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.
Files changed (47) hide show
  1. package/dist/config-file-schema.json +1 -1
  2. package/dist/ipc-message-schema.json +1 -1
  3. package/dist/messages/apply-request-data-schema.json +1 -1
  4. package/dist/messages/apply-response-data-schema.json +1 -1
  5. package/dist/messages/error-response-data-schema.json +1 -1
  6. package/dist/messages/initialize-request-data-schema.json +1 -1
  7. package/dist/messages/initialize-response-data-schema.json +1 -1
  8. package/dist/messages/plan-request-data-schema.json +1 -1
  9. package/dist/messages/plan-response-data-schema.json +1 -1
  10. package/dist/messages/sudo-request-data-schema.json +1 -1
  11. package/dist/messages/sudo-response-data-schema.json +1 -1
  12. package/dist/messages/validate-request-data-schema.json +1 -1
  13. package/dist/messages/validate-response-data-schema.json +1 -1
  14. package/dist/project-schema.json +1 -1
  15. package/dist/resource-schema.json +1 -1
  16. package/package.json +1 -1
  17. package/src/config-file-schema.json +1 -1
  18. package/src/config-file-schema.test.ts +2 -2
  19. package/src/ipc-message-schema.json +1 -1
  20. package/src/ipc-message-schema.test.ts +2 -2
  21. package/src/messages/apply-request-data-schema.json +1 -1
  22. package/src/messages/apply-request-data-schema.test.ts +4 -3
  23. package/src/messages/apply-response-data-schema.json +1 -1
  24. package/src/messages/apply-response-data-schema.test.ts +21 -0
  25. package/src/messages/error-response-data-schema.json +1 -1
  26. package/src/messages/error-response-data-schema.test.ts +23 -0
  27. package/src/messages/get-resources-response-data-schema.json +1 -1
  28. package/src/messages/get-resources-response-data-schema.test.ts +2 -2
  29. package/src/messages/initialize-request-data-schema.json +1 -1
  30. package/src/messages/initialize-request-data-schema.test.ts +2 -2
  31. package/src/messages/initialize-response-data-schema.json +1 -1
  32. package/src/messages/initialize-response-data-schema.test.ts +2 -2
  33. package/src/messages/plan-request-data-schema.json +1 -1
  34. package/src/messages/plan-request-data-schema.test.ts +2 -2
  35. package/src/messages/plan-response-data-schema.json +1 -1
  36. package/src/messages/plan-response-data-schema.test.ts +2 -2
  37. package/src/messages/sudo-request-data-schema.json +1 -1
  38. package/src/messages/sudo-request-data-schema.test.ts +2 -2
  39. package/src/messages/sudo-response-data-schema.json +1 -1
  40. package/src/messages/sudo-response-data-schema.test.ts +2 -2
  41. package/src/messages/validate-request-data-schema.json +1 -1
  42. package/src/messages/validate-response-data-schema.json +1 -1
  43. package/src/messages/validate-response-data-schema.test.ts +2 -2
  44. package/src/project-schema.json +1 -1
  45. package/src/project-schema.test.ts +2 -2
  46. package/src/resource-schema.json +1 -1
  47. package/src/resource-schema.test.ts +2 -2
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/config-file-schema.json",
4
4
  "title": "Config file Schema",
5
5
  "type": "array",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/ipc-message-schema.json",
4
4
  "title": "IPC Message Schema",
5
5
  "type": "object",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/apply-request-data-schema.json",
4
4
  "title": "Apply Request Schema Data",
5
5
  "description": "Apply the previously generated plan. The plan must already be generated in order for apply to work.",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/apply-response-data-schema.json",
4
4
  "title": "Apply Response Schema Data",
5
5
  "type": "null"
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/error-response-data-schema.json",
4
4
  "title": "Error Response Schema Data",
5
5
  "type": "object",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/initialize-request-data-schema.json",
4
4
  "title": "Initialize Request Schema Data",
5
5
  "description": "Initialize the plugin",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/initialize-response-data-schema.json",
4
4
  "title": "Initialize Request Schema Data",
5
5
  "description": "Initialize the plugin",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/plan-request-data-schema.json",
4
4
  "title": "Plan Request Schema Data",
5
5
  "type": "object",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/plan-response-data-schema.json",
4
4
  "title": "Plan Response Schema Data",
5
5
  "type": "object",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/sudo-request.json",
4
4
  "title": "Sudo request",
5
5
  "description": "Request sudo from the core CLI",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/sudo-request-response.json",
4
4
  "title": "Sudo request response",
5
5
  "description": "Response for a sudo request",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/validate-request-data-schema.json",
4
4
  "title": "Validate Request Schema Data",
5
5
  "type": "object",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/validate-response-data-schema.json",
4
4
  "title": "Validate Response Schema Data",
5
5
  "type": "object",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/project-schema.json",
4
4
  "title": "Project Schema",
5
5
  "type": "object",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/resource-schema.json",
4
4
  "title": "Resource Schema",
5
5
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-schemas",
3
- "version": "1.0.44",
3
+ "version": "1.0.45",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/config-file-schema.json",
4
4
  "title": "Config file Schema",
5
5
  "type": "array",
@@ -1,8 +1,8 @@
1
1
  import configFileSchema from './config-file-schema.json';
2
2
  import { describe, it, expect } from 'vitest'
3
- import Ajv2020 from 'ajv/dist/2020.js'
3
+ import Ajv from 'ajv'
4
4
 
5
- const ajv = new Ajv2020.default({
5
+ const ajv = new Ajv.default({
6
6
  strict: true,
7
7
  })
8
8
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/ipc-message-schema.json",
4
4
  "title": "IPC Message Schema",
5
5
  "type": "object",
@@ -1,8 +1,8 @@
1
1
  import schema from './ipc-message-schema.json';
2
2
  import { describe, it, expect } from 'vitest'
3
- import Ajv2020 from 'ajv/dist/2020.js'
3
+ import Ajv from 'ajv'
4
4
 
5
- const ajv = new Ajv2020.default({
5
+ const ajv = new Ajv.default({
6
6
  strict: true,
7
7
  })
8
8
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/apply-request-data-schema.json",
4
4
  "title": "Apply Request Schema Data",
5
5
  "description": "Apply the previously generated plan. The plan must already be generated in order for apply to work.",
@@ -1,13 +1,14 @@
1
1
  import schema from './apply-request-data-schema.json';
2
2
  import resourceSchema from '../resource-schema.json'
3
3
  import {describe, expect, it} from 'vitest'
4
- import Ajv2020 from 'ajv/dist/2020.js'
5
4
  import addFormats from 'ajv-formats';
6
- import {ApplyRequestData, ParameterOperation, ResourceOperation} from "../types/index.js";
5
+ import { ApplyRequestData, ParameterOperation, ResourceOperation } from "../types/index.js";
6
+ import Ajv from 'ajv';
7
7
 
8
- const ajv = new Ajv2020.default({
8
+ const ajv = new Ajv.default({
9
9
  strict: true,
10
10
  })
11
+
11
12
  addFormats.default(ajv);
12
13
  ajv.addSchema(resourceSchema);
13
14
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/apply-response-data-schema.json",
4
4
  "title": "Apply Response Schema Data",
5
5
  "type": "null"
@@ -0,0 +1,21 @@
1
+ import schema from './apply-response-data-schema.json';
2
+ import {describe, expect, it} from 'vitest'
3
+ import addFormats from 'ajv-formats';
4
+ import Ajv from 'ajv';
5
+
6
+ const ajv = new Ajv.default({
7
+ strict: true,
8
+ })
9
+
10
+ addFormats.default(ajv);
11
+
12
+ describe('Apply request data schema', () => {
13
+ it('compiles', () => {
14
+ ajv.compile(schema);
15
+ })
16
+
17
+ it("validates an empty config", () => {
18
+ const validate = ajv.compile(schema);
19
+ expect(validate(null)).to.be.true;
20
+ })
21
+ })
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/error-response-data-schema.json",
4
4
  "title": "Error Response Schema Data",
5
5
  "type": "object",
@@ -0,0 +1,23 @@
1
+ import schema from './error-response-data-schema.json';
2
+ import {describe, expect, it} from 'vitest'
3
+ import addFormats from 'ajv-formats';
4
+ import Ajv from 'ajv';
5
+
6
+ const ajv = new Ajv.default({
7
+ strict: true,
8
+ })
9
+
10
+ addFormats.default(ajv);
11
+
12
+ describe('Apply request data schema', () => {
13
+ it('compiles', () => {
14
+ ajv.compile(schema);
15
+ })
16
+
17
+ it("validates an error message", () => {
18
+ const validate = ajv.compile(schema);
19
+ expect(validate({
20
+ reason: "This was an error"
21
+ })).to.be.true;
22
+ })
23
+ })
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/get-resources-response-data-schema.json",
4
4
  "title": "Get Resources Response Schema Data",
5
5
  "type": "object",
@@ -1,9 +1,9 @@
1
1
  import schema from './get-resources-response-data-schema.json';
2
2
  import resourceSchema from '../resource-schema.json'
3
3
  import { describe, it, expect } from 'vitest'
4
- import Ajv2020 from 'ajv/dist/2020.js'
4
+ import Ajv from 'ajv'
5
5
 
6
- const ajv = new Ajv2020.default({
6
+ const ajv = new Ajv.default({
7
7
  strict: true,
8
8
  })
9
9
  ajv.addSchema(resourceSchema);
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/initialize-request-data-schema.json",
4
4
  "title": "Initialize Request Schema Data",
5
5
  "description": "Initialize the plugin",
@@ -1,8 +1,8 @@
1
1
  import schema from './initialize-request-data-schema.json';
2
2
  import {describe, expect, it} from 'vitest'
3
- import Ajv2020 from 'ajv/dist/2020.js'
3
+ import Ajv from 'ajv'
4
4
 
5
- const ajv = new Ajv2020.default({
5
+ const ajv = new Ajv.default({
6
6
  strict: true,
7
7
  })
8
8
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/initialize-response-data-schema.json",
4
4
  "title": "Initialize Request Schema Data",
5
5
  "description": "Initialize the plugin",
@@ -1,8 +1,8 @@
1
1
  import schema from './initialize-response-data-schema.json';
2
2
  import {describe, expect, it} from 'vitest'
3
- import Ajv2020 from 'ajv/dist/2020.js'
3
+ import Ajv from 'ajv'
4
4
 
5
- const ajv = new Ajv2020.default({
5
+ const ajv = new Ajv.default({
6
6
  strict: true,
7
7
  })
8
8
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/plan-request-data-schema.json",
4
4
  "title": "Plan Request Schema Data",
5
5
  "type": "object",
@@ -1,9 +1,9 @@
1
1
  import schema from './plan-request-data-schema.json';
2
2
  import resourceSchema from '../resource-schema.json'
3
3
  import { describe, it, expect } from 'vitest'
4
- import Ajv2020 from 'ajv/dist/2020.js'
4
+ import Ajv from 'ajv'
5
5
 
6
- const ajv = new Ajv2020.default({
6
+ const ajv = new Ajv.default({
7
7
  strict: true,
8
8
  strictRequired: false,
9
9
  })
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/plan-response-data-schema.json",
4
4
  "title": "Plan Response Schema Data",
5
5
  "type": "object",
@@ -1,11 +1,11 @@
1
1
  import schema from './plan-response-data-schema.json';
2
2
  import resourceSchema from '../resource-schema.json'
3
3
  import {describe, expect, it} from 'vitest'
4
- import Ajv2020 from 'ajv/dist/2020.js'
4
+ import Ajv from 'ajv'
5
5
  import addFormats from 'ajv-formats';
6
6
  import {ParameterOperation, PlanResponseData, ResourceOperation} from "../types/index.js";
7
7
 
8
- const ajv = new Ajv2020.default({
8
+ const ajv = new Ajv.default({
9
9
  strict: true,
10
10
  })
11
11
  addFormats.default(ajv);
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/sudo-request.json",
4
4
  "title": "Sudo request",
5
5
  "description": "Request sudo from the core CLI",
@@ -1,8 +1,8 @@
1
1
  import schema from './sudo-request-data-schema.json';
2
2
  import {describe, expect, it} from 'vitest'
3
- import Ajv2020 from 'ajv/dist/2020.js'
3
+ import Ajv from 'ajv'
4
4
 
5
- const ajv = new Ajv2020.default({
5
+ const ajv = new Ajv.default({
6
6
  strict: true,
7
7
  })
8
8
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/sudo-request-response.json",
4
4
  "title": "Sudo request response",
5
5
  "description": "Response for a sudo request",
@@ -1,8 +1,8 @@
1
1
  import schema from './sudo-response-data-schema.json';
2
2
  import {describe, expect, it} from 'vitest'
3
- import Ajv2020 from 'ajv/dist/2020.js'
3
+ import Ajv from 'ajv'
4
4
 
5
- const ajv = new Ajv2020.default({
5
+ const ajv = new Ajv.default({
6
6
  strict: true,
7
7
  })
8
8
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/validate-request-data-schema.json",
4
4
  "title": "Validate Request Schema Data",
5
5
  "type": "object",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/validate-response-data-schema.json",
4
4
  "title": "Validate Response Schema Data",
5
5
  "type": "object",
@@ -1,10 +1,10 @@
1
1
  import schema from './validate-response-data-schema.json';
2
2
  import {describe, expect, it} from 'vitest'
3
- import Ajv2020 from 'ajv/dist/2020.js'
3
+ import Ajv from 'ajv'
4
4
  import addFormats from 'ajv-formats';
5
5
  import {ValidateResponseData} from "../types/index.js";
6
6
 
7
- const ajv = new Ajv2020.default({
7
+ const ajv = new Ajv.default({
8
8
  strict: true,
9
9
  })
10
10
  addFormats.default(ajv);
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/project-schema.json",
4
4
  "title": "Project Schema",
5
5
  "type": "object",
@@ -1,8 +1,8 @@
1
1
  import schema from './project-schema.json';
2
2
  import { describe, it, expect } from 'vitest'
3
- import Ajv2020 from 'ajv/dist/2020.js'
3
+ import Ajv from 'ajv'
4
4
 
5
- const ajv = new Ajv2020.default({
5
+ const ajv = new Ajv.default({
6
6
  strict: true,
7
7
  })
8
8
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "https://www.codifycli.com/resource-schema.json",
4
4
  "title": "Resource Schema",
5
5
  "type": "object",
@@ -1,8 +1,8 @@
1
1
  import schema from './resource-schema.json';
2
2
  import { describe, it, expect } from 'vitest'
3
- import Ajv2020 from 'ajv/dist/2020.js'
3
+ import Ajv from 'ajv'
4
4
 
5
- const ajv = new Ajv2020.default({
5
+ const ajv = new Ajv.default({
6
6
  strict: true,
7
7
  })
8
8