@novu/framework 0.24.3-alpha.9 → 2.0.0-canary.0
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/README.md +23 -34
- package/dist/express.d.ts +2 -1
- package/dist/express.js +17 -15
- package/dist/h3.d.ts +2 -1
- package/dist/h3.js +18 -15
- package/dist/{handler-_6lXMYuL.d.ts → handler-Mor_4K8F.d.ts} +290 -122
- package/dist/index.d.ts +159 -5
- package/dist/index.js +36 -20
- package/dist/next.d.ts +10 -3
- package/dist/next.js +17 -15
- package/dist/nuxt.d.ts +2 -1
- package/dist/nuxt.js +18 -15
- package/dist/remix.d.ts +2 -1
- package/dist/remix.js +16 -14
- package/dist/sveltekit.d.ts +2 -1
- package/dist/sveltekit.js +16 -14
- package/package.json +41 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { S as Schema, F as FromSchema, E as Execute, W as WorkflowOptions,
|
|
2
|
-
export { A as ActionStep,
|
|
1
|
+
import { S as Schema, J as JsonSchema, F as FromSchema, E as Execute, W as WorkflowOptions, a as Workflow } from './handler-Mor_4K8F.js';
|
|
2
|
+
export { A as ActionStep, a1 as ActionStepEnum, Z as Awaitable, l as CancelEventTriggerResponse, v as ChannelStep, a0 as ChannelStepEnum, G as ChatOutput, I as ChatResult, C as Client, d as ClientOptions, c as CodeResult, u as CustomStep, M as DelayOutput, O as DelayResult, T as DigestOutput, U as DigestResult, h as DiscoverOutput, D as DiscoverProviderOutput, f as DiscoverStepOutput, g as DiscoverWorkflowOutput, Y as Either, w as EmailOutput, x as EmailResult, m as Event, j as EventTriggerParams, k as EventTriggerResponse, i as EventTriggerResult, $ as ExecuteInput, p as ExecuteOutput, o as ExecuteOutputMetadata, H as HealthCheck, K as InAppOutput, L as InAppResult, t as JobStatusEnum, N as NovuRequestHandler, _ as Prettify, P as PushOutput, B as PushResult, b as ServeHandlerOptions, r as Skip, y as SmsOutput, z as SmsResult, n as State, V as Step, s as StepOptions, e as StepType, X as Subscriber, q as SupportedFrameworkName, Q as digestRegularOutput, R as digestTimedOutput } from './handler-Mor_4K8F.js';
|
|
3
|
+
import { ValidateFunction as ValidateFunction$1 } from 'ajv';
|
|
4
|
+
import { ParseReturnType } from 'zod';
|
|
3
5
|
import 'json-schema-to-ts';
|
|
4
|
-
import '
|
|
6
|
+
import '@novu/shared';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Cron expression helper.
|
|
@@ -92,9 +94,161 @@ declare enum CronExpression {
|
|
|
92
94
|
MONDAY_TO_FRIDAY_AT_11PM = "0 0 23 * * 1-5"
|
|
93
95
|
}
|
|
94
96
|
|
|
97
|
+
declare enum PostActionEnum {
|
|
98
|
+
TRIGGER = "trigger",
|
|
99
|
+
EXECUTE = "execute",
|
|
100
|
+
PREVIEW = "preview"
|
|
101
|
+
}
|
|
102
|
+
declare enum GetActionEnum {
|
|
103
|
+
DISCOVER = "discover",
|
|
104
|
+
HEALTH_CHECK = "health-check",
|
|
105
|
+
CODE = "code"
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare enum NovuApiEndpointsEnum {
|
|
109
|
+
SYNC = "/v1/bridge/sync",
|
|
110
|
+
DIFF = "/v1/bridge/diff"
|
|
111
|
+
}
|
|
112
|
+
declare const SIGNATURE_TIMESTAMP_TOLERANCE_MINUTES = 5;
|
|
113
|
+
declare const SIGNATURE_TIMESTAMP_TOLERANCE: number;
|
|
114
|
+
|
|
115
|
+
declare enum ErrorCodeEnum {
|
|
116
|
+
WORKFLOW_NOT_FOUND_ERROR = "WorkflowNotFoundError",
|
|
117
|
+
WORKFLOW_ALREADY_EXISTS_ERROR = "WorkflowAlreadyExistsError",
|
|
118
|
+
WORKFLOW_EXECUTION_FAILED_ERROR = "WorkflowExecutionFailedError",
|
|
119
|
+
EXECUTION_STATE_OUTPUT_INVALID_ERROR = "ExecutionStateOutputInvalidError",
|
|
120
|
+
EXECUTION_STATE_RESULT_INVALID_ERROR = "ExecutionStateResultInvalidError",
|
|
121
|
+
EXECUTION_PROVIDER_OUTPUT_INVALID_ERROR = "ExecutionProviderOutputInvalidError",
|
|
122
|
+
PROVIDER_NOT_FOUND_ERROR = "ProviderNotFoundError",
|
|
123
|
+
PROVIDER_EXECUTION_FAILED_ERROR = "ProviderExecutionFailedError",
|
|
124
|
+
STEP_NOT_FOUND_ERROR = "StepNotFoundError",
|
|
125
|
+
STEP_ALREADY_EXISTS_ERROR = "StepAlreadyExistsError",
|
|
126
|
+
STEP_EXECUTION_FAILED_ERROR = "StepExecutionFailedError",
|
|
127
|
+
EXECUTION_STATE_CORRUPT_ERROR = "ExecutionStateCorruptError",
|
|
128
|
+
EXECUTION_EVENT_PAYLOAD_INVALID_ERROR = "ExecutionEventPayloadInvalidError",
|
|
129
|
+
EXECUTION_EVENT_CONTROL_INVALID_ERROR = "ExecutionEventControlInvalidError",
|
|
130
|
+
EXECUTION_STATE_CONTROL_INVALID_ERROR = "ExecutionStateControlInvalidError",
|
|
131
|
+
METHOD_NOT_ALLOWED_ERROR = "MethodNotAllowedError",
|
|
132
|
+
INVALID_ACTION_ERROR = "InvalidActionError",
|
|
133
|
+
MISSING_SECRET_KEY_ERROR = "MissingSecretKeyError",
|
|
134
|
+
SIGNATURE_MISMATCH_ERROR = "SignatureMismatchError",
|
|
135
|
+
SIGNATURE_NOT_FOUND_ERROR = "SignatureNotFoundError",
|
|
136
|
+
SIGNATURE_INVALID_ERROR = "SignatureInvalidError",
|
|
137
|
+
SIGNATURE_EXPIRED_ERROR = "SignatureExpiredError",
|
|
138
|
+
SIGNING_KEY_NOT_FOUND_ERROR = "SigningKeyNotFoundError",
|
|
139
|
+
PLATFORM_ERROR = "PlatformError",
|
|
140
|
+
SIGNATURE_VERSION_INVALID_ERROR = "SignatureVersionInvalidError",
|
|
141
|
+
WORKFLOW_PAYLOAD_INVALID_ERROR = "WorkflowPayloadInvalidError"
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
declare enum HttpHeaderKeysEnum {
|
|
145
|
+
NOVU_SIGNATURE = "novu-signature",
|
|
146
|
+
NOVU_ANONYMOUS = "novu-anonymous",
|
|
147
|
+
NOVU_SIGNATURE_DEPRECATED = "x-novu-signature",
|
|
148
|
+
NOVU_ANONYMOUS_DEPRECATED = "x-novu-anonymous",
|
|
149
|
+
NOVU_FRAMEWORK_SDK = "novu-framework-sdk",
|
|
150
|
+
NOVU_FRAMEWORK_API = "novu-framework-api",
|
|
151
|
+
NOVU_FRAMEWORK_VERSION = "novu-framework-version",
|
|
152
|
+
USER_AGENT = "user-agent",
|
|
153
|
+
CONTENT_TYPE = "content-type",
|
|
154
|
+
ACCESS_CONTROL_ALLOW_ORIGIN = "access-control-allow-origin",
|
|
155
|
+
ACCESS_CONTROL_ALLOW_METHODS = "access-control-allow-methods",
|
|
156
|
+
ACCESS_CONTROL_ALLOW_HEADERS = "access-control-allow-headers",
|
|
157
|
+
ACCESS_CONTROL_MAX_AGE = "access-control-max-age"
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare enum HttpMethodEnum {
|
|
161
|
+
POST = "POST",
|
|
162
|
+
GET = "GET",
|
|
163
|
+
OPTIONS = "OPTIONS"
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
declare enum HttpQueryKeysEnum {
|
|
167
|
+
WORKFLOW_ID = "workflowId",
|
|
168
|
+
STEP_ID = "stepId",
|
|
169
|
+
ACTION = "action",
|
|
170
|
+
SOURCE = "source"
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
declare enum HttpStatusEnum {
|
|
174
|
+
CONTINUE = 100,
|
|
175
|
+
SWITCHING_PROTOCOLS = 101,
|
|
176
|
+
PROCESSING = 102,
|
|
177
|
+
EARLYHINTS = 103,
|
|
178
|
+
OK = 200,
|
|
179
|
+
CREATED = 201,
|
|
180
|
+
ACCEPTED = 202,
|
|
181
|
+
NON_AUTHORITATIVE_INFORMATION = 203,
|
|
182
|
+
NO_CONTENT = 204,
|
|
183
|
+
RESET_CONTENT = 205,
|
|
184
|
+
PARTIAL_CONTENT = 206,
|
|
185
|
+
AMBIGUOUS = 300,
|
|
186
|
+
MOVED_PERMANENTLY = 301,
|
|
187
|
+
FOUND = 302,
|
|
188
|
+
SEE_OTHER = 303,
|
|
189
|
+
NOT_MODIFIED = 304,
|
|
190
|
+
TEMPORARY_REDIRECT = 307,
|
|
191
|
+
PERMANENT_REDIRECT = 308,
|
|
192
|
+
BAD_REQUEST = 400,
|
|
193
|
+
UNAUTHORIZED = 401,
|
|
194
|
+
PAYMENT_REQUIRED = 402,
|
|
195
|
+
FORBIDDEN = 403,
|
|
196
|
+
NOT_FOUND = 404,
|
|
197
|
+
METHOD_NOT_ALLOWED = 405,
|
|
198
|
+
NOT_ACCEPTABLE = 406,
|
|
199
|
+
PROXY_AUTHENTICATION_REQUIRED = 407,
|
|
200
|
+
REQUEST_TIMEOUT = 408,
|
|
201
|
+
CONFLICT = 409,
|
|
202
|
+
GONE = 410,
|
|
203
|
+
LENGTH_REQUIRED = 411,
|
|
204
|
+
PRECONDITION_FAILED = 412,
|
|
205
|
+
PAYLOAD_TOO_LARGE = 413,
|
|
206
|
+
URI_TOO_LONG = 414,
|
|
207
|
+
UNSUPPORTED_MEDIA_TYPE = 415,
|
|
208
|
+
REQUESTED_RANGE_NOT_SATISFIABLE = 416,
|
|
209
|
+
EXPECTATION_FAILED = 417,
|
|
210
|
+
I_AM_A_TEAPOT = 418,
|
|
211
|
+
MISDIRECTED = 421,
|
|
212
|
+
UNPROCESSABLE_ENTITY = 422,
|
|
213
|
+
FAILED_DEPENDENCY = 424,
|
|
214
|
+
PRECONDITION_REQUIRED = 428,
|
|
215
|
+
TOO_MANY_REQUESTS = 429,
|
|
216
|
+
INTERNAL_SERVER_ERROR = 500,
|
|
217
|
+
NOT_IMPLEMENTED = 501,
|
|
218
|
+
BAD_GATEWAY = 502,
|
|
219
|
+
SERVICE_UNAVAILABLE = 503,
|
|
220
|
+
GATEWAY_TIMEOUT = 504,
|
|
221
|
+
HTTP_VERSION_NOT_SUPPORTED = 505
|
|
222
|
+
}
|
|
223
|
+
declare const RETRYABLE_ERROR_STATUS_CODES: HttpStatusEnum[];
|
|
224
|
+
|
|
225
|
+
declare enum ResourceEnum {
|
|
226
|
+
WORKFLOW = "workflow",
|
|
227
|
+
PROVIDER = "provider",
|
|
228
|
+
STEP = "step"
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
type ValidateFunction<T = unknown> = ValidateFunction$1<T> | ((data: T) => ParseReturnType<T>);
|
|
232
|
+
type ValidationError = {
|
|
233
|
+
path: string;
|
|
234
|
+
message: string;
|
|
235
|
+
};
|
|
236
|
+
type ValidateResult<T> = {
|
|
237
|
+
success: false;
|
|
238
|
+
errors: ValidationError[];
|
|
239
|
+
} | {
|
|
240
|
+
success: true;
|
|
241
|
+
data: T;
|
|
242
|
+
};
|
|
243
|
+
interface Validator<T_Schema extends Schema> {
|
|
244
|
+
validate: <T_Data>(data: T_Data, schema: T_Schema) => Promise<ValidateResult<T_Data>>;
|
|
245
|
+
isSchema: (schema: Schema) => schema is T_Schema;
|
|
246
|
+
transformToJsonSchema: (schema: T_Schema) => JsonSchema;
|
|
247
|
+
}
|
|
248
|
+
|
|
95
249
|
/**
|
|
96
250
|
* Define a new notification workflow.
|
|
97
251
|
*/
|
|
98
|
-
declare function workflow<T_PayloadSchema extends Schema,
|
|
252
|
+
declare function workflow<T_PayloadSchema extends Schema, T_ControlSchema extends Schema, T_Payload = FromSchema<T_PayloadSchema>, T_Control = FromSchema<T_ControlSchema>>(workflowId: string, execute: Execute<T_Payload, T_Control>, workflowOptions?: WorkflowOptions<T_PayloadSchema, T_ControlSchema>): Workflow<T_Payload>;
|
|
99
253
|
|
|
100
|
-
export { CronExpression,
|
|
254
|
+
export { CronExpression, ErrorCodeEnum, Execute, FromSchema, GetActionEnum, HttpHeaderKeysEnum, HttpMethodEnum, HttpQueryKeysEnum, HttpStatusEnum, JsonSchema, NovuApiEndpointsEnum, PostActionEnum, RETRYABLE_ERROR_STATUS_CODES, ResourceEnum, SIGNATURE_TIMESTAMP_TOLERANCE, SIGNATURE_TIMESTAMP_TOLERANCE_MINUTES, Schema, type ValidateFunction, type ValidateResult, type ValidationError, type Validator, Workflow, WorkflowOptions, workflow };
|