@purveyors/sdk 0.11.0 → 0.12.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 +260 -96
- package/dist/index.js +11 -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")[];
|
|
205
205
|
};
|
|
206
206
|
};
|
|
207
207
|
};
|
|
@@ -868,7 +868,7 @@ interface paths {
|
|
|
868
868
|
};
|
|
869
869
|
/**
|
|
870
870
|
* List public catalog coffees
|
|
871
|
-
* @description Public catalog listing.
|
|
871
|
+
* @description Public catalog listing. Returns publishable retail and wholesale rows by default using the caller's field projection; set `showWholesale=false` to narrow to hobbyist-friendly suppliers. API-key callers are capped to their plan's per-call row limit. These catalog routes require a Supabase session JWT or Parchment API key. For entitlement-gated params, strict callers (non-demo API keys, bearer-session JWTs) receive a 401/403; lenient callers (first-party cookie-session and the configured public-demo API key) get the params stripped with a `meta.notices` entry. Send `Prefer: handling=strict` to opt into strict enforcement; `Prefer: handling=lenient` is honored only for callers already lenient-eligible and cannot downgrade a strict caller's enforcement.
|
|
872
872
|
*/
|
|
873
873
|
get: {
|
|
874
874
|
parameters: {
|
|
@@ -880,6 +880,7 @@ interface paths {
|
|
|
880
880
|
order?: "asc" | "desc";
|
|
881
881
|
showWholesale?: "true" | "false";
|
|
882
882
|
wholesaleOnly?: "true" | "false";
|
|
883
|
+
include?: "proof";
|
|
883
884
|
origin?: string;
|
|
884
885
|
continent?: string;
|
|
885
886
|
country?: string | string[];
|
|
@@ -963,7 +964,7 @@ interface paths {
|
|
|
963
964
|
};
|
|
964
965
|
/**
|
|
965
966
|
* Catalog filter metadata and counted facets
|
|
966
|
-
* @description Returns access-aware catalog filter metadata. Values are computed after visibility and entitled content filters are applied; premium process metadata
|
|
967
|
+
* @description Returns access-aware catalog filter metadata. Values are computed after visibility and entitled content filters are applied; importer, elevation, appearance, and premium process metadata are included only for member sessions and paid API tiers. These catalog routes require a Supabase session JWT or Parchment API key. For entitlement-gated params, strict callers (non-demo API keys, bearer-session JWTs) receive a 401/403; lenient callers (first-party cookie-session and the configured public-demo API key) get the params stripped with a `meta.notices` entry. Send `Prefer: handling=strict` to opt into strict enforcement; `Prefer: handling=lenient` is honored only for callers already lenient-eligible and cannot downgrade a strict caller's enforcement.
|
|
967
968
|
*/
|
|
968
969
|
get: {
|
|
969
970
|
parameters: {
|
|
@@ -1114,7 +1115,7 @@ interface paths {
|
|
|
1114
1115
|
};
|
|
1115
1116
|
/**
|
|
1116
1117
|
* Aggregate stats over the caller-visible catalog
|
|
1117
|
-
* @description Aggregate catalog stats (total, stocked count, per-origin histogram, average and min/max per-lb display price) computed over the same
|
|
1118
|
+
* @description Aggregate catalog stats (total, stocked count, per-origin histogram, average and min/max per-lb display price) computed over the same caller-visible catalog the /v1/catalog listing exposes. Not a raw table scan. `stocked` defaults to all rows so the stocked count is meaningful; pass `stocked=true|false` to restrict the universe.
|
|
1118
1119
|
*/
|
|
1119
1120
|
get: {
|
|
1120
1121
|
parameters: {
|
|
@@ -1651,7 +1652,7 @@ interface paths {
|
|
|
1651
1652
|
};
|
|
1652
1653
|
/**
|
|
1653
1654
|
* Market value signals (actionable buy signals)
|
|
1654
|
-
* @description Daily actionable value signals over market_signals.
|
|
1655
|
+
* @description Daily actionable value signals over market_signals. Only the exact unfiltered summary=true request is public; item rows and filtered queries require Parchment Intelligence (ppiAccess).
|
|
1655
1656
|
*/
|
|
1656
1657
|
get: {
|
|
1657
1658
|
parameters: {
|
|
@@ -1913,6 +1914,15 @@ interface paths {
|
|
|
1913
1914
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
1914
1915
|
};
|
|
1915
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
|
+
};
|
|
1916
1926
|
};
|
|
1917
1927
|
};
|
|
1918
1928
|
put?: never;
|
|
@@ -1932,7 +1942,7 @@ interface paths {
|
|
|
1932
1942
|
};
|
|
1933
1943
|
/**
|
|
1934
1944
|
* List saved sourcing briefs
|
|
1935
|
-
* @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.
|
|
1936
1946
|
*/
|
|
1937
1947
|
get: {
|
|
1938
1948
|
parameters: {
|
|
@@ -1975,7 +1985,7 @@ interface paths {
|
|
|
1975
1985
|
put?: never;
|
|
1976
1986
|
/**
|
|
1977
1987
|
* Create a sourcing brief
|
|
1978
|
-
* @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.
|
|
1979
1989
|
*/
|
|
1980
1990
|
post: {
|
|
1981
1991
|
parameters: {
|
|
@@ -2043,7 +2053,7 @@ interface paths {
|
|
|
2043
2053
|
};
|
|
2044
2054
|
/**
|
|
2045
2055
|
* Get a sourcing brief
|
|
2046
|
-
* @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.
|
|
2047
2057
|
*/
|
|
2048
2058
|
get: {
|
|
2049
2059
|
parameters: {
|
|
@@ -2111,7 +2121,7 @@ interface paths {
|
|
|
2111
2121
|
};
|
|
2112
2122
|
/**
|
|
2113
2123
|
* Run a sourcing brief against the catalog
|
|
2114
|
-
* @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.
|
|
2115
2125
|
*/
|
|
2116
2126
|
get: {
|
|
2117
2127
|
parameters: {
|
|
@@ -2182,6 +2192,74 @@ interface paths {
|
|
|
2182
2192
|
patch?: never;
|
|
2183
2193
|
trace?: never;
|
|
2184
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
|
+
};
|
|
2185
2263
|
"/v1/inventory": {
|
|
2186
2264
|
parameters: {
|
|
2187
2265
|
query?: never;
|
|
@@ -3931,6 +4009,47 @@ interface components {
|
|
|
3931
4009
|
canExport: boolean;
|
|
3932
4010
|
};
|
|
3933
4011
|
};
|
|
4012
|
+
/** @description API-owned row-level trust summary. Raw evidence is never included. */
|
|
4013
|
+
CatalogProofSummary: {
|
|
4014
|
+
/** @enum {string} */
|
|
4015
|
+
version: "proof-summary-v1";
|
|
4016
|
+
overall: {
|
|
4017
|
+
/** @enum {string} */
|
|
4018
|
+
label: "strong" | "partial" | "limited" | "not_available";
|
|
4019
|
+
families_with_signals: number;
|
|
4020
|
+
};
|
|
4021
|
+
families: {
|
|
4022
|
+
process: {
|
|
4023
|
+
/** @enum {string} */
|
|
4024
|
+
label: "disclosed" | "partial" | "not_available";
|
|
4025
|
+
confidence: number | null;
|
|
4026
|
+
signals: string[];
|
|
4027
|
+
message: string;
|
|
4028
|
+
};
|
|
4029
|
+
provenance: {
|
|
4030
|
+
/** @enum {string} */
|
|
4031
|
+
label: "identified" | "partial" | "not_available";
|
|
4032
|
+
confidence: number | null;
|
|
4033
|
+
signals: string[];
|
|
4034
|
+
message: string;
|
|
4035
|
+
};
|
|
4036
|
+
freshness: {
|
|
4037
|
+
/** @enum {string} */
|
|
4038
|
+
label: "dated" | "not_available";
|
|
4039
|
+
confidence: number | null;
|
|
4040
|
+
signals: string[];
|
|
4041
|
+
message: string;
|
|
4042
|
+
};
|
|
4043
|
+
pricing: {
|
|
4044
|
+
/** @enum {string} */
|
|
4045
|
+
label: "tiered" | "listed" | "not_available";
|
|
4046
|
+
confidence: number | null;
|
|
4047
|
+
signals: string[];
|
|
4048
|
+
message: string;
|
|
4049
|
+
};
|
|
4050
|
+
};
|
|
4051
|
+
limitations: ("not_certification" | "raw_evidence_not_included" | "supplier_verification_not_performed")[];
|
|
4052
|
+
};
|
|
3934
4053
|
CatalogItem: {
|
|
3935
4054
|
id: number;
|
|
3936
4055
|
name?: string | null;
|
|
@@ -3981,6 +4100,7 @@ interface components {
|
|
|
3981
4100
|
unstocked_date?: string | null;
|
|
3982
4101
|
ai_description?: string | null;
|
|
3983
4102
|
ai_tasting_notes?: unknown;
|
|
4103
|
+
proof?: components["schemas"]["CatalogProofSummary"];
|
|
3984
4104
|
};
|
|
3985
4105
|
CatalogListResponse: {
|
|
3986
4106
|
data: components["schemas"]["CatalogItem"][];
|
|
@@ -4001,7 +4121,7 @@ interface components {
|
|
|
4001
4121
|
version: "v1";
|
|
4002
4122
|
auth: {
|
|
4003
4123
|
/** @enum {string} */
|
|
4004
|
-
kind: "
|
|
4124
|
+
kind: "session" | "api-key";
|
|
4005
4125
|
/** @enum {string|null} */
|
|
4006
4126
|
role: "viewer" | "member" | "admin" | null;
|
|
4007
4127
|
/** @enum {string|null} */
|
|
@@ -4179,7 +4299,7 @@ interface components {
|
|
|
4179
4299
|
version: "v1";
|
|
4180
4300
|
auth: {
|
|
4181
4301
|
/** @enum {string} */
|
|
4182
|
-
kind: "
|
|
4302
|
+
kind: "session" | "api-key";
|
|
4183
4303
|
/** @enum {string|null} */
|
|
4184
4304
|
role: "viewer" | "member" | "admin" | null;
|
|
4185
4305
|
/** @enum {string|null} */
|
|
@@ -4227,7 +4347,7 @@ interface components {
|
|
|
4227
4347
|
version: "v1";
|
|
4228
4348
|
auth: {
|
|
4229
4349
|
/** @enum {string} */
|
|
4230
|
-
kind: "
|
|
4350
|
+
kind: "session" | "api-key";
|
|
4231
4351
|
/** @enum {string|null} */
|
|
4232
4352
|
role: "viewer" | "member" | "admin" | null;
|
|
4233
4353
|
/** @enum {string|null} */
|
|
@@ -4293,7 +4413,7 @@ interface components {
|
|
|
4293
4413
|
returned: number;
|
|
4294
4414
|
auth: {
|
|
4295
4415
|
/** @enum {string} */
|
|
4296
|
-
kind: "
|
|
4416
|
+
kind: "session" | "api-key";
|
|
4297
4417
|
/** @enum {string|null} */
|
|
4298
4418
|
role: "viewer" | "member" | "admin" | null;
|
|
4299
4419
|
/** @enum {string|null} */
|
|
@@ -4379,7 +4499,7 @@ interface components {
|
|
|
4379
4499
|
returned: number;
|
|
4380
4500
|
auth: {
|
|
4381
4501
|
/** @enum {string} */
|
|
4382
|
-
kind: "
|
|
4502
|
+
kind: "session" | "api-key";
|
|
4383
4503
|
/** @enum {string|null} */
|
|
4384
4504
|
role: "viewer" | "member" | "admin" | null;
|
|
4385
4505
|
/** @enum {string|null} */
|
|
@@ -4443,7 +4563,7 @@ interface components {
|
|
|
4443
4563
|
returned: number;
|
|
4444
4564
|
auth: {
|
|
4445
4565
|
/** @enum {string} */
|
|
4446
|
-
kind: "
|
|
4566
|
+
kind: "session" | "api-key";
|
|
4447
4567
|
/** @enum {string|null} */
|
|
4448
4568
|
role: "viewer" | "member" | "admin" | null;
|
|
4449
4569
|
/** @enum {string|null} */
|
|
@@ -4481,7 +4601,7 @@ interface components {
|
|
|
4481
4601
|
version: "v1";
|
|
4482
4602
|
auth: {
|
|
4483
4603
|
/** @enum {string} */
|
|
4484
|
-
kind: "
|
|
4604
|
+
kind: "session" | "api-key";
|
|
4485
4605
|
/** @enum {string|null} */
|
|
4486
4606
|
role: "viewer" | "member" | "admin" | null;
|
|
4487
4607
|
/** @enum {string|null} */
|
|
@@ -4897,42 +5017,7 @@ interface components {
|
|
|
4897
5017
|
/** @enum {string|null} */
|
|
4898
5018
|
baseline_source: "price_per_lb" | "price_tiers" | "cost_lb" | null;
|
|
4899
5019
|
};
|
|
4900
|
-
proof:
|
|
4901
|
-
/** @enum {string} */
|
|
4902
|
-
version: "proof-summary-v1";
|
|
4903
|
-
overall: {
|
|
4904
|
-
/** @enum {string} */
|
|
4905
|
-
label: "strong" | "partial" | "limited" | "not_available";
|
|
4906
|
-
families_with_signals: number;
|
|
4907
|
-
};
|
|
4908
|
-
families: {
|
|
4909
|
-
process: {
|
|
4910
|
-
label: string;
|
|
4911
|
-
confidence: number | null;
|
|
4912
|
-
signals: string[];
|
|
4913
|
-
message: string;
|
|
4914
|
-
};
|
|
4915
|
-
provenance: {
|
|
4916
|
-
label: string;
|
|
4917
|
-
confidence: number | null;
|
|
4918
|
-
signals: string[];
|
|
4919
|
-
message: string;
|
|
4920
|
-
};
|
|
4921
|
-
freshness: {
|
|
4922
|
-
label: string;
|
|
4923
|
-
confidence: number | null;
|
|
4924
|
-
signals: string[];
|
|
4925
|
-
message: string;
|
|
4926
|
-
};
|
|
4927
|
-
pricing: {
|
|
4928
|
-
label: string;
|
|
4929
|
-
confidence: number | null;
|
|
4930
|
-
signals: string[];
|
|
4931
|
-
message: string;
|
|
4932
|
-
};
|
|
4933
|
-
};
|
|
4934
|
-
limitations: string[];
|
|
4935
|
-
};
|
|
5020
|
+
proof: components["schemas"]["CatalogProofSummary"];
|
|
4936
5021
|
};
|
|
4937
5022
|
CatalogSimilarityMatch: {
|
|
4938
5023
|
coffee: {
|
|
@@ -4949,42 +5034,7 @@ interface components {
|
|
|
4949
5034
|
stocked: boolean | null;
|
|
4950
5035
|
arrival_date: string | null;
|
|
4951
5036
|
stocked_date: string | null;
|
|
4952
|
-
proof:
|
|
4953
|
-
/** @enum {string} */
|
|
4954
|
-
version: "proof-summary-v1";
|
|
4955
|
-
overall: {
|
|
4956
|
-
/** @enum {string} */
|
|
4957
|
-
label: "strong" | "partial" | "limited" | "not_available";
|
|
4958
|
-
families_with_signals: number;
|
|
4959
|
-
};
|
|
4960
|
-
families: {
|
|
4961
|
-
process: {
|
|
4962
|
-
label: string;
|
|
4963
|
-
confidence: number | null;
|
|
4964
|
-
signals: string[];
|
|
4965
|
-
message: string;
|
|
4966
|
-
};
|
|
4967
|
-
provenance: {
|
|
4968
|
-
label: string;
|
|
4969
|
-
confidence: number | null;
|
|
4970
|
-
signals: string[];
|
|
4971
|
-
message: string;
|
|
4972
|
-
};
|
|
4973
|
-
freshness: {
|
|
4974
|
-
label: string;
|
|
4975
|
-
confidence: number | null;
|
|
4976
|
-
signals: string[];
|
|
4977
|
-
message: string;
|
|
4978
|
-
};
|
|
4979
|
-
pricing: {
|
|
4980
|
-
label: string;
|
|
4981
|
-
confidence: number | null;
|
|
4982
|
-
signals: string[];
|
|
4983
|
-
message: string;
|
|
4984
|
-
};
|
|
4985
|
-
};
|
|
4986
|
-
limitations: string[];
|
|
4987
|
-
};
|
|
5037
|
+
proof: components["schemas"]["CatalogProofSummary"];
|
|
4988
5038
|
};
|
|
4989
5039
|
pricing: {
|
|
4990
5040
|
price_per_lb: number | null;
|
|
@@ -5219,6 +5269,44 @@ interface components {
|
|
|
5219
5269
|
limitations: string[];
|
|
5220
5270
|
};
|
|
5221
5271
|
};
|
|
5272
|
+
TrackedLotSummary: {
|
|
5273
|
+
catalogId: number;
|
|
5274
|
+
trackedAt: string;
|
|
5275
|
+
priceAtTracking: number | null;
|
|
5276
|
+
name: string;
|
|
5277
|
+
source: string | null;
|
|
5278
|
+
country: string | null;
|
|
5279
|
+
region: string | null;
|
|
5280
|
+
processing: string | null;
|
|
5281
|
+
stocked: boolean | null;
|
|
5282
|
+
wholesale: boolean | null;
|
|
5283
|
+
unstockedDate?: string | null;
|
|
5284
|
+
currentPrice: number | null;
|
|
5285
|
+
priceDelta: number | null;
|
|
5286
|
+
};
|
|
5287
|
+
TrackedLotsListResponse: {
|
|
5288
|
+
data: {
|
|
5289
|
+
catalogIds: number[];
|
|
5290
|
+
summaries: components["schemas"]["TrackedLotSummary"][];
|
|
5291
|
+
};
|
|
5292
|
+
meta: {
|
|
5293
|
+
/** @enum {string} */
|
|
5294
|
+
resource: "tracked-lots";
|
|
5295
|
+
/** @enum {string} */
|
|
5296
|
+
namespace: "/v1/portfolio/tracked-lots";
|
|
5297
|
+
/** @enum {string} */
|
|
5298
|
+
version: "v1";
|
|
5299
|
+
auth: {
|
|
5300
|
+
/** @enum {string} */
|
|
5301
|
+
kind: "session" | "api-key";
|
|
5302
|
+
/** @enum {string|null} */
|
|
5303
|
+
role: "admin" | "member" | "viewer" | null;
|
|
5304
|
+
/** @enum {string|null} */
|
|
5305
|
+
apiPlan: "viewer" | "member" | "enterprise" | null;
|
|
5306
|
+
ppiAccess: boolean;
|
|
5307
|
+
};
|
|
5308
|
+
};
|
|
5309
|
+
};
|
|
5222
5310
|
InventoryCatalog: {
|
|
5223
5311
|
id: number;
|
|
5224
5312
|
name: string | null;
|
|
@@ -5418,7 +5506,8 @@ interface components {
|
|
|
5418
5506
|
environmentalTemp?: number | null;
|
|
5419
5507
|
ambientTemp?: number | null;
|
|
5420
5508
|
rorBeanTemp?: number | null;
|
|
5421
|
-
|
|
5509
|
+
/** @enum {string} */
|
|
5510
|
+
dataSource?: "live" | "artisan_import" | "manual";
|
|
5422
5511
|
};
|
|
5423
5512
|
RoastEventInput: {
|
|
5424
5513
|
timeSeconds: number;
|
|
@@ -5906,6 +5995,10 @@ interface ParchmentClientOptions {
|
|
|
5906
5995
|
}
|
|
5907
5996
|
/** Query parameters for {@link ParchmentClient.catalog.list}. */
|
|
5908
5997
|
type CatalogListQuery = NonNullable<paths["/v1/catalog"]["get"]["parameters"]["query"]>;
|
|
5998
|
+
/** A catalog row returned by the canonical listing resource. */
|
|
5999
|
+
type CatalogItem = components["schemas"]["CatalogItem"];
|
|
6000
|
+
/** API-owned row-level trust summary returned when `include=proof`. */
|
|
6001
|
+
type CatalogProofSummary = components["schemas"]["CatalogProofSummary"];
|
|
5909
6002
|
/** Query parameters for {@link ParchmentClient.catalog.facets}. */
|
|
5910
6003
|
type CatalogFacetsQuery = NonNullable<paths["/v1/catalog/facets"]["get"]["parameters"]["query"]>;
|
|
5911
6004
|
/**
|
|
@@ -5951,6 +6044,10 @@ type MetadataIndexQuery = NonNullable<paths["/v1/market/metadata-index"]["get"][
|
|
|
5951
6044
|
type BriefMatchesQuery = NonNullable<paths["/v1/procurement/briefs/{id}/matches"]["get"]["parameters"]["query"]>;
|
|
5952
6045
|
/** Request body for {@link ParchmentClient.procurement.briefs.create}. */
|
|
5953
6046
|
type SourcingBriefCreateRequest = components["schemas"]["SourcingBriefCreateRequest"];
|
|
6047
|
+
/** Query parameters for {@link ParchmentClient.portfolio.trackedLots.list}. */
|
|
6048
|
+
type TrackedLotsListQuery = NonNullable<paths["/v1/portfolio/tracked-lots"]["get"]["parameters"]["query"]>;
|
|
6049
|
+
/** A tracked catalog lot enriched with current catalog and price state. */
|
|
6050
|
+
type TrackedLotSummary = components["schemas"]["TrackedLotSummary"];
|
|
5954
6051
|
/** Query parameters for {@link ParchmentClient.inventory.list}. */
|
|
5955
6052
|
type InventoryListQuery = NonNullable<paths["/v1/inventory"]["get"]["parameters"]["query"]>;
|
|
5956
6053
|
/** Request body for {@link ParchmentClient.inventory.create}. */
|
|
@@ -6205,7 +6302,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
6205
6302
|
content: {
|
|
6206
6303
|
"application/json": {
|
|
6207
6304
|
name: string;
|
|
6208
|
-
scopes?: ("catalog:read" | "inventory:read" | "roast:read" | "sales:read" | "tasting:read" | "inventory:write" | "roast:write" | "sales:write" | "tasting:write")[];
|
|
6305
|
+
scopes?: ("catalog:read" | "inventory:read" | "roast:read" | "sales:read" | "tasting:read" | "portfolio:read" | "inventory:write" | "roast:write" | "sales:write" | "tasting:write")[];
|
|
6209
6306
|
};
|
|
6210
6307
|
};
|
|
6211
6308
|
};
|
|
@@ -6262,7 +6359,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
6262
6359
|
}, {
|
|
6263
6360
|
body: {
|
|
6264
6361
|
name: string;
|
|
6265
|
-
scopes?: ("catalog:read" | "inventory:read" | "roast:read" | "sales:read" | "tasting:read" | "inventory:write" | "roast:write" | "sales:write" | "tasting:write")[];
|
|
6362
|
+
scopes?: ("catalog:read" | "inventory:read" | "roast:read" | "sales:read" | "tasting:read" | "portfolio:read" | "inventory:write" | "roast:write" | "sales:write" | "tasting:write")[];
|
|
6266
6363
|
};
|
|
6267
6364
|
}, `${string}/${string}`>>;
|
|
6268
6365
|
/** Revoke an API key owned by the authenticated session user. */
|
|
@@ -6407,9 +6504,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
6407
6504
|
create: (body: CliAuthRequestCreate) => Promise<openapi_fetch.FetchResponse<{
|
|
6408
6505
|
parameters: {
|
|
6409
6506
|
query?: never;
|
|
6410
|
-
header
|
|
6411
|
-
/** Fetch one of the caller's sourcing briefs by id. */
|
|
6412
|
-
? /** Fetch one of the caller's sourcing briefs by id. */: never;
|
|
6507
|
+
header?: never;
|
|
6413
6508
|
path?: never;
|
|
6414
6509
|
cookie?: never;
|
|
6415
6510
|
};
|
|
@@ -6574,7 +6669,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
6574
6669
|
[name: string]: unknown;
|
|
6575
6670
|
};
|
|
6576
6671
|
content: {
|
|
6577
|
-
"application/json": components["schemas"]
|
|
6672
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
6578
6673
|
};
|
|
6579
6674
|
};
|
|
6580
6675
|
401: {
|
|
@@ -6788,6 +6883,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
6788
6883
|
order?: "asc" | "desc";
|
|
6789
6884
|
showWholesale?: "true" | "false";
|
|
6790
6885
|
wholesaleOnly?: "true" | "false";
|
|
6886
|
+
include?: "proof";
|
|
6791
6887
|
origin?: string;
|
|
6792
6888
|
continent?: string;
|
|
6793
6889
|
country?: string | string[];
|
|
@@ -6860,6 +6956,7 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
6860
6956
|
order?: "asc" | "desc";
|
|
6861
6957
|
showWholesale?: "true" | "false";
|
|
6862
6958
|
wholesaleOnly?: "true" | "false";
|
|
6959
|
+
include?: "proof";
|
|
6863
6960
|
origin?: string;
|
|
6864
6961
|
continent?: string;
|
|
6865
6962
|
country?: string | string[];
|
|
@@ -7568,6 +7665,14 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
7568
7665
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
7569
7666
|
};
|
|
7570
7667
|
};
|
|
7668
|
+
503: {
|
|
7669
|
+
headers: {
|
|
7670
|
+
[name: string]: unknown;
|
|
7671
|
+
};
|
|
7672
|
+
content: {
|
|
7673
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
7674
|
+
};
|
|
7675
|
+
};
|
|
7571
7676
|
};
|
|
7572
7677
|
}, {
|
|
7573
7678
|
params: {
|
|
@@ -8068,6 +8173,65 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
8068
8173
|
}, `${string}/${string}`>>;
|
|
8069
8174
|
};
|
|
8070
8175
|
};
|
|
8176
|
+
portfolio: {
|
|
8177
|
+
trackedLots: {
|
|
8178
|
+
/**
|
|
8179
|
+
* List the caller's complete tracked catalog-id set and bounded recent
|
|
8180
|
+
* summaries enriched with live catalog state.
|
|
8181
|
+
*/
|
|
8182
|
+
list: (query?: TrackedLotsListQuery) => Promise<openapi_fetch.FetchResponse<{
|
|
8183
|
+
parameters: {
|
|
8184
|
+
query?: {
|
|
8185
|
+
summaryLimit?: number | null;
|
|
8186
|
+
};
|
|
8187
|
+
header?: never;
|
|
8188
|
+
path?: never;
|
|
8189
|
+
cookie?: never;
|
|
8190
|
+
};
|
|
8191
|
+
requestBody?: never;
|
|
8192
|
+
responses: {
|
|
8193
|
+
200: {
|
|
8194
|
+
headers: {
|
|
8195
|
+
[name: string]: unknown;
|
|
8196
|
+
};
|
|
8197
|
+
content: {
|
|
8198
|
+
"application/json": components["schemas"]["TrackedLotsListResponse"];
|
|
8199
|
+
};
|
|
8200
|
+
};
|
|
8201
|
+
400: {
|
|
8202
|
+
headers: {
|
|
8203
|
+
[name: string]: unknown;
|
|
8204
|
+
};
|
|
8205
|
+
content: {
|
|
8206
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8207
|
+
};
|
|
8208
|
+
};
|
|
8209
|
+
401: {
|
|
8210
|
+
headers: {
|
|
8211
|
+
[name: string]: unknown;
|
|
8212
|
+
};
|
|
8213
|
+
content: {
|
|
8214
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8215
|
+
};
|
|
8216
|
+
};
|
|
8217
|
+
403: {
|
|
8218
|
+
headers: {
|
|
8219
|
+
[name: string]: unknown;
|
|
8220
|
+
};
|
|
8221
|
+
content: {
|
|
8222
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
8223
|
+
};
|
|
8224
|
+
};
|
|
8225
|
+
};
|
|
8226
|
+
}, {
|
|
8227
|
+
params: {
|
|
8228
|
+
query: {
|
|
8229
|
+
summaryLimit?: number | null;
|
|
8230
|
+
} | undefined;
|
|
8231
|
+
};
|
|
8232
|
+
}, `${string}/${string}`>>;
|
|
8233
|
+
};
|
|
8234
|
+
};
|
|
8071
8235
|
inventory: {
|
|
8072
8236
|
/** List the caller's own green-coffee inventory (owner-scoped). */
|
|
8073
8237
|
list: (query?: InventoryListQuery) => Promise<openapi_fetch.FetchResponse<{
|
|
@@ -9755,4 +9919,4 @@ declare function createParchmentClient(options: ParchmentClientOptions): {
|
|
|
9755
9919
|
};
|
|
9756
9920
|
type ParchmentClient = ReturnType<typeof createParchmentClient>;
|
|
9757
9921
|
|
|
9758
|
-
export { type BriefMatchesQuery, type CatalogListQuery, 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 };
|
|
9922
|
+
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 TrackedLotSummary, type TrackedLotsListQuery, type components, createParchmentClient, type paths };
|
package/dist/index.js
CHANGED
|
@@ -112,6 +112,17 @@ 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
|
+
}
|
|
125
|
+
},
|
|
115
126
|
inventory: {
|
|
116
127
|
/** List the caller's own green-coffee inventory (owner-scoped). */
|
|
117
128
|
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/** 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;AA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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/** 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 },\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;AAuM1C,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,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