unitysvc-services 0.1.1__tar.gz → 0.1.4__tar.gz
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.
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/PKG-INFO +41 -39
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/README.md +39 -37
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/docs/api-reference.md +75 -54
- unitysvc_services-0.1.4/docs/cli-reference.md +658 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/docs/data-structure.md +10 -2
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/docs/file-schemas.md +11 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/docs/getting-started.md +43 -25
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/docs/workflows.md +121 -102
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/pyproject.toml +2 -2
- unitysvc_services-0.1.4/src/unitysvc_services/api.py +278 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/format_data.py +2 -7
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/list.py +14 -43
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/models/base.py +157 -102
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/models/listing_v1.py +25 -9
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/models/provider_v1.py +19 -8
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/models/seller_v1.py +10 -8
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/models/service_v1.py +8 -1
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/populate.py +2 -6
- unitysvc_services-0.1.4/src/unitysvc_services/publisher.py +1190 -0
- unitysvc_services-0.1.4/src/unitysvc_services/query.py +674 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/update.py +4 -13
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/utils.py +2 -6
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/validator.py +98 -79
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services.egg-info/PKG-INFO +41 -39
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services.egg-info/SOURCES.txt +2 -0
- unitysvc_services-0.1.4/tests/example_data/provider2/README.md +0 -0
- unitysvc_services-0.1.1/docs/cli-reference.md +0 -528
- unitysvc_services-0.1.1/src/unitysvc_services/publisher.py +0 -885
- unitysvc_services-0.1.1/src/unitysvc_services/query.py +0 -489
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/CONTRIBUTING.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/HISTORY.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/LICENSE +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/MANIFEST.in +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/docs/contributing.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/docs/development.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/docs/index.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/docs/installation.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/docs/usage.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/setup.cfg +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/__init__.py +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/cli.py +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/models/__init__.py +0 -0
- /unitysvc_services-0.1.1/tests/example_data/provider1/README.md → /unitysvc_services-0.1.4/src/unitysvc_services/py.typed +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services/scaffold.py +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services.egg-info/dependency_links.txt +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services.egg-info/entry_points.txt +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services.egg-info/requires.txt +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/src/unitysvc_services.egg-info/top_level.txt +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/__init__.py +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/README.md +0 -0
- {unitysvc_services-0.1.1/tests/example_data/provider2 → unitysvc_services-0.1.4/tests/example_data/provider1}/README.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/provider1/provider.toml +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/provider1/services/service1/code-example.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/provider1/services/service1/service.toml +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/provider1/services/service1/svcreseller.toml +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/provider1/terms-of-service.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/provider2/provider.json +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/provider2/services/service2/code-example.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/provider2/services/service2/service.json +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/provider2/services/service2/svcreseller.json +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/provider2/terms-of-service.md +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/example_data/seller.json +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/test_utils.py +0 -0
- {unitysvc_services-0.1.1 → unitysvc_services-0.1.4}/tests/test_validator.py +0 -0
@@ -1,10 +1,10 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: unitysvc-services
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.4
|
4
4
|
Summary: SDK for digital service providers on UnitySVC
|
5
5
|
Author-email: Bo Peng <bo.peng@unitysvc.com>
|
6
6
|
Maintainer-email: Bo Peng <bo.peng@unitysvc.com>
|
7
|
-
License: MIT
|
7
|
+
License-Expression: MIT
|
8
8
|
Project-URL: bugs, https://github.com/unitysvc/unitysvc-services/issues
|
9
9
|
Project-URL: changelog, https://github.com/unitysvc/unitysvc-services/blob/master/changelog.md
|
10
10
|
Project-URL: homepage, https://github.com/unitysvc/unitysvc-services
|
@@ -53,11 +53,11 @@ Client library and CLI tools for digital service providers to interact with the
|
|
53
53
|
|
54
54
|
UnitySVC Provider SDK enables digital service providers to manage their service offerings through a **local-first, version-controlled workflow**:
|
55
55
|
|
56
|
-
-
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
56
|
+
- **Define** service data using schema-validated files (JSON/TOML)
|
57
|
+
- **Manage** everything locally in git-controlled directories
|
58
|
+
- **Validate** data against schemas before publishing
|
59
|
+
- **Publish** to UnitySVC platform when ready
|
60
|
+
- **Automate** with populate scripts for dynamic catalogs
|
61
61
|
|
62
62
|
## Installation
|
63
63
|
|
@@ -79,27 +79,29 @@ unitysvc_services init seller my-marketplace
|
|
79
79
|
unitysvc_services validate
|
80
80
|
unitysvc_services format
|
81
81
|
|
82
|
-
# Publish to platform
|
83
|
-
export
|
82
|
+
# Publish to platform (publishes all: sellers, providers, offerings, listings)
|
83
|
+
export UNITYSVC_BASE_URL="https://api.unitysvc.com/api/v1"
|
84
84
|
export UNITYSVC_API_KEY="your-api-key"
|
85
|
+
unitysvc_services publish
|
85
86
|
|
87
|
+
# Or publish specific types only
|
86
88
|
unitysvc_services publish providers
|
87
|
-
unitysvc_services publish sellers
|
88
|
-
unitysvc_services publish offerings
|
89
|
-
unitysvc_services publish listings
|
90
89
|
|
91
|
-
# Verify
|
90
|
+
# Verify with default fields
|
92
91
|
unitysvc_services query offerings
|
92
|
+
|
93
|
+
# Query with custom fields
|
94
|
+
unitysvc_services query providers --fields id,name,contact_email
|
93
95
|
```
|
94
96
|
|
95
97
|
## Key Features
|
96
98
|
|
97
|
-
-
|
98
|
-
-
|
99
|
-
-
|
100
|
-
-
|
101
|
-
-
|
102
|
-
-
|
99
|
+
- 📋 **Pydantic Models** - Type-safe data models for all entities
|
100
|
+
- ✅ **Data Validation** - Comprehensive schema validation
|
101
|
+
- 🔄 **Local-First** - Work offline, commit to git, publish when ready
|
102
|
+
- 🚀 **CLI Tools** - Complete command-line interface
|
103
|
+
- 🤖 **Automation** - Script-based service generation
|
104
|
+
- 📝 **Multiple Formats** - Support for JSON and TOML
|
103
105
|
|
104
106
|
## Workflows
|
105
107
|
|
@@ -135,34 +137,34 @@ See [Data Structure Documentation](https://unitysvc-services.readthedocs.io/en/l
|
|
135
137
|
|
136
138
|
## CLI Commands
|
137
139
|
|
138
|
-
| Command
|
139
|
-
|
140
|
-
| `init`
|
141
|
-
| `list`
|
142
|
-
| `query`
|
143
|
-
| `publish`
|
144
|
-
| `update`
|
145
|
-
| `validate` | Validate data consistency
|
146
|
-
| `format`
|
147
|
-
| `populate` | Execute provider populate scripts
|
140
|
+
| Command | Description |
|
141
|
+
| ---------- | -------------------------------------- |
|
142
|
+
| `init` | Initialize new data files from schemas |
|
143
|
+
| `list` | List local data files |
|
144
|
+
| `query` | Query backend API for published data |
|
145
|
+
| `publish` | Publish data to backend |
|
146
|
+
| `update` | Update local file fields |
|
147
|
+
| `validate` | Validate data consistency |
|
148
|
+
| `format` | Format data files |
|
149
|
+
| `populate` | Execute provider populate scripts |
|
148
150
|
|
149
151
|
Run `unitysvc_services --help` or see [CLI Reference](https://unitysvc-services.readthedocs.io/en/latest/cli-reference/) for complete documentation.
|
150
152
|
|
151
153
|
## Documentation
|
152
154
|
|
153
|
-
-
|
154
|
-
-
|
155
|
-
-
|
156
|
-
-
|
157
|
-
-
|
158
|
-
-
|
155
|
+
- **[Getting Started](https://unitysvc-services.readthedocs.io/en/latest/getting-started/)** - Installation and first steps
|
156
|
+
- **[Data Structure](https://unitysvc-services.readthedocs.io/en/latest/data-structure/)** - File organization rules
|
157
|
+
- **[Workflows](https://unitysvc-services.readthedocs.io/en/latest/workflows/)** - Manual and automated patterns
|
158
|
+
- **[CLI Reference](https://unitysvc-services.readthedocs.io/en/latest/cli-reference/)** - All commands and options
|
159
|
+
- **[File Schemas](https://unitysvc-services.readthedocs.io/en/latest/file-schemas/)** - Schema specifications
|
160
|
+
- **[Python API](https://unitysvc-services.readthedocs.io/en/latest/api-reference/)** - Programmatic usage
|
159
161
|
|
160
162
|
## Links
|
161
163
|
|
162
|
-
-
|
163
|
-
-
|
164
|
-
-
|
165
|
-
-
|
164
|
+
- **PyPI**: https://pypi.org/project/unitysvc-services/
|
165
|
+
- **Documentation**: https://unitysvc-services.readthedocs.io
|
166
|
+
- **Source Code**: https://github.com/unitysvc/unitysvc-services
|
167
|
+
- **Issue Tracker**: https://github.com/unitysvc/unitysvc-services/issues
|
166
168
|
|
167
169
|
## License
|
168
170
|
|
@@ -11,11 +11,11 @@ Client library and CLI tools for digital service providers to interact with the
|
|
11
11
|
|
12
12
|
UnitySVC Provider SDK enables digital service providers to manage their service offerings through a **local-first, version-controlled workflow**:
|
13
13
|
|
14
|
-
-
|
15
|
-
-
|
16
|
-
-
|
17
|
-
-
|
18
|
-
-
|
14
|
+
- **Define** service data using schema-validated files (JSON/TOML)
|
15
|
+
- **Manage** everything locally in git-controlled directories
|
16
|
+
- **Validate** data against schemas before publishing
|
17
|
+
- **Publish** to UnitySVC platform when ready
|
18
|
+
- **Automate** with populate scripts for dynamic catalogs
|
19
19
|
|
20
20
|
## Installation
|
21
21
|
|
@@ -37,27 +37,29 @@ unitysvc_services init seller my-marketplace
|
|
37
37
|
unitysvc_services validate
|
38
38
|
unitysvc_services format
|
39
39
|
|
40
|
-
# Publish to platform
|
41
|
-
export
|
40
|
+
# Publish to platform (publishes all: sellers, providers, offerings, listings)
|
41
|
+
export UNITYSVC_BASE_URL="https://api.unitysvc.com/api/v1"
|
42
42
|
export UNITYSVC_API_KEY="your-api-key"
|
43
|
+
unitysvc_services publish
|
43
44
|
|
45
|
+
# Or publish specific types only
|
44
46
|
unitysvc_services publish providers
|
45
|
-
unitysvc_services publish sellers
|
46
|
-
unitysvc_services publish offerings
|
47
|
-
unitysvc_services publish listings
|
48
47
|
|
49
|
-
# Verify
|
48
|
+
# Verify with default fields
|
50
49
|
unitysvc_services query offerings
|
50
|
+
|
51
|
+
# Query with custom fields
|
52
|
+
unitysvc_services query providers --fields id,name,contact_email
|
51
53
|
```
|
52
54
|
|
53
55
|
## Key Features
|
54
56
|
|
55
|
-
-
|
56
|
-
-
|
57
|
-
-
|
58
|
-
-
|
59
|
-
-
|
60
|
-
-
|
57
|
+
- 📋 **Pydantic Models** - Type-safe data models for all entities
|
58
|
+
- ✅ **Data Validation** - Comprehensive schema validation
|
59
|
+
- 🔄 **Local-First** - Work offline, commit to git, publish when ready
|
60
|
+
- 🚀 **CLI Tools** - Complete command-line interface
|
61
|
+
- 🤖 **Automation** - Script-based service generation
|
62
|
+
- 📝 **Multiple Formats** - Support for JSON and TOML
|
61
63
|
|
62
64
|
## Workflows
|
63
65
|
|
@@ -93,34 +95,34 @@ See [Data Structure Documentation](https://unitysvc-services.readthedocs.io/en/l
|
|
93
95
|
|
94
96
|
## CLI Commands
|
95
97
|
|
96
|
-
| Command
|
97
|
-
|
98
|
-
| `init`
|
99
|
-
| `list`
|
100
|
-
| `query`
|
101
|
-
| `publish`
|
102
|
-
| `update`
|
103
|
-
| `validate` | Validate data consistency
|
104
|
-
| `format`
|
105
|
-
| `populate` | Execute provider populate scripts
|
98
|
+
| Command | Description |
|
99
|
+
| ---------- | -------------------------------------- |
|
100
|
+
| `init` | Initialize new data files from schemas |
|
101
|
+
| `list` | List local data files |
|
102
|
+
| `query` | Query backend API for published data |
|
103
|
+
| `publish` | Publish data to backend |
|
104
|
+
| `update` | Update local file fields |
|
105
|
+
| `validate` | Validate data consistency |
|
106
|
+
| `format` | Format data files |
|
107
|
+
| `populate` | Execute provider populate scripts |
|
106
108
|
|
107
109
|
Run `unitysvc_services --help` or see [CLI Reference](https://unitysvc-services.readthedocs.io/en/latest/cli-reference/) for complete documentation.
|
108
110
|
|
109
111
|
## Documentation
|
110
112
|
|
111
|
-
-
|
112
|
-
-
|
113
|
-
-
|
114
|
-
-
|
115
|
-
-
|
116
|
-
-
|
113
|
+
- **[Getting Started](https://unitysvc-services.readthedocs.io/en/latest/getting-started/)** - Installation and first steps
|
114
|
+
- **[Data Structure](https://unitysvc-services.readthedocs.io/en/latest/data-structure/)** - File organization rules
|
115
|
+
- **[Workflows](https://unitysvc-services.readthedocs.io/en/latest/workflows/)** - Manual and automated patterns
|
116
|
+
- **[CLI Reference](https://unitysvc-services.readthedocs.io/en/latest/cli-reference/)** - All commands and options
|
117
|
+
- **[File Schemas](https://unitysvc-services.readthedocs.io/en/latest/file-schemas/)** - Schema specifications
|
118
|
+
- **[Python API](https://unitysvc-services.readthedocs.io/en/latest/api-reference/)** - Programmatic usage
|
117
119
|
|
118
120
|
## Links
|
119
121
|
|
120
|
-
-
|
121
|
-
-
|
122
|
-
-
|
123
|
-
-
|
122
|
+
- **PyPI**: https://pypi.org/project/unitysvc-services/
|
123
|
+
- **Documentation**: https://unitysvc-services.readthedocs.io
|
124
|
+
- **Source Code**: https://github.com/unitysvc/unitysvc-services
|
125
|
+
- **Issue Tracker**: https://github.com/unitysvc/unitysvc-services/issues
|
124
126
|
|
125
127
|
## License
|
126
128
|
|
@@ -26,14 +26,17 @@ data, file_format = load_data_file(Path("data/my-provider/provider.json"))
|
|
26
26
|
```
|
27
27
|
|
28
28
|
**Parameters:**
|
29
|
-
|
29
|
+
|
30
|
+
- `file_path` (Path): Path to the data file
|
30
31
|
|
31
32
|
**Returns:**
|
32
|
-
|
33
|
+
|
34
|
+
- `tuple[dict[str, Any], str]`: Data dictionary and format ("json" or "toml")
|
33
35
|
|
34
36
|
**Raises:**
|
35
|
-
|
36
|
-
-
|
37
|
+
|
38
|
+
- `ValueError`: If file format is not supported
|
39
|
+
- `FileNotFoundError`: If file doesn't exist
|
37
40
|
|
38
41
|
#### write_data_file()
|
39
42
|
|
@@ -48,12 +51,14 @@ write_data_file(Path("data/my-provider/provider.json"), data, "json")
|
|
48
51
|
```
|
49
52
|
|
50
53
|
**Parameters:**
|
51
|
-
|
52
|
-
-
|
53
|
-
-
|
54
|
+
|
55
|
+
- `file_path` (Path): Path to write to
|
56
|
+
- `data` (dict): Data to write
|
57
|
+
- `file_format` (str): Format ("json" or "toml")
|
54
58
|
|
55
59
|
**Returns:**
|
56
|
-
|
60
|
+
|
61
|
+
- `None`
|
57
62
|
|
58
63
|
#### find_data_files()
|
59
64
|
|
@@ -68,10 +73,12 @@ files = find_data_files(Path("data"))
|
|
68
73
|
```
|
69
74
|
|
70
75
|
**Parameters:**
|
71
|
-
|
76
|
+
|
77
|
+
- `data_dir` (Path): Directory to search
|
72
78
|
|
73
79
|
**Returns:**
|
74
|
-
|
80
|
+
|
81
|
+
- `list[Path]`: List of data file paths
|
75
82
|
|
76
83
|
#### find_files_by_schema()
|
77
84
|
|
@@ -90,12 +97,14 @@ service_files = find_files_by_schema(
|
|
90
97
|
```
|
91
98
|
|
92
99
|
**Parameters:**
|
93
|
-
|
94
|
-
-
|
95
|
-
-
|
100
|
+
|
101
|
+
- `data_dir` (Path): Directory to search
|
102
|
+
- `schema` (str): Schema to match (e.g., "service_v1")
|
103
|
+
- `field_filter` (dict, optional): Additional field filters
|
96
104
|
|
97
105
|
**Returns:**
|
98
|
-
|
106
|
+
|
107
|
+
- `list[tuple[Path, dict]]`: List of (file_path, data) tuples
|
99
108
|
|
100
109
|
#### find_file_by_schema_and_name()
|
101
110
|
|
@@ -121,13 +130,15 @@ else:
|
|
121
130
|
```
|
122
131
|
|
123
132
|
**Parameters:**
|
124
|
-
|
125
|
-
-
|
126
|
-
-
|
127
|
-
-
|
133
|
+
|
134
|
+
- `data_dir` (Path): Directory to search
|
135
|
+
- `schema` (str): Schema to match
|
136
|
+
- `name_field` (str): Field name to match (e.g., "name")
|
137
|
+
- `name_value` (str): Field value to match
|
128
138
|
|
129
139
|
**Returns:**
|
130
|
-
|
140
|
+
|
141
|
+
- `tuple[Path, str, dict] | None`: (file_path, format, data) or None if not found
|
131
142
|
|
132
143
|
### unitysvc_services.cli
|
133
144
|
|
@@ -165,11 +176,13 @@ client = get_api_client(
|
|
165
176
|
```
|
166
177
|
|
167
178
|
**Parameters:**
|
168
|
-
|
169
|
-
-
|
179
|
+
|
180
|
+
- `backend_url` (str): Backend API URL
|
181
|
+
- `api_key` (str): API authentication key
|
170
182
|
|
171
183
|
**Returns:**
|
172
|
-
|
184
|
+
|
185
|
+
- `AuthenticatedClient`: Configured API client
|
173
186
|
|
174
187
|
#### publish_provider()
|
175
188
|
|
@@ -186,16 +199,19 @@ success = publish_provider(
|
|
186
199
|
```
|
187
200
|
|
188
201
|
**Parameters:**
|
189
|
-
|
190
|
-
-
|
202
|
+
|
203
|
+
- `client` (AuthenticatedClient): API client
|
204
|
+
- `provider_file` (Path): Path to provider file
|
191
205
|
|
192
206
|
**Returns:**
|
193
|
-
|
207
|
+
|
208
|
+
- `bool`: True if successful
|
194
209
|
|
195
210
|
Similar functions exist for:
|
196
|
-
|
197
|
-
-
|
198
|
-
-
|
211
|
+
|
212
|
+
- `publish_seller()`
|
213
|
+
- `publish_offering()`
|
214
|
+
- `publish_listing()`
|
199
215
|
|
200
216
|
### unitysvc_services.validator
|
201
217
|
|
@@ -217,18 +233,21 @@ if not is_valid:
|
|
217
233
|
```
|
218
234
|
|
219
235
|
**Parameters:**
|
220
|
-
|
236
|
+
|
237
|
+
- `data_dir` (Path): Directory to validate
|
221
238
|
|
222
239
|
**Returns:**
|
223
|
-
|
240
|
+
|
241
|
+
- `tuple[bool, list[str]]`: (is_valid, list of error messages)
|
224
242
|
|
225
243
|
**Validation checks:**
|
226
|
-
|
227
|
-
-
|
228
|
-
-
|
229
|
-
-
|
230
|
-
-
|
231
|
-
-
|
244
|
+
|
245
|
+
- Schema compliance
|
246
|
+
- Required fields present
|
247
|
+
- Name uniqueness
|
248
|
+
- Directory name matching
|
249
|
+
- Valid references
|
250
|
+
- File path validity
|
232
251
|
|
233
252
|
### unitysvc_services.formatter
|
234
253
|
|
@@ -252,17 +271,20 @@ for file_path in modified_files:
|
|
252
271
|
```
|
253
272
|
|
254
273
|
**Parameters:**
|
255
|
-
|
256
|
-
-
|
274
|
+
|
275
|
+
- `data_dir` (Path): Directory to format
|
276
|
+
- `check_only` (bool): If True, don't modify files
|
257
277
|
|
258
278
|
**Returns:**
|
259
|
-
|
279
|
+
|
280
|
+
- `list[Path]`: List of modified (or would-be modified) files
|
260
281
|
|
261
282
|
**Formatting rules:**
|
262
|
-
|
263
|
-
-
|
264
|
-
-
|
265
|
-
-
|
283
|
+
|
284
|
+
- JSON: 2-space indentation, sorted keys
|
285
|
+
- TOML: Standard formatting
|
286
|
+
- Remove trailing whitespace
|
287
|
+
- Single newline at end of file
|
266
288
|
|
267
289
|
### unitysvc_services.populator
|
268
290
|
|
@@ -288,12 +310,14 @@ for provider, success, output in results:
|
|
288
310
|
```
|
289
311
|
|
290
312
|
**Parameters:**
|
291
|
-
|
292
|
-
-
|
293
|
-
-
|
313
|
+
|
314
|
+
- `data_dir` (Path): Data directory
|
315
|
+
- `provider_filter` (str, optional): Run for specific provider only
|
316
|
+
- `dry_run` (bool): If True, don't actually execute
|
294
317
|
|
295
318
|
**Returns:**
|
296
|
-
|
319
|
+
|
320
|
+
- `list[tuple[str, bool, str]]`: List of (provider_name, success, output)
|
297
321
|
|
298
322
|
## Pydantic Models
|
299
323
|
|
@@ -358,11 +382,8 @@ The SDK respects these environment variables:
|
|
358
382
|
```python
|
359
383
|
import os
|
360
384
|
|
361
|
-
# Data directory
|
362
|
-
data_dir = os.getenv("UNITYSVC_DATA_DIR", "./data")
|
363
|
-
|
364
385
|
# Backend connection
|
365
|
-
backend_url = os.getenv("
|
386
|
+
backend_url = os.getenv("UNITYSVC_BASE_URL", "https://api.unitysvc.com/api/v1")
|
366
387
|
api_key = os.getenv("UNITYSVC_API_KEY")
|
367
388
|
```
|
368
389
|
|
@@ -502,6 +523,6 @@ def get_service(name: str, data_dir: Path = Path("data")) -> dict[str, Any] | No
|
|
502
523
|
|
503
524
|
## See Also
|
504
525
|
|
505
|
-
-
|
506
|
-
-
|
507
|
-
-
|
526
|
+
- [CLI Reference](cli-reference.md) - Command-line interface
|
527
|
+
- [File Schemas](file-schemas.md) - Data schema specifications
|
528
|
+
- [Workflows](workflows.md) - Usage patterns and examples
|