@kahitsan/plugin-sdk 0.7.1 → 0.7.3

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.
@@ -1,2 +1,2 @@
1
- export { buildFlow, FlowSteps, runFlow, defineFlow, node, edge } from "./index.js";
2
- export type { FlowDefinition, FlowNodeDef, FlowNodeKind, FlowPort, FlowNode, ExecFlow, ExecNode, FlowContext, NodeExec } from "./index.js";
1
+ export { buildFlow, FlowSteps, runFlow, defineFlow, node, edge, resourceFlows } from "./index.js";
2
+ export type { FlowDefinition, FlowNodeDef, FlowNodeKind, FlowPort, FlowNode, ExecFlow, ExecNode, FlowContext, NodeExec, ResourceFlows, ResourceFlowsConfig } from "./index.js";
@@ -111,6 +111,7 @@ async function runRequest(node2, ctx) {
111
111
  init.headers = { "Content-Type": "application/json" };
112
112
  }
113
113
  const res = await ctx.fetch(spec.url, init);
114
+ ctx.state[`${node2.id}__ok`] = res.ok;
114
115
  if (res.ok) {
115
116
  ctx.state[node2.id] = await res.json().catch(() => null);
116
117
  } else {
package/dist/index.d.ts CHANGED
@@ -793,5 +793,18 @@ type ExecFlow = Omit<FlowDefinition, "nodes"> & {
793
793
  nodes: ExecNode[];
794
794
  };
795
795
  declare function runFlow(flow: ExecFlow, startId: string, ctx: FlowContext): Promise<void>;
796
- export { FlowSteps, IDENTITY_HEADER, INTERNAL_SECRET_HEADER, MIGRATION_ADVISORY_LOCK_KEY, MigrationBuilder, PROTOCOL_VERSION, PluginUnavailableError, Types, applyTenantContext, asyncHandler, buildFlow, buildResourceRouter, buildResourceServices, callPlugin, checkInternalSecret, checkProtocol, compileCreateTable, composeWhere, createPlugin, createPluginServer, defineFlow, defineJob, defineResource, defineSchema, edge, escapeLike, identityHeaderOf, indexExpr, isWorkspaceElevated, loadMigrations, makeDataSurface, makeDatabaseService, migration, mountPluginServices, mountWsReceiver, node, parseIdentity, quoteIdent, readIdentity, requireAuth, requirePermission, requireWorkspace, resolveEngine, resourceMigrations, rollbackMigration, runFlow, runMigrationList, runMigrations, runWithTenantContext, s3DeleteObject, s3Enabled, s3GetObject, s3KeyFromUrl, s3PresignUrl, s3PublicUrl, s3PutObject, searchFragment, statusFilter, tenant, tryCallPlugin, verifyIdentity, withTenantContext };
797
- export type { AdditionalMount, AuthProvider, AuthProviderDecl, AuthService, AuthenticatedUser, BackfillOpts, ColumnDef, ColumnDefault, ColumnKind, ColumnOpts, CompileTableOpts, CoreServices, CreatePluginServerOptions, DataSurface, DecimalOpts, DefinedResource, Engine, EscapeHatch, ExecFlow, ExecNode, FindOpts, FlowContext, FlowDefinition, FlowNode, FlowNodeDef, FlowNodeKind, FlowPort, ForwardedIdentity, Identity, IndexMember, IndexOpts, Logger, MemberDTO, Migration, MigrationContext, MigrationOpts, NodeExec, PermissionsService, PluginAsset, PluginAssets, PluginContext, PluginDb, PluginDefinition, PluginEvents, PluginInitInput, PluginInitOutput, PluginKernel, PluginManifest, PluginPeer, PluginRouterFactory, PluginRpc, PluginServerContext, PluginServerHandle, PluginServicesFactory, PluginSettings, PresignedAsset, ResourceColumns, ResourceCreateSpec, ResourceField, ResourceFields, ResourceFilter, ResourceIndex, ResourceListSpec, ResourcePagination, ResourceRouterDeps, ResourceSearch, ResourceService, ResourceSoftDelete, ResourceSort, ResourceSpec, ResourceUpdateSpec, RunMigrationsOptions, SchemaDef, SqlFragment, StringOpts, TableDef, TenantContext, TenantDb, WhereOpts, WorkspaceDTO, WsReceiverOptions };
796
+ interface ResourceFlowsConfig {
797
+ readonly id: string;
798
+ readonly noun: string;
799
+ readonly basePath: string;
800
+ }
801
+ interface ResourceFlows {
802
+ readonly createFlow: ExecFlow;
803
+ readonly editFlow: ExecFlow;
804
+ readonly archiveFlow: ExecFlow;
805
+ readonly restoreFlow: ExecFlow;
806
+ readonly all: readonly ExecFlow[];
807
+ }
808
+ declare function resourceFlows(cfg: ResourceFlowsConfig): ResourceFlows;
809
+ export { FlowSteps, IDENTITY_HEADER, INTERNAL_SECRET_HEADER, MIGRATION_ADVISORY_LOCK_KEY, MigrationBuilder, PROTOCOL_VERSION, PluginUnavailableError, Types, applyTenantContext, asyncHandler, buildFlow, buildResourceRouter, buildResourceServices, callPlugin, checkInternalSecret, checkProtocol, compileCreateTable, composeWhere, createPlugin, createPluginServer, defineFlow, defineJob, defineResource, defineSchema, edge, escapeLike, identityHeaderOf, indexExpr, isWorkspaceElevated, loadMigrations, makeDataSurface, makeDatabaseService, migration, mountPluginServices, mountWsReceiver, node, parseIdentity, quoteIdent, readIdentity, requireAuth, requirePermission, requireWorkspace, resolveEngine, resourceFlows, resourceMigrations, rollbackMigration, runFlow, runMigrationList, runMigrations, runWithTenantContext, s3DeleteObject, s3Enabled, s3GetObject, s3KeyFromUrl, s3PresignUrl, s3PublicUrl, s3PutObject, searchFragment, statusFilter, tenant, tryCallPlugin, verifyIdentity, withTenantContext };
810
+ export type { AdditionalMount, AuthProvider, AuthProviderDecl, AuthService, AuthenticatedUser, BackfillOpts, ColumnDef, ColumnDefault, ColumnKind, ColumnOpts, CompileTableOpts, CoreServices, CreatePluginServerOptions, DataSurface, DecimalOpts, DefinedResource, Engine, EscapeHatch, ExecFlow, ExecNode, FindOpts, FlowContext, FlowDefinition, FlowNode, FlowNodeDef, FlowNodeKind, FlowPort, ForwardedIdentity, Identity, IndexMember, IndexOpts, Logger, MemberDTO, Migration, MigrationContext, MigrationOpts, NodeExec, PermissionsService, PluginAsset, PluginAssets, PluginContext, PluginDb, PluginDefinition, PluginEvents, PluginInitInput, PluginInitOutput, PluginKernel, PluginManifest, PluginPeer, PluginRouterFactory, PluginRpc, PluginServerContext, PluginServerHandle, PluginServicesFactory, PluginSettings, PresignedAsset, ResourceColumns, ResourceCreateSpec, ResourceField, ResourceFields, ResourceFilter, ResourceFlows, ResourceFlowsConfig, ResourceIndex, ResourceListSpec, ResourcePagination, ResourceRouterDeps, ResourceSearch, ResourceService, ResourceSoftDelete, ResourceSort, ResourceSpec, ResourceUpdateSpec, RunMigrationsOptions, SchemaDef, SqlFragment, StringOpts, TableDef, TenantContext, TenantDb, WhereOpts, WorkspaceDTO, WsReceiverOptions };