@eightstate/escli 0.7.0 → 0.7.1

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/entry.js CHANGED
@@ -7,11 +7,12 @@ import { buildErrorEnvelope, buildUsageError } from './lib/envelope.js';
7
7
  import { GLOBAL_SHORT_FLAGS, globalFlagTakesValue, isGlobalFlagToken } from './lib/globals.js';
8
8
  import { commandRegistry, commandsById } from './lib/registry.js';
9
9
  import { writeStdout } from './io/io.js';
10
+ import packageJson from '../package.json' with { type: 'json' };
10
11
  const moduleDir = dirname(fileURLToPath(import.meta.url));
11
12
  const pjson = {
12
- name: '@eightstate/escli',
13
- version: '0.5.0',
14
- type: 'module',
13
+ name: packageJson.name,
14
+ version: packageJson.version,
15
+ type: packageJson.type,
15
16
  oclif: {
16
17
  bin: 'escli',
17
18
  enableJsonFlag: true,
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  import { EnvelopeSchema } from '@eightstate/contracts/envelope';
3
3
  import { ManifestSchema } from '@eightstate/contracts/manifest';
4
4
  import { commandRegistry } from './registry.js';
5
+ import packageJson from '../../package.json' with { type: 'json' };
5
6
  function jsonSchema(schema) {
6
7
  return z.toJSONSchema(schema);
7
8
  }
@@ -25,7 +26,7 @@ export function buildManifest(compact = false, scope) {
25
26
  }),
26
27
  };
27
28
  }
28
- return ManifestSchema.parse({ version: '0.5.0', commands });
29
+ return ManifestSchema.parse({ version: packageJson.version, commands });
29
30
  }
30
31
  function isInScope(commandId, scope) {
31
32
  if (!scope)
@@ -4679,29 +4679,24 @@
4679
4679
  "thread.js"
4680
4680
  ]
4681
4681
  },
