@purveyors/sdk 0.11.1 → 0.13.0
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/index.d.ts +549 -12
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -201,7 +201,7 @@ interface paths {
|
|
|
201
201
|
content: {
|
|
202
202
|
"application/json": {
|
|
203
203
|
name: string;
|
|
204
|
-
scopes?: ("catalog:read" | "inventory:read" | "roast:read" | "sales:read" | "tasting:read" | "inventory:write" | "roast:write" | "sales:write" | "tasting:write")[];
|
|
204
|
+
scopes?: ("catalog:read" | "inventory:read" | "roast:read" | "sales:read" | "tasting:read" | "portfolio:read" | "inventory:write" | "roast:write" | "sales:write" | "tasting:write" | "portfolio:write")[];
|
|
205
205
|
};
|
|
206
206
|
};
|
|
207
207
|
};
|
|
@@ -1914,6 +1914,15 @@ interface paths {
|
|
|
1914
1914
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
1915
1915
|
};
|
|
1916
1916
|
};
|
|
1917
|
+
/** @description Owner-safe similarity matching is temporarily unavailable during rollout */
|
|
1918
|
+
503: {
|
|
1919
|
+
headers: {
|
|
1920
|
+
[name: string]: unknown;
|
|
1921
|
+
};
|
|
1922
|
+
content: {
|
|
1923
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
1924
|
+
};
|
|
1925
|
+
};
|
|
1917
1926
|
};
|
|
1918
1927
|
};
|
|
1919
1928
|
put?: never;
|
|
@@ -1933,7 +1942,7 @@ interface paths {
|
|
|
1933
1942
|
};
|
|
1934
1943
|
/**
|
|
1935
1944
|
* List saved sourcing briefs
|
|
1936
|
-
* @description List the authenticated principal's active sourcing briefs. Requires a member session or a paid (member+) API plan; API keys also need the catalog:read scope.
|
|
1945
|
+
* @description List the authenticated principal's active sourcing briefs. Requires a Parchment Intelligence or member session, or a paid (member+) API plan; API keys also need the catalog:read scope.
|
|
1937
1946
|
*/
|
|
1938
1947
|
get: {
|
|
1939
1948
|
parameters: {
|
|
@@ -1976,7 +1985,7 @@ interface paths {
|
|
|
1976
1985
|
put?: never;
|
|
1977
1986
|
/**
|
|
1978
1987
|
* Create a sourcing brief
|
|
1979
|
-
* @description Create a saved sourcing brief for the authenticated principal. Requires a member session or a paid (member+) API plan; API keys also need the catalog:read scope.
|
|
1988
|
+
* @description Create a saved sourcing brief for the authenticated principal. Requires a Parchment Intelligence or member session, or a paid (member+) API plan; API keys also need the catalog:read scope.
|
|
1980
1989
|
*/
|
|
1981
1990
|
post: {
|
|
1982
1991
|
parameters: {
|
|
@@ -2044,7 +2053,7 @@ interface paths {
|
|
|
2044
2053
|
};
|
|
2045
2054
|
/**
|
|
2046
2055
|
* Get a sourcing brief
|
|
2047
|
-
* @description Fetch one of the authenticated principal's sourcing briefs by id. Requires a member session or a paid (member+) API plan; API keys also need the catalog:read scope.
|
|
2056
|
+
* @description Fetch one of the authenticated principal's sourcing briefs by id. Requires a Parchment Intelligence or member session, or a paid (member+) API plan; API keys also need the catalog:read scope.
|
|
2048
2057
|
*/
|
|
2049
2058
|
get: {
|
|
2050
2059
|
parameters: {
|
|
@@ -2112,7 +2121,7 @@ interface paths {
|
|
|
2112
2121
|
};
|
|
2113
2122
|
/**
|
|
2114
2123
|
* Run a sourcing brief against the catalog
|
|
2115
|
-
* @description Return the catalog coffees that satisfy a saved brief's criteria, each annotated with the deterministic reasons it matched. Requires a member session or a paid (member+) API plan; API keys also need the catalog:read scope.
|
|
2124
|
+
* @description Return the catalog coffees that satisfy a saved brief's criteria, each annotated with the deterministic reasons it matched. Requires a Parchment Intelligence or member session, or a paid (member+) API plan; API keys also need the catalog:read scope.
|
|
2116
2125
|
*/
|
|
2117
2126
|
get: {
|
|
2118
2127
|
parameters: {
|
|
@@ -2183,6 +2192,248 @@ interface paths {
|
|
|
2183
2192
|
patch?: never;
|
|
2184
2193
|
trace?: never;
|
|
2185
2194
|
};
|
|
2195
|
+
"/v1/portfolio/tracked-lots": {
|
|
2196
|
+
parameters: {
|
|
2197
|
+
query?: never;
|
|
2198
|
+
header?: never;
|
|
2199
|
+
path?: never;
|
|
2200
|
+
cookie?: never;
|
|
2201
|
+
};
|
|
2202
|
+
/**
|
|
2203
|
+
* List tracked catalog lots
|
|
2204
|
+
* @description Return the caller's complete tracked catalog-id set and recent live catalog summaries. Member and Parchment Intelligence sessions are allowed. API keys must be owner-bound, paid/entitled, and carry portfolio:read.
|
|
2205
|
+
*/
|
|
2206
|
+
get: {
|
|
2207
|
+
parameters: {
|
|
2208
|
+
query?: {
|
|
2209
|
+
summaryLimit?: number | null;
|
|
2210
|
+
};
|
|
2211
|
+
header?: never;
|
|
2212
|
+
path?: never;
|
|
2213
|
+
cookie?: never;
|
|
2214
|
+
};
|
|
2215
|
+
requestBody?: never;
|
|
2216
|
+
responses: {
|
|
2217
|
+
/** @description The caller's tracked lot ids and summaries */
|
|
2218
|
+
200: {
|
|
2219
|
+
headers: {
|
|
2220
|
+
[name: string]: unknown;
|
|
2221
|
+
};
|
|
2222
|
+
content: {
|
|
2223
|
+
"application/json": components["schemas"]["TrackedLotsListResponse"];
|
|
2224
|
+
};
|
|
2225
|
+
};
|
|
2226
|
+
/** @description Invalid path or query parameter */
|
|
2227
|
+
400: {
|
|
2228
|
+
headers: {
|
|
2229
|
+
[name: string]: unknown;
|
|
2230
|
+
};
|
|
2231
|
+
content: {
|
|
2232
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2233
|
+
};
|
|
2234
|
+
};
|
|
2235
|
+
/** @description Authentication required */
|
|
2236
|
+
401: {
|
|
2237
|
+
headers: {
|
|
2238
|
+
[name: string]: unknown;
|
|
2239
|
+
};
|
|
2240
|
+
content: {
|
|
2241
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2242
|
+
};
|
|
2243
|
+
};
|
|
2244
|
+
/** @description Insufficient entitlement (plan or role) */
|
|
2245
|
+
403: {
|
|
2246
|
+
headers: {
|
|
2247
|
+
[name: string]: unknown;
|
|
2248
|
+
};
|
|
2249
|
+
content: {
|
|
2250
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2251
|
+
};
|
|
2252
|
+
};
|
|
2253
|
+
};
|
|
2254
|
+
};
|
|
2255
|
+
put?: never;
|
|
2256
|
+
post?: never;
|
|
2257
|
+
delete?: never;
|
|
2258
|
+
options?: never;
|
|
2259
|
+
head?: never;
|
|
2260
|
+
patch?: never;
|
|
2261
|
+
trace?: never;
|
|
2262
|
+
};
|
|
2263
|
+
"/v1/portfolio/tracked-lots/{catalogId}": {
|
|
2264
|
+
parameters: {
|
|
2265
|
+
query?: never;
|
|
2266
|
+
header?: never;
|
|
2267
|
+
path?: never;
|
|
2268
|
+
cookie?: never;
|
|
2269
|
+
};
|
|
2270
|
+
get?: never;
|
|
2271
|
+
/**
|
|
2272
|
+
* Track a catalog lot
|
|
2273
|
+
* @description Idempotently set a visible catalog lot to tracked for the authenticated owner, capturing its current display price on the first successful PUT. Session eligibility matches portfolio reads; owner-bound API keys additionally require the exact portfolio:write scope.
|
|
2274
|
+
*/
|
|
2275
|
+
put: {
|
|
2276
|
+
parameters: {
|
|
2277
|
+
query?: never;
|
|
2278
|
+
header?: never;
|
|
2279
|
+
path: {
|
|
2280
|
+
catalogId: number;
|
|
2281
|
+
};
|
|
2282
|
+
cookie?: never;
|
|
2283
|
+
};
|
|
2284
|
+
requestBody?: never;
|
|
2285
|
+
responses: {
|
|
2286
|
+
/** @description The tracked state after the mutation */
|
|
2287
|
+
200: {
|
|
2288
|
+
headers: {
|
|
2289
|
+
[name: string]: unknown;
|
|
2290
|
+
};
|
|
2291
|
+
content: {
|
|
2292
|
+
"application/json": components["schemas"]["TrackedLotMutationResponse"];
|
|
2293
|
+
};
|
|
2294
|
+
};
|
|
2295
|
+
/** @description Invalid path or query parameter */
|
|
2296
|
+
400: {
|
|
2297
|
+
headers: {
|
|
2298
|
+
[name: string]: unknown;
|
|
2299
|
+
};
|
|
2300
|
+
content: {
|
|
2301
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2302
|
+
};
|
|
2303
|
+
};
|
|
2304
|
+
/** @description Authentication required */
|
|
2305
|
+
401: {
|
|
2306
|
+
headers: {
|
|
2307
|
+
[name: string]: unknown;
|
|
2308
|
+
};
|
|
2309
|
+
content: {
|
|
2310
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2311
|
+
};
|
|
2312
|
+
};
|
|
2313
|
+
/** @description Insufficient entitlement (plan or role) */
|
|
2314
|
+
403: {
|
|
2315
|
+
headers: {
|
|
2316
|
+
[name: string]: unknown;
|
|
2317
|
+
};
|
|
2318
|
+
content: {
|
|
2319
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2320
|
+
};
|
|
2321
|
+
};
|
|
2322
|
+
/** @description Catalog lot does not exist or is not visible to the authenticated principal */
|
|
2323
|
+
404: {
|
|
2324
|
+
headers: {
|
|
2325
|
+
[name: string]: unknown;
|
|
2326
|
+
};
|
|
2327
|
+
content: {
|
|
2328
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2329
|
+
};
|
|
2330
|
+
};
|
|
2331
|
+
/** @description Tracked state changed between the idempotent upsert and owner-scoped readback; retry the PUT */
|
|
2332
|
+
409: {
|
|
2333
|
+
headers: {
|
|
2334
|
+
[name: string]: unknown;
|
|
2335
|
+
};
|
|
2336
|
+
content: {
|
|
2337
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2338
|
+
};
|
|
2339
|
+
};
|
|
2340
|
+
/** @description Per-user mutation throttle exceeded */
|
|
2341
|
+
429: {
|
|
2342
|
+
headers: {
|
|
2343
|
+
[name: string]: unknown;
|
|
2344
|
+
};
|
|
2345
|
+
content: {
|
|
2346
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2347
|
+
};
|
|
2348
|
+
};
|
|
2349
|
+
/** @description Portfolio writes are disabled */
|
|
2350
|
+
503: {
|
|
2351
|
+
headers: {
|
|
2352
|
+
[name: string]: unknown;
|
|
2353
|
+
};
|
|
2354
|
+
content: {
|
|
2355
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2356
|
+
};
|
|
2357
|
+
};
|
|
2358
|
+
};
|
|
2359
|
+
};
|
|
2360
|
+
post?: never;
|
|
2361
|
+
/**
|
|
2362
|
+
* Untrack a catalog lot
|
|
2363
|
+
* @description Idempotently set a catalog lot to untracked for the authenticated owner. Repeated DELETE requests return the same untracked state even when the catalog lot is absent or no longer visible.
|
|
2364
|
+
*/
|
|
2365
|
+
delete: {
|
|
2366
|
+
parameters: {
|
|
2367
|
+
query?: never;
|
|
2368
|
+
header?: never;
|
|
2369
|
+
path: {
|
|
2370
|
+
catalogId: number;
|
|
2371
|
+
};
|
|
2372
|
+
cookie?: never;
|
|
2373
|
+
};
|
|
2374
|
+
requestBody?: never;
|
|
2375
|
+
responses: {
|
|
2376
|
+
/** @description The untracked state after the mutation */
|
|
2377
|
+
200: {
|
|
2378
|
+
headers: {
|
|
2379
|
+
[name: string]: unknown;
|
|
2380
|
+
};
|
|
2381
|
+
content: {
|
|
2382
|
+
"application/json": components["schemas"]["TrackedLotMutationResponse"];
|
|
2383
|
+
};
|
|
2384
|
+
};
|
|
2385
|
+
/** @description Invalid path or query parameter */
|
|
2386
|
+
400: {
|
|
2387
|
+
headers: {
|
|
2388
|
+
[name: string]: unknown;
|
|
2389
|
+
};
|
|
2390
|
+
content: {
|
|
2391
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2392
|
+
};
|
|
2393
|
+
};
|
|
2394
|
+
/** @description Authentication required */
|
|
2395
|
+
401: {
|
|
2396
|
+
headers: {
|
|
2397
|
+
[name: string]: unknown;
|
|
2398
|
+
};
|
|
2399
|
+
content: {
|
|
2400
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2401
|
+
};
|
|
2402
|
+
};
|
|
2403
|
+
/** @description Insufficient entitlement (plan or role) */
|
|
2404
|
+
403: {
|
|
2405
|
+
headers: {
|
|
2406
|
+
[name: string]: unknown;
|
|
2407
|
+
};
|
|
2408
|
+
content: {
|
|
2409
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2410
|
+
};
|
|
2411
|
+
};
|
|
2412
|
+
/** @description Per-user mutation throttle exceeded */
|
|
2413
|
+
429: {
|
|
2414
|
+
headers: {
|
|
2415
|
+
[name: string]: unknown;
|
|
2416
|
+
};
|
|
2417
|
+
content: {
|
|
2418
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2419
|
+
};
|
|
2420
|
+
};
|
|
2421
|
+
/** @description Portfolio writes are disabled */
|
|
2422
|
+
503: {
|
|
2423
|
+
headers: {
|
|
2424
|
+
[name: string]: unknown;
|
|
2425
|
+
};
|
|
2426
|
+
content: {
|
|
2427
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
2428
|
+
};
|
|
2429
|
+
};
|
|
2430
|
+
};
|
|
2431
|
+
};
|
|
2432
|
+
options?: never;
|
|
2433
|
+
head?: never;
|
|
2434
|
+
patch?: never;
|
|
2435
|
+
trace?: never;
|
|
2436
|
+
};
|
|
2186
2437
|
"/v1/inventory": {
|
|
2187
2438
|
parameters: {
|
|
2188
2439
|
query?: never;
|
|
@@ -5192,6 +5443,69 @@ interface components {
|
|
|
5192
5443
|
limitations: string[];
|
|
5193
5444
|
};
|
|
5194
5445
|
};
|
|
5446
|
+
TrackedLotSummary: {
|
|
5447
|
+
catalogId: number;
|
|
5448
|
+
trackedAt: string;
|
|
5449
|
+
priceAtTracking: number | null;
|
|
5450
|
+
name: string;
|
|
5451
|
+
source: string | null;
|
|
5452
|
+
country: string | null;
|
|
5453
|
+
region: string | null;
|
|
5454
|
+
processing: string | null;
|
|
5455
|
+
stocked: boolean | null;
|
|
5456
|
+
wholesale: boolean | null;
|
|
5457
|
+
unstockedDate?: string | null;
|
|
5458
|
+
currentPrice: number | null;
|
|
5459
|
+
priceDelta: number | null;
|
|
5460
|
+
};
|
|
5461
|
+
TrackedLotsListResponse: {
|
|
5462
|
+
data: {
|
|
5463
|
+
catalogIds: number[];
|
|
5464
|
+
summaries: components["schemas"]["TrackedLotSummary"][];
|
|
5465
|
+
};
|
|
5466
|
+
meta: {
|
|
5467
|
+
/** @enum {string} */
|
|
5468
|
+
resource: "tracked-lots";
|
|
5469
|
+
/** @enum {string} */
|
|
5470
|
+
namespace: "/v1/portfolio/tracked-lots";
|
|
5471
|
+
/** @enum {string} */
|
|
5472
|
+
version: "v1";
|
|
5473
|
+
auth: {
|
|
5474
|
+
/** @enum {string} */
|
|
5475
|
+
kind: "session" | "api-key";
|
|
5476
|
+
/** @enum {string|null} */
|
|
5477
|
+
role: "admin" | "member" | "viewer" | null;
|
|
5478
|
+
/** @enum {string|null} */
|
|
5479
|
+
apiPlan: "viewer" | "member" | "enterprise" | null;
|
|
5480
|
+
ppiAccess: boolean;
|
|
5481
|
+
};
|
|
5482
|
+
};
|
|
5483
|
+
};
|
|
5484
|
+
TrackedLotMutationResponse: {
|
|
5485
|
+
data: {
|
|
5486
|
+
catalogId: number;
|
|
5487
|
+
tracked: boolean;
|
|
5488
|
+
trackedAt: string | null;
|
|
5489
|
+
priceAtTracking: number | null;
|
|
5490
|
+
};
|
|
5491
|
+
meta: {
|
|
5492
|
+
/** @enum {string} */
|
|
5493
|
+
resource: "tracked-lots";
|
|
5494
|
+
/** @enum {string} */
|
|
5495
|
+
namespace: "/v1/portfolio/tracked-lots";
|
|
5496
|
+
/** @enum {string} */
|
|
5497
|
+
version: "v1";
|
|
5498
|
+
auth: {
|
|
5499
|
+
/** @enum {string} */
|
|
5500
|
+
kind: "session" | "api-key";
|
|
5501
|
+
/** @enum {string|null} */
|
|
5502
|
+
role: "admin" | "member" | "viewer" | null;
|
|
5503
|
+
/** @enum {string|null} */
|
|
5504
|
+
apiPlan: "viewer" | "member" | "enterprise" | null;
|
|
5505
|
+
ppiAccess: boolean;
|
|
5506
|
+
};
|
|
5507
|
+
};
|
|
5508
|
+
};
|
|
5195
5509
|
InventoryCatalog: {
|
|
5196
5510
|
id: number;
|
|
5197
5511
|
name: string | null;
|
|
@@ -5929,6 +6243,12 @@ type MetadataIndexQuery = NonNullable<paths["/v1/market/metadata-index"]["get"][
|
|
|
5929
6243
|
type BriefMatchesQuery = NonNullable<paths["/v1/procurement/briefs/{id}/matches"]["get"]["parameters"]["query"]>;
|
|
5930
6244
|
/** Request body for {@link ParchmentClient.procurement.briefs.create}. */
|
|
5931
6245
|
type SourcingBriefCreateRequest = components["schemas"]["SourcingBriefCreateRequest"];
|
|
6246
|
+
/** Query parameters for {@link ParchmentClient.portfolio.trackedLots.list}. */
|
|
6247
|
+
type TrackedLotsListQuery = NonNullable<paths["/v1/portfolio/tracked-lots"]["get"]["parameters"]["query"]>;
|
|
6248
|
+
/** A tracked catalog lot enriched with current catalog and price state. */
|
|
6249
|
+
type TrackedLotSummary = components["schemas"]["TrackedLotSummary"];
|
|
6250
|
+
/** State returned by tracked-lot PUT and DELETE mutations. */
|
|
6251
|
+
type TrackedLotMutation = components["schemas"]["TrackedLotMutationResponse"];
|
|
5932
6252
|
/** Query parameters for {@link ParchmentClient.inventory.list}. */
|
|
5933
6253
|
type InventoryListQuery = NonNullable<paths["/v1/inventory"]["get"]["parameters"]["query"]>;
|
|
5934
6254
|
/** Request body for {@link ParchmentClient.inventory.create}. */
|
|
@@ -6183,7 +6503,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
6183
6503
|
content: {
|
|
6184
6504
|
"application/json": {
|
|
6185
6505
|
name: string;
|
|
6186
|
-
scopes?: ("catalog:read" | "inventory:read" | "roast:read" | "sales:read" | "tasting:read" | "inventory:write" | "roast:write" | "sales:write" | "tasting:write")[];
|
|
6506
|
+
scopes?: ("catalog:read" | "inventory:read" | "roast:read" | "sales:read" | "tasting:read" | "portfolio:read" | "inventory:write" | "roast:write" | "sales:write" | "tasting:write" | "portfolio:write")[];
|
|
6187
6507
|
};
|
|
6188
6508
|
};
|
|
6189
6509
|
};
|
|
@@ -6240,7 +6560,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
6240
6560
|
}, {
|
|
6241
6561
|
body: {
|
|
6242
6562
|
name: string;
|
|
6243
|
-
scopes?: ("catalog:read" | "inventory:read" | "roast:read" | "sales:read" | "tasting:read" | "inventory:write" | "roast:write" | "sales:write" | "tasting:write")[];
|
|
6563
|
+
scopes?: ("catalog:read" | "inventory:read" | "roast:read" | "sales:read" | "tasting:read" | "portfolio:read" | "inventory:write" | "roast:write" | "sales:write" | "tasting:write" | "portfolio:write")[];
|
|
6244
6564
|
};
|
|
6245
6565
|
}, `${string}/${string}`>>;
|
|
6246
6566
|
/** Revoke an API key owned by the authenticated session user. */
|
|
@@ -6336,7 +6656,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
6336
6656
|
[name: string]: unknown;
|
|
6337
6657
|
};
|
|
6338
6658
|
content: {
|
|
6339
|
-
"application/json": components["schemas"]
|
|
6659
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
6340
6660
|
};
|
|
6341
6661
|
};
|
|
6342
6662
|
401: {
|
|
@@ -6441,9 +6761,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
6441
6761
|
[name: string]: unknown;
|
|
6442
6762
|
};
|
|
6443
6763
|
content: {
|
|
6444
|
-
"application/json":
|
|
6445
|
-
/** Match Artisan roast metadata to one of the supplied inventory rows. */
|
|
6446
|
-
components["schemas"]["ErrorResponse"];
|
|
6764
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
6447
6765
|
};
|
|
6448
6766
|
};
|
|
6449
6767
|
};
|
|
@@ -7548,6 +7866,14 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
7548
7866
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
7549
7867
|
};
|
|
7550
7868
|
};
|
|
7869
|
+
503: {
|
|
7870
|
+
headers: {
|
|
7871
|
+
[name: string]: unknown;
|
|
7872
|
+
};
|
|
7873
|
+
content: {
|
|
7874
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
7875
|
+
};
|
|
7876
|
+
};
|
|
7551
7877
|
};
|
|
7552
7878
|
}, {
|
|
7553
7879
|
params: {
|
|
@@ -8048,6 +8374,217 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
8048
8374
|
}, `${string}/${string}`>>;
|
|
8049
8375
|
};
|
|
8050
8376
|
};
|
|
8377
|
+
portfolio: {
|
|
8378
|
+
trackedLots: {
|
|
8379
|
+
/**
|
|
8380
|
+
* List the caller's complete tracked catalog-id set and bounded recent
|
|
8381
|
+
* summaries enriched with live catalog state.
|
|
8382
|
+
*/
|
|
8383
|
+
list: (query?: TrackedLotsListQuery) => Promise<openapi_fetch.FetchResponse<{
|
|
8384
|
+
parameters: {
|
|
8385
|
+
query?: {
|
|
8386
|
+
summaryLimit?: number | null;
|
|
8387
|
+
};
|
|
8388
|
+
header?: never;
|
|
8389
|
+
path?: never;
|
|
8390
|
+
cookie?: never;
|
|
8391
|
+
};
|
|
8392
|
+
requestBody?: never;
|
|
8393
|
+
responses: {
|
|
8394
|
+
200: {
|
|
8395
|
+
headers: {
|
|
8396
|
+
[name: string]: unknown;
|
|
8397
|
+
};
|
|
8398
|
+
content: {
|
|
8399
|
+
"application/json": components["schemas"]["TrackedLotsListResponse"];
|
|
8400
|
+
};
|
|
8401
|
+
};
|
|
8402
|
+
400: {
|
|
8403
|
+
headers: {
|
|
8404
|
+
[name: string]: unknown;
|
|
8405
|
+
};
|
|
8406
|
+
content: {
|
|
8407
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8408
|
+
};
|
|
8409
|
+
};
|
|
8410
|
+
401: {
|
|
8411
|
+
headers: {
|
|
8412
|
+
[name: string]: unknown;
|
|
8413
|
+
};
|
|
8414
|
+
content: {
|
|
8415
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8416
|
+
};
|
|
8417
|
+
};
|
|
8418
|
+
403: {
|
|
8419
|
+
headers: {
|
|
8420
|
+
[name: string]: unknown;
|
|
8421
|
+
};
|
|
8422
|
+
content: {
|
|
8423
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8424
|
+
};
|
|
8425
|
+
};
|
|
8426
|
+
};
|
|
8427
|
+
}, {
|
|
8428
|
+
params: {
|
|
8429
|
+
query: {
|
|
8430
|
+
summaryLimit?: number | null;
|
|
8431
|
+
} | undefined;
|
|
8432
|
+
};
|
|
8433
|
+
}, `${string}/${string}`>>;
|
|
8434
|
+
/** Idempotently set a visible catalog lot to tracked. */
|
|
8435
|
+
track: (catalogId: number) => Promise<openapi_fetch.FetchResponse<{
|
|
8436
|
+
parameters: {
|
|
8437
|
+
query?: never;
|
|
8438
|
+
header?: never;
|
|
8439
|
+
path: {
|
|
8440
|
+
catalogId: number;
|
|
8441
|
+
};
|
|
8442
|
+
cookie?: never;
|
|
8443
|
+
};
|
|
8444
|
+
requestBody?: never;
|
|
8445
|
+
responses: {
|
|
8446
|
+
200: {
|
|
8447
|
+
headers: {
|
|
8448
|
+
[name: string]: unknown;
|
|
8449
|
+
};
|
|
8450
|
+
content: {
|
|
8451
|
+
"application/json": components["schemas"]["TrackedLotMutationResponse"];
|
|
8452
|
+
};
|
|
8453
|
+
};
|
|
8454
|
+
400: {
|
|
8455
|
+
headers: {
|
|
8456
|
+
[name: string]: unknown;
|
|
8457
|
+
};
|
|
8458
|
+
content: {
|
|
8459
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8460
|
+
};
|
|
8461
|
+
};
|
|
8462
|
+
401: {
|
|
8463
|
+
headers: {
|
|
8464
|
+
[name: string]: unknown;
|
|
8465
|
+
};
|
|
8466
|
+
content: {
|
|
8467
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8468
|
+
};
|
|
8469
|
+
};
|
|
8470
|
+
403: {
|
|
8471
|
+
headers: {
|
|
8472
|
+
[name: string]: unknown;
|
|
8473
|
+
};
|
|
8474
|
+
content: {
|
|
8475
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8476
|
+
};
|
|
8477
|
+
};
|
|
8478
|
+
404: {
|
|
8479
|
+
headers: {
|
|
8480
|
+
[name: string]: unknown;
|
|
8481
|
+
};
|
|
8482
|
+
content: {
|
|
8483
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8484
|
+
};
|
|
8485
|
+
};
|
|
8486
|
+
409: {
|
|
8487
|
+
headers: {
|
|
8488
|
+
[name: string]: unknown;
|
|
8489
|
+
};
|
|
8490
|
+
content: {
|
|
8491
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8492
|
+
};
|
|
8493
|
+
};
|
|
8494
|
+
429: {
|
|
8495
|
+
headers: {
|
|
8496
|
+
[name: string]: unknown;
|
|
8497
|
+
};
|
|
8498
|
+
content: {
|
|
8499
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8500
|
+
};
|
|
8501
|
+
};
|
|
8502
|
+
503: {
|
|
8503
|
+
headers: {
|
|
8504
|
+
[name: string]: unknown;
|
|
8505
|
+
};
|
|
8506
|
+
content: {
|
|
8507
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8508
|
+
};
|
|
8509
|
+
};
|
|
8510
|
+
};
|
|
8511
|
+
}, {
|
|
8512
|
+
params: {
|
|
8513
|
+
path: {
|
|
8514
|
+
catalogId: number;
|
|
8515
|
+
};
|
|
8516
|
+
};
|
|
8517
|
+
}, `${string}/${string}`>>;
|
|
8518
|
+
/** Idempotently set an owner catalog lot to untracked. */
|
|
8519
|
+
untrack: (catalogId: number) => Promise<openapi_fetch.FetchResponse<{
|
|
8520
|
+
parameters: {
|
|
8521
|
+
query?: never;
|
|
8522
|
+
header?: never;
|
|
8523
|
+
path: {
|
|
8524
|
+
catalogId: number;
|
|
8525
|
+
};
|
|
8526
|
+
cookie?: never;
|
|
8527
|
+
};
|
|
8528
|
+
requestBody?: never;
|
|
8529
|
+
responses: {
|
|
8530
|
+
200: {
|
|
8531
|
+
headers: {
|
|
8532
|
+
[name: string]: unknown;
|
|
8533
|
+
};
|
|
8534
|
+
content: {
|
|
8535
|
+
"application/json": components["schemas"]["TrackedLotMutationResponse"];
|
|
8536
|
+
};
|
|
8537
|
+
};
|
|
8538
|
+
400: {
|
|
8539
|
+
headers: {
|
|
8540
|
+
[name: string]: unknown;
|
|
8541
|
+
};
|
|
8542
|
+
content: {
|
|
8543
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8544
|
+
};
|
|
8545
|
+
};
|
|
8546
|
+
401: {
|
|
8547
|
+
headers: {
|
|
8548
|
+
[name: string]: unknown;
|
|
8549
|
+
};
|
|
8550
|
+
content: {
|
|
8551
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8552
|
+
};
|
|
8553
|
+
};
|
|
8554
|
+
403: {
|
|
8555
|
+
headers: {
|
|
8556
|
+
[name: string]: unknown;
|
|
8557
|
+
};
|
|
8558
|
+
content: {
|
|
8559
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8560
|
+
};
|
|
8561
|
+
};
|
|
8562
|
+
429: {
|
|
8563
|
+
headers: {
|
|
8564
|
+
[name: string]: unknown;
|
|
8565
|
+
};
|
|
8566
|
+
content: {
|
|
8567
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8568
|
+
};
|
|
8569
|
+
};
|
|
8570
|
+
503: {
|
|
8571
|
+
headers: {
|
|
8572
|
+
[name: string]: unknown;
|
|
8573
|
+
};
|
|
8574
|
+
content: {
|
|
8575
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8576
|
+
};
|
|
8577
|
+
};
|
|
8578
|
+
};
|
|
8579
|
+
}, {
|
|
8580
|
+
params: {
|
|
8581
|
+
path: {
|
|
8582
|
+
catalogId: number;
|
|
8583
|
+
};
|
|
8584
|
+
};
|
|
8585
|
+
}, `${string}/${string}`>>;
|
|
8586
|
+
};
|
|
8587
|
+
};
|
|
8051
8588
|
inventory: {
|
|
8052
8589
|
/** List the caller's own green-coffee inventory (owner-scoped). */
|
|
8053
8590
|
list: (query?: InventoryListQuery) => Promise<openapi_fetch.FetchResponse<{
|
|
@@ -9735,4 +10272,4 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
9735
10272
|
};
|
|
9736
10273
|
type ParchmentClient = ReturnType<typeof createParchmentClient>;
|
|
9737
10274
|
|
|
9738
|
-
export { type BriefMatchesQuery, type CatalogItem, type CatalogListQuery, type CatalogProofSummary, type CatalogSimilarQuery, type InventoryCreateRequest, type InventoryUpdateRequest, type MarketSignalsQuery, type MetadataIndexQuery, type ParchmentClient, type ParchmentClientOptions, type PriceIndexQuery, type PriceIndexStatsQuery, type SalesCreateRequest, type SalesListQuery, type SalesUpdateRequest, type SourcingBriefCreateRequest, type components, createParchmentClient, type paths };
|
|
10275
|
+
export { type BriefMatchesQuery, type CatalogItem, type CatalogListQuery, type CatalogProofSummary, type CatalogSimilarQuery, type InventoryCreateRequest, type InventoryUpdateRequest, type MarketSignalsQuery, type MetadataIndexQuery, type ParchmentClient, type ParchmentClientOptions, type PriceIndexQuery, type PriceIndexStatsQuery, type SalesCreateRequest, type SalesListQuery, type SalesUpdateRequest, type SourcingBriefCreateRequest, type TrackedLotMutation, type TrackedLotSummary, type TrackedLotsListQuery, type components, createParchmentClient, type paths };
|
package/dist/index.js
CHANGED
|
@@ -112,6 +112,25 @@ function createParchmentClient(options) {
|
|
|
112
112
|
})
|
|
113
113
|
}
|
|
114
114
|
},
|
|
115
|
+
portfolio: {
|
|
116
|
+
trackedLots: {
|
|
117
|
+
/**
|
|
118
|
+
* List the caller's complete tracked catalog-id set and bounded recent
|
|
119
|
+
* summaries enriched with live catalog state.
|
|
120
|
+
*/
|
|
121
|
+
list: (query) => client.GET("/v1/portfolio/tracked-lots", {
|
|
122
|
+
params: { query }
|
|
123
|
+
}),
|
|
124
|
+
/** Idempotently set a visible catalog lot to tracked. */
|
|
125
|
+
track: (catalogId) => client.PUT("/v1/portfolio/tracked-lots/{catalogId}", {
|
|
126
|
+
params: { path: { catalogId } }
|
|
127
|
+
}),
|
|
128
|
+
/** Idempotently set an owner catalog lot to untracked. */
|
|
129
|
+
untrack: (catalogId) => client.DELETE("/v1/portfolio/tracked-lots/{catalogId}", {
|
|
130
|
+
params: { path: { catalogId } }
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
},
|
|
115
134
|
inventory: {
|
|
116
135
|
/** List the caller's own green-coffee inventory (owner-scoped). */
|
|
117
136
|
list: (query) => client.GET("/v1/inventory", { params: { query } }),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.ts"],"sourcesContent":["import createClient, { type ClientOptions } from \"openapi-fetch\";\nimport type { components, paths } from \"./schema\";\n\nexport interface ParchmentClientOptions {\n /** Base URL of the Parchment API, e.g. https://api.purveyors.io */\n baseUrl: string;\n /**\n * Optional bearer token (a Supabase JWT or, later, an API key). Sent as\n * `Authorization: Bearer <token>`. Auth is resolved server-side against the\n * unified principal model; the SDK only forwards the credential.\n */\n token?: string;\n /** Override the fetch implementation (useful for tests or custom runtimes). */\n fetch?: ClientOptions[\"fetch\"];\n}\n\n/** Query parameters for {@link ParchmentClient.catalog.list}. */\nexport type CatalogListQuery = NonNullable<\n paths[\"/v1/catalog\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** A catalog row returned by the canonical listing resource. */\nexport type CatalogItem = components[\"schemas\"][\"CatalogItem\"];\n/** API-owned row-level trust summary returned when `include=proof`. */\nexport type CatalogProofSummary = components[\"schemas\"][\"CatalogProofSummary\"];\n/** Query parameters for {@link ParchmentClient.catalog.facets}. */\nexport type CatalogFacetsQuery = NonNullable<\n paths[\"/v1/catalog/facets\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/**\n * Optional headers for {@link ParchmentClient.catalog.list}, notably the\n * RFC 7240 `Prefer: handling=lenient|strict` override (PADR-0013 §7). Sending\n * `handling=lenient` opts a strict caller (API key or bearer-session JWT) back\n * into strip-with-notice degradation instead of a 401/403 hard-deny.\n */\nexport type CatalogListHeaders = NonNullable<\n paths[\"/v1/catalog\"][\"get\"][\"parameters\"][\"header\"]\n>;\n/** Optional headers for {@link ParchmentClient.catalog.facets}; see {@link CatalogListHeaders}. */\nexport type CatalogFacetsHeaders = NonNullable<\n paths[\"/v1/catalog/facets\"][\"get\"][\"parameters\"][\"header\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.originPriceStats}. */\nexport type CatalogOriginPriceStatsQuery = NonNullable<\n paths[\"/v1/catalog/origin-price-stats\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.stats}. */\nexport type CatalogStatsQuery = NonNullable<\n paths[\"/v1/catalog/stats\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.rank}. */\nexport type CatalogRankQuery = NonNullable<\n paths[\"/v1/catalog/rank\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.rankPremium}. */\nexport type CatalogRankPremiumQuery = NonNullable<\n paths[\"/v1/catalog/rank-premium\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.suppliers}. */\nexport type CatalogSuppliersQuery = NonNullable<\n paths[\"/v1/catalog/suppliers\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.supplierDetail}. */\nexport type CatalogSupplierDetailQuery = NonNullable<\n paths[\"/v1/catalog/suppliers/detail\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.supplierRank}. */\nexport type CatalogSupplierRankQuery = NonNullable<\n paths[\"/v1/catalog/suppliers/rank\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Optional headers for ranking endpoints; see {@link CatalogListHeaders}. */\nexport type CatalogRankHeaders = NonNullable<\n paths[\"/v1/catalog/rank\"][\"get\"][\"parameters\"][\"header\"]\n>;\n/** Optional headers for premium ranking endpoints; see {@link CatalogListHeaders}. */\nexport type CatalogRankPremiumHeaders = NonNullable<\n paths[\"/v1/catalog/rank-premium\"][\"get\"][\"parameters\"][\"header\"]\n>;\n/** Optional headers for supplier aggregate endpoints; see {@link CatalogListHeaders}. */\nexport type CatalogSupplierHeaders = NonNullable<\n paths[\"/v1/catalog/suppliers\"][\"get\"][\"parameters\"][\"header\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.similar}. */\nexport type CatalogSimilarQuery = NonNullable<\n paths[\"/v1/catalog/{id}/similar\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.priceIndex.list}. */\nexport type PriceIndexQuery = NonNullable<\n paths[\"/v1/price-index\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.market.signals}. */\nexport type MarketSignalsQuery = NonNullable<\n paths[\"/v1/market/signals\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.priceIndex.stats}. */\nexport type PriceIndexStatsQuery = NonNullable<\n paths[\"/v1/price-index/stats\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.market.metadataIndex}. */\nexport type MetadataIndexQuery = NonNullable<\n paths[\"/v1/market/metadata-index\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.procurement.briefs.matches}. */\nexport type BriefMatchesQuery = NonNullable<\n paths[\"/v1/procurement/briefs/{id}/matches\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Request body for {@link ParchmentClient.procurement.briefs.create}. */\nexport type SourcingBriefCreateRequest =\n components[\"schemas\"][\"SourcingBriefCreateRequest\"];\n/** Query parameters for {@link ParchmentClient.inventory.list}. */\nexport type InventoryListQuery = NonNullable<\n paths[\"/v1/inventory\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Request body for {@link ParchmentClient.inventory.create}. */\nexport type InventoryCreateRequest = NonNullable<\n paths[\"/v1/inventory\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.inventory.update}. */\nexport type InventoryUpdateRequest = NonNullable<\n paths[\"/v1/inventory/{id}\"][\"patch\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Query parameters for {@link ParchmentClient.roasts.list}. */\nexport type RoastListQuery = NonNullable<\n paths[\"/v1/roasts\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.roasts.get}. */\nexport type RoastGetQuery = NonNullable<\n paths[\"/v1/roasts/{id}\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Request body for {@link ParchmentClient.roasts.classify}. */\nexport type RoastClassificationRequest = NonNullable<\n paths[\"/v1/roasts/classify\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.roasts.create}. */\nexport type RoastCreateRequest = NonNullable<\n paths[\"/v1/roasts\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.roasts.update}. */\nexport type RoastUpdateRequest = NonNullable<\n paths[\"/v1/roasts/{id}\"][\"patch\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.roasts.import}. */\nexport type RoastImportRequest = NonNullable<\n paths[\"/v1/roasts/imports\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.roasts.replaceArtisanImport}. */\nexport type RoastArtisanImportReplaceRequest = NonNullable<\n paths[\"/v1/roasts/{id}/artisan-import\"][\"put\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Query parameters for {@link ParchmentClient.sales.list}. */\nexport type SalesListQuery = NonNullable<\n paths[\"/v1/sales\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Request body for {@link ParchmentClient.sales.create}. */\nexport type SalesCreateRequest = NonNullable<\n paths[\"/v1/sales\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.sales.update}. */\nexport type SalesUpdateRequest = NonNullable<\n paths[\"/v1/sales/{id}\"][\"patch\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Query parameters for {@link ParchmentClient.tasting.get}. */\nexport type TastingGetQuery = NonNullable<\n paths[\"/v1/tasting/{catalogId}\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Request body for {@link ParchmentClient.tasting.rate}. */\nexport type TastingRateRequest = NonNullable<\n paths[\"/v1/tasting/inventory/{inventoryId}\"][\"put\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.apiKeys.create}. */\nexport type ApiKeyCreateRequest = NonNullable<\n paths[\"/v1/api-keys\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\nexport type CliAuthRequestCreate = NonNullable<\n paths[\"/v1/cli-auth/requests\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\nexport type CliAuthInspectRequest = NonNullable<\n paths[\"/v1/cli-auth/inspect\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\nexport type CliAuthApproveRequest = NonNullable<\n paths[\"/v1/cli-auth/approve\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\nexport type CliAuthExchangeRequest = NonNullable<\n paths[\"/v1/cli-auth/token\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n\n/**\n * Create a typed Parchment API client.\n *\n * The generated core (openapi-fetch over the generated `paths` types) is the\n * contract truth; the named helpers below are the hand-maintained ergonomic\n * layer and grow as endpoints land. `raw` always exposes the underlying typed\n * client for direct path access to anything not yet wrapped.\n */\nexport function createParchmentClient(options: ParchmentClientOptions) {\n const { baseUrl, token, fetch: fetchImpl } = options;\n\n const client = createClient<paths>({\n baseUrl,\n fetch: fetchImpl,\n headers: token ? { Authorization: `Bearer ${token}` } : undefined,\n });\n\n return {\n /** The underlying typed openapi-fetch client for direct path access. */\n raw: client,\n /** Liveness and service identity. */\n health: () => client.GET(\"/health\"),\n /** Resolved principal and entitlements for the caller. */\n me: () => client.GET(\"/v1/me\"),\n apiKeys: {\n /** List API keys owned by the authenticated session user. */\n list: () => client.GET(\"/v1/api-keys\"),\n /** Create an API key. The raw secret is returned only once. */\n create: (body: ApiKeyCreateRequest) =>\n client.POST(\"/v1/api-keys\", { body }),\n /** Revoke an API key owned by the authenticated session user. */\n revoke: (id: string) =>\n client.DELETE(\"/v1/api-keys/{id}\", {\n params: { path: { id } },\n }),\n /** Rotate an API key and return the replacement secret once. */\n rotate: (id: string) =>\n client.POST(\"/v1/api-keys/{id}/rotate\", {\n params: { path: { id } },\n }),\n },\n cliAuth: {\n /** Create a signed, short-lived login request bound to a PKCE challenge. */\n create: (body: CliAuthRequestCreate) =>\n client.POST(\"/v1/cli-auth/requests\", { body }),\n /** Inspect a signed request before displaying the web consent screen. */\n inspect: (body: CliAuthInspectRequest) =>\n client.POST(\"/v1/cli-auth/inspect\", { body }),\n /** Approve a request using the client's authenticated user session. */\n approve: (body: CliAuthApproveRequest) =>\n client.POST(\"/v1/cli-auth/approve\", { body }),\n /** Exchange an approved request and verifier for the one-time raw key. */\n exchange: (body: CliAuthExchangeRequest) =>\n client.POST(\"/v1/cli-auth/token\", { body }),\n },\n catalog: {\n /** Catalog capabilities and visibility for the caller. */\n access: () => client.GET(\"/v1/catalog/access\"),\n /**\n * List public catalog coffees (paginated). Pass `headers` to send the\n * `Prefer: handling=lenient|strict` override (see {@link CatalogListHeaders}).\n */\n list: (query?: CatalogListQuery, headers?: CatalogListHeaders) =>\n client.GET(\"/v1/catalog\", { params: { query, header: headers } }),\n /**\n * Catalog filter metadata and counted facets. Pass `headers` to send the\n * `Prefer: handling=lenient|strict` override (see {@link CatalogFacetsHeaders}).\n */\n facets: (query?: CatalogFacetsQuery, headers?: CatalogFacetsHeaders) =>\n client.GET(\"/v1/catalog/facets\", {\n params: { query, header: headers },\n }),\n /** Live catalog price context by origin. */\n originPriceStats: (query?: CatalogOriginPriceStatsQuery) =>\n client.GET(\"/v1/catalog/origin-price-stats\", { params: { query } }),\n /** Aggregate stats over the caller-visible catalog. */\n stats: (query?: CatalogStatsQuery) =>\n client.GET(\"/v1/catalog/stats\", { params: { query } }),\n /** Rank caller-visible catalog coffees by deterministic objectives. */\n rank: (query?: CatalogRankQuery, headers?: CatalogRankHeaders) =>\n client.GET(\"/v1/catalog/rank\", {\n params: { query, header: headers },\n }),\n /** Rank premium catalog candidates by Purveyor Score. */\n rankPremium: (\n query?: CatalogRankPremiumQuery,\n headers?: CatalogRankPremiumHeaders,\n ) =>\n client.GET(\"/v1/catalog/rank-premium\", {\n params: { query, header: headers },\n }),\n /** List supplier aggregates over caller-visible catalog coffees. */\n suppliers: (\n query?: CatalogSuppliersQuery,\n headers?: CatalogSupplierHeaders,\n ) =>\n client.GET(\"/v1/catalog/suppliers\", {\n params: { query, header: headers },\n }),\n /** Return aggregate detail for a supplier query. */\n supplierDetail: (\n query: CatalogSupplierDetailQuery,\n headers?: CatalogSupplierHeaders,\n ) =>\n client.GET(\"/v1/catalog/suppliers/detail\", {\n params: { query, header: headers },\n }),\n /** Rank suppliers by catalog score and availability. */\n supplierRank: (\n query?: CatalogSupplierRankQuery,\n headers?: CatalogSupplierHeaders,\n ) =>\n client.GET(\"/v1/catalog/suppliers/rank\", {\n params: { query, header: headers },\n }),\n /** Aggregate proof-coverage over the public catalog. */\n proofCoverage: () => client.GET(\"/v1/catalog/proof-coverage\"),\n /** Find catalog coffees similar to a target coffee. */\n similar: (id: string, query?: CatalogSimilarQuery) =>\n client.GET(\"/v1/catalog/{id}/similar\", {\n params: { path: { id }, query },\n }),\n },\n priceIndex: {\n /** Parchment Price Index (aggregate snapshots). */\n list: (query?: PriceIndexQuery) =>\n client.GET(\"/v1/price-index\", { params: { query } }),\n /** Price movement significance stats (precomputed). */\n stats: (query?: PriceIndexStatsQuery) =>\n client.GET(\"/v1/price-index/stats\", { params: { query } }),\n },\n market: {\n /** Actionable market value signals. */\n signals: (query?: MarketSignalsQuery) =>\n client.GET(\"/v1/market/signals\", { params: { query } }),\n /** Metadata-trend index (process/disclosure/Purveyor Score over time). */\n metadataIndex: (query?: MetadataIndexQuery) =>\n client.GET(\"/v1/market/metadata-index\", { params: { query } }),\n },\n procurement: {\n briefs: {\n /** List the caller's saved sourcing briefs. */\n list: () => client.GET(\"/v1/procurement/briefs\"),\n /** Create a saved sourcing brief. */\n create: (body: SourcingBriefCreateRequest) =>\n client.POST(\"/v1/procurement/briefs\", { body }),\n /** Fetch one of the caller's sourcing briefs by id. */\n get: (id: string) =>\n client.GET(\"/v1/procurement/briefs/{id}\", {\n params: { path: { id } },\n }),\n /** Run a saved brief against the catalog (paginated matches). */\n matches: (id: string, query?: BriefMatchesQuery) =>\n client.GET(\"/v1/procurement/briefs/{id}/matches\", {\n params: { path: { id }, query },\n }),\n },\n },\n inventory: {\n /** List the caller's own green-coffee inventory (owner-scoped). */\n list: (query?: InventoryListQuery) =>\n client.GET(\"/v1/inventory\", { params: { query } }),\n /**\n * Create an owner inventory lot. Requires a session or an owner-bound API\n * key carrying the exact `inventory:write` scope. Pass `idempotencyKey`\n * to make retries safe: the same key replays the original result, and a\n * concurrent duplicate gets 409 while the first is in flight.\n */\n create: (\n body: InventoryCreateRequest,\n options?: { idempotencyKey?: string },\n ) =>\n client.POST(\"/v1/inventory\", {\n body,\n params: options?.idempotencyKey\n ? { header: { \"idempotency-key\": options.idempotencyKey } }\n : undefined,\n }),\n /**\n * Update one of the caller's own inventory rows. Pass `ifMatch` (the\n * row's `last_updated`) to enable optimistic concurrency (409 on mismatch).\n */\n update: (\n id: number,\n body: InventoryUpdateRequest,\n options?: { ifMatch?: string },\n ) =>\n client.PATCH(\"/v1/inventory/{id}\", {\n params: {\n path: { id },\n header: options?.ifMatch\n ? { \"if-match\": options.ifMatch }\n : undefined,\n },\n body,\n }),\n /**\n * Delete one of the caller's own inventory rows. Returns 409 if dependent\n * roast profiles or sales exist (no force-cascade).\n */\n delete: (id: number) =>\n client.DELETE(\"/v1/inventory/{id}\", { params: { path: { id } } }),\n },\n roasts: {\n /** Match Artisan roast metadata to one of the supplied inventory rows. */\n classify: (body: RoastClassificationRequest) =>\n client.POST(\"/v1/roasts/classify\", { body }),\n /** List the caller's own roast profiles (owner-scoped). */\n list: (query?: RoastListQuery) =>\n client.GET(\"/v1/roasts\", { params: { query } }),\n /**\n * Fetch one of the caller's roast profiles by id, optionally with its\n * temperature curve (`includeTemps`) and event markers (`includeEvents`).\n */\n get: (id: string, query?: RoastGetQuery) =>\n client.GET(\"/v1/roasts/{id}\", { params: { path: { id }, query } }),\n /**\n * Create an owner roast profile, optionally with nested temperature/event\n * rows. Requires a session or an owner-bound API key carrying the exact\n * `roast:write` scope. Pass `idempotencyKey` to make retries safe.\n */\n create: (\n body: RoastCreateRequest,\n options?: { idempotencyKey?: string },\n ) =>\n client.POST(\"/v1/roasts\", {\n body,\n params: options?.idempotencyKey\n ? { header: { \"idempotency-key\": options.idempotencyKey } }\n : undefined,\n }),\n /**\n * Update one of the caller's own roast profiles. Pass `ifMatch` (the\n * row's `last_updated`) to enable optimistic concurrency (409 on mismatch).\n */\n update: (\n id: number,\n body: RoastUpdateRequest,\n options?: { ifMatch?: string },\n ) =>\n client.PATCH(\"/v1/roasts/{id}\", {\n params: {\n path: { id },\n header: options?.ifMatch\n ? { \"if-match\": options.ifMatch }\n : undefined,\n },\n body,\n }),\n /** Delete one of the caller's own roast profiles. */\n delete: (id: number) =>\n client.DELETE(\"/v1/roasts/{id}\", { params: { path: { id } } }),\n /**\n * Create a roast profile from an Artisan `.alog` file against one of the\n * caller's green-coffee lots, persisting the imported curve, events, and\n * an artisan_import_log entry atomically. Requires a session or an\n * owner-bound API key carrying the exact `roast:write` scope. Pass\n * `idempotencyKey` to make retries safe.\n */\n import: (\n body: RoastImportRequest,\n options?: { idempotencyKey?: string },\n ) =>\n client.POST(\"/v1/roasts/imports\", {\n body,\n params: options?.idempotencyKey\n ? { header: { \"idempotency-key\": options.idempotencyKey } }\n : undefined,\n }),\n /**\n * Replace the Artisan import data on one of the caller's existing roasts,\n * re-deriving its curve, events, and computed metrics while preserving the\n * roast's identity. Pass `ifMatch` (the roast's `last_updated`) to enable\n * optimistic concurrency (409 on mismatch).\n */\n replaceArtisanImport: (\n id: number,\n body: RoastArtisanImportReplaceRequest,\n options?: { ifMatch?: string },\n ) =>\n client.PUT(\"/v1/roasts/{id}/artisan-import\", {\n params: {\n path: { id },\n header: options?.ifMatch\n ? { \"if-match\": options.ifMatch }\n : undefined,\n },\n body,\n }),\n /**\n * Clear import-derived curve, events, metrics, and provenance data from\n * one of the caller's existing roasts without deleting the roast profile.\n */\n clearArtisanImport: (id: number) =>\n client.DELETE(\"/v1/roasts/{id}/artisan-import\", {\n params: { path: { id } },\n }),\n },\n sales: {\n /** List the caller's own sales (owner-scoped). */\n list: (query?: SalesListQuery) =>\n client.GET(\"/v1/sales\", { params: { query } }),\n /**\n * Record a sale against one of the caller's own green-coffee inventory\n * lots. Requires a session or an owner-bound API key carrying the exact\n * `sales:write` scope. Pass `idempotencyKey` to make retries safe: the\n * same key replays the original result, and a concurrent duplicate gets\n * 409 while the first is in flight.\n */\n create: (\n body: SalesCreateRequest,\n options?: { idempotencyKey?: string },\n ) =>\n client.POST(\"/v1/sales\", {\n body,\n params: options?.idempotencyKey\n ? { header: { \"idempotency-key\": options.idempotencyKey } }\n : undefined,\n }),\n /**\n * Update one of the caller's own sales. The sales table carries no\n * `last_updated` column, so no If-Match optimistic concurrency is\n * offered.\n */\n update: (id: number, body: SalesUpdateRequest) =>\n client.PATCH(\"/v1/sales/{id}\", {\n params: { path: { id } },\n body,\n }),\n /** Delete one of the caller's own sales. */\n delete: (id: number) =>\n client.DELETE(\"/v1/sales/{id}\", { params: { path: { id } } }),\n },\n tasting: {\n /** Fetch supplier notes plus the caller's own latest tasting notes. */\n get: (catalogId: string, query?: TastingGetQuery) =>\n client.GET(\"/v1/tasting/{catalogId}\", {\n params: { path: { catalogId }, query },\n }),\n /** Replace the caller's rating for one owned inventory lot. */\n rate: (inventoryId: number, body: TastingRateRequest) =>\n client.PUT(\"/v1/tasting/inventory/{inventoryId}\", {\n params: { path: { inventoryId } },\n body,\n }),\n },\n };\n}\n\nexport type ParchmentClient = ReturnType<typeof createParchmentClient>;\n"],"mappings":";AAAA,OAAO,kBAA0C;AAiM1C,SAAS,sBAAsB,SAAiC;AACrE,QAAM,EAAE,SAAS,OAAO,OAAO,UAAU,IAAI;AAE7C,QAAM,SAAS,aAAoB;AAAA,IACjC;AAAA,IACA,OAAO;AAAA,IACP,SAAS,QAAQ,EAAE,eAAe,UAAU,KAAK,GAAG,IAAI;AAAA,EAC1D,CAAC;AAED,SAAO;AAAA;AAAA,IAEL,KAAK;AAAA;AAAA,IAEL,QAAQ,MAAM,OAAO,IAAI,SAAS;AAAA;AAAA,IAElC,IAAI,MAAM,OAAO,IAAI,QAAQ;AAAA,IAC7B,SAAS;AAAA;AAAA,MAEP,MAAM,MAAM,OAAO,IAAI,cAAc;AAAA;AAAA,MAErC,QAAQ,CAAC,SACP,OAAO,KAAK,gBAAgB,EAAE,KAAK,CAAC;AAAA;AAAA,MAEtC,QAAQ,CAAC,OACP,OAAO,OAAO,qBAAqB;AAAA,QACjC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE;AAAA,MACzB,CAAC;AAAA;AAAA,MAEH,QAAQ,CAAC,OACP,OAAO,KAAK,4BAA4B;AAAA,QACtC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE;AAAA,MACzB,CAAC;AAAA,IACL;AAAA,IACA,SAAS;AAAA;AAAA,MAEP,QAAQ,CAAC,SACP,OAAO,KAAK,yBAAyB,EAAE,KAAK,CAAC;AAAA;AAAA,MAE/C,SAAS,CAAC,SACR,OAAO,KAAK,wBAAwB,EAAE,KAAK,CAAC;AAAA;AAAA,MAE9C,SAAS,CAAC,SACR,OAAO,KAAK,wBAAwB,EAAE,KAAK,CAAC;AAAA;AAAA,MAE9C,UAAU,CAAC,SACT,OAAO,KAAK,sBAAsB,EAAE,KAAK,CAAC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,CAAC;AAAA;AAAA,MAEH,QAAQ,CAAC,OACP,OAAO,OAAO,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;AAAA,IAChE;AAAA,IACA,SAAS;AAAA;AAAA,MAEP,KAAK,CAAC,WAAmB,UACvB,OAAO,IAAI,2BAA2B;AAAA,QACpC,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM;AAAA,MACvC,CAAC;AAAA;AAAA,MAEH,MAAM,CAAC,aAAqB,SAC1B,OAAO,IAAI,uCAAuC;AAAA,QAChD,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE;AAAA,QAChC;AAAA,MACF,CAAC;AAAA,IACL;AAAA,EACF;AACF;","names":["options"]}
|
|
1
|
+
{"version":3,"sources":["../src/client.ts"],"sourcesContent":["import createClient, { type ClientOptions } from \"openapi-fetch\";\nimport type { components, paths } from \"./schema\";\n\nexport interface ParchmentClientOptions {\n /** Base URL of the Parchment API, e.g. https://api.purveyors.io */\n baseUrl: string;\n /**\n * Optional bearer token (a Supabase JWT or, later, an API key). Sent as\n * `Authorization: Bearer <token>`. Auth is resolved server-side against the\n * unified principal model; the SDK only forwards the credential.\n */\n token?: string;\n /** Override the fetch implementation (useful for tests or custom runtimes). */\n fetch?: ClientOptions[\"fetch\"];\n}\n\n/** Query parameters for {@link ParchmentClient.catalog.list}. */\nexport type CatalogListQuery = NonNullable<\n paths[\"/v1/catalog\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** A catalog row returned by the canonical listing resource. */\nexport type CatalogItem = components[\"schemas\"][\"CatalogItem\"];\n/** API-owned row-level trust summary returned when `include=proof`. */\nexport type CatalogProofSummary = components[\"schemas\"][\"CatalogProofSummary\"];\n/** Query parameters for {@link ParchmentClient.catalog.facets}. */\nexport type CatalogFacetsQuery = NonNullable<\n paths[\"/v1/catalog/facets\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/**\n * Optional headers for {@link ParchmentClient.catalog.list}, notably the\n * RFC 7240 `Prefer: handling=lenient|strict` override (PADR-0013 §7). Sending\n * `handling=lenient` opts a strict caller (API key or bearer-session JWT) back\n * into strip-with-notice degradation instead of a 401/403 hard-deny.\n */\nexport type CatalogListHeaders = NonNullable<\n paths[\"/v1/catalog\"][\"get\"][\"parameters\"][\"header\"]\n>;\n/** Optional headers for {@link ParchmentClient.catalog.facets}; see {@link CatalogListHeaders}. */\nexport type CatalogFacetsHeaders = NonNullable<\n paths[\"/v1/catalog/facets\"][\"get\"][\"parameters\"][\"header\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.originPriceStats}. */\nexport type CatalogOriginPriceStatsQuery = NonNullable<\n paths[\"/v1/catalog/origin-price-stats\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.stats}. */\nexport type CatalogStatsQuery = NonNullable<\n paths[\"/v1/catalog/stats\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.rank}. */\nexport type CatalogRankQuery = NonNullable<\n paths[\"/v1/catalog/rank\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.rankPremium}. */\nexport type CatalogRankPremiumQuery = NonNullable<\n paths[\"/v1/catalog/rank-premium\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.suppliers}. */\nexport type CatalogSuppliersQuery = NonNullable<\n paths[\"/v1/catalog/suppliers\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.supplierDetail}. */\nexport type CatalogSupplierDetailQuery = NonNullable<\n paths[\"/v1/catalog/suppliers/detail\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.supplierRank}. */\nexport type CatalogSupplierRankQuery = NonNullable<\n paths[\"/v1/catalog/suppliers/rank\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Optional headers for ranking endpoints; see {@link CatalogListHeaders}. */\nexport type CatalogRankHeaders = NonNullable<\n paths[\"/v1/catalog/rank\"][\"get\"][\"parameters\"][\"header\"]\n>;\n/** Optional headers for premium ranking endpoints; see {@link CatalogListHeaders}. */\nexport type CatalogRankPremiumHeaders = NonNullable<\n paths[\"/v1/catalog/rank-premium\"][\"get\"][\"parameters\"][\"header\"]\n>;\n/** Optional headers for supplier aggregate endpoints; see {@link CatalogListHeaders}. */\nexport type CatalogSupplierHeaders = NonNullable<\n paths[\"/v1/catalog/suppliers\"][\"get\"][\"parameters\"][\"header\"]\n>;\n/** Query parameters for {@link ParchmentClient.catalog.similar}. */\nexport type CatalogSimilarQuery = NonNullable<\n paths[\"/v1/catalog/{id}/similar\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.priceIndex.list}. */\nexport type PriceIndexQuery = NonNullable<\n paths[\"/v1/price-index\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.market.signals}. */\nexport type MarketSignalsQuery = NonNullable<\n paths[\"/v1/market/signals\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.priceIndex.stats}. */\nexport type PriceIndexStatsQuery = NonNullable<\n paths[\"/v1/price-index/stats\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.market.metadataIndex}. */\nexport type MetadataIndexQuery = NonNullable<\n paths[\"/v1/market/metadata-index\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.procurement.briefs.matches}. */\nexport type BriefMatchesQuery = NonNullable<\n paths[\"/v1/procurement/briefs/{id}/matches\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Request body for {@link ParchmentClient.procurement.briefs.create}. */\nexport type SourcingBriefCreateRequest =\n components[\"schemas\"][\"SourcingBriefCreateRequest\"];\n/** Query parameters for {@link ParchmentClient.portfolio.trackedLots.list}. */\nexport type TrackedLotsListQuery = NonNullable<\n paths[\"/v1/portfolio/tracked-lots\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** A tracked catalog lot enriched with current catalog and price state. */\nexport type TrackedLotSummary = components[\"schemas\"][\"TrackedLotSummary\"];\n/** State returned by tracked-lot PUT and DELETE mutations. */\nexport type TrackedLotMutation =\n components[\"schemas\"][\"TrackedLotMutationResponse\"];\n/** Query parameters for {@link ParchmentClient.inventory.list}. */\nexport type InventoryListQuery = NonNullable<\n paths[\"/v1/inventory\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Request body for {@link ParchmentClient.inventory.create}. */\nexport type InventoryCreateRequest = NonNullable<\n paths[\"/v1/inventory\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.inventory.update}. */\nexport type InventoryUpdateRequest = NonNullable<\n paths[\"/v1/inventory/{id}\"][\"patch\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Query parameters for {@link ParchmentClient.roasts.list}. */\nexport type RoastListQuery = NonNullable<\n paths[\"/v1/roasts\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Query parameters for {@link ParchmentClient.roasts.get}. */\nexport type RoastGetQuery = NonNullable<\n paths[\"/v1/roasts/{id}\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Request body for {@link ParchmentClient.roasts.classify}. */\nexport type RoastClassificationRequest = NonNullable<\n paths[\"/v1/roasts/classify\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.roasts.create}. */\nexport type RoastCreateRequest = NonNullable<\n paths[\"/v1/roasts\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.roasts.update}. */\nexport type RoastUpdateRequest = NonNullable<\n paths[\"/v1/roasts/{id}\"][\"patch\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.roasts.import}. */\nexport type RoastImportRequest = NonNullable<\n paths[\"/v1/roasts/imports\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.roasts.replaceArtisanImport}. */\nexport type RoastArtisanImportReplaceRequest = NonNullable<\n paths[\"/v1/roasts/{id}/artisan-import\"][\"put\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Query parameters for {@link ParchmentClient.sales.list}. */\nexport type SalesListQuery = NonNullable<\n paths[\"/v1/sales\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Request body for {@link ParchmentClient.sales.create}. */\nexport type SalesCreateRequest = NonNullable<\n paths[\"/v1/sales\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.sales.update}. */\nexport type SalesUpdateRequest = NonNullable<\n paths[\"/v1/sales/{id}\"][\"patch\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Query parameters for {@link ParchmentClient.tasting.get}. */\nexport type TastingGetQuery = NonNullable<\n paths[\"/v1/tasting/{catalogId}\"][\"get\"][\"parameters\"][\"query\"]\n>;\n/** Request body for {@link ParchmentClient.tasting.rate}. */\nexport type TastingRateRequest = NonNullable<\n paths[\"/v1/tasting/inventory/{inventoryId}\"][\"put\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n/** Request body for {@link ParchmentClient.apiKeys.create}. */\nexport type ApiKeyCreateRequest = NonNullable<\n paths[\"/v1/api-keys\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\nexport type CliAuthRequestCreate = NonNullable<\n paths[\"/v1/cli-auth/requests\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\nexport type CliAuthInspectRequest = NonNullable<\n paths[\"/v1/cli-auth/inspect\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\nexport type CliAuthApproveRequest = NonNullable<\n paths[\"/v1/cli-auth/approve\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\nexport type CliAuthExchangeRequest = NonNullable<\n paths[\"/v1/cli-auth/token\"][\"post\"][\"requestBody\"]\n>[\"content\"][\"application/json\"];\n\n/**\n * Create a typed Parchment API client.\n *\n * The generated core (openapi-fetch over the generated `paths` types) is the\n * contract truth; the named helpers below are the hand-maintained ergonomic\n * layer and grow as endpoints land. `raw` always exposes the underlying typed\n * client for direct path access to anything not yet wrapped.\n */\nexport function createParchmentClient(options: ParchmentClientOptions) {\n const { baseUrl, token, fetch: fetchImpl } = options;\n\n const client = createClient<paths>({\n baseUrl,\n fetch: fetchImpl,\n headers: token ? { Authorization: `Bearer ${token}` } : undefined,\n });\n\n return {\n /** The underlying typed openapi-fetch client for direct path access. */\n raw: client,\n /** Liveness and service identity. */\n health: () => client.GET(\"/health\"),\n /** Resolved principal and entitlements for the caller. */\n me: () => client.GET(\"/v1/me\"),\n apiKeys: {\n /** List API keys owned by the authenticated session user. */\n list: () => client.GET(\"/v1/api-keys\"),\n /** Create an API key. The raw secret is returned only once. */\n create: (body: ApiKeyCreateRequest) =>\n client.POST(\"/v1/api-keys\", { body }),\n /** Revoke an API key owned by the authenticated session user. */\n revoke: (id: string) =>\n client.DELETE(\"/v1/api-keys/{id}\", {\n params: { path: { id } },\n }),\n /** Rotate an API key and return the replacement secret once. */\n rotate: (id: string) =>\n client.POST(\"/v1/api-keys/{id}/rotate\", {\n params: { path: { id } },\n }),\n },\n cliAuth: {\n /** Create a signed, short-lived login request bound to a PKCE challenge. */\n create: (body: CliAuthRequestCreate) =>\n client.POST(\"/v1/cli-auth/requests\", { body }),\n /** Inspect a signed request before displaying the web consent screen. */\n inspect: (body: CliAuthInspectRequest) =>\n client.POST(\"/v1/cli-auth/inspect\", { body }),\n /** Approve a request using the client's authenticated user session. */\n approve: (body: CliAuthApproveRequest) =>\n client.POST(\"/v1/cli-auth/approve\", { body }),\n /** Exchange an approved request and verifier for the one-time raw key. */\n exchange: (body: CliAuthExchangeRequest) =>\n client.POST(\"/v1/cli-auth/token\", { body }),\n },\n catalog: {\n /** Catalog capabilities and visibility for the caller. */\n access: () => client.GET(\"/v1/catalog/access\"),\n /**\n * List public catalog coffees (paginated). Pass `headers` to send the\n * `Prefer: handling=lenient|strict` override (see {@link CatalogListHeaders}).\n */\n list: (query?: CatalogListQuery, headers?: CatalogListHeaders) =>\n client.GET(\"/v1/catalog\", { params: { query, header: headers } }),\n /**\n * Catalog filter metadata and counted facets. Pass `headers` to send the\n * `Prefer: handling=lenient|strict` override (see {@link CatalogFacetsHeaders}).\n */\n facets: (query?: CatalogFacetsQuery, headers?: CatalogFacetsHeaders) =>\n client.GET(\"/v1/catalog/facets\", {\n params: { query, header: headers },\n }),\n /** Live catalog price context by origin. */\n originPriceStats: (query?: CatalogOriginPriceStatsQuery) =>\n client.GET(\"/v1/catalog/origin-price-stats\", { params: { query } }),\n /** Aggregate stats over the caller-visible catalog. */\n stats: (query?: CatalogStatsQuery) =>\n client.GET(\"/v1/catalog/stats\", { params: { query } }),\n /** Rank caller-visible catalog coffees by deterministic objectives. */\n rank: (query?: CatalogRankQuery, headers?: CatalogRankHeaders) =>\n client.GET(\"/v1/catalog/rank\", {\n params: { query, header: headers },\n }),\n /** Rank premium catalog candidates by Purveyor Score. */\n rankPremium: (\n query?: CatalogRankPremiumQuery,\n headers?: CatalogRankPremiumHeaders,\n ) =>\n client.GET(\"/v1/catalog/rank-premium\", {\n params: { query, header: headers },\n }),\n /** List supplier aggregates over caller-visible catalog coffees. */\n suppliers: (\n query?: CatalogSuppliersQuery,\n headers?: CatalogSupplierHeaders,\n ) =>\n client.GET(\"/v1/catalog/suppliers\", {\n params: { query, header: headers },\n }),\n /** Return aggregate detail for a supplier query. */\n supplierDetail: (\n query: CatalogSupplierDetailQuery,\n headers?: CatalogSupplierHeaders,\n ) =>\n client.GET(\"/v1/catalog/suppliers/detail\", {\n params: { query, header: headers },\n }),\n /** Rank suppliers by catalog score and availability. */\n supplierRank: (\n query?: CatalogSupplierRankQuery,\n headers?: CatalogSupplierHeaders,\n ) =>\n client.GET(\"/v1/catalog/suppliers/rank\", {\n params: { query, header: headers },\n }),\n /** Aggregate proof-coverage over the public catalog. */\n proofCoverage: () => client.GET(\"/v1/catalog/proof-coverage\"),\n /** Find catalog coffees similar to a target coffee. */\n similar: (id: string, query?: CatalogSimilarQuery) =>\n client.GET(\"/v1/catalog/{id}/similar\", {\n params: { path: { id }, query },\n }),\n },\n priceIndex: {\n /** Parchment Price Index (aggregate snapshots). */\n list: (query?: PriceIndexQuery) =>\n client.GET(\"/v1/price-index\", { params: { query } }),\n /** Price movement significance stats (precomputed). */\n stats: (query?: PriceIndexStatsQuery) =>\n client.GET(\"/v1/price-index/stats\", { params: { query } }),\n },\n market: {\n /** Actionable market value signals. */\n signals: (query?: MarketSignalsQuery) =>\n client.GET(\"/v1/market/signals\", { params: { query } }),\n /** Metadata-trend index (process/disclosure/Purveyor Score over time). */\n metadataIndex: (query?: MetadataIndexQuery) =>\n client.GET(\"/v1/market/metadata-index\", { params: { query } }),\n },\n procurement: {\n briefs: {\n /** List the caller's saved sourcing briefs. */\n list: () => client.GET(\"/v1/procurement/briefs\"),\n /** Create a saved sourcing brief. */\n create: (body: SourcingBriefCreateRequest) =>\n client.POST(\"/v1/procurement/briefs\", { body }),\n /** Fetch one of the caller's sourcing briefs by id. */\n get: (id: string) =>\n client.GET(\"/v1/procurement/briefs/{id}\", {\n params: { path: { id } },\n }),\n /** Run a saved brief against the catalog (paginated matches). */\n matches: (id: string, query?: BriefMatchesQuery) =>\n client.GET(\"/v1/procurement/briefs/{id}/matches\", {\n params: { path: { id }, query },\n }),\n },\n },\n portfolio: {\n trackedLots: {\n /**\n * List the caller's complete tracked catalog-id set and bounded recent\n * summaries enriched with live catalog state.\n */\n list: (query?: TrackedLotsListQuery) =>\n client.GET(\"/v1/portfolio/tracked-lots\", {\n params: { query },\n }),\n /** Idempotently set a visible catalog lot to tracked. */\n track: (catalogId: number) =>\n client.PUT(\"/v1/portfolio/tracked-lots/{catalogId}\", {\n params: { path: { catalogId } },\n }),\n /** Idempotently set an owner catalog lot to untracked. */\n untrack: (catalogId: number) =>\n client.DELETE(\"/v1/portfolio/tracked-lots/{catalogId}\", {\n params: { path: { catalogId } },\n }),\n },\n },\n inventory: {\n /** List the caller's own green-coffee inventory (owner-scoped). */\n list: (query?: InventoryListQuery) =>\n client.GET(\"/v1/inventory\", { params: { query } }),\n /**\n * Create an owner inventory lot. Requires a session or an owner-bound API\n * key carrying the exact `inventory:write` scope. Pass `idempotencyKey`\n * to make retries safe: the same key replays the original result, and a\n * concurrent duplicate gets 409 while the first is in flight.\n */\n create: (\n body: InventoryCreateRequest,\n options?: { idempotencyKey?: string },\n ) =>\n client.POST(\"/v1/inventory\", {\n body,\n params: options?.idempotencyKey\n ? { header: { \"idempotency-key\": options.idempotencyKey } }\n : undefined,\n }),\n /**\n * Update one of the caller's own inventory rows. Pass `ifMatch` (the\n * row's `last_updated`) to enable optimistic concurrency (409 on mismatch).\n */\n update: (\n id: number,\n body: InventoryUpdateRequest,\n options?: { ifMatch?: string },\n ) =>\n client.PATCH(\"/v1/inventory/{id}\", {\n params: {\n path: { id },\n header: options?.ifMatch\n ? { \"if-match\": options.ifMatch }\n : undefined,\n },\n body,\n }),\n /**\n * Delete one of the caller's own inventory rows. Returns 409 if dependent\n * roast profiles or sales exist (no force-cascade).\n */\n delete: (id: number) =>\n client.DELETE(\"/v1/inventory/{id}\", { params: { path: { id } } }),\n },\n roasts: {\n /** Match Artisan roast metadata to one of the supplied inventory rows. */\n classify: (body: RoastClassificationRequest) =>\n client.POST(\"/v1/roasts/classify\", { body }),\n /** List the caller's own roast profiles (owner-scoped). */\n list: (query?: RoastListQuery) =>\n client.GET(\"/v1/roasts\", { params: { query } }),\n /**\n * Fetch one of the caller's roast profiles by id, optionally with its\n * temperature curve (`includeTemps`) and event markers (`includeEvents`).\n */\n get: (id: string, query?: RoastGetQuery) =>\n client.GET(\"/v1/roasts/{id}\", { params: { path: { id }, query } }),\n /**\n * Create an owner roast profile, optionally with nested temperature/event\n * rows. Requires a session or an owner-bound API key carrying the exact\n * `roast:write` scope. Pass `idempotencyKey` to make retries safe.\n */\n create: (\n body: RoastCreateRequest,\n options?: { idempotencyKey?: string },\n ) =>\n client.POST(\"/v1/roasts\", {\n body,\n params: options?.idempotencyKey\n ? { header: { \"idempotency-key\": options.idempotencyKey } }\n : undefined,\n }),\n /**\n * Update one of the caller's own roast profiles. Pass `ifMatch` (the\n * row's `last_updated`) to enable optimistic concurrency (409 on mismatch).\n */\n update: (\n id: number,\n body: RoastUpdateRequest,\n options?: { ifMatch?: string },\n ) =>\n client.PATCH(\"/v1/roasts/{id}\", {\n params: {\n path: { id },\n header: options?.ifMatch\n ? { \"if-match\": options.ifMatch }\n : undefined,\n },\n body,\n }),\n /** Delete one of the caller's own roast profiles. */\n delete: (id: number) =>\n client.DELETE(\"/v1/roasts/{id}\", { params: { path: { id } } }),\n /**\n * Create a roast profile from an Artisan `.alog` file against one of the\n * caller's green-coffee lots, persisting the imported curve, events, and\n * an artisan_import_log entry atomically. Requires a session or an\n * owner-bound API key carrying the exact `roast:write` scope. Pass\n * `idempotencyKey` to make retries safe.\n */\n import: (\n body: RoastImportRequest,\n options?: { idempotencyKey?: string },\n ) =>\n client.POST(\"/v1/roasts/imports\", {\n body,\n params: options?.idempotencyKey\n ? { header: { \"idempotency-key\": options.idempotencyKey } }\n : undefined,\n }),\n /**\n * Replace the Artisan import data on one of the caller's existing roasts,\n * re-deriving its curve, events, and computed metrics while preserving the\n * roast's identity. Pass `ifMatch` (the roast's `last_updated`) to enable\n * optimistic concurrency (409 on mismatch).\n */\n replaceArtisanImport: (\n id: number,\n body: RoastArtisanImportReplaceRequest,\n options?: { ifMatch?: string },\n ) =>\n client.PUT(\"/v1/roasts/{id}/artisan-import\", {\n params: {\n path: { id },\n header: options?.ifMatch\n ? { \"if-match\": options.ifMatch }\n : undefined,\n },\n body,\n }),\n /**\n * Clear import-derived curve, events, metrics, and provenance data from\n * one of the caller's existing roasts without deleting the roast profile.\n */\n clearArtisanImport: (id: number) =>\n client.DELETE(\"/v1/roasts/{id}/artisan-import\", {\n params: { path: { id } },\n }),\n },\n sales: {\n /** List the caller's own sales (owner-scoped). */\n list: (query?: SalesListQuery) =>\n client.GET(\"/v1/sales\", { params: { query } }),\n /**\n * Record a sale against one of the caller's own green-coffee inventory\n * lots. Requires a session or an owner-bound API key carrying the exact\n * `sales:write` scope. Pass `idempotencyKey` to make retries safe: the\n * same key replays the original result, and a concurrent duplicate gets\n * 409 while the first is in flight.\n */\n create: (\n body: SalesCreateRequest,\n options?: { idempotencyKey?: string },\n ) =>\n client.POST(\"/v1/sales\", {\n body,\n params: options?.idempotencyKey\n ? { header: { \"idempotency-key\": options.idempotencyKey } }\n : undefined,\n }),\n /**\n * Update one of the caller's own sales. The sales table carries no\n * `last_updated` column, so no If-Match optimistic concurrency is\n * offered.\n */\n update: (id: number, body: SalesUpdateRequest) =>\n client.PATCH(\"/v1/sales/{id}\", {\n params: { path: { id } },\n body,\n }),\n /** Delete one of the caller's own sales. */\n delete: (id: number) =>\n client.DELETE(\"/v1/sales/{id}\", { params: { path: { id } } }),\n },\n tasting: {\n /** Fetch supplier notes plus the caller's own latest tasting notes. */\n get: (catalogId: string, query?: TastingGetQuery) =>\n client.GET(\"/v1/tasting/{catalogId}\", {\n params: { path: { catalogId }, query },\n }),\n /** Replace the caller's rating for one owned inventory lot. */\n rate: (inventoryId: number, body: TastingRateRequest) =>\n client.PUT(\"/v1/tasting/inventory/{inventoryId}\", {\n params: { path: { inventoryId } },\n body,\n }),\n },\n };\n}\n\nexport type ParchmentClient = ReturnType<typeof createParchmentClient>;\n"],"mappings":";AAAA,OAAO,kBAA0C;AA0M1C,SAAS,sBAAsB,SAAiC;AACrE,QAAM,EAAE,SAAS,OAAO,OAAO,UAAU,IAAI;AAE7C,QAAM,SAAS,aAAoB;AAAA,IACjC;AAAA,IACA,OAAO;AAAA,IACP,SAAS,QAAQ,EAAE,eAAe,UAAU,KAAK,GAAG,IAAI;AAAA,EAC1D,CA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