skedyul 1.6.0 → 1.7.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.
@@ -63,6 +63,37 @@ export interface ProvisionHandlerContext {
63
63
  export interface ProvisionHandlerResult {
64
64
  }
65
65
  export type ProvisionHandler = (ctx: ProvisionHandlerContext) => Promise<ProvisionHandlerResult>;
66
+ export type SetupRevalidateReason = 'crm_changed' | 'env_changed';
67
+ export interface SetupRevalidateContext {
68
+ env: Record<string, string>;
69
+ workplace: WorkplaceInfo;
70
+ appInstallationId: string;
71
+ app: AppInfoWithHandles;
72
+ reason: SetupRevalidateReason;
73
+ /** Step handles that listen for this change */
74
+ steps: string[];
75
+ crm?: {
76
+ migrationId?: string;
77
+ deletedModelIds?: string[];
78
+ deletedFieldIds?: string[];
79
+ createdModelIds?: string[];
80
+ updatedModelIds?: string[];
81
+ createdFieldIds?: string[];
82
+ updatedFieldIds?: string[];
83
+ };
84
+ envChange?: {
85
+ keys: string[];
86
+ };
87
+ /** Invocation context for log traceability */
88
+ invocation?: InvocationContext;
89
+ /** Context-aware logger that automatically includes invocation context */
90
+ log: ContextLogger;
91
+ }
92
+ export interface SetupRevalidateResult {
93
+ completed?: string[];
94
+ invalidated?: string[];
95
+ }
96
+ export type SetupRevalidateHandler = (ctx: SetupRevalidateContext) => Promise<SetupRevalidateResult | void>;
66
97
  /**
67
98
  * Base ServerHooks type with common fields
68
99
  */
@@ -79,6 +110,17 @@ type BaseServerHooks = {
79
110
  /** Timeout in milliseconds. Defaults to 60000 (1 minute) if not specified. */
80
111
  timeout?: number;
81
112
  };
113
+ /**
114
+ * Setup revalidation after CRM migrations or env key removal.
115
+ * App should call setup.complete / setup.invalidate for listening steps.
116
+ */
117
+ setup?: {
118
+ revalidate?: SetupRevalidateHandler | {
119
+ handler: SetupRevalidateHandler;
120
+ /** Timeout in milliseconds. Defaults to 60000 (1 minute) if not specified. */
121
+ timeout?: number;
122
+ };
123
+ };
82
124
  };
83
125
  /**
84
126
  * ServerHooks when oauth_callback is present.
@@ -16,7 +16,7 @@ export type { FormatMoneyMinorEstimateOptions } from './estimation';
16
16
  export { ToolResponseMetaSchema } from './tool';
17
17
  export { createSuccessResponse, createListResponse, createErrorResponse, createValidationError, createNotFoundError, createAuthError, createRateLimitError, createExternalError, createTimeoutError, createPermissionError, createConflictError, isSuccess, isFailure, isRetryable, getRetryDelay, } from './tool-response';
18
18
  export type { HealthStatus, ComputeLayer, DedicatedServerInstance, ServerlessServerInstance, SkedyulServerInstance, } from './server';
19
- export type { InstallHandlerContext, InstallHandlerResponseOAuth, InstallHandlerResponseStandard, HasOAuthCallback, InstallHandlerResult, InstallHandler, UninstallHandlerContext, UninstallHandlerResult, UninstallHandler, OAuthCallbackContext, OAuthCallbackResult, OAuthCallbackHandler, ProvisionHandlerContext, ProvisionHandlerResult, ProvisionHandler, ServerHooksWithOAuth, ServerHooksWithoutOAuth, ServerHooks, } from './handlers';
19
+ export type { InstallHandlerContext, InstallHandlerResponseOAuth, InstallHandlerResponseStandard, HasOAuthCallback, InstallHandlerResult, InstallHandler, UninstallHandlerContext, UninstallHandlerResult, UninstallHandler, OAuthCallbackContext, OAuthCallbackResult, OAuthCallbackHandler, ProvisionHandlerContext, ProvisionHandlerResult, ProvisionHandler, SetupRevalidateReason, SetupRevalidateContext, SetupRevalidateResult, SetupRevalidateHandler, ServerHooksWithOAuth, ServerHooksWithoutOAuth, ServerHooks, } from './handlers';
20
20
  export type { APIGatewayProxyEvent, APIGatewayProxyResult } from './aws';
21
21
  export type { WebhookWireRequest, HandlerRawRequest, WebhookRequest, WebhookResponse, ProvisionWebhookContext, RuntimeWebhookContext, WebhookContext, WebhookHandler, WebhookLifecycleContext, CommunicationChannelLifecycleContext, WebhookLifecycleResult, WebhookLifecycleHook, WebhookInvocationMode, WebhookType, WebhookDefinition, WebhookRegistry, WebhookName, WebhookMetadata, } from './webhook';
22
22
  export { isRuntimeWebhookContext } from './webhook';
@@ -5,7 +5,7 @@ export type InvocationType = 'tool_call' | 'server_hook' | 'workflow_step' | 'we
5
5
  /**
6
6
  * Server hook handles for lifecycle events
7
7
  */
8
- export type ServerHookHandle = 'provision' | 'install' | 'uninstall' | 'oauth_callback';
8
+ export type ServerHookHandle = 'provision' | 'install' | 'uninstall' | 'oauth_callback' | 'setup.revalidate';
9
9
  /**
10
10
  * Context for tracking how an executable was invoked.
11
11
  * Used for log traceability and filtering.
@@ -19,7 +19,7 @@ export interface InvocationContext {
19
19
  toolCallId?: string;
20
20
  /** The tool's handle for searching (e.g., "get_customers") */
21
21
  toolHandle?: string;
22
- /** Hook type: "provision", "install", "uninstall", "oauth_callback" */
22
+ /** Hook type: "provision", "install", "uninstall", "oauth_callback", "setup.revalidate" */
23
23
  serverHookHandle?: ServerHookHandle;
24
24
  /** The app installation that triggered the call */
25
25
  appInstallationId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "1.6.0",
3
+ "version": "1.7.1",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",