4682
- "notion:ds:create": {
4682
+ "notion:db:create": {
4683
4683
  "aliases": [
4684
- "notion:data-source:create",
4685
- "n:ds:create",
4686
- "n:data-source:create"
4684
+ "notion:database:create",
4685
+ "n:db:create",
4686
+ "n:database:create"
4687
4687
  ],
4688
4688
  "args": {
4689
- "database_id": {
4690
- "description": "Database ID or URL.",
4691
- "name": "database_id",
4692
- "required": true
4693
- },
4694
- "name": {
4695
- "description": "Data source name.",
4696
- "name": "name",
4689
+ "title": {
4690
+ "description": "Database title.",
4691
+ "name": "title",
4697
4692
  "required": true
4698
4693
  }
4699
4694
  },
4700
- "description": "Add another table/data source with its own schema under an existing Notion database, optionally requesting views over it.",
4695
+ "description": "Create a database container under a parent, create its initial data source schema, and optionally request initial views.",
4701
4696
  "examples": [
4702
- "<%= config.bin %> notion ds create 362e7f31-7d53-4f6a-a0f6-7a7a7b68b0dc Accounts --schema accounts.schema.json --view table:\"All accounts\"",
4703
- "<%= config.bin %> notion ds create 362e7f31-7d53-4f6a-a0f6-7a7a7b68b0dc Accounts --schema accounts.schema.json --dry-run",
4704
- "<%= config.bin %> --json notion ds create 362e7f31-7d53-4f6a-a0f6-7a7a7b68b0dc Accounts --schema accounts.schema.json"
4697
+ "<%= config.bin %> notion db create \"Launch CRM\" --parent 24f104cd477e80afbc30000bd28de8f9 --schema crm.schema.json --data-source-name Leads --view table:\"All leads\"",
4698
+ "<%= config.bin %> notion db create \"Launch CRM\" --parent 24f104cd477e80afbc30000bd28de8f9 --schema crm.schema.json --dry-run",
4699
+ "<%= config.bin %> --json notion db create \"Launch CRM\" --parent 24f104cd477e80afbc30000bd28de8f9 --schema crm.schema.json"
4705
4700
  ],
4706
4701
  "flags": {
4707
4702
  "json": {
@@ -4764,6 +4759,14 @@
4764
4759
  "allowNo": false,
4765
4760
  "type": "boolean"
4766
4761
  },
4762
+ "parent": {
4763
+ "description": "Parent page ID, page URL, or wiki database ID.",
4764
+ "name": "parent",
4765
+ "required": true,
4766
+ "hasDynamicHelp": false,
4767
+ "multiple": false,
4768
+ "type": "option"
4769
+ },
4767
4770
  "schema-input": {
4768
4771
  "description": "Schema JSON path, inline JSON, or - for stdin.",
4769
4772
  "name": "schema-input",
@@ -4773,8 +4776,15 @@
4773
4776
  "multiple": false,
4774
4777
  "type": "option"
4775
4778
  },
4779
+ "data-source-name": {
4780
+ "description": "Initial data source name. Defaults to the database title.",
4781
+ "name": "data-source-name",
4782
+ "hasDynamicHelp": false,
4783
+ "multiple": false,
4784
+ "type": "option"
4785
+ },
4776
4786
  "view": {
4777
- "description": "View as <type:name>.",
4787
+ "description": "Initial view as <type:name>.",
4778
4788
  "name": "view",
4779
4789
  "hasDynamicHelp": false,
4780
4790
  "multiple": true,
@@ -4802,12 +4812,12 @@
4802
4812
  },
4803
4813
  "hasDynamicHelp": false,
4804
4814
  "hiddenAliases": [],
4805
- "id": "notion:ds:create",
4815
+ "id": "notion:db:create",
4806
4816
  "pluginAlias": "@eightstate/escli",
4807
4817
  "pluginName": "@eightstate/escli",
4808
4818
  "pluginType": "core",
4809
4819
  "strict": true,
4810
- "summary": "Create a Notion data source under a database",
4820
+ "summary": "Create a Notion database and initial data source",
4811
4821
  "enableJsonFlag": true,
4812
4822
  "emitsJsonEnvelope": false,
4813
4823
  "errors": [
@@ -4838,28 +4848,27 @@
4838
4848
  "dist",
4839
4849
  "commands",
4840
4850
  "notion",
4841
- "ds",
4851
+ "db",
4842
4852
  "create.js"
4843
4853
  ]
4844
4854
  },
4845
- "notion:db:create": {
4855
+ "notion:db:query": {
4846
4856
  "aliases": [
4847
- "notion:database:create",
4848
- "n:db:create",
4849
- "n:database:create"
4857
+ "notion:database:query",
4858
+ "notion:ds:query"
4850
4859
  ],
4851
4860
  "args": {
4852
- "title": {
4853
- "description": "Database title.",
4854
- "name": "title",
4861
+ "target": {
4862
+ "description": "Notion data-source UUID, database UUID, or Notion URL.",
4863
+ "name": "target",
4855
4864
  "required": true
4856
4865
  }
4857
4866
  },
4858
- "description": "Create a database container under a parent, create its initial data source schema, and optionally request initial views.",
4867
+ "description": "Read rows from a Notion data source with pass-through filters, sorts, selected properties, and stateless pagination.",
4859
4868
  "examples": [
4860
- "<%= config.bin %> notion db create \"Launch CRM\" --parent 24f104cd477e80afbc30000bd28de8f9 --schema crm.schema.json --data-source-name Leads --view table:\"All leads\"",
4861
- "<%= config.bin %> notion db create \"Launch CRM\" --parent 24f104cd477e80afbc30000bd28de8f9 --schema crm.schema.json --dry-run",
4862
- "<%= config.bin %> --json notion db create \"Launch CRM\" --parent 24f104cd477e80afbc30000bd28de8f9 --schema crm.schema.json"
4869
+ "<%= config.bin %> notion db query ds_362ef7b0c9a44f0aa0b3d174fd12004a --select Name,Status,Due",
4870
+ "<%= config.bin %> notion db query ds_362ef7b0c9a44f0aa0b3d174fd12004a --filter '{\"property\":\"Status\",\"status\":{\"equals\":\"In Progress\"}}' --sort Due:asc",
4871
+ "<%= config.bin %> notion db query ds_362ef7b0c9a44f0aa0b3d174fd12004a --next eyJzZXNzaW9uIjoiNGNmNyJ9"
4863
4872
  ],
4864
4873
  "flags": {
4865
4874
  "json": {
@@ -4922,89 +4931,114 @@
4922
4931
  "allowNo": false,
4923
4932
  "type": "boolean"
4924
4933
  },
4925
- "parent": {
4926
- "description": "Parent page ID, page URL, or wiki database ID.",
4927
- "name": "parent",
4928
- "required": true,
4934
+ "filter": {
4935
+ "description": "Notion filter object as JSON or @file.",
4936
+ "name": "filter",
4929
4937
  "hasDynamicHelp": false,
4930
4938
  "multiple": false,
4931
4939
  "type": "option"
4932
4940
  },
4933
- "schema-input": {
4934
- "description": "Schema JSON path, inline JSON, or - for stdin.",
4935
- "name": "schema-input",
4936
- "required": true,
4941
+ "sort": {
4942
+ "description": "Repeatable sort shorthand: prop:asc or prop:desc.",
4943
+ "exclusive": [
4944
+ "sort-json"
4945
+ ],
4946
+ "name": "sort",
4947
+ "hasDynamicHelp": false,
4948
+ "multiple": true,
4949
+ "type": "option"
4950
+ },
4951
+ "sort-json": {
4952
+ "description": "Exact Notion sorts array as JSON or @file.",
4953
+ "exclusive": [
4954
+ "sort"
4955
+ ],
4956
+ "name": "sort-json",
4937
4957
  "hasDynamicHelp": false,
4938
- "helpValue": "schema",
4939
4958
  "multiple": false,
4940
4959
  "type": "option"
4941
4960
  },
4942
- "data-source-name": {
4943
- "description": "Initial data source name. Defaults to the database title.",
4944
- "name": "data-source-name",
4961
+ "source": {
4962
+ "description": "Select a data source when the target is a multi-source database.",
4963
+ "name": "source",
4945
4964
  "hasDynamicHelp": false,
4946
4965
  "multiple": false,
4947
4966
  "type": "option"
4948
4967
  },
4949
- "view": {
4950
- "description": "Initial view as <type:name>.",
4951
- "name": "view",
4968
+ "result-type": {
4969
+ "description": "Wiki-only result-type filter.",
4970
+ "name": "result-type",
4971
+ "default": "page",
4952
4972
  "hasDynamicHelp": false,
4953
- "multiple": true,
4973
+ "multiple": false,
4974
+ "options": [
4975
+ "page",
4976
+ "data_source",
4977
+ "any"
4978
+ ],
4954
4979
  "type": "option"
4955
4980
  },
4956
- "view-file": {
4957
- "description": "JSON file containing richer view specs.",
4958
- "name": "view-file",
4981
+ "select": {
4982
+ "description": "Comma-separated properties to display.",
4983
+ "name": "select",
4984
+ "hasDynamicHelp": false,
4985
+ "multiple": false,
4986
+ "type": "option"
4987
+ },
4988
+ "page-size": {
4989
+ "description": "Rows to request, 1-100.",
4990
+ "name": "page-size",
4991
+ "hasDynamicHelp": false,
4992
+ "multiple": false,
4993
+ "type": "option"
4994
+ },
4995
+ "title-prop": {
4996
+ "description": "Override title property detection.",
4997
+ "name": "title-prop",
4998
+ "hasDynamicHelp": false,
4999
+ "multiple": false,
5000
+ "type": "option"
5001
+ },
5002
+ "next": {
5003
+ "description": "Continue from Notion pagination token.",
5004
+ "name": "next",
4959
5005
  "hasDynamicHelp": false,
4960
5006
  "multiple": false,
4961
5007
  "type": "option"
4962
5008
  },
4963
5009
  "raw": {
4964
- "description": "Emit verbatim Notion response body.",
5010
+ "description": "Return verbatim Notion response body.",
4965
5011
  "name": "raw",
4966
5012
  "allowNo": false,
4967
5013
  "type": "boolean"
4968
- },
4969
- "dry-run": {
4970
- "description": "Validate inputs and print the create payload without writing to Notion.",
4971
- "name": "dry-run",
4972
- "allowNo": false,
4973
- "type": "boolean"
4974
5014
  }
4975
5015
  },
4976
5016
  "hasDynamicHelp": false,
4977
5017
  "hiddenAliases": [],
4978
- "id": "notion:db:create",
5018
+ "id": "notion:db:query",
4979
5019
  "pluginAlias": "@eightstate/escli",
4980
5020
  "pluginName": "@eightstate/escli",
4981
5021
  "pluginType": "core",
4982
5022
  "strict": true,
4983
- "summary": "Create a Notion database and initial data source",
5023
+ "summary": "Query a Notion data source",
4984
5024
  "enableJsonFlag": true,
4985
5025
  "emitsJsonEnvelope": false,
4986
5026
  "errors": [
4987
5027
  "usage.required",
4988
5028
  "usage.invalid",
4989
- "validation.failed",
5029
+ "usage.unknown_flag",
4990
5030
  "json.invalid",
4991
- "file.not_found",
4992
- "file.read_failed",
4993
5031
  "auth.required",
5032
+ "notion.enrollment_required",
4994
5033
  "notion.unauthorized",
4995
5034
  "notion.restricted",
4996
5035
  "notion.not_found",
4997
- "notion.rate_limited",
4998
5036
  "notion.validation",
4999
- "notion.conflict",
5000
- "notion.timeout_uncertain",
5001
- "notion.enrollment_required",
5002
- "notion.batch_partial",
5037
+ "notion.rate_limited",
5003
5038
  "gate.invalid_response",
5004
5039
  "network.error",
5005
5040
  "network.timeout",
5006
- "service.unavailable",
5007
- "api.error"
5041
+ "service.unavailable"
5008
5042
  ],
5009
5043
  "isESM": true,
5010
5044
  "relativePath": [
@@ -5012,26 +5046,32 @@
5012
5046
  "commands",
5013
5047
  "notion",
5014
5048
  "db",
5015
- "create.js"
5049
+ "query.js"
5016
5050
  ]
5017
5051
  },
5018
- "notion:db:query": {
5052
+ "notion:ds:create": {
5019
5053
  "aliases": [
5020
- "notion:database:query",
5021
- "notion:ds:query"
5054
+ "notion:data-source:create",
5055
+ "n:ds:create",
5056
+ "n:data-source:create"
5022
5057
  ],
5023
5058
  "args": {
5024
- "target": {
5025
- "description": "Notion data-source UUID, database UUID, or Notion URL.",
5026
- "name": "target",
5059
+ "database_id": {
5060
+ "description": "Database ID or URL.",
5061
+ "name": "database_id",
5062
+ "required": true
5063
+ },
5064
+ "name": {
5065
+ "description": "Data source name.",
5066
+ "name": "name",
5027
5067
  "required": true
5028
5068
  }
5029
5069
  },
5030
- "description": "Read rows from a Notion data source with pass-through filters, sorts, selected properties, and stateless pagination.",
5070
+ "description": "Add another table/data source with its own schema under an existing Notion database, optionally requesting views over it.",
5031
5071
  "examples": [
5032
- "<%= config.bin %> notion db query ds_362ef7b0c9a44f0aa0b3d174fd12004a --select Name,Status,Due",
5033
- "<%= config.bin %> notion db query ds_362ef7b0c9a44f0aa0b3d174fd12004a --filter '{\"property\":\"Status\",\"status\":{\"equals\":\"In Progress\"}}' --sort Due:asc",
5034
- "<%= config.bin %> notion db query ds_362ef7b0c9a44f0aa0b3d174fd12004a --next eyJzZXNzaW9uIjoiNGNmNyJ9"
5072
+ "<%= config.bin %> notion ds create 362e7f31-7d53-4f6a-a0f6-7a7a7b68b0dc Accounts --schema accounts.schema.json --view table:\"All accounts\"",
5073
+ "<%= config.bin %> notion ds create 362e7f31-7d53-4f6a-a0f6-7a7a7b68b0dc Accounts --schema accounts.schema.json --dry-run",
5074
+ "<%= config.bin %> --json notion ds create 362e7f31-7d53-4f6a-a0f6-7a7a7b68b0dc Accounts --schema accounts.schema.json"
5035
5075
  ],
5036
5076
  "flags": {
5037
5077
  "json": {
@@ -5094,122 +5134,82 @@
5094
5134
  "allowNo": false,
5095
5135
  "type": "boolean"
5096
5136
  },
5097
- "filter": {
5098
- "description": "Notion filter object as JSON or @file.",
5099
- "name": "filter",
5137
+ "schema-input": {
5138
+ "description": "Schema JSON path, inline JSON, or - for stdin.",
5139
+ "name": "schema-input",
5140
+ "required": true,
5100
5141
  "hasDynamicHelp": false,
5142
+ "helpValue": "schema",
5101
5143
  "multiple": false,
5102
5144
  "type": "option"
5103
5145
  },
5104
- "sort": {
5105
- "description": "Repeatable sort shorthand: prop:asc or prop:desc.",
5106
- "exclusive": [
5107
- "sort-json"
5108
- ],
5109
- "name": "sort",
5146
+ "view": {
5147
+ "description": "View as <type:name>.",
5148
+ "name": "view",
5110
5149
  "hasDynamicHelp": false,
5111
5150
  "multiple": true,
5112
5151
  "type": "option"
5113
5152
  },
5114
- "sort-json": {
5115
- "description": "Exact Notion sorts array as JSON or @file.",
5116
- "exclusive": [
5117
- "sort"
5118
- ],
5119
- "name": "sort-json",
5120
- "hasDynamicHelp": false,
5121
- "multiple": false,
5122
- "type": "option"
5123
- },
5124
- "source": {
5125
- "description": "Select a data source when the target is a multi-source database.",
5126
- "name": "source",
5127
- "hasDynamicHelp": false,
5128
- "multiple": false,
5129
- "type": "option"
5130
- },
5131
- "result-type": {
5132
- "description": "Wiki-only result-type filter.",
5133
- "name": "result-type",
5134
- "default": "page",
5135
- "hasDynamicHelp": false,
5136
- "multiple": false,
5137
- "options": [
5138
- "page",
5139
- "data_source",
5140
- "any"
5141
- ],
5142
- "type": "option"
5143
- },
5144
- "select": {
5145
- "description": "Comma-separated properties to display.",
5146
- "name": "select",
5147
- "hasDynamicHelp": false,
5148
- "multiple": false,
5149
- "type": "option"
5150
- },
5151
- "page-size": {
5152
- "description": "Rows to request, 1-100.",
5153
- "name": "page-size",
5154
- "hasDynamicHelp": false,
5155
- "multiple": false,
5156
- "type": "option"
5157
- },
5158
- "title-prop": {
5159
- "description": "Override title property detection.",
5160
- "name": "title-prop",
5161
- "hasDynamicHelp": false,
5162
- "multiple": false,
5163
- "type": "option"
5164
- },
5165
- "next": {
5166
- "description": "Continue from Notion pagination token.",
5167
- "name": "next",
5153
+ "view-file": {
5154
+ "description": "JSON file containing richer view specs.",
5155
+ "name": "view-file",
5168
5156
  "hasDynamicHelp": false,
5169
5157
  "multiple": false,
5170
5158
  "type": "option"
5171
5159
  },
5172
5160
  "raw": {
5173
- "description": "Return verbatim Notion response body.",
5161
+ "description": "Emit verbatim Notion response body.",
5174
5162
  "name": "raw",
5175
5163
  "allowNo": false,
5176
5164
  "type": "boolean"
5165
+ },
5166
+ "dry-run": {
5167
+ "description": "Validate inputs and print the create payload without writing to Notion.",
5168
+ "name": "dry-run",
5169
+ "allowNo": false,
5170
+ "type": "boolean"
5177
5171
  }
5178
5172
  },
5179
5173
  "hasDynamicHelp": false,
5180
5174
  "hiddenAliases": [],
5181
- "id": "notion:db:query",
5175
+ "id": "notion:ds:create",
5182
5176
  "pluginAlias": "@eightstate/escli",
5183
5177
  "pluginName": "@eightstate/escli",
5184
5178
  "pluginType": "core",
5185
5179
  "strict": true,
5186
- "summary": "Query a Notion data source",
5180
+ "summary": "Create a Notion data source under a database",
5187
5181
  "enableJsonFlag": true,
5188
5182
  "emitsJsonEnvelope": false,
5189
5183
  "errors": [
5190
5184
  "usage.required",
5191
5185
  "usage.invalid",
5192
- "usage.unknown_flag",
5186
+ "validation.failed",
5193
5187
  "json.invalid",
5188
+ "file.not_found",
5189
+ "file.read_failed",
5194
5190
  "auth.required",
5195
- "notion.enrollment_required",
5196
5191
  "notion.unauthorized",
5197
5192
  "notion.restricted",
5198
5193
  "notion.not_found",
5199
- "notion.validation",
5200
5194
  "notion.rate_limited",
5195
+ "notion.validation",
5196
+ "notion.conflict",
5197
+ "notion.timeout_uncertain",
5198
+ "notion.enrollment_required",
5199
+ "notion.batch_partial",
5201
5200
  "gate.invalid_response",
5202
5201
  "network.error",
5203
5202
  "network.timeout",
5204
- "service.unavailable"
5203
+ "service.unavailable",
5204
+ "api.error"
5205
5205
  ],
5206
5206
  "isESM": true,
5207
5207
  "relativePath": [
5208
5208
  "dist",
5209
5209
  "commands",
5210
5210
  "notion",
5211
- "db",
5212
- "query.js"
5211
+ "ds",
5212
+ "create.js"
5213
5213
  ]
5214
5214
  },
5215
5215
  "notion:page:edit": {
@@ -7456,5 +7456,5 @@
7456
7456
  ]
7457
7457
  }
7458
7458
  },
7459
- "version": "0.7.0"
7459
+ "version": "0.7.1"
7460
7460
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eightstate/escli",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "repository": {
@@ -24,7 +24,7 @@
24
24
  "@oclif/core": "4.11.3",
25
25
  "chalk": "5.6.2",
26
26
  "zod": "4.4.3",
27
- "@eightstate/contracts": "0.7.0"
27
+ "@eightstate/contracts": "0.7.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@eslint/js": "9.39.1",