@siglume/api-sdk 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/bin/siglume.cjs +1 -161
- package/dist/bin/siglume.cjs.map +1 -1
- package/dist/bin/siglume.js +1 -161
- package/dist/bin/siglume.js.map +1 -1
- package/dist/cli/index.cjs +1 -161
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +3 -116
- package/dist/cli/index.d.ts +3 -116
- package/dist/cli/index.js +1 -161
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +1 -222
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -202
- package/dist/index.d.ts +4 -202
- package/dist/index.js +1 -222
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.d.cts
CHANGED
|
@@ -136,13 +136,6 @@ declare const AppCategory: {
|
|
|
136
136
|
type AppCategory = (typeof AppCategory)[keyof typeof AppCategory];
|
|
137
137
|
interface AppManifest {
|
|
138
138
|
capability_key: string;
|
|
139
|
-
/**
|
|
140
|
-
* LOCAL-ONLY identification. The Siglume platform never reads this on
|
|
141
|
-
* auto_register / confirm_auto_register and rejects submissions that
|
|
142
|
-
* declare a version — the authoritative `release_semver` is controlled
|
|
143
|
-
* by the platform per the bump rules on the confirm endpoint
|
|
144
|
-
* (see `confirm_registration({ version_bump: ... })`).
|
|
145
|
-
*/
|
|
146
139
|
version?: string;
|
|
147
140
|
name: string;
|
|
148
141
|
job_to_be_done: string;
|
|
@@ -159,13 +152,6 @@ interface AppManifest {
|
|
|
159
152
|
applicable_regulations?: string[];
|
|
160
153
|
data_residency?: string;
|
|
161
154
|
short_description?: string;
|
|
162
|
-
/**
|
|
163
|
-
* Long-form sales description shown on the buyer-facing API detail
|
|
164
|
-
* page. Complements `short_description` (one-liner) with a fuller
|
|
165
|
-
* pitch: who this is for, what it can / cannot do, limits, required
|
|
166
|
-
* connected accounts. The Tool Manual is agent-facing and not shown
|
|
167
|
-
* to buyers; put buyer-facing story here.
|
|
168
|
-
*/
|
|
169
155
|
description?: string;
|
|
170
156
|
docs_url?: string;
|
|
171
157
|
support_contact?: string;
|
|
@@ -260,6 +246,7 @@ interface AppListingRecord {
|
|
|
260
246
|
price_value_minor: number;
|
|
261
247
|
currency: string;
|
|
262
248
|
short_description?: string | null;
|
|
249
|
+
description?: string | null;
|
|
263
250
|
docs_url?: string | null;
|
|
264
251
|
support_contact?: string | null;
|
|
265
252
|
seller_display_name?: string | null;
|
|
@@ -1201,61 +1188,8 @@ interface AgentThreadRecord {
|
|
|
1201
1188
|
items: NetworkContentDetail[];
|
|
1202
1189
|
raw: Record<string, unknown>;
|
|
1203
1190
|
}
|
|
1204
|
-
declare const RefundReason: {
|
|
1205
|
-
readonly CUSTOMER_REQUEST: "customer-request";
|
|
1206
|
-
readonly DUPLICATE: "duplicate";
|
|
1207
|
-
readonly FRAUDULENT: "fraudulent";
|
|
1208
|
-
readonly SERVICE_FAILURE: "service-failure";
|
|
1209
|
-
readonly GOODWILL: "goodwill";
|
|
1210
|
-
};
|
|
1211
|
-
type RefundReason = (typeof RefundReason)[keyof typeof RefundReason];
|
|
1212
|
-
declare const DisputeResponse: {
|
|
1213
|
-
readonly ACCEPT: "accept";
|
|
1214
|
-
readonly CONTEST: "contest";
|
|
1215
|
-
};
|
|
1216
|
-
type DisputeResponse = (typeof DisputeResponse)[keyof typeof DisputeResponse];
|
|
1217
|
-
interface RefundRecord {
|
|
1218
|
-
refund_id: string;
|
|
1219
|
-
receipt_id: string;
|
|
1220
|
-
owner_user_id?: string | null;
|
|
1221
|
-
payment_mandate_id?: string | null;
|
|
1222
|
-
usage_event_id?: string | null;
|
|
1223
|
-
chain_receipt_id?: string | null;
|
|
1224
|
-
amount_minor: number;
|
|
1225
|
-
currency: string;
|
|
1226
|
-
status: string;
|
|
1227
|
-
reason_code: string;
|
|
1228
|
-
note?: string | null;
|
|
1229
|
-
idempotency_key?: string | null;
|
|
1230
|
-
on_chain_tx_hash?: string | null;
|
|
1231
|
-
metadata: Record<string, unknown>;
|
|
1232
|
-
idempotent_replay: boolean;
|
|
1233
|
-
created_at?: string | null;
|
|
1234
|
-
updated_at?: string | null;
|
|
1235
|
-
raw: Record<string, unknown>;
|
|
1236
|
-
}
|
|
1237
|
-
interface DisputeRecord {
|
|
1238
|
-
dispute_id: string;
|
|
1239
|
-
receipt_id: string;
|
|
1240
|
-
owner_user_id?: string | null;
|
|
1241
|
-
payment_mandate_id?: string | null;
|
|
1242
|
-
usage_event_id?: string | null;
|
|
1243
|
-
external_dispute_id?: string | null;
|
|
1244
|
-
status: string;
|
|
1245
|
-
reason_code: string;
|
|
1246
|
-
description?: string | null;
|
|
1247
|
-
evidence: Record<string, unknown>;
|
|
1248
|
-
response_decision?: string | null;
|
|
1249
|
-
response_note?: string | null;
|
|
1250
|
-
responded_at?: string | null;
|
|
1251
|
-
metadata: Record<string, unknown>;
|
|
1252
|
-
idempotent_replay: boolean;
|
|
1253
|
-
created_at?: string | null;
|
|
1254
|
-
updated_at?: string | null;
|
|
1255
|
-
raw: Record<string, unknown>;
|
|
1256
|
-
}
|
|
1257
1191
|
|
|
1258
|
-
declare const WEBHOOK_EVENT_TYPES: readonly ["subscription.created", "subscription.renewed", "subscription.cancelled", "subscription.paused", "subscription.reinstated", "
|
|
1192
|
+
declare const WEBHOOK_EVENT_TYPES: readonly ["subscription.created", "subscription.renewed", "subscription.cancelled", "subscription.paused", "subscription.reinstated", "payment.succeeded", "payment.failed", "capability.published", "capability.delisted", "execution.completed", "execution.failed"];
|
|
1259
1193
|
type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number];
|
|
1260
1194
|
interface WebhookSubscriptionRecord {
|
|
1261
1195
|
subscription_id: string;
|
|
@@ -1317,15 +1251,6 @@ interface SubscriptionLifecycleEventData extends Record<string, unknown> {
|
|
|
1317
1251
|
currency?: string;
|
|
1318
1252
|
amount_minor?: number;
|
|
1319
1253
|
}
|
|
1320
|
-
interface RefundIssuedEventData extends Record<string, unknown> {
|
|
1321
|
-
refund_id?: string;
|
|
1322
|
-
receipt_id?: string;
|
|
1323
|
-
amount_minor?: number;
|
|
1324
|
-
currency?: string;
|
|
1325
|
-
status?: string;
|
|
1326
|
-
payment_mandate_id?: string;
|
|
1327
|
-
on_chain_tx_hash?: string;
|
|
1328
|
-
}
|
|
1329
1254
|
interface PaymentEventData extends SubscriptionLifecycleEventData {
|
|
1330
1255
|
payment_status?: string;
|
|
1331
1256
|
}
|
|
@@ -1360,14 +1285,10 @@ interface SubscriptionPausedEvent extends WebhookEventBase<"subscription.paused"
|
|
|
1360
1285
|
}
|
|
1361
1286
|
interface SubscriptionReinstatedEvent extends WebhookEventBase<"subscription.reinstated", SubscriptionLifecycleEventData> {
|
|
1362
1287
|
}
|
|
1363
|
-
interface RefundIssuedEvent extends WebhookEventBase<"refund.issued", RefundIssuedEventData> {
|
|
1364
|
-
}
|
|
1365
1288
|
interface PaymentSucceededEvent extends WebhookEventBase<"payment.succeeded", PaymentEventData> {
|
|
1366
1289
|
}
|
|
1367
1290
|
interface PaymentFailedEvent extends WebhookEventBase<"payment.failed", PaymentEventData> {
|
|
1368
1291
|
}
|
|
1369
|
-
interface PaymentDisputedEvent extends WebhookEventBase<"payment.disputed", PaymentEventData> {
|
|
1370
|
-
}
|
|
1371
1292
|
interface CapabilityPublishedEvent extends WebhookEventBase<"capability.published", CapabilityEventData> {
|
|
1372
1293
|
}
|
|
1373
1294
|
interface CapabilityDelistedEvent extends WebhookEventBase<"capability.delisted", CapabilityEventData> {
|
|
@@ -1376,7 +1297,7 @@ interface ExecutionCompletedEvent extends WebhookEventBase<"execution.completed"
|
|
|
1376
1297
|
}
|
|
1377
1298
|
interface ExecutionFailedEvent extends WebhookEventBase<"execution.failed", ExecutionFailedEventData> {
|
|
1378
1299
|
}
|
|
1379
|
-
type SiglumeWebhookEvent = SubscriptionCreatedEvent | SubscriptionRenewedEvent | SubscriptionCancelledEvent | SubscriptionPausedEvent | SubscriptionReinstatedEvent |
|
|
1300
|
+
type SiglumeWebhookEvent = SubscriptionCreatedEvent | SubscriptionRenewedEvent | SubscriptionCancelledEvent | SubscriptionPausedEvent | SubscriptionReinstatedEvent | PaymentSucceededEvent | PaymentFailedEvent | CapabilityPublishedEvent | CapabilityDelistedEvent | ExecutionCompletedEvent | ExecutionFailedEvent;
|
|
1380
1301
|
interface QueuedWebhookEvent {
|
|
1381
1302
|
queued: boolean;
|
|
1382
1303
|
event: SiglumeWebhookEvent;
|
|
@@ -1423,7 +1344,6 @@ interface SiglumeClientShape {
|
|
|
1423
1344
|
source_url?: string;
|
|
1424
1345
|
runtime_validation?: Record<string, unknown>;
|
|
1425
1346
|
oauth_credentials?: Record<string, unknown> | unknown[];
|
|
1426
|
-
metadata?: Record<string, unknown>;
|
|
1427
1347
|
source_context?: Record<string, unknown>;
|
|
1428
1348
|
input_form_spec?: Record<string, unknown>;
|
|
1429
1349
|
}): Promise<AutoRegistrationReceipt>;
|
|
@@ -1865,39 +1785,6 @@ interface SiglumeClientShape {
|
|
|
1865
1785
|
limit?: number;
|
|
1866
1786
|
cursor?: string;
|
|
1867
1787
|
}): Promise<CursorPage<SupportCaseRecord>>;
|
|
1868
|
-
issue_partial_refund(options: {
|
|
1869
|
-
receipt_id: string;
|
|
1870
|
-
amount_minor: number;
|
|
1871
|
-
reason?: RefundReason | string;
|
|
1872
|
-
note?: string;
|
|
1873
|
-
idempotency_key: string;
|
|
1874
|
-
original_amount_minor?: number;
|
|
1875
|
-
}): Promise<RefundRecord>;
|
|
1876
|
-
issue_full_refund(options: {
|
|
1877
|
-
receipt_id: string;
|
|
1878
|
-
reason?: RefundReason | string;
|
|
1879
|
-
note?: string;
|
|
1880
|
-
idempotency_key?: string;
|
|
1881
|
-
}): Promise<RefundRecord>;
|
|
1882
|
-
list_refunds(options?: {
|
|
1883
|
-
receipt_id?: string;
|
|
1884
|
-
limit?: number;
|
|
1885
|
-
}): Promise<RefundRecord[]>;
|
|
1886
|
-
get_refund(refund_id: string): Promise<RefundRecord>;
|
|
1887
|
-
get_refunds_for_receipt(receipt_id: string, options?: {
|
|
1888
|
-
limit?: number;
|
|
1889
|
-
}): Promise<RefundRecord[]>;
|
|
1890
|
-
list_disputes(options?: {
|
|
1891
|
-
receipt_id?: string;
|
|
1892
|
-
limit?: number;
|
|
1893
|
-
}): Promise<DisputeRecord[]>;
|
|
1894
|
-
get_dispute(dispute_id: string): Promise<DisputeRecord>;
|
|
1895
|
-
respond_to_dispute(options: {
|
|
1896
|
-
dispute_id: string;
|
|
1897
|
-
response: DisputeResponse | string;
|
|
1898
|
-
evidence: Record<string, unknown>;
|
|
1899
|
-
note?: string;
|
|
1900
|
-
}): Promise<DisputeRecord>;
|
|
1901
1788
|
create_webhook_subscription(options: {
|
|
1902
1789
|
callback_url: string;
|
|
1903
1790
|
description?: string;
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -136,13 +136,6 @@ declare const AppCategory: {
|
|
|
136
136
|
type AppCategory = (typeof AppCategory)[keyof typeof AppCategory];
|
|
137
137
|
interface AppManifest {
|
|
138
138
|
capability_key: string;
|
|
139
|
-
/**
|
|
140
|
-
* LOCAL-ONLY identification. The Siglume platform never reads this on
|
|
141
|
-
* auto_register / confirm_auto_register and rejects submissions that
|
|
142
|
-
* declare a version — the authoritative `release_semver` is controlled
|
|
143
|
-
* by the platform per the bump rules on the confirm endpoint
|
|
144
|
-
* (see `confirm_registration({ version_bump: ... })`).
|
|
145
|
-
*/
|
|
146
139
|
version?: string;
|
|
147
140
|
name: string;
|
|
148
141
|
job_to_be_done: string;
|
|
@@ -159,13 +152,6 @@ interface AppManifest {
|
|
|
159
152
|
applicable_regulations?: string[];
|
|
160
153
|
data_residency?: string;
|
|
161
154
|
short_description?: string;
|
|
162
|
-
/**
|
|
163
|
-
* Long-form sales description shown on the buyer-facing API detail
|
|
164
|
-
* page. Complements `short_description` (one-liner) with a fuller
|
|
165
|
-
* pitch: who this is for, what it can / cannot do, limits, required
|
|
166
|
-
* connected accounts. The Tool Manual is agent-facing and not shown
|
|
167
|
-
* to buyers; put buyer-facing story here.
|
|
168
|
-
*/
|
|
169
155
|
description?: string;
|
|
170
156
|
docs_url?: string;
|
|
171
157
|
support_contact?: string;
|
|
@@ -260,6 +246,7 @@ interface AppListingRecord {
|
|
|
260
246
|
price_value_minor: number;
|
|
261
247
|
currency: string;
|
|
262
248
|
short_description?: string | null;
|
|
249
|
+
description?: string | null;
|
|
263
250
|
docs_url?: string | null;
|
|
264
251
|
support_contact?: string | null;
|
|
265
252
|
seller_display_name?: string | null;
|
|
@@ -1201,61 +1188,8 @@ interface AgentThreadRecord {
|
|
|
1201
1188
|
items: NetworkContentDetail[];
|
|
1202
1189
|
raw: Record<string, unknown>;
|
|
1203
1190
|
}
|
|
1204
|
-
declare const RefundReason: {
|
|
1205
|
-
readonly CUSTOMER_REQUEST: "customer-request";
|
|
1206
|
-
readonly DUPLICATE: "duplicate";
|
|
1207
|
-
readonly FRAUDULENT: "fraudulent";
|
|
1208
|
-
readonly SERVICE_FAILURE: "service-failure";
|
|
1209
|
-
readonly GOODWILL: "goodwill";
|
|
1210
|
-
};
|
|
1211
|
-
type RefundReason = (typeof RefundReason)[keyof typeof RefundReason];
|
|
1212
|
-
declare const DisputeResponse: {
|
|
1213
|
-
readonly ACCEPT: "accept";
|
|
1214
|
-
readonly CONTEST: "contest";
|
|
1215
|
-
};
|
|
1216
|
-
type DisputeResponse = (typeof DisputeResponse)[keyof typeof DisputeResponse];
|
|
1217
|
-
interface RefundRecord {
|
|
1218
|
-
refund_id: string;
|
|
1219
|
-
receipt_id: string;
|
|
1220
|
-
owner_user_id?: string | null;
|
|
1221
|
-
payment_mandate_id?: string | null;
|
|
1222
|
-
usage_event_id?: string | null;
|
|
1223
|
-
chain_receipt_id?: string | null;
|
|
1224
|
-
amount_minor: number;
|
|
1225
|
-
currency: string;
|
|
1226
|
-
status: string;
|
|
1227
|
-
reason_code: string;
|
|
1228
|
-
note?: string | null;
|
|
1229
|
-
idempotency_key?: string | null;
|
|
1230
|
-
on_chain_tx_hash?: string | null;
|
|
1231
|
-
metadata: Record<string, unknown>;
|
|
1232
|
-
idempotent_replay: boolean;
|
|
1233
|
-
created_at?: string | null;
|
|
1234
|
-
updated_at?: string | null;
|
|
1235
|
-
raw: Record<string, unknown>;
|
|
1236
|
-
}
|
|
1237
|
-
interface DisputeRecord {
|
|
1238
|
-
dispute_id: string;
|
|
1239
|
-
receipt_id: string;
|
|
1240
|
-
owner_user_id?: string | null;
|
|
1241
|
-
payment_mandate_id?: string | null;
|
|
1242
|
-
usage_event_id?: string | null;
|
|
1243
|
-
external_dispute_id?: string | null;
|
|
1244
|
-
status: string;
|
|
1245
|
-
reason_code: string;
|
|
1246
|
-
description?: string | null;
|
|
1247
|
-
evidence: Record<string, unknown>;
|
|
1248
|
-
response_decision?: string | null;
|
|
1249
|
-
response_note?: string | null;
|
|
1250
|
-
responded_at?: string | null;
|
|
1251
|
-
metadata: Record<string, unknown>;
|
|
1252
|
-
idempotent_replay: boolean;
|
|
1253
|
-
created_at?: string | null;
|
|
1254
|
-
updated_at?: string | null;
|
|
1255
|
-
raw: Record<string, unknown>;
|
|
1256
|
-
}
|
|
1257
1191
|
|
|
1258
|
-
declare const WEBHOOK_EVENT_TYPES: readonly ["subscription.created", "subscription.renewed", "subscription.cancelled", "subscription.paused", "subscription.reinstated", "
|
|
1192
|
+
declare const WEBHOOK_EVENT_TYPES: readonly ["subscription.created", "subscription.renewed", "subscription.cancelled", "subscription.paused", "subscription.reinstated", "payment.succeeded", "payment.failed", "capability.published", "capability.delisted", "execution.completed", "execution.failed"];
|
|
1259
1193
|
type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[number];
|
|
1260
1194
|
interface WebhookSubscriptionRecord {
|
|
1261
1195
|
subscription_id: string;
|
|
@@ -1317,15 +1251,6 @@ interface SubscriptionLifecycleEventData extends Record<string, unknown> {
|
|
|
1317
1251
|
currency?: string;
|
|
1318
1252
|
amount_minor?: number;
|
|
1319
1253
|
}
|
|
1320
|
-
interface RefundIssuedEventData extends Record<string, unknown> {
|
|
1321
|
-
refund_id?: string;
|
|
1322
|
-
receipt_id?: string;
|
|
1323
|
-
amount_minor?: number;
|
|
1324
|
-
currency?: string;
|
|
1325
|
-
status?: string;
|
|
1326
|
-
payment_mandate_id?: string;
|
|
1327
|
-
on_chain_tx_hash?: string;
|
|
1328
|
-
}
|
|
1329
1254
|
interface PaymentEventData extends SubscriptionLifecycleEventData {
|
|
1330
1255
|
payment_status?: string;
|
|
1331
1256
|
}
|
|
@@ -1360,14 +1285,10 @@ interface SubscriptionPausedEvent extends WebhookEventBase<"subscription.paused"
|
|
|
1360
1285
|
}
|
|
1361
1286
|
interface SubscriptionReinstatedEvent extends WebhookEventBase<"subscription.reinstated", SubscriptionLifecycleEventData> {
|
|
1362
1287
|
}
|
|
1363
|
-
interface RefundIssuedEvent extends WebhookEventBase<"refund.issued", RefundIssuedEventData> {
|
|
1364
|
-
}
|
|
1365
1288
|
interface PaymentSucceededEvent extends WebhookEventBase<"payment.succeeded", PaymentEventData> {
|
|
1366
1289
|
}
|
|
1367
1290
|
interface PaymentFailedEvent extends WebhookEventBase<"payment.failed", PaymentEventData> {
|
|
1368
1291
|
}
|
|
1369
|
-
interface PaymentDisputedEvent extends WebhookEventBase<"payment.disputed", PaymentEventData> {
|
|
1370
|
-
}
|
|
1371
1292
|
interface CapabilityPublishedEvent extends WebhookEventBase<"capability.published", CapabilityEventData> {
|
|
1372
1293
|
}
|
|
1373
1294
|
interface CapabilityDelistedEvent extends WebhookEventBase<"capability.delisted", CapabilityEventData> {
|
|
@@ -1376,7 +1297,7 @@ interface ExecutionCompletedEvent extends WebhookEventBase<"execution.completed"
|
|
|
1376
1297
|
}
|
|
1377
1298
|
interface ExecutionFailedEvent extends WebhookEventBase<"execution.failed", ExecutionFailedEventData> {
|
|
1378
1299
|
}
|
|
1379
|
-
type SiglumeWebhookEvent = SubscriptionCreatedEvent | SubscriptionRenewedEvent | SubscriptionCancelledEvent | SubscriptionPausedEvent | SubscriptionReinstatedEvent |
|
|
1300
|
+
type SiglumeWebhookEvent = SubscriptionCreatedEvent | SubscriptionRenewedEvent | SubscriptionCancelledEvent | SubscriptionPausedEvent | SubscriptionReinstatedEvent | PaymentSucceededEvent | PaymentFailedEvent | CapabilityPublishedEvent | CapabilityDelistedEvent | ExecutionCompletedEvent | ExecutionFailedEvent;
|
|
1380
1301
|
interface QueuedWebhookEvent {
|
|
1381
1302
|
queued: boolean;
|
|
1382
1303
|
event: SiglumeWebhookEvent;
|
|
@@ -1423,7 +1344,6 @@ interface SiglumeClientShape {
|
|
|
1423
1344
|
source_url?: string;
|
|
1424
1345
|
runtime_validation?: Record<string, unknown>;
|
|
1425
1346
|
oauth_credentials?: Record<string, unknown> | unknown[];
|
|
1426
|
-
metadata?: Record<string, unknown>;
|
|
1427
1347
|
source_context?: Record<string, unknown>;
|
|
1428
1348
|
input_form_spec?: Record<string, unknown>;
|
|
1429
1349
|
}): Promise<AutoRegistrationReceipt>;
|
|
@@ -1865,39 +1785,6 @@ interface SiglumeClientShape {
|
|
|
1865
1785
|
limit?: number;
|
|
1866
1786
|
cursor?: string;
|
|
1867
1787
|
}): Promise<CursorPage<SupportCaseRecord>>;
|
|
1868
|
-
issue_partial_refund(options: {
|
|
1869
|
-
receipt_id: string;
|
|
1870
|
-
amount_minor: number;
|
|
1871
|
-
reason?: RefundReason | string;
|
|
1872
|
-
note?: string;
|
|
1873
|
-
idempotency_key: string;
|
|
1874
|
-
original_amount_minor?: number;
|
|
1875
|
-
}): Promise<RefundRecord>;
|
|
1876
|
-
issue_full_refund(options: {
|
|
1877
|
-
receipt_id: string;
|
|
1878
|
-
reason?: RefundReason | string;
|
|
1879
|
-
note?: string;
|
|
1880
|
-
idempotency_key?: string;
|
|
1881
|
-
}): Promise<RefundRecord>;
|
|
1882
|
-
list_refunds(options?: {
|
|
1883
|
-
receipt_id?: string;
|
|
1884
|
-
limit?: number;
|
|
1885
|
-
}): Promise<RefundRecord[]>;
|
|
1886
|
-
get_refund(refund_id: string): Promise<RefundRecord>;
|
|
1887
|
-
get_refunds_for_receipt(receipt_id: string, options?: {
|
|
1888
|
-
limit?: number;
|
|
1889
|
-
}): Promise<RefundRecord[]>;
|
|
1890
|
-
list_disputes(options?: {
|
|
1891
|
-
receipt_id?: string;
|
|
1892
|
-
limit?: number;
|
|
1893
|
-
}): Promise<DisputeRecord[]>;
|
|
1894
|
-
get_dispute(dispute_id: string): Promise<DisputeRecord>;
|
|
1895
|
-
respond_to_dispute(options: {
|
|
1896
|
-
dispute_id: string;
|
|
1897
|
-
response: DisputeResponse | string;
|
|
1898
|
-
evidence: Record<string, unknown>;
|
|
1899
|
-
note?: string;
|
|
1900
|
-
}): Promise<DisputeRecord>;
|
|
1901
1788
|
create_webhook_subscription(options: {
|
|
1902
1789
|
callback_url: string;
|
|
1903
1790
|
description?: string;
|
package/dist/cli/index.js
CHANGED
|
@@ -119,18 +119,6 @@ function camelCaseFromCapabilityKey(capabilityKey) {
|
|
|
119
119
|
}
|
|
120
120
|
return `${words.map((word) => word[0].toUpperCase() + word.slice(1)).join("")}App`;
|
|
121
121
|
}
|
|
122
|
-
function buildDefaultI18n(manifestPayload) {
|
|
123
|
-
const job = String(manifestPayload.job_to_be_done ?? "").trim();
|
|
124
|
-
const shortDescription = String(
|
|
125
|
-
manifestPayload.short_description ?? manifestPayload.job_to_be_done ?? manifestPayload.name ?? ""
|
|
126
|
-
).trim();
|
|
127
|
-
return {
|
|
128
|
-
job_to_be_done_en: job,
|
|
129
|
-
job_to_be_done_ja: job,
|
|
130
|
-
short_description_en: shortDescription,
|
|
131
|
-
short_description_ja: shortDescription
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
122
|
function buildRegistrationStubSource(manifestPayload, toolManualPayload) {
|
|
135
123
|
const capabilityKey = String(manifestPayload.capability_key ?? "generated-registration");
|
|
136
124
|
const jobToBeDone = String(
|
|
@@ -285,10 +273,8 @@ var init_webhooks = __esm({
|
|
|
285
273
|
"subscription.cancelled",
|
|
286
274
|
"subscription.paused",
|
|
287
275
|
"subscription.reinstated",
|
|
288
|
-
"refund.issued",
|
|
289
276
|
"payment.succeeded",
|
|
290
277
|
"payment.failed",
|
|
291
|
-
"payment.disputed",
|
|
292
278
|
"capability.published",
|
|
293
279
|
"capability.delisted",
|
|
294
280
|
"execution.completed",
|
|
@@ -1328,6 +1314,7 @@ function parseListing(data) {
|
|
|
1328
1314
|
price_value_minor: Number(data.price_value_minor ?? 0),
|
|
1329
1315
|
currency: String(data.currency ?? "USD"),
|
|
1330
1316
|
short_description: stringOrNull(data.short_description),
|
|
1317
|
+
description: stringOrNull(data.description),
|
|
1331
1318
|
docs_url: stringOrNull(data.docs_url),
|
|
1332
1319
|
support_contact: stringOrNull(data.support_contact),
|
|
1333
1320
|
seller_display_name: stringOrNull(data.seller_display_name),
|
|
@@ -2406,50 +2393,6 @@ function parseMarketProposalActionResult(execution) {
|
|
|
2406
2393
|
raw: { ...execution.raw }
|
|
2407
2394
|
};
|
|
2408
2395
|
}
|
|
2409
|
-
function parseRefund(data) {
|
|
2410
|
-
return {
|
|
2411
|
-
refund_id: String(data.refund_id ?? data.id ?? ""),
|
|
2412
|
-
receipt_id: String(data.receipt_id ?? ""),
|
|
2413
|
-
owner_user_id: stringOrNull(data.owner_user_id) ?? void 0,
|
|
2414
|
-
payment_mandate_id: stringOrNull(data.payment_mandate_id) ?? void 0,
|
|
2415
|
-
usage_event_id: stringOrNull(data.usage_event_id) ?? void 0,
|
|
2416
|
-
chain_receipt_id: stringOrNull(data.chain_receipt_id) ?? void 0,
|
|
2417
|
-
amount_minor: Number(data.amount_minor ?? 0),
|
|
2418
|
-
currency: String(data.currency ?? "USD"),
|
|
2419
|
-
status: String(data.status ?? "issued"),
|
|
2420
|
-
reason_code: String(data.reason_code ?? "customer-request"),
|
|
2421
|
-
note: stringOrNull(data.note) ?? void 0,
|
|
2422
|
-
idempotency_key: stringOrNull(data.idempotency_key) ?? void 0,
|
|
2423
|
-
on_chain_tx_hash: stringOrNull(data.on_chain_tx_hash) ?? void 0,
|
|
2424
|
-
metadata: toRecord(data.metadata),
|
|
2425
|
-
idempotent_replay: Boolean(data.idempotent_replay ?? false),
|
|
2426
|
-
created_at: stringOrNull(data.created_at) ?? void 0,
|
|
2427
|
-
updated_at: stringOrNull(data.updated_at) ?? void 0,
|
|
2428
|
-
raw: { ...data }
|
|
2429
|
-
};
|
|
2430
|
-
}
|
|
2431
|
-
function parseDispute(data) {
|
|
2432
|
-
return {
|
|
2433
|
-
dispute_id: String(data.dispute_id ?? data.id ?? ""),
|
|
2434
|
-
receipt_id: String(data.receipt_id ?? ""),
|
|
2435
|
-
owner_user_id: stringOrNull(data.owner_user_id) ?? void 0,
|
|
2436
|
-
payment_mandate_id: stringOrNull(data.payment_mandate_id) ?? void 0,
|
|
2437
|
-
usage_event_id: stringOrNull(data.usage_event_id) ?? void 0,
|
|
2438
|
-
external_dispute_id: stringOrNull(data.external_dispute_id) ?? void 0,
|
|
2439
|
-
status: String(data.status ?? "open"),
|
|
2440
|
-
reason_code: String(data.reason_code ?? "manual-review"),
|
|
2441
|
-
description: stringOrNull(data.description) ?? void 0,
|
|
2442
|
-
evidence: toRecord(data.evidence),
|
|
2443
|
-
response_decision: stringOrNull(data.response_decision) ?? void 0,
|
|
2444
|
-
response_note: stringOrNull(data.response_note) ?? void 0,
|
|
2445
|
-
responded_at: stringOrNull(data.responded_at) ?? void 0,
|
|
2446
|
-
metadata: toRecord(data.metadata),
|
|
2447
|
-
idempotent_replay: Boolean(data.idempotent_replay ?? false),
|
|
2448
|
-
created_at: stringOrNull(data.created_at) ?? void 0,
|
|
2449
|
-
updated_at: stringOrNull(data.updated_at) ?? void 0,
|
|
2450
|
-
raw: { ...data }
|
|
2451
|
-
};
|
|
2452
|
-
}
|
|
2453
2396
|
function cloneJsonLike(value) {
|
|
2454
2397
|
if (Array.isArray(value)) {
|
|
2455
2398
|
return value.map((item) => cloneJsonLike(item));
|
|
@@ -2535,7 +2478,6 @@ var init_client = __esm({
|
|
|
2535
2478
|
const manifestPayload = coerceMapping(manifest, "manifest");
|
|
2536
2479
|
const toolManualPayload = coerceMapping(tool_manual, "tool_manual");
|
|
2537
2480
|
const payload = {
|
|
2538
|
-
i18n: buildDefaultI18n(manifestPayload),
|
|
2539
2481
|
manifest: { ...manifestPayload },
|
|
2540
2482
|
tool_manual: { ...toolManualPayload }
|
|
2541
2483
|
};
|
|
@@ -2556,9 +2498,6 @@ var init_client = __esm({
|
|
|
2556
2498
|
)
|
|
2557
2499
|
} : coerceMapping(options.oauth_credentials, "oauth_credentials");
|
|
2558
2500
|
}
|
|
2559
|
-
if (options.metadata) {
|
|
2560
|
-
payload.metadata = coerceMapping(options.metadata, "metadata");
|
|
2561
|
-
}
|
|
2562
2501
|
if (options.source_context) {
|
|
2563
2502
|
payload.source_context = coerceMapping(options.source_context, "source_context");
|
|
2564
2503
|
}
|
|
@@ -4209,105 +4148,6 @@ ${details}` : summary;
|
|
|
4209
4148
|
fetchNext: next_cursor ? (cursor) => this.list_support_cases({ ...options, cursor }) : void 0
|
|
4210
4149
|
});
|
|
4211
4150
|
}
|
|
4212
|
-
async issue_partial_refund(options) {
|
|
4213
|
-
const receipt_id = String(options.receipt_id ?? "").trim();
|
|
4214
|
-
const idempotency_key = String(options.idempotency_key ?? "").trim();
|
|
4215
|
-
if (!receipt_id) {
|
|
4216
|
-
throw new SiglumeClientError("receipt_id is required.");
|
|
4217
|
-
}
|
|
4218
|
-
if (!idempotency_key) {
|
|
4219
|
-
throw new SiglumeClientError("idempotency_key is required.");
|
|
4220
|
-
}
|
|
4221
|
-
if (!Number.isFinite(options.amount_minor)) {
|
|
4222
|
-
throw new SiglumeClientError("amount_minor must be a finite number.");
|
|
4223
|
-
}
|
|
4224
|
-
const amount_minor = Math.trunc(options.amount_minor);
|
|
4225
|
-
if (amount_minor <= 0) {
|
|
4226
|
-
throw new SiglumeClientError("amount_minor must be positive.");
|
|
4227
|
-
}
|
|
4228
|
-
if (typeof options.original_amount_minor === "number" && amount_minor > Math.trunc(options.original_amount_minor)) {
|
|
4229
|
-
throw new SiglumeClientError("amount_minor cannot exceed the original receipt amount.");
|
|
4230
|
-
}
|
|
4231
|
-
const [data] = await this.request("POST", "/market/refunds", {
|
|
4232
|
-
json_body: {
|
|
4233
|
-
receipt_id,
|
|
4234
|
-
amount_minor,
|
|
4235
|
-
reason_code: options.reason ?? "customer-request",
|
|
4236
|
-
note: options.note,
|
|
4237
|
-
idempotency_key
|
|
4238
|
-
}
|
|
4239
|
-
});
|
|
4240
|
-
return parseRefund(data);
|
|
4241
|
-
}
|
|
4242
|
-
async issue_full_refund(options) {
|
|
4243
|
-
const receipt_id = String(options.receipt_id ?? "").trim();
|
|
4244
|
-
if (!receipt_id) {
|
|
4245
|
-
throw new SiglumeClientError("receipt_id is required.");
|
|
4246
|
-
}
|
|
4247
|
-
const provided_key = String(options.idempotency_key ?? "").trim();
|
|
4248
|
-
const idempotency_key = provided_key || `full-refund:${receipt_id}`;
|
|
4249
|
-
const [data] = await this.request("POST", "/market/refunds", {
|
|
4250
|
-
json_body: {
|
|
4251
|
-
receipt_id,
|
|
4252
|
-
reason_code: options.reason ?? "customer-request",
|
|
4253
|
-
note: options.note,
|
|
4254
|
-
idempotency_key
|
|
4255
|
-
}
|
|
4256
|
-
});
|
|
4257
|
-
return parseRefund(data);
|
|
4258
|
-
}
|
|
4259
|
-
async list_refunds(options = {}) {
|
|
4260
|
-
const [data] = await this.requestAny("GET", "/market/refunds", {
|
|
4261
|
-
params: {
|
|
4262
|
-
receipt_id: options.receipt_id,
|
|
4263
|
-
limit: Math.max(1, Math.min(Math.trunc(options.limit ?? 50), 100))
|
|
4264
|
-
}
|
|
4265
|
-
});
|
|
4266
|
-
if (!Array.isArray(data)) {
|
|
4267
|
-
throw new SiglumeClientError("Expected refunds to be returned as an array.");
|
|
4268
|
-
}
|
|
4269
|
-
return data.filter((item) => isRecord(item)).map(parseRefund);
|
|
4270
|
-
}
|
|
4271
|
-
async get_refund(refund_id) {
|
|
4272
|
-
const [data] = await this.request("GET", `/market/refunds/${refund_id}`);
|
|
4273
|
-
return parseRefund(data);
|
|
4274
|
-
}
|
|
4275
|
-
async get_refunds_for_receipt(receipt_id, options = {}) {
|
|
4276
|
-
return this.list_refunds({ receipt_id, limit: options.limit });
|
|
4277
|
-
}
|
|
4278
|
-
async list_disputes(options = {}) {
|
|
4279
|
-
const [data] = await this.requestAny("GET", "/market/disputes", {
|
|
4280
|
-
params: {
|
|
4281
|
-
receipt_id: options.receipt_id,
|
|
4282
|
-
limit: Math.max(1, Math.min(Math.trunc(options.limit ?? 50), 100))
|
|
4283
|
-
}
|
|
4284
|
-
});
|
|
4285
|
-
if (!Array.isArray(data)) {
|
|
4286
|
-
throw new SiglumeClientError("Expected disputes to be returned as an array.");
|
|
4287
|
-
}
|
|
4288
|
-
return data.filter((item) => isRecord(item)).map(parseDispute);
|
|
4289
|
-
}
|
|
4290
|
-
async get_dispute(dispute_id) {
|
|
4291
|
-
const [data] = await this.request("GET", `/market/disputes/${dispute_id}`);
|
|
4292
|
-
return parseDispute(data);
|
|
4293
|
-
}
|
|
4294
|
-
async respond_to_dispute(options) {
|
|
4295
|
-
const dispute_id = String(options.dispute_id ?? "").trim();
|
|
4296
|
-
if (!dispute_id) {
|
|
4297
|
-
throw new SiglumeClientError("dispute_id is required.");
|
|
4298
|
-
}
|
|
4299
|
-
if (!isRecord(options.evidence)) {
|
|
4300
|
-
throw new SiglumeClientError("evidence must be an object.");
|
|
4301
|
-
}
|
|
4302
|
-
const [data] = await this.request("POST", `/market/disputes/${dispute_id}/respond`, {
|
|
4303
|
-
json_body: {
|
|
4304
|
-
response: options.response,
|
|
4305
|
-
evidence: toRecord(options.evidence),
|
|
4306
|
-
note: options.note
|
|
4307
|
-
}
|
|
4308
|
-
});
|
|
4309
|
-
return parseDispute(data);
|
|
4310
|
-
}
|
|
4311
4151
|
async create_webhook_subscription(options) {
|
|
4312
4152
|
const normalizedEventTypes = options.event_types.map((item) => String(item).trim()).filter((item) => item.length > 0);
|
|
4313
4153
|
if (normalizedEventTypes.length === 0) {
|