Skip to content

Commit 5064daf

Browse files
authored
Merge pull request #26 from gadget-inc/add_collections_overrides
Add schema overrides for collections
2 parents 41a51ca + baabc41 commit 5064daf

File tree

9 files changed

+153
-1
lines changed

9 files changed

+153
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"id": 123,
3+
"handle": "example string",
4+
"title": "example string",
5+
"updated_at": "2019-01-01 00:00:00.000Z",
6+
"body_html": "example string",
7+
"published_at": "2019-01-01 00:00:00.000Z",
8+
"sort_order": "example string",
9+
"template_suffix": "example string",
10+
"disjunctive": true,
11+
"rules": [
12+
{
13+
"column": "example string",
14+
"relation": "example string",
15+
"condition": "example string"
16+
}
17+
],
18+
"published_scope": "example string",
19+
"admin_graphql_api_id": "https://www.example.com/"
20+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "shopify-webhook-schemas",
3-
"version": "0.2.9",
3+
"version": "0.3.0",
44
"description": "",
55
"main": "dist/src/index.js",
66
"type": "commonjs",

schemas/2025-04/collections/create.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"body_html": {
99
"type": "string"
1010
},
11+
"disjunctive": {
12+
"type": "boolean"
13+
},
1114
"handle": {
1215
"type": "string"
1316
},
@@ -41,6 +44,23 @@
4144
"published_scope": {
4245
"type": "string"
4346
},
47+
"rules": {
48+
"items": {
49+
"properties": {
50+
"column": {
51+
"type": "string"
52+
},
53+
"condition": {
54+
"type": "string"
55+
},
56+
"relation": {
57+
"type": "string"
58+
}
59+
},
60+
"type": "object"
61+
},
62+
"type": "array"
63+
},
4464
"sort_order": {
4565
"type": [
4666
"null",

schemas/2025-04/collections/update.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"body_html": {
99
"type": "string"
1010
},
11+
"disjunctive": {
12+
"type": "boolean"
13+
},
1114
"handle": {
1215
"type": "string"
1316
},
@@ -41,6 +44,23 @@
4144
"published_scope": {
4245
"type": "string"
4346
},
47+
"rules": {
48+
"items": {
49+
"properties": {
50+
"column": {
51+
"type": "string"
52+
},
53+
"condition": {
54+
"type": "string"
55+
},
56+
"relation": {
57+
"type": "string"
58+
}
59+
},
60+
"type": "object"
61+
},
62+
"type": "array"
63+
},
4464
"sort_order": {
4565
"type": [
4666
"null",

schemas/2025-07/collections/create.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"body_html": {
99
"type": "string"
1010
},
11+
"disjunctive": {
12+
"type": "boolean"
13+
},
1114
"handle": {
1215
"type": "string"
1316
},
@@ -41,6 +44,23 @@
4144
"published_scope": {
4245
"type": "string"
4346
},
47+
"rules": {
48+
"items": {
49+
"properties": {
50+
"column": {
51+
"type": "string"
52+
},
53+
"condition": {
54+
"type": "string"
55+
},
56+
"relation": {
57+
"type": "string"
58+
}
59+
},
60+
"type": "object"
61+
},
62+
"type": "array"
63+
},
4464
"sort_order": {
4565
"type": [
4666
"null",

schemas/2025-07/collections/update.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"body_html": {
99
"type": "string"
1010
},
11+
"disjunctive": {
12+
"type": "boolean"
13+
},
1114
"handle": {
1215
"type": "string"
1316
},
@@ -41,6 +44,23 @@
4144
"published_scope": {
4245
"type": "string"
4346
},
47+
"rules": {
48+
"items": {
49+
"properties": {
50+
"column": {
51+
"type": "string"
52+
},
53+
"condition": {
54+
"type": "string"
55+
},
56+
"relation": {
57+
"type": "string"
58+
}
59+
},
60+
"type": "object"
61+
},
62+
"type": "array"
63+
},
4464
"sort_order": {
4565
"type": [
4666
"null",

schemas/2025-10/collections/create.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"body_html": {
99
"type": "string"
1010
},
11+
"disjunctive": {
12+
"type": "boolean"
13+
},
1114
"handle": {
1215
"type": "string"
1316
},
@@ -41,6 +44,23 @@
4144
"published_scope": {
4245
"type": "string"
4346
},
47+
"rules": {
48+
"items": {
49+
"properties": {
50+
"column": {
51+
"type": "string"
52+
},
53+
"condition": {
54+
"type": "string"
55+
},
56+
"relation": {
57+
"type": "string"
58+
}
59+
},
60+
"type": "object"
61+
},
62+
"type": "array"
63+
},
4464
"sort_order": {
4565
"type": [
4666
"null",

schemas/2025-10/collections/update.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"body_html": {
99
"type": "string"
1010
},
11+
"disjunctive": {
12+
"type": "boolean"
13+
},
1114
"handle": {
1215
"type": "string"
1316
},
@@ -41,6 +44,23 @@
4144
"published_scope": {
4245
"type": "string"
4346
},
47+
"rules": {
48+
"items": {
49+
"properties": {
50+
"column": {
51+
"type": "string"
52+
},
53+
"condition": {
54+
"type": "string"
55+
},
56+
"relation": {
57+
"type": "string"
58+
}
59+
},
60+
"type": "object"
61+
},
62+
"type": "array"
63+
},
4464
"sort_order": {
4565
"type": [
4666
"null",

src/infer-schema.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,18 @@ export const overrides: { topics: string[]; schema: any; required?: string[]; ve
690690
width: { type: "number" },
691691
},
692692
},
693+
rules: {
694+
type: "array",
695+
items: {
696+
type: "object",
697+
properties: {
698+
column: { type: "string" },
699+
relation: { type: "string" },
700+
condition: { type: "string" },
701+
},
702+
},
703+
},
704+
disjunctive: { type: "boolean" },
693705
},
694706
},
695707
{

0 commit comments

Comments
 (0)