@spooled/sdk 1.0.16 → 1.0.17
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-52WBv4Ct.d.cts → index-6vDZKgqp.d.cts} +158 -8
- package/dist/{index-52WBv4Ct.d.ts → index-6vDZKgqp.d.ts} +158 -8
- package/dist/index.cjs +58 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +58 -2
- package/dist/index.js.map +1 -1
- package/dist/worker/index.d.cts +1 -1
- package/dist/worker/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RealtimeConnectionOptions, C as ConnectionState, S as SubscriptionFilter, a as RealtimeEventType, b as RealtimeEvent, c as RetryConfig } from './index-
|
|
2
|
-
export { A as API_VERSION, b5 as AddDependenciesParams, b6 as AddDependenciesResponse,
|
|
1
|
+
import { R as RealtimeConnectionOptions, C as ConnectionState, S as SubscriptionFilter, a as RealtimeEventType, b as RealtimeEvent, c as RetryConfig } from './index-6vDZKgqp.cjs';
|
|
2
|
+
export { A as API_VERSION, b5 as AddDependenciesParams, b6 as AddDependenciesResponse, bU as AdminApiKeyResponse, bW as AdminCreateApiKeyParams, bT as AdminCreateOrganizationParams, bV as AdminCreateOrganizationResponse, bX as AdminDeleteOrganizationParams, bN as AdminListOrganizationsParams, bR as AdminOrganizationDetail, bQ as AdminOrganizationList, bP as AdminOrganizationSummary, b_ as AdminPlanLimits, bZ as AdminPlatformStats, q as AdminResource, bS as AdminUpdateOrganizationParams, bO as AdminUsageStats, be as ApiKeySummary, o as ApiKeysResource, k as AuthResource, as as BatchJobStatus, B as BillingResource, bD as BillingStatus, az as BoostPriorityResponse, aB as BulkEnqueueParams, aC as BulkEnqueueResponse, aA as BulkJobItem, bu as CheckSlugResponse, a1 as CircuitBreaker, h as CircuitBreakerConfig, a2 as CircuitState, au as ClaimJobsParams, av as ClaimJobsResult, at as ClaimedJob, aw as CompleteJobParams, bf as CreateApiKeyParams, bg as CreateApiKeyResponse, bE as CreateBillingPortalParams, bF as CreateBillingPortalResponse, ao as CreateJobParams, ap as CreateJobResult, bk as CreateOrganizationParams, bm as CreateOrganizationResponse, ba as CreateOutgoingWebhookParams, aU as CreateScheduleParams, aV as CreateScheduleResponse, b1 as CreateWorkflowParams, b2 as CreateWorkflowResponse, bA as CurrentUserResponse, i as DEFAULT_CONFIG, bG as DashboardData, p as DashboardResource, bK as DashboardWorkerSummary, D as DebugFn, ah as DependencyMode, ax as FailJobParams, cF as GrpcClientOptions, cK as GrpcCompleteJobParams, cL as GrpcCompleteJobResponse, cl as GrpcCompleteRequest, cm as GrpcCompleteResponse, cI as GrpcDequeueJobParams, cJ as GrpcDequeueJobResponse, cj as GrpcDequeueRequest, ck as GrpcDequeueResponse, cD as GrpcDeregisterRequest, cE as GrpcDeregisterResponse, cG as GrpcEnqueueJobParams, cH as GrpcEnqueueJobResponse, ch as GrpcEnqueueRequest, ci as GrpcEnqueueResponse, cx as GrpcErrorResponse, cM as GrpcFailJobParams, cN as GrpcFailJobResponse, cn as GrpcFailRequest, co as GrpcFailResponse, cr as GrpcGetJobRequest, cs as GrpcGetJobResponse, ct as GrpcGetQueueStatsRequest, cu as GrpcGetQueueStatsResponse, cQ as GrpcGetQueueStatsResponse_Legacy, cT as GrpcHeartbeatParams, cB as GrpcHeartbeatRequest, cC as GrpcHeartbeatResponse, cU as GrpcHeartbeatResponse_Legacy, cg as GrpcJob, cb as GrpcJobStatus, cc as GrpcJobStatusNumber, cw as GrpcProcessRequest, cy as GrpcProcessResponse, c3 as GrpcQueueOperations, cR as GrpcRegisterWorkerParams, cz as GrpcRegisterWorkerRequest, cA as GrpcRegisterWorkerResponse, cS as GrpcRegisterWorkerResponse_Legacy, cO as GrpcRenewLeaseParams, cp as GrpcRenewLeaseRequest, cq as GrpcRenewLeaseResponse, cP as GrpcRenewLeaseResponse_Legacy, cv as GrpcStreamJobsRequest, cd as GrpcTimestamp, c4 as GrpcWorkerOperations, H as HealthResource, bM as HealthResponse, T as HeartbeatEvent, ay as HeartbeatJobParams, a4 as HttpClient, b$ as IngestCustomWebhookParams, c0 as IngestGitHubWebhookOptions, c1 as IngestStripeWebhookOptions, bl as InitialApiKey, am as Job, z as JobCompletedEvent, Z as JobContext, x as JobCreatedEvent, E as JobFailedEvent, Y as JobHandler, F as JobProgressEvent, _ as JobResult, y as JobStartedEvent, ar as JobStats, aa as JobStatus, G as JobStatusChangedEvent, c9 as JobStream, an as JobSummary, bI as JobSummaryStats, b4 as JobWithDependencies, J as JobsResource, a9 as JsonArray, a8 as JsonObject, a6 as JsonPrimitive, a7 as JsonValue, aD as ListDlqParams, aq as ListJobsParams, aj as ListParams, aX as ListSchedulesParams, b3 as ListWorkflowsParams, bw as LoginParams, bx as LoginResponse, M as MetricsResource, bi as Organization, bt as OrganizationMember, bj as OrganizationSummary, bo as OrganizationUsage, O as OrganizationsResource, b9 as OutgoingWebhook, bd as OutgoingWebhookDelivery, ak as PaginatedResponse, ai as PaginationParams, aM as PauseQueueResponse, bY as PlanCount, bp as PlanLimits, ad as PlanTier, ca as ProcessJobsStream, aG as PurgeDlqParams, aH as PurgeDlqResponse, aI as QueueConfig, aJ as QueueConfigSummary, I as QueuePausedEvent, K as QueueResumedEvent, aK as QueueStats, bJ as QueueSummary, Q as QueuesResource, w as RealtimeEventData, bL as RecentActivity, by as RefreshTokenParams, bz as RefreshTokenResponse, aQ as RegisterWorkerParams, aR as RegisterWorkerResponse, g as ResolvedConfig, bq as ResourceUsage, aN as ResumeQueueResponse, aE as RetryDlqParams, aF as RetryDlqResponse, j as SDK_VERSION, aT as Schedule, aZ as ScheduleRun, ae as ScheduleRunStatus, P as ScheduleTriggeredEvent, l as SchedulesResource, d as SpooledClient, f as SpooledClientConfig, c2 as SpooledGrpcClient, t as SpooledRealtime, u as SpooledRealtimeOptions, U as SpooledWorker, V as SpooledWorkerOptions, c8 as StreamOptions, bH as SystemInfo, bc as TestWebhookResponse, aY as TriggerScheduleResponse, bh as UpdateApiKeyParams, bn as UpdateOrganizationParams, bb as UpdateOutgoingWebhookParams, aL as UpdateQueueConfigParams, aW as UpdateScheduleParams, br as UsageItem, bs as UsageWarning, bB as ValidateTokenParams, bC as ValidateTokenResponse, af as WebhookDeliveryStatus, ag as WebhookEventType, s as WebhookIngestionResource, bv as WebhookTokenResponse, n as WebhooksResource, aO as Worker, N as WorkerDeregisteredEvent, $ as WorkerEvent, a0 as WorkerEventData, aS as WorkerHeartbeatParams, L as WorkerRegisteredEvent, X as WorkerState, ab as WorkerStatus, aP as WorkerSummary, W as WorkersResource, a_ as Workflow, b7 as WorkflowJob, b0 as WorkflowJobDefinition, b8 as WorkflowJobStatus, a$ as WorkflowResponse, ac as WorkflowStatus, m as WorkflowsResource, c5 as asyncIterableFromStream, a3 as createCircuitBreaker, e as createClient, a5 as createHttpClient, c6 as createJobStream, al as createPaginatedResponse, c7 as createProcessJobsStream, cf as dateToTimestamp, r as resolveConfig, ce as timestampToDate, v as validateConfig } from './index-6vDZKgqp.cjs';
|
|
3
3
|
import * as protoLoader from '@grpc/proto-loader';
|
|
4
4
|
import { ServiceClientConstructor } from '@grpc/grpc-js';
|
|
5
5
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RealtimeConnectionOptions, C as ConnectionState, S as SubscriptionFilter, a as RealtimeEventType, b as RealtimeEvent, c as RetryConfig } from './index-
|
|
2
|
-
export { A as API_VERSION, b5 as AddDependenciesParams, b6 as AddDependenciesResponse,
|
|
1
|
+
import { R as RealtimeConnectionOptions, C as ConnectionState, S as SubscriptionFilter, a as RealtimeEventType, b as RealtimeEvent, c as RetryConfig } from './index-6vDZKgqp.js';
|
|
2
|
+
export { A as API_VERSION, b5 as AddDependenciesParams, b6 as AddDependenciesResponse, bU as AdminApiKeyResponse, bW as AdminCreateApiKeyParams, bT as AdminCreateOrganizationParams, bV as AdminCreateOrganizationResponse, bX as AdminDeleteOrganizationParams, bN as AdminListOrganizationsParams, bR as AdminOrganizationDetail, bQ as AdminOrganizationList, bP as AdminOrganizationSummary, b_ as AdminPlanLimits, bZ as AdminPlatformStats, q as AdminResource, bS as AdminUpdateOrganizationParams, bO as AdminUsageStats, be as ApiKeySummary, o as ApiKeysResource, k as AuthResource, as as BatchJobStatus, B as BillingResource, bD as BillingStatus, az as BoostPriorityResponse, aB as BulkEnqueueParams, aC as BulkEnqueueResponse, aA as BulkJobItem, bu as CheckSlugResponse, a1 as CircuitBreaker, h as CircuitBreakerConfig, a2 as CircuitState, au as ClaimJobsParams, av as ClaimJobsResult, at as ClaimedJob, aw as CompleteJobParams, bf as CreateApiKeyParams, bg as CreateApiKeyResponse, bE as CreateBillingPortalParams, bF as CreateBillingPortalResponse, ao as CreateJobParams, ap as CreateJobResult, bk as CreateOrganizationParams, bm as CreateOrganizationResponse, ba as CreateOutgoingWebhookParams, aU as CreateScheduleParams, aV as CreateScheduleResponse, b1 as CreateWorkflowParams, b2 as CreateWorkflowResponse, bA as CurrentUserResponse, i as DEFAULT_CONFIG, bG as DashboardData, p as DashboardResource, bK as DashboardWorkerSummary, D as DebugFn, ah as DependencyMode, ax as FailJobParams, cF as GrpcClientOptions, cK as GrpcCompleteJobParams, cL as GrpcCompleteJobResponse, cl as GrpcCompleteRequest, cm as GrpcCompleteResponse, cI as GrpcDequeueJobParams, cJ as GrpcDequeueJobResponse, cj as GrpcDequeueRequest, ck as GrpcDequeueResponse, cD as GrpcDeregisterRequest, cE as GrpcDeregisterResponse, cG as GrpcEnqueueJobParams, cH as GrpcEnqueueJobResponse, ch as GrpcEnqueueRequest, ci as GrpcEnqueueResponse, cx as GrpcErrorResponse, cM as GrpcFailJobParams, cN as GrpcFailJobResponse, cn as GrpcFailRequest, co as GrpcFailResponse, cr as GrpcGetJobRequest, cs as GrpcGetJobResponse, ct as GrpcGetQueueStatsRequest, cu as GrpcGetQueueStatsResponse, cQ as GrpcGetQueueStatsResponse_Legacy, cT as GrpcHeartbeatParams, cB as GrpcHeartbeatRequest, cC as GrpcHeartbeatResponse, cU as GrpcHeartbeatResponse_Legacy, cg as GrpcJob, cb as GrpcJobStatus, cc as GrpcJobStatusNumber, cw as GrpcProcessRequest, cy as GrpcProcessResponse, c3 as GrpcQueueOperations, cR as GrpcRegisterWorkerParams, cz as GrpcRegisterWorkerRequest, cA as GrpcRegisterWorkerResponse, cS as GrpcRegisterWorkerResponse_Legacy, cO as GrpcRenewLeaseParams, cp as GrpcRenewLeaseRequest, cq as GrpcRenewLeaseResponse, cP as GrpcRenewLeaseResponse_Legacy, cv as GrpcStreamJobsRequest, cd as GrpcTimestamp, c4 as GrpcWorkerOperations, H as HealthResource, bM as HealthResponse, T as HeartbeatEvent, ay as HeartbeatJobParams, a4 as HttpClient, b$ as IngestCustomWebhookParams, c0 as IngestGitHubWebhookOptions, c1 as IngestStripeWebhookOptions, bl as InitialApiKey, am as Job, z as JobCompletedEvent, Z as JobContext, x as JobCreatedEvent, E as JobFailedEvent, Y as JobHandler, F as JobProgressEvent, _ as JobResult, y as JobStartedEvent, ar as JobStats, aa as JobStatus, G as JobStatusChangedEvent, c9 as JobStream, an as JobSummary, bI as JobSummaryStats, b4 as JobWithDependencies, J as JobsResource, a9 as JsonArray, a8 as JsonObject, a6 as JsonPrimitive, a7 as JsonValue, aD as ListDlqParams, aq as ListJobsParams, aj as ListParams, aX as ListSchedulesParams, b3 as ListWorkflowsParams, bw as LoginParams, bx as LoginResponse, M as MetricsResource, bi as Organization, bt as OrganizationMember, bj as OrganizationSummary, bo as OrganizationUsage, O as OrganizationsResource, b9 as OutgoingWebhook, bd as OutgoingWebhookDelivery, ak as PaginatedResponse, ai as PaginationParams, aM as PauseQueueResponse, bY as PlanCount, bp as PlanLimits, ad as PlanTier, ca as ProcessJobsStream, aG as PurgeDlqParams, aH as PurgeDlqResponse, aI as QueueConfig, aJ as QueueConfigSummary, I as QueuePausedEvent, K as QueueResumedEvent, aK as QueueStats, bJ as QueueSummary, Q as QueuesResource, w as RealtimeEventData, bL as RecentActivity, by as RefreshTokenParams, bz as RefreshTokenResponse, aQ as RegisterWorkerParams, aR as RegisterWorkerResponse, g as ResolvedConfig, bq as ResourceUsage, aN as ResumeQueueResponse, aE as RetryDlqParams, aF as RetryDlqResponse, j as SDK_VERSION, aT as Schedule, aZ as ScheduleRun, ae as ScheduleRunStatus, P as ScheduleTriggeredEvent, l as SchedulesResource, d as SpooledClient, f as SpooledClientConfig, c2 as SpooledGrpcClient, t as SpooledRealtime, u as SpooledRealtimeOptions, U as SpooledWorker, V as SpooledWorkerOptions, c8 as StreamOptions, bH as SystemInfo, bc as TestWebhookResponse, aY as TriggerScheduleResponse, bh as UpdateApiKeyParams, bn as UpdateOrganizationParams, bb as UpdateOutgoingWebhookParams, aL as UpdateQueueConfigParams, aW as UpdateScheduleParams, br as UsageItem, bs as UsageWarning, bB as ValidateTokenParams, bC as ValidateTokenResponse, af as WebhookDeliveryStatus, ag as WebhookEventType, s as WebhookIngestionResource, bv as WebhookTokenResponse, n as WebhooksResource, aO as Worker, N as WorkerDeregisteredEvent, $ as WorkerEvent, a0 as WorkerEventData, aS as WorkerHeartbeatParams, L as WorkerRegisteredEvent, X as WorkerState, ab as WorkerStatus, aP as WorkerSummary, W as WorkersResource, a_ as Workflow, b7 as WorkflowJob, b0 as WorkflowJobDefinition, b8 as WorkflowJobStatus, a$ as WorkflowResponse, ac as WorkflowStatus, m as WorkflowsResource, c5 as asyncIterableFromStream, a3 as createCircuitBreaker, e as createClient, a5 as createHttpClient, c6 as createJobStream, al as createPaginatedResponse, c7 as createProcessJobsStream, cf as dateToTimestamp, r as resolveConfig, ce as timestampToDate, v as validateConfig } from './index-6vDZKgqp.js';
|
|
3
3
|
import * as protoLoader from '@grpc/proto-loader';
|
|
4
4
|
import { ServiceClientConstructor } from '@grpc/grpc-js';
|
|
5
5
|
|
package/dist/index.js
CHANGED
|
@@ -1214,11 +1214,14 @@ var WorkflowsResource = class {
|
|
|
1214
1214
|
constructor(http) {
|
|
1215
1215
|
this.http = http;
|
|
1216
1216
|
this.jobs = {
|
|
1217
|
+
list: this.listWorkflowJobs.bind(this),
|
|
1218
|
+
get: this.getWorkflowJob.bind(this),
|
|
1219
|
+
getStatus: this.getWorkflowJobsStatus.bind(this),
|
|
1217
1220
|
getDependencies: this.getJobDependencies.bind(this),
|
|
1218
1221
|
addDependencies: this.addJobDependencies.bind(this)
|
|
1219
1222
|
};
|
|
1220
1223
|
}
|
|
1221
|
-
/**
|
|
1224
|
+
/** Workflow job operations */
|
|
1222
1225
|
jobs;
|
|
1223
1226
|
/**
|
|
1224
1227
|
* List all workflows
|
|
@@ -1253,7 +1256,16 @@ var WorkflowsResource = class {
|
|
|
1253
1256
|
async retry(id) {
|
|
1254
1257
|
return this.http.post(`/workflows/${id}/retry`);
|
|
1255
1258
|
}
|
|
1256
|
-
//
|
|
1259
|
+
// Workflow job operations (private implementations)
|
|
1260
|
+
async listWorkflowJobs(workflowId) {
|
|
1261
|
+
return this.http.get(`/workflows/${workflowId}/jobs`);
|
|
1262
|
+
}
|
|
1263
|
+
async getWorkflowJob(workflowId, jobId) {
|
|
1264
|
+
return this.http.get(`/workflows/${workflowId}/jobs/${jobId}`);
|
|
1265
|
+
}
|
|
1266
|
+
async getWorkflowJobsStatus(workflowId) {
|
|
1267
|
+
return this.http.get(`/workflows/${workflowId}/jobs/status`);
|
|
1268
|
+
}
|
|
1257
1269
|
async getJobDependencies(jobId) {
|
|
1258
1270
|
return this.http.get(`/jobs/${jobId}/dependencies`);
|
|
1259
1271
|
}
|
|
@@ -1417,6 +1429,50 @@ var OrganizationsResource = class {
|
|
|
1417
1429
|
async generateSlug(name) {
|
|
1418
1430
|
return this.http.post("/organizations/generate-slug", { name });
|
|
1419
1431
|
}
|
|
1432
|
+
/**
|
|
1433
|
+
* Get the webhook token for the current organization.
|
|
1434
|
+
*
|
|
1435
|
+
* This token is used to verify incoming webhook payloads from Spooled.
|
|
1436
|
+
* Use this token to validate webhook signatures.
|
|
1437
|
+
*
|
|
1438
|
+
* @example
|
|
1439
|
+
* ```typescript
|
|
1440
|
+
* const { token } = await client.organizations.getWebhookToken();
|
|
1441
|
+
* console.log('Webhook token:', token);
|
|
1442
|
+
* ```
|
|
1443
|
+
*/
|
|
1444
|
+
async getWebhookToken() {
|
|
1445
|
+
return this.http.get("/organizations/webhook-token");
|
|
1446
|
+
}
|
|
1447
|
+
/**
|
|
1448
|
+
* Regenerate the webhook token for the current organization.
|
|
1449
|
+
*
|
|
1450
|
+
* This invalidates the old token immediately. All webhook signature
|
|
1451
|
+
* verification using the old token will fail after regeneration.
|
|
1452
|
+
*
|
|
1453
|
+
* @example
|
|
1454
|
+
* ```typescript
|
|
1455
|
+
* const { token: newToken } = await client.organizations.regenerateWebhookToken();
|
|
1456
|
+
* console.log('New webhook token:', newToken);
|
|
1457
|
+
* ```
|
|
1458
|
+
*/
|
|
1459
|
+
async regenerateWebhookToken() {
|
|
1460
|
+
return this.http.post("/organizations/webhook-token/regenerate");
|
|
1461
|
+
}
|
|
1462
|
+
/**
|
|
1463
|
+
* Clear/delete the webhook token for the current organization.
|
|
1464
|
+
*
|
|
1465
|
+
* After this, webhook signature verification will fail until a new
|
|
1466
|
+
* token is generated via regenerateWebhookToken().
|
|
1467
|
+
*
|
|
1468
|
+
* @example
|
|
1469
|
+
* ```typescript
|
|
1470
|
+
* await client.organizations.clearWebhookToken();
|
|
1471
|
+
* ```
|
|
1472
|
+
*/
|
|
1473
|
+
async clearWebhookToken() {
|
|
1474
|
+
await this.http.post("/organizations/webhook-token/clear");
|
|
1475
|
+
}
|
|
1420
1476
|
};
|
|
1421
1477
|
|
|
1422
1478
|
// src/resources/billing.ts
|