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