@weftlabs/sdk 0.32.1 → 0.32.2
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/facilitator/middleware/index.js +1 -1
- package/dist/facilitator/middleware/index.js.map +1 -1
- package/dist/facilitator/middleware/index.mjs +1 -1
- package/dist/facilitator/middleware/index.mjs.map +1 -1
- package/dist/index.d.mts +315 -211
- package/dist/index.d.ts +315 -211
- package/dist/index.js +228 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +228 -0
- package/dist/index.mjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +1 -1
- package/dist/server.mjs.map +1 -1
- package/docs/APIKeysApi.md +3 -1
- package/docs/AuthApi.md +3 -0
- package/docs/PaymentsApi.md +3 -1
- package/docs/WebhooksApi.md +435 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -464,6 +464,7 @@ __export(src_exports, {
|
|
|
464
464
|
WalletProviderEnum: () => WalletProviderEnum,
|
|
465
465
|
WalletToJSON: () => WalletToJSON,
|
|
466
466
|
WalletToJSONTyped: () => WalletToJSONTyped,
|
|
467
|
+
WebhooksApi: () => WebhooksApi,
|
|
467
468
|
WeftClient: () => WeftClient,
|
|
468
469
|
WeftError: () => WeftError,
|
|
469
470
|
X402_FACILITATOR_URL: () => X402_FACILITATOR_URL,
|
|
@@ -5096,6 +5097,7 @@ var PaymentsApi = class extends BaseAPI {
|
|
|
5096
5097
|
return await response.value();
|
|
5097
5098
|
}
|
|
5098
5099
|
/**
|
|
5100
|
+
* Seller payment receipts for the authenticated organization. A resource key with `product_id` set returns only payments whose `product_id` is that product. A resource key with `product_id` nil returns the organization. A payment outside that scope is not found.
|
|
5099
5101
|
* List payments
|
|
5100
5102
|
*/
|
|
5101
5103
|
async listPaymentsRaw(requestParameters, initOverrides) {
|
|
@@ -5124,6 +5126,7 @@ var PaymentsApi = class extends BaseAPI {
|
|
|
5124
5126
|
return new JSONApiResponse(response, (jsonValue) => PaymentListResponseFromJSON(jsonValue));
|
|
5125
5127
|
}
|
|
5126
5128
|
/**
|
|
5129
|
+
* Seller payment receipts for the authenticated organization. A resource key with `product_id` set returns only payments whose `product_id` is that product. A resource key with `product_id` nil returns the organization. A payment outside that scope is not found.
|
|
5127
5130
|
* List payments
|
|
5128
5131
|
*/
|
|
5129
5132
|
async listPayments(requestParameters = {}, initOverrides) {
|
|
@@ -5288,6 +5291,230 @@ var SearchApi = class extends BaseAPI {
|
|
|
5288
5291
|
}
|
|
5289
5292
|
};
|
|
5290
5293
|
|
|
5294
|
+
// src/generated/apis/WebhooksApi.ts
|
|
5295
|
+
var WebhooksApi = class extends BaseAPI {
|
|
5296
|
+
/**
|
|
5297
|
+
* Retired. Returns HTTP 410 with error code `gone`. The body is ignored.
|
|
5298
|
+
* Create a webhook endpoint
|
|
5299
|
+
* @deprecated
|
|
5300
|
+
*/
|
|
5301
|
+
async createWebhookEndpointRaw(initOverrides) {
|
|
5302
|
+
const queryParameters = {};
|
|
5303
|
+
const headerParameters = {};
|
|
5304
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
5305
|
+
const token = this.configuration.accessToken;
|
|
5306
|
+
const tokenString = await token("bearerAuth", []);
|
|
5307
|
+
if (tokenString) {
|
|
5308
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
5309
|
+
}
|
|
5310
|
+
}
|
|
5311
|
+
let urlPath = `/api/v1/webhook_endpoints`;
|
|
5312
|
+
const response = await this.request({
|
|
5313
|
+
path: urlPath,
|
|
5314
|
+
method: "POST",
|
|
5315
|
+
headers: headerParameters,
|
|
5316
|
+
query: queryParameters
|
|
5317
|
+
}, initOverrides);
|
|
5318
|
+
return new VoidApiResponse(response);
|
|
5319
|
+
}
|
|
5320
|
+
/**
|
|
5321
|
+
* Retired. Returns HTTP 410 with error code `gone`. The body is ignored.
|
|
5322
|
+
* Create a webhook endpoint
|
|
5323
|
+
* @deprecated
|
|
5324
|
+
*/
|
|
5325
|
+
async createWebhookEndpoint(initOverrides) {
|
|
5326
|
+
await this.createWebhookEndpointRaw(initOverrides);
|
|
5327
|
+
}
|
|
5328
|
+
/**
|
|
5329
|
+
* Retired. Returns HTTP 410 with error code `gone`. Stored rows are kept.
|
|
5330
|
+
* Delete a webhook endpoint
|
|
5331
|
+
* @deprecated
|
|
5332
|
+
*/
|
|
5333
|
+
async deleteWebhookEndpointRaw(requestParameters, initOverrides) {
|
|
5334
|
+
if (requestParameters["id"] == null) {
|
|
5335
|
+
throw new RequiredError(
|
|
5336
|
+
"id",
|
|
5337
|
+
'Required parameter "id" was null or undefined when calling deleteWebhookEndpoint().'
|
|
5338
|
+
);
|
|
5339
|
+
}
|
|
5340
|
+
const queryParameters = {};
|
|
5341
|
+
const headerParameters = {};
|
|
5342
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
5343
|
+
const token = this.configuration.accessToken;
|
|
5344
|
+
const tokenString = await token("bearerAuth", []);
|
|
5345
|
+
if (tokenString) {
|
|
5346
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
5347
|
+
}
|
|
5348
|
+
}
|
|
5349
|
+
let urlPath = `/api/v1/webhook_endpoints/{id}`;
|
|
5350
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));
|
|
5351
|
+
const response = await this.request({
|
|
5352
|
+
path: urlPath,
|
|
5353
|
+
method: "DELETE",
|
|
5354
|
+
headers: headerParameters,
|
|
5355
|
+
query: queryParameters
|
|
5356
|
+
}, initOverrides);
|
|
5357
|
+
return new VoidApiResponse(response);
|
|
5358
|
+
}
|
|
5359
|
+
/**
|
|
5360
|
+
* Retired. Returns HTTP 410 with error code `gone`. Stored rows are kept.
|
|
5361
|
+
* Delete a webhook endpoint
|
|
5362
|
+
* @deprecated
|
|
5363
|
+
*/
|
|
5364
|
+
async deleteWebhookEndpoint(requestParameters, initOverrides) {
|
|
5365
|
+
await this.deleteWebhookEndpointRaw(requestParameters, initOverrides);
|
|
5366
|
+
}
|
|
5367
|
+
/**
|
|
5368
|
+
* Retired. Returns HTTP 410 with error code `gone`.
|
|
5369
|
+
* Get a webhook endpoint
|
|
5370
|
+
* @deprecated
|
|
5371
|
+
*/
|
|
5372
|
+
async getWebhookEndpointRaw(requestParameters, initOverrides) {
|
|
5373
|
+
if (requestParameters["id"] == null) {
|
|
5374
|
+
throw new RequiredError(
|
|
5375
|
+
"id",
|
|
5376
|
+
'Required parameter "id" was null or undefined when calling getWebhookEndpoint().'
|
|
5377
|
+
);
|
|
5378
|
+
}
|
|
5379
|
+
const queryParameters = {};
|
|
5380
|
+
const headerParameters = {};
|
|
5381
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
5382
|
+
const token = this.configuration.accessToken;
|
|
5383
|
+
const tokenString = await token("bearerAuth", []);
|
|
5384
|
+
if (tokenString) {
|
|
5385
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
5386
|
+
}
|
|
5387
|
+
}
|
|
5388
|
+
let urlPath = `/api/v1/webhook_endpoints/{id}`;
|
|
5389
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));
|
|
5390
|
+
const response = await this.request({
|
|
5391
|
+
path: urlPath,
|
|
5392
|
+
method: "GET",
|
|
5393
|
+
headers: headerParameters,
|
|
5394
|
+
query: queryParameters
|
|
5395
|
+
}, initOverrides);
|
|
5396
|
+
return new VoidApiResponse(response);
|
|
5397
|
+
}
|
|
5398
|
+
/**
|
|
5399
|
+
* Retired. Returns HTTP 410 with error code `gone`.
|
|
5400
|
+
* Get a webhook endpoint
|
|
5401
|
+
* @deprecated
|
|
5402
|
+
*/
|
|
5403
|
+
async getWebhookEndpoint(requestParameters, initOverrides) {
|
|
5404
|
+
await this.getWebhookEndpointRaw(requestParameters, initOverrides);
|
|
5405
|
+
}
|
|
5406
|
+
/**
|
|
5407
|
+
* Retired. Returns HTTP 410 with error code `gone`.
|
|
5408
|
+
* List webhook endpoints
|
|
5409
|
+
* @deprecated
|
|
5410
|
+
*/
|
|
5411
|
+
async listWebhookEndpointsRaw(initOverrides) {
|
|
5412
|
+
const queryParameters = {};
|
|
5413
|
+
const headerParameters = {};
|
|
5414
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
5415
|
+
const token = this.configuration.accessToken;
|
|
5416
|
+
const tokenString = await token("bearerAuth", []);
|
|
5417
|
+
if (tokenString) {
|
|
5418
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
5419
|
+
}
|
|
5420
|
+
}
|
|
5421
|
+
let urlPath = `/api/v1/webhook_endpoints`;
|
|
5422
|
+
const response = await this.request({
|
|
5423
|
+
path: urlPath,
|
|
5424
|
+
method: "GET",
|
|
5425
|
+
headers: headerParameters,
|
|
5426
|
+
query: queryParameters
|
|
5427
|
+
}, initOverrides);
|
|
5428
|
+
return new VoidApiResponse(response);
|
|
5429
|
+
}
|
|
5430
|
+
/**
|
|
5431
|
+
* Retired. Returns HTTP 410 with error code `gone`.
|
|
5432
|
+
* List webhook endpoints
|
|
5433
|
+
* @deprecated
|
|
5434
|
+
*/
|
|
5435
|
+
async listWebhookEndpoints(initOverrides) {
|
|
5436
|
+
await this.listWebhookEndpointsRaw(initOverrides);
|
|
5437
|
+
}
|
|
5438
|
+
/**
|
|
5439
|
+
* Retired. Returns HTTP 410 with error code `gone`. The body is ignored.
|
|
5440
|
+
* Replace a webhook endpoint
|
|
5441
|
+
* @deprecated
|
|
5442
|
+
*/
|
|
5443
|
+
async replaceWebhookEndpointRaw(requestParameters, initOverrides) {
|
|
5444
|
+
if (requestParameters["id"] == null) {
|
|
5445
|
+
throw new RequiredError(
|
|
5446
|
+
"id",
|
|
5447
|
+
'Required parameter "id" was null or undefined when calling replaceWebhookEndpoint().'
|
|
5448
|
+
);
|
|
5449
|
+
}
|
|
5450
|
+
const queryParameters = {};
|
|
5451
|
+
const headerParameters = {};
|
|
5452
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
5453
|
+
const token = this.configuration.accessToken;
|
|
5454
|
+
const tokenString = await token("bearerAuth", []);
|
|
5455
|
+
if (tokenString) {
|
|
5456
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
5457
|
+
}
|
|
5458
|
+
}
|
|
5459
|
+
let urlPath = `/api/v1/webhook_endpoints/{id}`;
|
|
5460
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));
|
|
5461
|
+
const response = await this.request({
|
|
5462
|
+
path: urlPath,
|
|
5463
|
+
method: "PUT",
|
|
5464
|
+
headers: headerParameters,
|
|
5465
|
+
query: queryParameters
|
|
5466
|
+
}, initOverrides);
|
|
5467
|
+
return new VoidApiResponse(response);
|
|
5468
|
+
}
|
|
5469
|
+
/**
|
|
5470
|
+
* Retired. Returns HTTP 410 with error code `gone`. The body is ignored.
|
|
5471
|
+
* Replace a webhook endpoint
|
|
5472
|
+
* @deprecated
|
|
5473
|
+
*/
|
|
5474
|
+
async replaceWebhookEndpoint(requestParameters, initOverrides) {
|
|
5475
|
+
await this.replaceWebhookEndpointRaw(requestParameters, initOverrides);
|
|
5476
|
+
}
|
|
5477
|
+
/**
|
|
5478
|
+
* Retired. Returns HTTP 410 with error code `gone`. The body is ignored.
|
|
5479
|
+
* Update a webhook endpoint
|
|
5480
|
+
* @deprecated
|
|
5481
|
+
*/
|
|
5482
|
+
async updateWebhookEndpointRaw(requestParameters, initOverrides) {
|
|
5483
|
+
if (requestParameters["id"] == null) {
|
|
5484
|
+
throw new RequiredError(
|
|
5485
|
+
"id",
|
|
5486
|
+
'Required parameter "id" was null or undefined when calling updateWebhookEndpoint().'
|
|
5487
|
+
);
|
|
5488
|
+
}
|
|
5489
|
+
const queryParameters = {};
|
|
5490
|
+
const headerParameters = {};
|
|
5491
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
5492
|
+
const token = this.configuration.accessToken;
|
|
5493
|
+
const tokenString = await token("bearerAuth", []);
|
|
5494
|
+
if (tokenString) {
|
|
5495
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
5496
|
+
}
|
|
5497
|
+
}
|
|
5498
|
+
let urlPath = `/api/v1/webhook_endpoints/{id}`;
|
|
5499
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"])));
|
|
5500
|
+
const response = await this.request({
|
|
5501
|
+
path: urlPath,
|
|
5502
|
+
method: "PATCH",
|
|
5503
|
+
headers: headerParameters,
|
|
5504
|
+
query: queryParameters
|
|
5505
|
+
}, initOverrides);
|
|
5506
|
+
return new VoidApiResponse(response);
|
|
5507
|
+
}
|
|
5508
|
+
/**
|
|
5509
|
+
* Retired. Returns HTTP 410 with error code `gone`. The body is ignored.
|
|
5510
|
+
* Update a webhook endpoint
|
|
5511
|
+
* @deprecated
|
|
5512
|
+
*/
|
|
5513
|
+
async updateWebhookEndpoint(requestParameters, initOverrides) {
|
|
5514
|
+
await this.updateWebhookEndpointRaw(requestParameters, initOverrides);
|
|
5515
|
+
}
|
|
5516
|
+
};
|
|
5517
|
+
|
|
5291
5518
|
// src/error.ts
|
|
5292
5519
|
var PRE_SIGN_FETCH_CODES = /* @__PURE__ */ new Set([
|
|
5293
5520
|
"EXCEEDED_MAX_COST",
|
|
@@ -6049,6 +6276,7 @@ __reExport(src_exports, facilitator_exports, module.exports);
|
|
|
6049
6276
|
WalletProviderEnum,
|
|
6050
6277
|
WalletToJSON,
|
|
6051
6278
|
WalletToJSONTyped,
|
|
6279
|
+
WebhooksApi,
|
|
6052
6280
|
WeftClient,
|
|
6053
6281
|
WeftError,
|
|
6054
6282
|
X402_FACILITATOR_URL,
|