@mastra/core 0.1.0 → 0.1.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/authenticator.d.ts +62 -0
- package/dist/constants.d.ts +1 -0
- package/dist/core.cjs.development.js +5011 -0
- package/dist/core.cjs.development.js.map +1 -0
- package/dist/core.cjs.production.min.js +2 -0
- package/dist/core.cjs.production.min.js.map +1 -0
- package/dist/core.esm.js +4947 -0
- package/dist/core.esm.js.map +1 -0
- package/dist/data-access/index.d.ts +350 -0
- package/dist/framework.d.ts +116 -0
- package/dist/generated-types/index.d.ts +4 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +8 -0
- package/dist/integration.d.ts +100 -0
- package/dist/lib/index.d.ts +5 -0
- package/dist/lib/query-builder/constants.d.ts +16 -0
- package/dist/lib/query-builder/filters/sql.d.ts +8 -0
- package/dist/lib/query-builder/schema.d.ts +36 -0
- package/dist/lib/query-builder/sorts/sql.d.ts +7 -0
- package/dist/lib/query-builder/types.d.ts +30 -0
- package/dist/lib/query-builder/utils.d.ts +26 -0
- package/dist/lib/utils/object.d.ts +50 -0
- package/dist/next/callback.d.ts +3 -0
- package/dist/next/connect.d.ts +3 -0
- package/dist/next/index.d.ts +15 -0
- package/dist/next/inngest.d.ts +3 -0
- package/dist/next/utils.d.ts +9 -0
- package/dist/next/webhook.d.ts +9 -0
- package/dist/prisma/client.d.ts +2 -0
- package/dist/prisma/client.ts +31 -0
- package/dist/prisma/gen.js +139 -0
- package/dist/prisma/migrations/20240828034109_initial_migration/migration.sql +111 -0
- package/dist/prisma/migrations/20240829210901_initial_migration/migration.sql +1 -0
- package/dist/prisma/migrations/20240905143158_initial_migration/migration.sql +1 -0
- package/dist/prisma/migrations/20240911212856_initial_migration/migration.sql +1 -0
- package/dist/prisma/migrations/20240915044235_initial_migration/migration.sql +1 -0
- package/dist/prisma/migrations/migration_lock.toml +3 -0
- package/dist/prisma/schema.prisma +129 -0
- package/dist/schemas.d.ts +84 -0
- package/dist/service/service.property.d.ts +24 -0
- package/dist/service/service.record.d.ts +24 -0
- package/dist/sync-factory.d.ts +13 -0
- package/dist/sync-fixtures/github.d.ts +949 -0
- package/dist/sync-fixtures/stripe.d.ts +92 -0
- package/dist/types.d.ts +367 -0
- package/dist/utils/errors.d.ts +3 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/inngest.d.ts +4 -0
- package/dist/workflows/conditions/constants.d.ts +16 -0
- package/dist/workflows/conditions/types.d.ts +2 -0
- package/dist/workflows/handler.d.ts +38 -0
- package/dist/workflows/runner.d.ts +43 -0
- package/dist/workflows/schemas.d.ts +1043 -0
- package/dist/workflows/types.d.ts +96 -0
- package/dist/workflows/utils.d.ts +111 -0
- package/package.json +2 -2
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products.
|
|
4
|
+
* [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.
|
|
5
|
+
*
|
|
6
|
+
* For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.
|
|
7
|
+
*
|
|
8
|
+
* Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview).
|
|
9
|
+
*/
|
|
10
|
+
export type price = {
|
|
11
|
+
/**
|
|
12
|
+
* Whether the price can be used for new purchases.
|
|
13
|
+
*/
|
|
14
|
+
active: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.
|
|
17
|
+
*/
|
|
18
|
+
billing_scheme: 'per_unit' | 'tiered';
|
|
19
|
+
/**
|
|
20
|
+
* Time at which the object was created. Measured in seconds since the Unix epoch.
|
|
21
|
+
*/
|
|
22
|
+
created: number;
|
|
23
|
+
/**
|
|
24
|
+
* Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
|
25
|
+
*/
|
|
26
|
+
currency: string;
|
|
27
|
+
/**
|
|
28
|
+
* Unique identifier for the object.
|
|
29
|
+
*/
|
|
30
|
+
id: string;
|
|
31
|
+
/**
|
|
32
|
+
* Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
|
33
|
+
*/
|
|
34
|
+
livemode: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.
|
|
37
|
+
*/
|
|
38
|
+
lookup_key?: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
|
41
|
+
*/
|
|
42
|
+
metadata: {
|
|
43
|
+
[key: string]: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* A brief description of the price, hidden from customers.
|
|
47
|
+
*/
|
|
48
|
+
nickname?: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
|
51
|
+
*/
|
|
52
|
+
tax_behavior?: ('exclusive' | 'inclusive' | 'unspecified') | null;
|
|
53
|
+
/**
|
|
54
|
+
* Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows.
|
|
55
|
+
*/
|
|
56
|
+
tiers_mode?: ('graduated' | 'volume') | null;
|
|
57
|
+
/**
|
|
58
|
+
* One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
|
|
59
|
+
*/
|
|
60
|
+
type: 'one_time' | 'recurring';
|
|
61
|
+
/**
|
|
62
|
+
* The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`.
|
|
63
|
+
*/
|
|
64
|
+
unit_amount?: number | null;
|
|
65
|
+
/**
|
|
66
|
+
* The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`.
|
|
67
|
+
*/
|
|
68
|
+
unit_amount_decimal?: string | null;
|
|
69
|
+
};
|
|
70
|
+
export declare const priceSchema: z.ZodSchema<price>;
|
|
71
|
+
type GetPricesPriceResponse = price;
|
|
72
|
+
type GetPricesResponse = {
|
|
73
|
+
/**
|
|
74
|
+
* Details about each object.
|
|
75
|
+
*/
|
|
76
|
+
data: Array<price>;
|
|
77
|
+
/**
|
|
78
|
+
* True if this list has another page of items after this one that can be fetched.
|
|
79
|
+
*/
|
|
80
|
+
has_more: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
|
|
83
|
+
*/
|
|
84
|
+
object: 'list';
|
|
85
|
+
/**
|
|
86
|
+
* The URL where this list can be accessed.
|
|
87
|
+
*/
|
|
88
|
+
url: string;
|
|
89
|
+
};
|
|
90
|
+
export declare const getPricesPriceResponseSchema: z.ZodSchema<GetPricesPriceResponse>;
|
|
91
|
+
export declare const getPricesResponseSchema: z.ZodSchema<GetPricesResponse>;
|
|
92
|
+
export {};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { OAuth2Token } from '@badgateway/oauth2-client';
|
|
2
|
+
import { BaseContext } from 'inngest';
|
|
3
|
+
import { ZodSchema } from 'zod';
|
|
4
|
+
import { Integration } from './integration';
|
|
5
|
+
interface WorkflowConfig {
|
|
6
|
+
blueprintDirPath: string;
|
|
7
|
+
systemApis: Omit<IntegrationApi, 'integrationName'>[];
|
|
8
|
+
systemEvents: {
|
|
9
|
+
[key: string]: IntegrationEvent;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface Config {
|
|
13
|
+
name: string;
|
|
14
|
+
packageManager?: string;
|
|
15
|
+
systemHostURL: string;
|
|
16
|
+
routeRegistrationPath: string;
|
|
17
|
+
db: {
|
|
18
|
+
provider: string;
|
|
19
|
+
uri: string;
|
|
20
|
+
};
|
|
21
|
+
workflows: WorkflowConfig;
|
|
22
|
+
integrations: Integration[];
|
|
23
|
+
env?: {
|
|
24
|
+
provider?: 'local' | 'vercel';
|
|
25
|
+
file?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export type IntegrationContext = {
|
|
29
|
+
connectionId: string;
|
|
30
|
+
};
|
|
31
|
+
export type SchemaFieldOptions = {
|
|
32
|
+
options: {
|
|
33
|
+
[parentValue: string]: {
|
|
34
|
+
value: string;
|
|
35
|
+
label: string;
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
38
|
+
parentField: string;
|
|
39
|
+
} | {
|
|
40
|
+
options: {
|
|
41
|
+
value: string;
|
|
42
|
+
label: string;
|
|
43
|
+
}[];
|
|
44
|
+
parentField?: never;
|
|
45
|
+
} | {
|
|
46
|
+
options: undefined;
|
|
47
|
+
parentField?: never;
|
|
48
|
+
};
|
|
49
|
+
export type frameWorkIcon = {
|
|
50
|
+
icon: string;
|
|
51
|
+
alt: string;
|
|
52
|
+
};
|
|
53
|
+
export interface IntegrationApiExcutorParams<T extends Record<string, any> = Record<string, any>> {
|
|
54
|
+
data: T;
|
|
55
|
+
}
|
|
56
|
+
export type ZodeSchemaGenerator = ({ ctx, }: {
|
|
57
|
+
ctx: IntegrationContext;
|
|
58
|
+
}) => Promise<ZodSchema>;
|
|
59
|
+
export type EventSchema = ZodSchema | ZodeSchemaGenerator;
|
|
60
|
+
/**
|
|
61
|
+
* @param T - the type of the Integration Instance
|
|
62
|
+
*/
|
|
63
|
+
type IntegrationEventHandler<T extends Integration = Integration> = {
|
|
64
|
+
handler?: EventHandler<T>;
|
|
65
|
+
};
|
|
66
|
+
export type IntegrationEvent<T extends Integration = Integration> = RefinedIntegrationEvent & IntegrationEventHandler<T>;
|
|
67
|
+
export type IntegrationApi<IN extends Record<string, any> = Record<string, any>, OUT extends Record<string, any> = Record<string, any>> = {
|
|
68
|
+
integrationName: string;
|
|
69
|
+
schema: ZodSchema<IN> | (({ ctx }: {
|
|
70
|
+
ctx: IntegrationContext;
|
|
71
|
+
}) => Promise<ZodSchema<IN>>);
|
|
72
|
+
outputSchema?: ZodSchema | (({ ctx }: {
|
|
73
|
+
ctx: IntegrationContext;
|
|
74
|
+
}) => Promise<ZodSchema<OUT>>);
|
|
75
|
+
type: string;
|
|
76
|
+
label: string;
|
|
77
|
+
getSchemaOptions?: ({ ctx, }: {
|
|
78
|
+
ctx: IntegrationContext;
|
|
79
|
+
}) => Promise<Record<string, SchemaFieldOptions>>;
|
|
80
|
+
icon?: frameWorkIcon;
|
|
81
|
+
description: string;
|
|
82
|
+
documentation?: string;
|
|
83
|
+
category?: string;
|
|
84
|
+
executor: (params: IntegrationApiExcutorParams<IN>) => Promise<OUT>;
|
|
85
|
+
isHidden?: boolean;
|
|
86
|
+
};
|
|
87
|
+
export declare enum IntegrationErrors {
|
|
88
|
+
BROKEN_CONNECTION = "BROKEN_CONNECTION",
|
|
89
|
+
MISSING_SCOPES = "MISSING_SCOPES"
|
|
90
|
+
}
|
|
91
|
+
export interface IntegrationApiExcutorParams<T> {
|
|
92
|
+
data: T;
|
|
93
|
+
ctx: IntegrationContext;
|
|
94
|
+
}
|
|
95
|
+
export type RefinedIntegrationApi<T = unknown> = Omit<IntegrationApi, 'getSchemaOptions'> & {
|
|
96
|
+
schemaOptions: Record<string, SchemaFieldOptions>;
|
|
97
|
+
zodSchema: ZodSchema<T>;
|
|
98
|
+
zodOutputSchema: ZodSchema<T>;
|
|
99
|
+
};
|
|
100
|
+
export type RefinedIntegrationEvent<T = unknown> = {
|
|
101
|
+
schema: EventSchema;
|
|
102
|
+
key?: string;
|
|
103
|
+
integrationName?: string;
|
|
104
|
+
label?: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
getSchemaOptions?: ({ ctx, }: {
|
|
107
|
+
ctx: IntegrationContext;
|
|
108
|
+
}) => Promise<Record<string, SchemaFieldOptions>>;
|
|
109
|
+
zodSchema?: ZodSchema<T>;
|
|
110
|
+
};
|
|
111
|
+
export declare enum IntegrationCredentialType {
|
|
112
|
+
OAUTH = "OAUTH",
|
|
113
|
+
API_KEY = "API_KEY"
|
|
114
|
+
}
|
|
115
|
+
export declare const IntegrationFieldTypeEnum: {
|
|
116
|
+
readonly SINGLE_LINE_TEXT: "SINGLE_LINE_TEXT";
|
|
117
|
+
readonly LONG_TEXT: "LONG_TEXT";
|
|
118
|
+
readonly RICH_TEXT: "RICH_TEXT";
|
|
119
|
+
readonly SINGLE_SELECT: "SINGLE_SELECT";
|
|
120
|
+
readonly MULTI_SELECT: "MULTI_SELECT";
|
|
121
|
+
readonly CREATABLE_SELECT: "CREATABLE_SELECT";
|
|
122
|
+
readonly CHECKBOX: "CHECKBOX";
|
|
123
|
+
readonly DATE: "DATE";
|
|
124
|
+
readonly USER: "USER";
|
|
125
|
+
readonly BADGE_LIST: "BADGE_LIST";
|
|
126
|
+
readonly CURRENCY: "CURRENCY";
|
|
127
|
+
readonly URL: "URL";
|
|
128
|
+
readonly PHONE: "PHONE";
|
|
129
|
+
readonly CONTACT: "CONTACT";
|
|
130
|
+
readonly COMPANY: "COMPANY";
|
|
131
|
+
readonly COMPOSITE: "COMPOSITE";
|
|
132
|
+
readonly PERSON: "PERSON";
|
|
133
|
+
readonly ENRICHMENT: "ENRICHMENT";
|
|
134
|
+
};
|
|
135
|
+
export type IntegrationFieldType = keyof typeof IntegrationFieldTypeEnum;
|
|
136
|
+
export type OAuthToken = OAuth2Token & {
|
|
137
|
+
[key: string]: any;
|
|
138
|
+
};
|
|
139
|
+
export type APIKey = {
|
|
140
|
+
apiKey: string;
|
|
141
|
+
} & {
|
|
142
|
+
[key: string]: any;
|
|
143
|
+
};
|
|
144
|
+
export type CredentialValue = OAuthToken | APIKey;
|
|
145
|
+
export type AuthToken = Omit<OAuthToken, 'refreshToken'> | APIKey;
|
|
146
|
+
export type MakeWebhookURL = ({ event, name, }: {
|
|
147
|
+
name: string;
|
|
148
|
+
event: string;
|
|
149
|
+
}) => string;
|
|
150
|
+
export type EventHandlerExecutorParams = BaseContext<any>;
|
|
151
|
+
export type EventHandlerReturnType = {
|
|
152
|
+
id: string;
|
|
153
|
+
event: string;
|
|
154
|
+
executor: ({ event, step }: EventHandlerExecutorParams) => Promise<any>;
|
|
155
|
+
onFailure?: ({ event, }: {
|
|
156
|
+
event: {
|
|
157
|
+
data: {
|
|
158
|
+
event: {
|
|
159
|
+
data: Record<string, any>;
|
|
160
|
+
user: Record<string, string>;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
}) => Promise<any>;
|
|
165
|
+
cancelOn?: {
|
|
166
|
+
event: string;
|
|
167
|
+
if: string;
|
|
168
|
+
}[];
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* @param T - the type of the Integration Instance defining the event handler
|
|
172
|
+
*/
|
|
173
|
+
export type EventHandler<T = unknown> = (params: {
|
|
174
|
+
integrationInstance: T;
|
|
175
|
+
eventKey: string;
|
|
176
|
+
makeWebhookUrl: MakeWebhookURL;
|
|
177
|
+
}) => EventHandlerReturnType;
|
|
178
|
+
export type QueryResult<T> = {
|
|
179
|
+
data: T;
|
|
180
|
+
};
|
|
181
|
+
export type Routes = 'connect' | 'callback' | 'inngest' | 'webhook';
|
|
182
|
+
export interface OpenAPI {
|
|
183
|
+
openapi: string;
|
|
184
|
+
info: OpenAPI_Info;
|
|
185
|
+
servers?: OpenAPI_Server[];
|
|
186
|
+
paths: OpenAPI_Paths;
|
|
187
|
+
components?: OpenAPI_Components;
|
|
188
|
+
security?: OpenAPI_SecurityRequirement[];
|
|
189
|
+
tags?: OpenAPI_Tag[];
|
|
190
|
+
externalDocs?: OpenAPI_ExternalDocumentation;
|
|
191
|
+
}
|
|
192
|
+
export interface OpenAPI_Info {
|
|
193
|
+
title: string;
|
|
194
|
+
version: string;
|
|
195
|
+
description?: string;
|
|
196
|
+
termsOfService?: string;
|
|
197
|
+
contact?: OpenAPI_Contact;
|
|
198
|
+
license?: OpenAPI_License;
|
|
199
|
+
}
|
|
200
|
+
export interface OpenAPI_Contact {
|
|
201
|
+
name?: string;
|
|
202
|
+
url?: string;
|
|
203
|
+
email?: string;
|
|
204
|
+
}
|
|
205
|
+
export interface OpenAPI_License {
|
|
206
|
+
name: string;
|
|
207
|
+
url?: string;
|
|
208
|
+
}
|
|
209
|
+
export interface OpenAPI_Server {
|
|
210
|
+
url: string;
|
|
211
|
+
description?: string;
|
|
212
|
+
}
|
|
213
|
+
export interface OpenAPI_Paths {
|
|
214
|
+
[path: string]: OpenAPI_PathItem;
|
|
215
|
+
}
|
|
216
|
+
export interface OpenAPI_PathItem {
|
|
217
|
+
summary?: string;
|
|
218
|
+
description?: string;
|
|
219
|
+
get?: OpenAPI_Operation;
|
|
220
|
+
put?: OpenAPI_Operation;
|
|
221
|
+
post?: OpenAPI_Operation;
|
|
222
|
+
delete?: OpenAPI_Operation;
|
|
223
|
+
options?: OpenAPI_Operation;
|
|
224
|
+
head?: OpenAPI_Operation;
|
|
225
|
+
patch?: OpenAPI_Operation;
|
|
226
|
+
trace?: OpenAPI_Operation;
|
|
227
|
+
servers?: OpenAPI_Server[];
|
|
228
|
+
parameters?: OpenAPI_Parameter[];
|
|
229
|
+
}
|
|
230
|
+
export interface OpenAPI_Operation {
|
|
231
|
+
summary?: string;
|
|
232
|
+
description?: string;
|
|
233
|
+
operationId?: string;
|
|
234
|
+
parameters?: OpenAPI_Parameter[];
|
|
235
|
+
requestBody?: OpenAPI_RequestBody;
|
|
236
|
+
responses: OpenAPI_Responses;
|
|
237
|
+
deprecated?: boolean;
|
|
238
|
+
security?: OpenAPI_SecurityRequirement[];
|
|
239
|
+
tags?: string[];
|
|
240
|
+
servers?: OpenAPI_Server[];
|
|
241
|
+
}
|
|
242
|
+
export interface OpenAPI_Parameter {
|
|
243
|
+
name: string;
|
|
244
|
+
in: 'query' | 'header' | 'path' | 'cookie';
|
|
245
|
+
description?: string;
|
|
246
|
+
required?: boolean;
|
|
247
|
+
schema: OpenAPI_Schema;
|
|
248
|
+
$ref?: string;
|
|
249
|
+
example?: string | string[];
|
|
250
|
+
enum?: string[];
|
|
251
|
+
}
|
|
252
|
+
export interface OpenAPI_RequestBody {
|
|
253
|
+
description?: string;
|
|
254
|
+
content: {
|
|
255
|
+
[mediaType: string]: OpenAPI_MediaType;
|
|
256
|
+
};
|
|
257
|
+
required?: boolean;
|
|
258
|
+
}
|
|
259
|
+
export interface OpenAPI_MediaType {
|
|
260
|
+
schema: OpenAPI_Schema;
|
|
261
|
+
}
|
|
262
|
+
export interface OpenAPI_Responses {
|
|
263
|
+
[statusCode: string]: OpenAPI_Response;
|
|
264
|
+
}
|
|
265
|
+
export interface OpenAPI_Response {
|
|
266
|
+
description: string;
|
|
267
|
+
content?: {
|
|
268
|
+
[mediaType: string]: OpenAPI_MediaType;
|
|
269
|
+
};
|
|
270
|
+
headers?: {
|
|
271
|
+
[headerName: string]: OpenAPI_Header;
|
|
272
|
+
};
|
|
273
|
+
links?: {
|
|
274
|
+
[linkName: string]: OpenAPI_Link;
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
export interface OpenAPI_Header {
|
|
278
|
+
description?: string;
|
|
279
|
+
schema: OpenAPI_Schema;
|
|
280
|
+
}
|
|
281
|
+
export interface OpenAPI_Link {
|
|
282
|
+
operationRef?: string;
|
|
283
|
+
operationId?: string;
|
|
284
|
+
parameters?: {
|
|
285
|
+
[parameterName: string]: any;
|
|
286
|
+
};
|
|
287
|
+
requestBody?: any;
|
|
288
|
+
description?: string;
|
|
289
|
+
}
|
|
290
|
+
export interface OpenAPI_Schema {
|
|
291
|
+
type?: string;
|
|
292
|
+
format?: string;
|
|
293
|
+
properties?: {
|
|
294
|
+
[propertyName: string]: OpenAPI_Schema;
|
|
295
|
+
};
|
|
296
|
+
required?: string[];
|
|
297
|
+
items?: OpenAPI_Schema;
|
|
298
|
+
enum?: any[];
|
|
299
|
+
example?: any;
|
|
300
|
+
$ref?: string;
|
|
301
|
+
allOf?: OpenAPI_Schema[];
|
|
302
|
+
}
|
|
303
|
+
export interface OpenAPI_Components {
|
|
304
|
+
schemas?: {
|
|
305
|
+
[schemaName: string]: OpenAPI_Schema;
|
|
306
|
+
};
|
|
307
|
+
responses?: {
|
|
308
|
+
[responseName: string]: OpenAPI_Response;
|
|
309
|
+
};
|
|
310
|
+
parameters?: {
|
|
311
|
+
[parameterName: string]: OpenAPI_Parameter;
|
|
312
|
+
};
|
|
313
|
+
requestBodies?: {
|
|
314
|
+
[requestBodyName: string]: OpenAPI_RequestBody;
|
|
315
|
+
};
|
|
316
|
+
headers?: {
|
|
317
|
+
[headerName: string]: OpenAPI_Header;
|
|
318
|
+
};
|
|
319
|
+
securitySchemes?: {
|
|
320
|
+
[securitySchemeName: string]: OpenAPI_SecurityScheme;
|
|
321
|
+
};
|
|
322
|
+
links?: {
|
|
323
|
+
[linkName: string]: OpenAPI_Link;
|
|
324
|
+
};
|
|
325
|
+
callbacks?: {
|
|
326
|
+
[callbackName: string]: OpenAPI_PathItem;
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
export interface OpenAPI_SecurityScheme {
|
|
330
|
+
type: 'apiKey' | 'http' | 'oauth2' | 'openIdConnect';
|
|
331
|
+
in?: 'query' | 'header' | 'cookie';
|
|
332
|
+
name?: string;
|
|
333
|
+
scheme?: string;
|
|
334
|
+
bearerFormat?: string;
|
|
335
|
+
flows?: OpenAPI_OAuthFlows;
|
|
336
|
+
openIdConnectUrl?: string;
|
|
337
|
+
}
|
|
338
|
+
export interface OpenAPI_OAuthFlows {
|
|
339
|
+
implicit?: OpenAPI_OAuthFlow;
|
|
340
|
+
password?: OpenAPI_OAuthFlow;
|
|
341
|
+
clientCredentials?: OpenAPI_OAuthFlow;
|
|
342
|
+
authorizationCode?: OpenAPI_OAuthFlow;
|
|
343
|
+
}
|
|
344
|
+
export interface OpenAPI_OAuthFlow {
|
|
345
|
+
authorizationUrl?: string;
|
|
346
|
+
tokenUrl?: string;
|
|
347
|
+
refreshUrl?: string;
|
|
348
|
+
scopes: {
|
|
349
|
+
[scope: string]: string;
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
export interface OpenAPI_SecurityRequirement {
|
|
353
|
+
[securitySchemeName: string]: string[];
|
|
354
|
+
}
|
|
355
|
+
export interface OpenAPI_Tag {
|
|
356
|
+
name: string;
|
|
357
|
+
description?: string;
|
|
358
|
+
externalDocs?: OpenAPI_ExternalDocumentation;
|
|
359
|
+
}
|
|
360
|
+
export interface OpenAPI_ExternalDocumentation {
|
|
361
|
+
description?: string;
|
|
362
|
+
url: string;
|
|
363
|
+
}
|
|
364
|
+
export interface OpenAPI_Callback {
|
|
365
|
+
[callbackName: string]: OpenAPI_PathItem;
|
|
366
|
+
}
|
|
367
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SchemaFieldOptions } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Extract schema options for the provided schema - Builds a map of fieldname to field options
|
|
5
|
+
* @param schema - schema
|
|
6
|
+
* @param dataCtx - data context - this is an object of options for each field that isn't enum (meaning string fields) but should have options
|
|
7
|
+
* @returns schema options
|
|
8
|
+
* */
|
|
9
|
+
export declare function extractSchemaOptions({ schema, dataCtx, }: {
|
|
10
|
+
schema: z.ZodObject<any>;
|
|
11
|
+
dataCtx?: Record<string, SchemaFieldOptions>;
|
|
12
|
+
}): Record<string, SchemaFieldOptions>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const FilterOpToValueMapEnum: {
|
|
2
|
+
readonly EQUAL: "EQUAL";
|
|
3
|
+
readonly NOT_EQUAL: "NOT_EQUAL";
|
|
4
|
+
readonly CONTAINS: "CONTAINS";
|
|
5
|
+
readonly IS: "IS";
|
|
6
|
+
readonly IS_NOT: "IS_NOT";
|
|
7
|
+
readonly NOT_CONTAINS: "NOT_CONTAINS";
|
|
8
|
+
readonly IS_ANY_OF: "IS_ANY_OF";
|
|
9
|
+
readonly GREATER_THAN: "GREATER_THAN";
|
|
10
|
+
readonly LESS_THAN: "LESS_THAN";
|
|
11
|
+
readonly DOES_NOT_CONTAIN: "DOES_NOT_CONTAIN";
|
|
12
|
+
readonly GREATER_THAN_OR_EQUAL: "GREATER_THAN_OR_EQUAL";
|
|
13
|
+
readonly LESS_THAN_OR_EQUAL: "LESS_THAN_OR_EQUAL";
|
|
14
|
+
readonly SET: "SET";
|
|
15
|
+
readonly NOT_SET: "NOT_SET";
|
|
16
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const createWorkflowHandler: ({ blueprintDirPath, runBlueprint, }: {
|
|
2
|
+
blueprintDirPath: string;
|
|
3
|
+
runBlueprint: Function;
|
|
4
|
+
}) => import("inngest").InngestFunction<Omit<import("inngest").InngestFunction.Options<import("inngest").Inngest<{
|
|
5
|
+
id: string;
|
|
6
|
+
}>, import("inngest").InngestMiddleware.Stack, [{
|
|
7
|
+
event: string;
|
|
8
|
+
}], import("inngest").Handler<import("inngest").Inngest<{
|
|
9
|
+
id: string;
|
|
10
|
+
}>, string, {
|
|
11
|
+
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
12
|
+
logger: import("inngest/middleware/logger").Logger;
|
|
13
|
+
error: Error;
|
|
14
|
+
}>>, "triggers">, ({ event, step }: import("inngest").Context<import("inngest").Inngest<{
|
|
15
|
+
id: string;
|
|
16
|
+
}>, string, {
|
|
17
|
+
logger: import("inngest/middleware/logger").Logger;
|
|
18
|
+
}>) => Promise<{
|
|
19
|
+
event: {
|
|
20
|
+
name: string;
|
|
21
|
+
ts?: number | undefined;
|
|
22
|
+
id?: string | undefined;
|
|
23
|
+
data?: any;
|
|
24
|
+
user?: any;
|
|
25
|
+
v?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
body: string;
|
|
28
|
+
}>, import("inngest").Handler<import("inngest").Inngest<{
|
|
29
|
+
id: string;
|
|
30
|
+
}>, string, {
|
|
31
|
+
event: import("inngest").FailureEventPayload<import("inngest").EventPayload<any>>;
|
|
32
|
+
logger: import("inngest/middleware/logger").Logger;
|
|
33
|
+
error: Error;
|
|
34
|
+
}>, import("inngest").Inngest<{
|
|
35
|
+
id: string;
|
|
36
|
+
}>, import("inngest").InngestMiddleware.Stack, [{
|
|
37
|
+
event: string;
|
|
38
|
+
}]>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ActionVariables, Blueprint, WorkflowConditionGroup } from './types';
|
|
3
|
+
import { IntegrationApi, IntegrationContext, IntegrationEvent } from '../types';
|
|
4
|
+
export declare function evaluateCondition({ c, dataCtx, schema, triggerId, }: {
|
|
5
|
+
c: WorkflowConditionGroup;
|
|
6
|
+
dataCtx: any;
|
|
7
|
+
schema: z.ZodSchema<unknown>;
|
|
8
|
+
triggerId?: string;
|
|
9
|
+
}): boolean;
|
|
10
|
+
export declare function resolveSchemaPath({ currentPath, schema, targetPath, finalMap, }: {
|
|
11
|
+
currentPath: string;
|
|
12
|
+
schema: any;
|
|
13
|
+
targetPath: string;
|
|
14
|
+
finalMap: Record<string, any>;
|
|
15
|
+
}): z.ZodSchema<unknown> | undefined;
|
|
16
|
+
export declare function replacePayloadVariables({ value, stringContainingVariables, variable, }: {
|
|
17
|
+
value: string;
|
|
18
|
+
stringContainingVariables: string | string[];
|
|
19
|
+
variable: string;
|
|
20
|
+
}): string | string[];
|
|
21
|
+
export declare function resolveCondition({ c, dataCtx, schema, triggerId, }: {
|
|
22
|
+
c: WorkflowConditionGroup;
|
|
23
|
+
dataCtx: any;
|
|
24
|
+
triggerId?: string;
|
|
25
|
+
schema: z.ZodSchema<unknown>;
|
|
26
|
+
}): boolean | undefined;
|
|
27
|
+
export declare function resolvePath({ path, replacementDataPayload, }: {
|
|
28
|
+
path: string;
|
|
29
|
+
replacementDataPayload: any;
|
|
30
|
+
}): any;
|
|
31
|
+
export declare function resolvePayload({ payload, dataContext, variables, parentKey, }: {
|
|
32
|
+
payload: any;
|
|
33
|
+
dataContext: any;
|
|
34
|
+
variables?: Record<string, ActionVariables | undefined>;
|
|
35
|
+
parentKey?: string;
|
|
36
|
+
}): Record<string, any>;
|
|
37
|
+
export declare function blueprintRunner({ ctx, dataCtx, blueprint, frameworkEvents, frameworkApis, }: {
|
|
38
|
+
dataCtx: any;
|
|
39
|
+
ctx: IntegrationContext;
|
|
40
|
+
blueprint: Blueprint;
|
|
41
|
+
frameworkApis: Record<string, IntegrationApi<any>>;
|
|
42
|
+
frameworkEvents: Record<string, IntegrationEvent<any>>;
|
|
43
|
+
}): Promise<void>;
|