unitysvc-services 0.1.10__tar.gz → 0.1.11__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.
Potentially problematic release.
This version of unitysvc-services might be problematic. Click here for more details.
- {unitysvc_services-0.1.10/src/unitysvc_services.egg-info → unitysvc_services-0.1.11}/PKG-INFO +1 -1
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/cli-reference.md +316 -37
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/pyproject.toml +1 -1
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/api.py +2 -2
- unitysvc_services-0.1.11/src/unitysvc_services/interactive_prompt.py +1129 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/populate.py +11 -4
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/publisher.py +225 -97
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/scaffold.py +143 -66
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/test.py +21 -43
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11/src/unitysvc_services.egg-info}/PKG-INFO +1 -1
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services.egg-info/SOURCES.txt +1 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/test_utils.py +7 -4
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/CONTRIBUTING.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/HISTORY.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/LICENSE +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/MANIFEST.in +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/README.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/api-reference.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/code-examples.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/contributing.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/data-structure.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/development.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/documenting-services.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/file-schemas.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/getting-started.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/index.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/installation.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/usage.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/docs/workflows.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/setup.cfg +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/__init__.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/cli.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/format_data.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/list.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/models/__init__.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/models/base.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/models/listing_v1.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/models/provider_v1.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/models/seller_v1.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/models/service_v1.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/py.typed +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/query.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/schema/base.json +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/schema/listing_v1.json +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/schema/provider_v1.json +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/schema/seller_v1.json +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/schema/service_v1.json +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/update.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/utils.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services/validator.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services.egg-info/dependency_links.txt +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services.egg-info/entry_points.txt +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services.egg-info/requires.txt +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/src/unitysvc_services.egg-info/top_level.txt +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/__init__.py +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/README.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider1/README.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider1/provider.toml +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider1/services/service1/code-example.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider1/services/service1/service.toml +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider1/services/service1/svcreseller.toml +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider1/terms-of-service.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider2/README.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider2/provider.json +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider2/services/service2/code-example.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider2/services/service2/service.json +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider2/services/service2/svcreseller.json +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/provider2/terms-of-service.md +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/example_data/seller.json +0 -0
- {unitysvc_services-0.1.10 → unitysvc_services-0.1.11}/tests/test_validator.py +0 -0
|
@@ -34,92 +34,212 @@ usvc [OPTIONS] COMMAND [ARGS]...
|
|
|
34
34
|
|
|
35
35
|
## init - Initialize Data Files
|
|
36
36
|
|
|
37
|
-
Create new data
|
|
37
|
+
Create new data files through **interactive prompts** or by **copying from existing data**.
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
All `init` commands support two modes:
|
|
40
|
+
|
|
41
|
+
1. **Interactive Mode** (default): Prompts you step-by-step for field values with validation and smart defaults
|
|
42
|
+
2. **Copy Mode**: Uses `--source` to copy structure from an existing directory
|
|
43
|
+
|
|
44
|
+
### Key Features
|
|
45
|
+
|
|
46
|
+
**Interactive Mode Features:**
|
|
47
|
+
- ✅ **Auto-discovery**: Automatically detects seller and service names from existing files
|
|
48
|
+
- ✅ **Validation**: Email format, URI validation, integer checks, and more
|
|
49
|
+
- ✅ **Smart defaults**: Computed defaults based on previous inputs or filesystem discovery
|
|
50
|
+
- ✅ **Skip optional fields**: Press Enter to skip any optional field
|
|
51
|
+
- ✅ **Complex objects**: Add documents and pricing information interactively
|
|
52
|
+
- ✅ **File validation**: Checks document file paths exist before saving
|
|
53
|
+
- ✅ **Cancellation**: Press Ctrl+C to cancel at any time
|
|
54
|
+
|
|
55
|
+
### init seller
|
|
40
56
|
|
|
41
|
-
Create a new
|
|
57
|
+
Create a new seller file interactively or copy from existing.
|
|
42
58
|
|
|
43
59
|
```bash
|
|
44
|
-
|
|
60
|
+
usvc init seller <name> [OPTIONS]
|
|
45
61
|
```
|
|
46
62
|
|
|
47
63
|
**Arguments:**
|
|
48
64
|
|
|
49
|
-
- `<name>` -
|
|
65
|
+
- `<name>` - Seller identifier (URL-friendly name)
|
|
50
66
|
|
|
51
67
|
**Options:**
|
|
52
68
|
|
|
53
|
-
- `--format {json|toml}` - Output format (default:
|
|
54
|
-
- `--source PATH` -
|
|
55
|
-
- `--output PATH` - Output directory (default: ./data)
|
|
69
|
+
- `--format {json|toml}` - Output format (default: json)
|
|
70
|
+
- `--source PATH` - Copy from existing seller directory (skips interactive prompts)
|
|
71
|
+
- `--output-dir PATH` - Output directory (default: ./data)
|
|
72
|
+
|
|
73
|
+
**Interactive Mode** prompts for:
|
|
74
|
+
|
|
75
|
+
- **Basic Information**: seller type (individual/organization/partnership/corporation), display name, description
|
|
76
|
+
- **Contact Information**: primary email, secondary email, homepage URL
|
|
77
|
+
- **Additional Details**: business registration, tax ID, account manager
|
|
78
|
+
- **Status & Verification**: status (active/pending/disabled), KYC verification
|
|
56
79
|
|
|
57
80
|
**Examples:**
|
|
58
81
|
|
|
59
82
|
```bash
|
|
60
|
-
#
|
|
61
|
-
usvc init
|
|
83
|
+
# Interactive mode - will prompt for all fields
|
|
84
|
+
usvc init seller acme-corp
|
|
62
85
|
|
|
63
|
-
#
|
|
64
|
-
usvc init
|
|
86
|
+
# Interactive mode with JSON format
|
|
87
|
+
usvc init seller acme-corp --format json
|
|
65
88
|
|
|
66
|
-
# Copy from existing
|
|
67
|
-
usvc init
|
|
89
|
+
# Copy from existing seller
|
|
90
|
+
usvc init seller new-seller --source ./data/acme-corp
|
|
68
91
|
```
|
|
69
92
|
|
|
70
|
-
### init
|
|
93
|
+
### init provider
|
|
71
94
|
|
|
72
|
-
Create a new
|
|
95
|
+
Create a new provider file interactively or copy from existing.
|
|
73
96
|
|
|
74
97
|
```bash
|
|
75
|
-
|
|
98
|
+
usvc init provider <name> [OPTIONS]
|
|
76
99
|
```
|
|
77
100
|
|
|
78
101
|
**Arguments:**
|
|
79
102
|
|
|
80
|
-
- `<name>` -
|
|
103
|
+
- `<name>` - Provider identifier (e.g., 'openai', 'fireworks')
|
|
81
104
|
|
|
82
105
|
**Options:**
|
|
83
106
|
|
|
84
|
-
- `--format {json|toml}` - Output format (default:
|
|
85
|
-
- `--source PATH` -
|
|
86
|
-
- `--output PATH` - Output directory (default: ./data)
|
|
107
|
+
- `--format {json|toml}` - Output format (default: json)
|
|
108
|
+
- `--source PATH` - Copy from existing provider directory
|
|
109
|
+
- `--output-dir PATH` - Output directory (default: ./data)
|
|
87
110
|
|
|
88
|
-
|
|
111
|
+
**Interactive Mode** prompts for:
|
|
112
|
+
|
|
113
|
+
- **Basic Information**: display name, description
|
|
114
|
+
- **Contact & Web**: contact email, secondary email, homepage URL
|
|
115
|
+
- **Provider Access**: API endpoint, API key, access method (http/websocket/grpc)
|
|
116
|
+
- **Status**: provider status
|
|
117
|
+
- **Service Population** (optional): Command to auto-generate service offerings via `usvc populate`
|
|
118
|
+
|
|
119
|
+
**Examples:**
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Interactive mode
|
|
123
|
+
usvc init provider openai
|
|
124
|
+
|
|
125
|
+
# Copy mode
|
|
126
|
+
usvc init provider new-provider --source ./data/openai
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Auto-Population Feature:**
|
|
130
|
+
|
|
131
|
+
If you enable the services populator, you can create a script that automatically generates service offerings:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# During init, answer "yes" to "Enable automated service population?"
|
|
135
|
+
# Provide command: python scripts/populate_openai.py
|
|
136
|
+
|
|
137
|
+
# Later, run populate to generate services
|
|
138
|
+
usvc populate
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### init offering
|
|
89
142
|
|
|
90
|
-
Create a new
|
|
143
|
+
Create a new service offering file interactively or copy from existing.
|
|
91
144
|
|
|
92
145
|
```bash
|
|
93
|
-
|
|
146
|
+
usvc init offering <name> [OPTIONS]
|
|
94
147
|
```
|
|
95
148
|
|
|
96
149
|
**Arguments:**
|
|
97
150
|
|
|
98
|
-
- `<name>` -
|
|
151
|
+
- `<name>` - Service name (e.g., 'gpt-4', 'llama-3-1-405b')
|
|
99
152
|
|
|
100
153
|
**Options:**
|
|
101
154
|
|
|
102
|
-
- `--format {json|toml}` - Output format (default:
|
|
103
|
-
- `--source PATH` -
|
|
104
|
-
- `--output PATH` - Output directory (default: ./data)
|
|
155
|
+
- `--format {json|toml}` - Output format (default: json)
|
|
156
|
+
- `--source PATH` - Copy from existing offering directory
|
|
157
|
+
- `--output-dir PATH` - Output directory (default: ./data)
|
|
105
158
|
|
|
106
|
-
|
|
159
|
+
**Interactive Mode** prompts for:
|
|
160
|
+
|
|
161
|
+
- **Basic Information**: service name, display name, version, description
|
|
162
|
+
- **Classification**: service type (llm/embedding/vision/audio/image/video), upstream status
|
|
163
|
+
- **Upstream Access Interface**: API endpoint, API key, documents (optional)
|
|
164
|
+
- **Upstream Pricing** (optional): pricing unit, tier name, currency, price structure
|
|
165
|
+
- **Additional Information**: tagline
|
|
166
|
+
|
|
167
|
+
**Pricing Structures:**
|
|
168
|
+
|
|
169
|
+
When adding pricing, you can choose from three types:
|
|
170
|
+
|
|
171
|
+
1. **Simple**: `{"amount": 10.00}`
|
|
172
|
+
2. **Input/Output** (for LLMs): `{"input": 5.00, "output": 15.00}`
|
|
173
|
+
3. **Custom JSON**: `{"base": 5.00, "per_unit": 0.001}` or any custom structure
|
|
174
|
+
|
|
175
|
+
**Examples:**
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Interactive mode - will create data/gpt-4/service.json
|
|
179
|
+
usvc init offering gpt-4
|
|
107
180
|
|
|
108
|
-
|
|
181
|
+
# Interactive with TOML format
|
|
182
|
+
usvc init offering gpt-4 --format toml
|
|
183
|
+
|
|
184
|
+
# Copy from existing offering
|
|
185
|
+
usvc init offering gpt-4-turbo --source ./data/gpt-4
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### init listing
|
|
189
|
+
|
|
190
|
+
Create a new service listing file interactively or copy from existing.
|
|
109
191
|
|
|
110
192
|
```bash
|
|
111
|
-
|
|
193
|
+
usvc init listing <name> [OPTIONS]
|
|
112
194
|
```
|
|
113
195
|
|
|
114
196
|
**Arguments:**
|
|
115
197
|
|
|
116
|
-
- `<name>` -
|
|
198
|
+
- `<name>` - Listing identifier
|
|
117
199
|
|
|
118
200
|
**Options:**
|
|
119
201
|
|
|
120
|
-
- `--format {json|toml}` - Output format (default:
|
|
121
|
-
- `--source PATH` -
|
|
122
|
-
- `--output PATH` - Output directory (default: ./data)
|
|
202
|
+
- `--format {json|toml}` - Output format (default: json)
|
|
203
|
+
- `--source PATH` - Copy from existing listing directory
|
|
204
|
+
- `--output-dir PATH` - Output directory (default: ./data)
|
|
205
|
+
|
|
206
|
+
**Interactive Mode** prompts for:
|
|
207
|
+
|
|
208
|
+
- **Basic Information**: service name (auto-detected), listing name, display name
|
|
209
|
+
- **Seller Information**: seller name (auto-detected from seller.json)
|
|
210
|
+
- **Status**: listing status (unknown/upstream_ready/downstream_ready/ready/in_service/deprecated)
|
|
211
|
+
- **Documents** (optional): Add multiple documents interactively
|
|
212
|
+
|
|
213
|
+
**Auto-Discovery:**
|
|
214
|
+
|
|
215
|
+
The listing workflow automatically discovers:
|
|
216
|
+
- **seller_name**: Searches ./data, ./, ../data, ../ for seller.json/seller.toml
|
|
217
|
+
- **service_name**: Searches ./, ../ for service.json/service.toml
|
|
218
|
+
|
|
219
|
+
This means you don't need to manually type names - they're auto-filled!
|
|
220
|
+
|
|
221
|
+
**Document Support:**
|
|
222
|
+
|
|
223
|
+
When adding documents, you can specify:
|
|
224
|
+
- **Required**: title, MIME type, category
|
|
225
|
+
- **Optional**: description, file path (relative to listing dir), external URL, public flag
|
|
226
|
+
- **Validation**: File existence checks, at least one of file_path or external_URL required
|
|
227
|
+
|
|
228
|
+
**Examples:**
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Interactive mode from project root
|
|
232
|
+
usvc init listing premium-gpt4
|
|
233
|
+
# Auto-detects seller from ./data/seller.json
|
|
234
|
+
|
|
235
|
+
# From inside service directory
|
|
236
|
+
cd data/my-provider/gpt-4
|
|
237
|
+
usvc init listing standard
|
|
238
|
+
# Auto-detects service from ./service.json and seller from ../../data/seller.json
|
|
239
|
+
|
|
240
|
+
# Copy mode
|
|
241
|
+
usvc init listing new-listing --source ./data/old-listing
|
|
242
|
+
```
|
|
123
243
|
|
|
124
244
|
## list - List Local Files
|
|
125
245
|
|
|
@@ -297,6 +417,7 @@ unitysvc_services publish COMMAND [OPTIONS]
|
|
|
297
417
|
**Common Options:**
|
|
298
418
|
|
|
299
419
|
- `--data-path, -d PATH` - Data directory path (default: current directory)
|
|
420
|
+
- `--dryrun` - Preview what would be created/updated without making actual changes
|
|
300
421
|
|
|
301
422
|
**Required Environment Variables:**
|
|
302
423
|
|
|
@@ -314,8 +435,80 @@ usvc publish --data-path ./data
|
|
|
314
435
|
|
|
315
436
|
# Publish only providers
|
|
316
437
|
usvc publish providers
|
|
438
|
+
|
|
439
|
+
# Preview changes before publishing (dryrun mode)
|
|
440
|
+
usvc publish --dryrun
|
|
441
|
+
|
|
442
|
+
# Preview specific type
|
|
443
|
+
usvc publish providers --dryrun
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
**Dryrun Mode:**
|
|
447
|
+
|
|
448
|
+
The `--dryrun` option allows you to preview what would happen during publish without making actual changes to the backend. This is useful for:
|
|
449
|
+
|
|
450
|
+
- Verifying which entities would be created vs updated
|
|
451
|
+
- Checking that all dependencies exist before publishing
|
|
452
|
+
- Confirming changes before committing them
|
|
453
|
+
|
|
454
|
+
In dryrun mode:
|
|
455
|
+
- No actual data is sent to the backend
|
|
456
|
+
- Backend returns what action would be taken (create/update)
|
|
457
|
+
- Missing dependencies are reported but don't cause errors
|
|
458
|
+
- Summary shows what would happen if published
|
|
459
|
+
|
|
460
|
+
**Dryrun Output Format:**
|
|
461
|
+
|
|
462
|
+
Dryrun mode displays a summary table showing what actions would be taken:
|
|
463
|
+
|
|
464
|
+
```bash
|
|
465
|
+
$ usvc publish --dryrun
|
|
466
|
+
|
|
467
|
+
Publishing Sellers...
|
|
468
|
+
╭──────────┬─────────┬─────────┬────────╮
|
|
469
|
+
│ Type │ Created │ Updated │ Failed │
|
|
470
|
+
├──────────┼─────────┼─────────┼────────┤
|
|
471
|
+
│ Sellers │ 1 │ 0 │ │
|
|
472
|
+
╰──────────┴─────────┴─────────┴────────╯
|
|
473
|
+
|
|
474
|
+
Publishing Providers...
|
|
475
|
+
╭───────────┬─────────┬─────────┬────────╮
|
|
476
|
+
│ Type │ Created │ Updated │ Failed │
|
|
477
|
+
├───────────┼─────────┼─────────┼────────┤
|
|
478
|
+
│ Providers │ 2 │ 0 │ │
|
|
479
|
+
╰───────────┴─────────┴─────────┴────────╯
|
|
480
|
+
|
|
481
|
+
Publishing Offerings...
|
|
482
|
+
╭───────────┬─────────┬─────────┬────────╮
|
|
483
|
+
│ Type │ Created │ Updated │ Failed │
|
|
484
|
+
├───────────┼─────────┼─────────┼────────┤
|
|
485
|
+
│ Offerings │ 5 │ 3 │ │
|
|
486
|
+
╰───────────┴─────────┴─────────┴────────╯
|
|
487
|
+
|
|
488
|
+
Publishing Listings...
|
|
489
|
+
╭──────────┬─────────┬─────────┬────────╮
|
|
490
|
+
│ Type │ Created │ Updated │ Failed │
|
|
491
|
+
├──────────┼─────────┼─────────┼────────┤
|
|
492
|
+
│ Listings │ 8 │ 0 │ │
|
|
493
|
+
╰──────────┴─────────┴─────────┴────────╯
|
|
494
|
+
|
|
495
|
+
Summary
|
|
496
|
+
╭───────────┬─────────┬─────────┬────────╮
|
|
497
|
+
│ Type │ Created │ Updated │ Failed │
|
|
498
|
+
├───────────┼─────────┼─────────┼────────┤
|
|
499
|
+
│ Sellers │ 1 │ 0 │ │
|
|
500
|
+
│ Providers │ 2 │ 0 │ │
|
|
501
|
+
│ Offerings │ 5 │ 3 │ │
|
|
502
|
+
│ Listings │ 8 │ 0 │ │
|
|
503
|
+
╰───────────┴─────────┴─────────┴────────╯
|
|
317
504
|
```
|
|
318
505
|
|
|
506
|
+
Notes:
|
|
507
|
+
- Created: Entities that would be created (don't exist on backend)
|
|
508
|
+
- Updated: Entities that would be updated (exist but have changes)
|
|
509
|
+
- Failed: Entities that encountered errors (shown in red if > 0, blank if 0)
|
|
510
|
+
- Blank cells indicate zero count for easier reading
|
|
511
|
+
|
|
319
512
|
**Publishing Order (when publishing all):**
|
|
320
513
|
|
|
321
514
|
1. Sellers - Must exist before listings
|
|
@@ -334,6 +527,7 @@ unitysvc_services publish providers [OPTIONS]
|
|
|
334
527
|
**Options:**
|
|
335
528
|
|
|
336
529
|
- `--data-path, -d PATH` - File or directory path (default: current directory)
|
|
530
|
+
- `--dryrun` - Preview what would be created/updated without making actual changes
|
|
337
531
|
|
|
338
532
|
**Examples:**
|
|
339
533
|
|
|
@@ -346,6 +540,9 @@ usvc publish providers --data-path ./data/my-provider/provider.json
|
|
|
346
540
|
|
|
347
541
|
# Publish from custom directory
|
|
348
542
|
usvc publish providers --data-path ./custom-data
|
|
543
|
+
|
|
544
|
+
# Preview provider changes
|
|
545
|
+
usvc publish providers --dryrun
|
|
349
546
|
```
|
|
350
547
|
|
|
351
548
|
### publish sellers
|
|
@@ -359,6 +556,7 @@ unitysvc_services publish sellers [OPTIONS]
|
|
|
359
556
|
**Options:**
|
|
360
557
|
|
|
361
558
|
- `--data-path, -d PATH` - File or directory path (default: current directory)
|
|
559
|
+
- `--dryrun` - Preview what would be created/updated without making actual changes
|
|
362
560
|
|
|
363
561
|
### publish offerings
|
|
364
562
|
|
|
@@ -371,6 +569,7 @@ unitysvc_services publish offerings [OPTIONS]
|
|
|
371
569
|
**Options:**
|
|
372
570
|
|
|
373
571
|
- `--data-path, -d PATH` - File or directory path (default: current directory)
|
|
572
|
+
- `--dryrun` - Preview what would be created/updated without making actual changes
|
|
374
573
|
|
|
375
574
|
### publish listings
|
|
376
575
|
|
|
@@ -383,6 +582,7 @@ unitysvc_services publish listings [OPTIONS]
|
|
|
383
582
|
**Options:**
|
|
384
583
|
|
|
385
584
|
- `--data-path, -d PATH` - File or directory path (default: current directory)
|
|
585
|
+
- `--dryrun` - Preview what would be created/updated without making actual changes
|
|
386
586
|
|
|
387
587
|
**Publishing Order:**
|
|
388
588
|
|
|
@@ -739,6 +939,76 @@ usvc --show-completion
|
|
|
739
939
|
|
|
740
940
|
## Common Workflows
|
|
741
941
|
|
|
942
|
+
### Creating Data from Scratch (Interactive)
|
|
943
|
+
|
|
944
|
+
Create a complete data structure interactively:
|
|
945
|
+
|
|
946
|
+
```bash
|
|
947
|
+
# 1. Create seller (will prompt for contact info, etc.)
|
|
948
|
+
usvc init seller acme-corp
|
|
949
|
+
# Follow prompts: enter email, homepage, etc.
|
|
950
|
+
|
|
951
|
+
# 2. Create provider (will prompt for API endpoint, etc.)
|
|
952
|
+
cd data/acme-corp
|
|
953
|
+
usvc init provider openai
|
|
954
|
+
# Follow prompts: API endpoint, contact, optional services_populator
|
|
955
|
+
|
|
956
|
+
# 3. Create service offering (will prompt for service details)
|
|
957
|
+
cd openai
|
|
958
|
+
usvc init offering gpt-4
|
|
959
|
+
# Follow prompts: description, upstream API, optional pricing
|
|
960
|
+
|
|
961
|
+
# 4. Create listing (auto-detects seller and service!)
|
|
962
|
+
cd gpt-4
|
|
963
|
+
usvc init listing standard
|
|
964
|
+
# Auto-fills seller from data/seller.json and service from service.json
|
|
965
|
+
# Add optional documents
|
|
966
|
+
|
|
967
|
+
# 5. Validate everything
|
|
968
|
+
cd ../../../.. # Back to project root
|
|
969
|
+
usvc validate
|
|
970
|
+
|
|
971
|
+
# 6. Format files
|
|
972
|
+
usvc format
|
|
973
|
+
|
|
974
|
+
# 7. Preview before publishing
|
|
975
|
+
cd data
|
|
976
|
+
usvc publish --dryrun
|
|
977
|
+
|
|
978
|
+
# 8. Publish if everything looks good
|
|
979
|
+
usvc publish
|
|
980
|
+
```
|
|
981
|
+
|
|
982
|
+
**Note**: The interactive prompts include:
|
|
983
|
+
- ✅ Auto-discovery of seller/service names
|
|
984
|
+
- ✅ Validation of emails, URLs, and required fields
|
|
985
|
+
- ✅ Smart defaults (e.g., display name from ID)
|
|
986
|
+
- ✅ Optional document and pricing support
|
|
987
|
+
|
|
988
|
+
### Copying from Existing Data
|
|
989
|
+
|
|
990
|
+
Quickly create new data by copying from existing structures:
|
|
991
|
+
|
|
992
|
+
```bash
|
|
993
|
+
# Copy an existing service offering to create a similar one
|
|
994
|
+
usvc init offering gpt-4-turbo --source ./data/acme-corp/openai/gpt-4
|
|
995
|
+
|
|
996
|
+
# Copy a listing
|
|
997
|
+
usvc init listing premium --source ./data/acme-corp/openai/gpt-4/standard
|
|
998
|
+
|
|
999
|
+
# Copy a provider
|
|
1000
|
+
usvc init provider anthropic --source ./data/acme-corp/openai
|
|
1001
|
+
|
|
1002
|
+
# Copy a seller
|
|
1003
|
+
usvc init seller new-seller --source ./data/acme-corp
|
|
1004
|
+
```
|
|
1005
|
+
|
|
1006
|
+
**Benefits of copy mode:**
|
|
1007
|
+
- 🚀 Skip interactive prompts for similar services
|
|
1008
|
+
- 📋 Preserves structure and documents
|
|
1009
|
+
- ⚡ Faster than manual entry for bulk creation
|
|
1010
|
+
- 🔄 Updates names and IDs automatically
|
|
1011
|
+
|
|
742
1012
|
### Full Publish Flow
|
|
743
1013
|
|
|
744
1014
|
```bash
|
|
@@ -750,8 +1020,11 @@ export UNITYSVC_API_KEY=your-key
|
|
|
750
1020
|
usvc validate
|
|
751
1021
|
usvc format
|
|
752
1022
|
|
|
753
|
-
#
|
|
1023
|
+
# Preview changes before publishing (recommended)
|
|
754
1024
|
cd data
|
|
1025
|
+
usvc publish --dryrun
|
|
1026
|
+
|
|
1027
|
+
# If preview looks good, publish all (handles order automatically)
|
|
755
1028
|
usvc publish
|
|
756
1029
|
|
|
757
1030
|
# Verify
|
|
@@ -767,6 +1040,9 @@ usvc update offering --name my-service --status ready
|
|
|
767
1040
|
# Validate
|
|
768
1041
|
usvc validate
|
|
769
1042
|
|
|
1043
|
+
# Preview changes
|
|
1044
|
+
usvc publish offerings --dryrun
|
|
1045
|
+
|
|
770
1046
|
# Publish changes
|
|
771
1047
|
usvc publish offerings
|
|
772
1048
|
```
|
|
@@ -781,8 +1057,11 @@ usvc populate
|
|
|
781
1057
|
usvc validate
|
|
782
1058
|
usvc format
|
|
783
1059
|
|
|
784
|
-
#
|
|
1060
|
+
# Preview generated data
|
|
785
1061
|
cd data
|
|
1062
|
+
usvc publish --dryrun
|
|
1063
|
+
|
|
1064
|
+
# Publish all
|
|
786
1065
|
usvc publish
|
|
787
1066
|
```
|
|
788
1067
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "unitysvc-services"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.11"
|
|
8
8
|
description = "SDK for digital service providers on UnitySVC"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Bo Peng", email = "bo.peng@unitysvc.com" }]
|
|
@@ -88,7 +88,7 @@ class UnitySvcAPI:
|
|
|
88
88
|
stdout, stderr = await asyncio.wait_for(proc.communicate(), timeout=30.0)
|
|
89
89
|
|
|
90
90
|
if proc.returncode != 0:
|
|
91
|
-
error_msg = stderr.decode().strip() if stderr else "
|
|
91
|
+
error_msg = stderr.decode().strip() if stderr else "curl command failed"
|
|
92
92
|
raise RuntimeError(f"Curl error: {error_msg}")
|
|
93
93
|
|
|
94
94
|
# Parse response: last line is status code, rest is body
|
|
@@ -165,7 +165,7 @@ class UnitySvcAPI:
|
|
|
165
165
|
stdout, stderr = await asyncio.wait_for(proc.communicate(), timeout=30.0)
|
|
166
166
|
|
|
167
167
|
if proc.returncode != 0:
|
|
168
|
-
error_msg = stderr.decode().strip() if stderr else "
|
|
168
|
+
error_msg = stderr.decode().strip() if stderr else "curl command failed"
|
|
169
169
|
raise RuntimeError(f"Curl error: {error_msg}")
|
|
170
170
|
|
|
171
171
|
# Parse response: last line is status code, rest is body
|