@tailor-platform/sdk 0.0.1 → 0.8.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.
- package/CHANGELOG.md +790 -0
- package/LICENSE +21 -0
- package/README.md +8 -41
- package/dist/auth-Di3vQUrT.mjs +743 -0
- package/dist/cli/api.d.mts +213 -0
- package/dist/cli/api.mjs +4 -0
- package/dist/cli/index.d.mts +3 -0
- package/dist/cli/index.mjs +996 -0
- package/dist/configure/index.d.mts +5 -0
- package/dist/configure/index.mjs +108 -0
- package/dist/index-BWN4RmSt.d.mts +232 -0
- package/dist/plugin-generated.d.ts +14 -0
- package/dist/token-B9YK0eTP.mjs +5498 -0
- package/dist/types-DWQxkbYl.d.mts +1389 -0
- package/dist/utils/test/index.d.mts +40 -0
- package/dist/utils/test/index.mjs +63 -0
- package/docs/cli-reference.md +484 -0
- package/docs/configuration.md +132 -0
- package/docs/core-concepts.md +504 -0
- package/docs/quickstart.md +96 -0
- package/docs/testing.md +298 -0
- package/package.json +87 -8
- package/postinstall.mjs +87 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference path="./../plugin-generated.d.ts" />
|
|
2
|
+
|
|
3
|
+
import { AuthConfig, AuthServiceInput, BuiltinIdP, ExecutorServiceConfig, ExecutorServiceInput, IDToken, IdPConfig, IdProviderConfig, OAuth2Client, OAuth2ClientGrantType, OIDC, PermissionCondition, QueryType, Resolver, ResolverServiceConfig, ResolverServiceInput, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAttributeType, SCIMAuthorization, SCIMConfig, SCIMResource, StaticWebsiteConfig, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, TenantProviderConfig, UserAttributeKey, UserAttributeListKey, UserAttributeMap, UsernameFieldKey, ValueOperand, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, unauthenticatedTailorUser } from "../types-DWQxkbYl.mjs";
|
|
4
|
+
import { FunctionOperation, GqlOperation, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookTrigger, Operation, RecordCreatedArgs, RecordDeletedArgs, RecordTrigger, RecordUpdatedArgs, ResolverExecutedArgs, ResolverExecutedTrigger, ScheduleTrigger, Trigger, WebhookOperation, createExecutor, createResolver, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t } from "../index-BWN4RmSt.mjs";
|
|
5
|
+
export { AuthConfig, AuthServiceInput, BuiltinIdP, ExecutorServiceConfig, ExecutorServiceInput, FunctionOperation, GqlOperation, IDToken, IdPConfig, IdProviderConfig, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookTrigger, OAuth2Client, OAuth2ClientGrantType, OIDC, Operation, PermissionCondition, QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordTrigger, RecordUpdatedArgs, Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, ResolverServiceConfig, ResolverServiceInput, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAttributeType, SCIMAuthorization, SCIMConfig, SCIMResource, ScheduleTrigger, StaticWebsiteConfig, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, TenantProviderConfig, Trigger, UserAttributeKey, UserAttributeListKey, UserAttributeMap, UsernameFieldKey, ValueOperand, WebhookOperation, createExecutor, createResolver, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { TailorField, db, defineAuth, defineConfig, defineGenerators, t as t$1, unauthenticatedTailorUser } from "../auth-Di3vQUrT.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/configure/services/resolver/resolver.ts
|
|
4
|
+
function createResolver(config) {
|
|
5
|
+
const normalizedOutput = config.output instanceof TailorField ? config.output : t$1.object(config.output);
|
|
6
|
+
return {
|
|
7
|
+
...config,
|
|
8
|
+
output: normalizedOutput
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/configure/services/executor/executor.ts
|
|
14
|
+
function createExecutor(config) {
|
|
15
|
+
if (config.operation.kind === "graphql") config.operation.query = config.operation.query.toString();
|
|
16
|
+
return config;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/configure/services/executor/trigger/event.ts
|
|
21
|
+
function recordCreatedTrigger({ type, condition }) {
|
|
22
|
+
return {
|
|
23
|
+
kind: "recordCreated",
|
|
24
|
+
typeName: type.name,
|
|
25
|
+
condition,
|
|
26
|
+
__args: {}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function recordUpdatedTrigger({ type, condition }) {
|
|
30
|
+
return {
|
|
31
|
+
kind: "recordUpdated",
|
|
32
|
+
typeName: type.name,
|
|
33
|
+
condition,
|
|
34
|
+
__args: {}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function recordDeletedTrigger({ type, condition }) {
|
|
38
|
+
return {
|
|
39
|
+
kind: "recordDeleted",
|
|
40
|
+
typeName: type.name,
|
|
41
|
+
condition,
|
|
42
|
+
__args: {}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function resolverExecutedTrigger({ resolver, condition }) {
|
|
46
|
+
return {
|
|
47
|
+
kind: "resolverExecuted",
|
|
48
|
+
resolverName: resolver.name,
|
|
49
|
+
condition,
|
|
50
|
+
__args: {}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/configure/services/executor/trigger/schedule.ts
|
|
56
|
+
function scheduleTrigger({ cron, timezone }) {
|
|
57
|
+
return {
|
|
58
|
+
kind: "schedule",
|
|
59
|
+
cron,
|
|
60
|
+
timezone,
|
|
61
|
+
__args: {}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/configure/services/executor/trigger/webhook.ts
|
|
67
|
+
function incomingWebhookTrigger() {
|
|
68
|
+
return {
|
|
69
|
+
kind: "incomingWebhook",
|
|
70
|
+
__args: {}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/configure/services/staticwebsite/index.ts
|
|
76
|
+
function defineStaticWebSite(name, config) {
|
|
77
|
+
return {
|
|
78
|
+
...config,
|
|
79
|
+
name,
|
|
80
|
+
get url() {
|
|
81
|
+
return `${name}:url`;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/configure/services/idp/index.ts
|
|
88
|
+
function defineIdp(name, config) {
|
|
89
|
+
return {
|
|
90
|
+
...config,
|
|
91
|
+
name,
|
|
92
|
+
provider(providerName, clientName) {
|
|
93
|
+
return {
|
|
94
|
+
name: providerName,
|
|
95
|
+
kind: "BuiltInIdP",
|
|
96
|
+
namespace: name,
|
|
97
|
+
clientName
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region src/configure/index.ts
|
|
105
|
+
const t = { ...t$1 };
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
export { TailorField, createExecutor, createResolver, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, incomingWebhookTrigger, recordCreatedTrigger, recordDeletedTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser };
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/// <reference path="./plugin-generated.d.ts" />
|
|
2
|
+
|
|
3
|
+
import { AllowedValues, AllowedValuesOutput, ArrayFieldOutput, ExecutorInput, FieldMetadata, FieldOptions, FieldOutput, FunctionOperation, GqlOperation, IncomingWebhookTrigger as IncomingWebhookTrigger$1, InferFieldsOutput, RecordTrigger as RecordTrigger$1, ResolverExecutedTrigger as ResolverExecutedTrigger$1, ResolverInput, ScheduleTriggerInput, TailorDBType, TailorField, TailorUser, WebhookOperation, output as output$1 } from "./types-DWQxkbYl.mjs";
|
|
4
|
+
import { EmptyObject } from "type-fest";
|
|
5
|
+
import { Client } from "@urql/core";
|
|
6
|
+
import { StandardCRON } from "ts-cron-validator";
|
|
7
|
+
|
|
8
|
+
//#region src/configure/services/resolver/resolver.d.ts
|
|
9
|
+
type Context<Input extends Record<string, TailorField<any>> | undefined> = {
|
|
10
|
+
input: Input extends Record<string, TailorField<any>> ? InferFieldsOutput<Input> : never;
|
|
11
|
+
user: TailorUser;
|
|
12
|
+
};
|
|
13
|
+
type OutputType<O> = O extends TailorField<any> ? output$1<O> : O extends Record<string, TailorField<any>> ? InferFieldsOutput<O> : never;
|
|
14
|
+
declare function createResolver<Input extends Record<string, TailorField<any>> | undefined = undefined, Output extends TailorField<any> | Record<string, TailorField<any>> = TailorField<any>>(config: Omit<ResolverInput, "input" | "output" | "body"> & Readonly<{
|
|
15
|
+
input?: Input;
|
|
16
|
+
output: Output;
|
|
17
|
+
body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;
|
|
18
|
+
}>): {
|
|
19
|
+
output: (Output & TailorField<any, any, any>) | TailorField<{
|
|
20
|
+
type: "nested";
|
|
21
|
+
array: false;
|
|
22
|
+
}, {}, FieldMetadata>;
|
|
23
|
+
description?: string | undefined;
|
|
24
|
+
name: string;
|
|
25
|
+
operation: "query" | "mutation";
|
|
26
|
+
input?: Input;
|
|
27
|
+
body: (context: Context<Input>) => OutputType<Output> | Promise<OutputType<Output>>;
|
|
28
|
+
};
|
|
29
|
+
type ResolverConfig = ReturnType<typeof createResolver<any, any>>;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/configure/services/executor/operation.d.ts
|
|
32
|
+
type FunctionOperation$1<Args> = Omit<FunctionOperation, "body"> & {
|
|
33
|
+
body: (args: Args) => void | Promise<void>;
|
|
34
|
+
};
|
|
35
|
+
type UrqlOperationArgs = Parameters<Client["query"] | Client["mutation"]>;
|
|
36
|
+
type GqlOperation$1<Args> = Omit<GqlOperation, "query" | "variables"> & {
|
|
37
|
+
query: UrqlOperationArgs[0];
|
|
38
|
+
variables?: (args: Args) => UrqlOperationArgs[1];
|
|
39
|
+
};
|
|
40
|
+
type RequestHeader = "A-IM" | "Accept" | "Accept-Additions" | "Accept-CH" | "Accept-Charset" | "Accept-Datetime" | "Accept-Encoding" | "Accept-Features" | "Accept-Language" | "Accept-Patch" | "Accept-Post" | "Accept-Ranges" | "Accept-Signature" | "Access-Control" | "Access-Control-Allow-Credentials" | "Access-Control-Allow-Headers" | "Access-Control-Allow-Methods" | "Access-Control-Allow-Origin" | "Access-Control-Expose-Headers" | "Access-Control-Max-Age" | "Access-Control-Request-Headers" | "Access-Control-Request-Method" | "Age" | "Allow" | "ALPN" | "Alt-Svc" | "Alt-Used" | "Alternates" | "AMP-Cache-Transform" | "Apply-To-Redirect-Ref" | "Authentication-Control" | "Authentication-Info" | "Authorization" | "Available-Dictionary" | "C-Ext" | "C-Man" | "C-Opt" | "C-PEP" | "C-PEP-Info" | "Cache-Control" | "Cache-Status" | "Cal-Managed-ID" | "CalDAV-Timezones" | "Capsule-Protocol" | "CDN-Cache-Control" | "CDN-Loop" | "Cert-Not-After" | "Cert-Not-Before" | "Clear-Site-Data" | "Client-Cert" | "Client-Cert-Chain" | "Close" | "CMCD-Object" | "CMCD-Request" | "CMCD-Session" | "CMCD-Status" | "CMSD-Dynamic" | "CMSD-Static" | "Concealed-Auth-Export" | "Configuration-Context" | "Connection" | "Content-Base" | "Content-Digest" | "Content-Disposition" | "Content-Encoding" | "Content-ID" | "Content-Language" | "Content-Length" | "Content-Location" | "Content-MD5" | "Content-Range" | "Content-Script-Type" | "Content-Security-Policy" | "Content-Security-Policy-Report-Only" | "Content-Style-Type" | "Content-Type" | "Content-Version" | "Cookie" | "Cookie2" | "Cross-Origin-Embedder-Policy" | "Cross-Origin-Embedder-Policy-Report-Only" | "Cross-Origin-Opener-Policy" | "Cross-Origin-Opener-Policy-Report-Only" | "Cross-Origin-Resource-Policy" | "CTA-Common-Access-Token" | "DASL" | "Date" | "DAV" | "Default-Style" | "Delta-Base" | "Deprecation" | "Depth" | "Derived-From" | "Destination" | "Differential-ID" | "Dictionary-ID" | "Digest" | "DPoP" | "DPoP-Nonce" | "Early-Data" | "EDIINT-Features" | "ETag" | "Expect" | "Expect-CT" | "Expires" | "Ext" | "Forwarded" | "From" | "GetProfile" | "Hobareg" | "Host" | "HTTP2-Settings" | "If" | "If-Match" | "If-Modified-Since" | "If-None-Match" | "If-Range" | "If-Schedule-Tag-Match" | "If-Unmodified-Since" | "IM" | "Include-Referred-Token-Binding-ID" | "Isolation" | "Keep-Alive" | "Label" | "Last-Event-ID" | "Last-Modified" | "Link" | "Link-Template" | "Location" | "Lock-Token" | "Man" | "Max-Forwards" | "Memento-Datetime" | "Meter" | "Method-Check" | "Method-Check-Expires" | "MIME-Version" | "Negotiate" | "NEL" | "OData-EntityId" | "OData-Isolation" | "OData-MaxVersion" | "OData-Version" | "Opt" | "Optional-WWW-Authenticate" | "Ordering-Type" | "Origin" | "Origin-Agent-Cluster" | "OSCORE" | "OSLC-Core-Version" | "Overwrite" | "P3P" | "PEP" | "PEP-Info" | "Permissions-Policy" | "PICS-Label" | "Ping-From" | "Ping-To" | "Position" | "Pragma" | "Prefer" | "Preference-Applied" | "Priority" | "ProfileObject" | "Protocol" | "Protocol-Info" | "Protocol-Query" | "Protocol-Request" | "Proxy-Authenticate" | "Proxy-Authentication-Info" | "Proxy-Authorization" | "Proxy-Features" | "Proxy-Instruction" | "Proxy-Status" | "Public" | "Public-Key-Pins" | "Public-Key-Pins-Report-Only" | "Range" | "Redirect-Ref" | "Referer" | "Referer-Root" | "Referrer-Policy" | "Refresh" | "Repeatability-Client-ID" | "Repeatability-First-Sent" | "Repeatability-Request-ID" | "Repeatability-Result" | "Replay-Nonce" | "Reporting-Endpoints" | "Repr-Digest" | "Retry-After" | "Safe" | "Schedule-Reply" | "Schedule-Tag" | "Sec-GPC" | "Sec-Purpose" | "Sec-Token-Binding" | "Sec-WebSocket-Accept" | "Sec-WebSocket-Extensions" | "Sec-WebSocket-Key" | "Sec-WebSocket-Protocol" | "Sec-WebSocket-Version" | "Security-Scheme" | "Server" | "Server-Timing" | "Set-Cookie" | "Set-Cookie2" | "SetProfile" | "Signature" | "Signature-Input" | "SLUG" | "SoapAction" | "Status-URI" | "Strict-Transport-Security" | "Sunset" | "Surrogate-Capability" | "Surrogate-Control" | "TCN" | "TE" | "Timeout" | "Timing-Allow-Origin" | "Topic" | "Traceparent" | "Tracestate" | "Trailer" | "Transfer-Encoding" | "TTL" | "Upgrade" | "Urgency" | "URI" | "Use-As-Dictionary" | "User-Agent" | "Variant-Vary" | "Vary" | "Via" | "Want-Content-Digest" | "Want-Digest" | "Want-Repr-Digest" | "Warning" | "WWW-Authenticate" | "X-Content-Type-Options" | "X-Frame-Options" | (string & {});
|
|
41
|
+
type WebhookOperation$1<Args> = Omit<WebhookOperation, "url" | "body" | "headers"> & {
|
|
42
|
+
url: (args: Args) => string;
|
|
43
|
+
body?: (args: Args) => Record<string, unknown>;
|
|
44
|
+
headers?: { [key in RequestHeader]?: string | {
|
|
45
|
+
vault: string;
|
|
46
|
+
key: string;
|
|
47
|
+
} };
|
|
48
|
+
};
|
|
49
|
+
type Operation<Args> = FunctionOperation$1<Args> | GqlOperation$1<Args> | WebhookOperation$1<Args>;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/configure/services/executor/trigger/event.d.ts
|
|
52
|
+
interface EventArgs {
|
|
53
|
+
workspaceId: string;
|
|
54
|
+
appNamespace: string;
|
|
55
|
+
}
|
|
56
|
+
interface RecordArgs extends EventArgs {
|
|
57
|
+
typeName: string;
|
|
58
|
+
}
|
|
59
|
+
interface RecordCreatedArgs<T extends TailorDBType> extends RecordArgs {
|
|
60
|
+
newRecord: output$1<T>;
|
|
61
|
+
}
|
|
62
|
+
interface RecordUpdatedArgs<T extends TailorDBType> extends RecordArgs {
|
|
63
|
+
newRecord: output$1<T>;
|
|
64
|
+
oldRecord: output$1<T>;
|
|
65
|
+
}
|
|
66
|
+
interface RecordDeletedArgs<T extends TailorDBType> extends RecordArgs {
|
|
67
|
+
oldRecord: output$1<T>;
|
|
68
|
+
}
|
|
69
|
+
type ResolverExecutedArgs<R extends ResolverConfig> = EventArgs & {
|
|
70
|
+
resolverName: string;
|
|
71
|
+
} & ({
|
|
72
|
+
result: output$1<R["output"]>;
|
|
73
|
+
error: undefined;
|
|
74
|
+
} | {
|
|
75
|
+
result: undefined;
|
|
76
|
+
error: string;
|
|
77
|
+
});
|
|
78
|
+
type RecordTrigger<Args> = RecordTrigger$1 & {
|
|
79
|
+
__args: Args;
|
|
80
|
+
};
|
|
81
|
+
declare function recordCreatedTrigger<T extends TailorDBType>({
|
|
82
|
+
type,
|
|
83
|
+
condition
|
|
84
|
+
}: {
|
|
85
|
+
type: T;
|
|
86
|
+
condition?: (args: RecordCreatedArgs<T>) => boolean;
|
|
87
|
+
}): RecordTrigger<RecordCreatedArgs<T>>;
|
|
88
|
+
declare function recordUpdatedTrigger<T extends TailorDBType>({
|
|
89
|
+
type,
|
|
90
|
+
condition
|
|
91
|
+
}: {
|
|
92
|
+
type: T;
|
|
93
|
+
condition?: (args: RecordUpdatedArgs<T>) => boolean;
|
|
94
|
+
}): RecordTrigger<RecordUpdatedArgs<T>>;
|
|
95
|
+
declare function recordDeletedTrigger<T extends TailorDBType>({
|
|
96
|
+
type,
|
|
97
|
+
condition
|
|
98
|
+
}: {
|
|
99
|
+
type: T;
|
|
100
|
+
condition?: (args: RecordDeletedArgs<T>) => boolean;
|
|
101
|
+
}): RecordTrigger<RecordDeletedArgs<T>>;
|
|
102
|
+
type ResolverExecutedTrigger<Args> = ResolverExecutedTrigger$1 & {
|
|
103
|
+
__args: Args;
|
|
104
|
+
};
|
|
105
|
+
declare function resolverExecutedTrigger<R extends ResolverConfig>({
|
|
106
|
+
resolver,
|
|
107
|
+
condition
|
|
108
|
+
}: {
|
|
109
|
+
resolver: R;
|
|
110
|
+
condition?: (args: ResolverExecutedArgs<R>) => boolean;
|
|
111
|
+
}): ResolverExecutedTrigger<ResolverExecutedArgs<R>>;
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/configure/services/executor/trigger/schedule.d.ts
|
|
114
|
+
type Timezone = "UTC" | "Pacific/Midway" | "Pacific/Niue" | "Pacific/Pago_Pago" | "America/Adak" | "Pacific/Honolulu" | "Pacific/Rarotonga" | "Pacific/Tahiti" | "Pacific/Marquesas" | "America/Anchorage" | "America/Juneau" | "America/Metlakatla" | "America/Nome" | "America/Sitka" | "America/Yakutat" | "Pacific/Gambier" | "America/Los_Angeles" | "America/Tijuana" | "America/Vancouver" | "Pacific/Pitcairn" | "America/Boise" | "America/Cambridge_Bay" | "America/Chihuahua" | "America/Creston" | "America/Dawson" | "America/Dawson_Creek" | "America/Denver" | "America/Edmonton" | "America/Fort_Nelson" | "America/Hermosillo" | "America/Inuvik" | "America/Mazatlan" | "America/Ojinaga" | "America/Phoenix" | "America/Whitehorse" | "America/Yellowknife" | "America/Bahia_Banderas" | "America/Belize" | "America/Chicago" | "America/Costa_Rica" | "America/El_Salvador" | "America/Guatemala" | "America/Indiana/Knox" | "America/Indiana/Tell_City" | "America/Managua" | "America/Matamoros" | "America/Menominee" | "America/Merida" | "America/Mexico_City" | "America/Monterrey" | "America/North_Dakota/Beulah" | "America/North_Dakota/Center" | "America/North_Dakota/New_Salem" | "America/Rainy_River" | "America/Rankin_Inlet" | "America/Regina" | "America/Resolute" | "America/Swift_Current" | "America/Tegucigalpa" | "America/Winnipeg" | "Pacific/Easter" | "Pacific/Galapagos" | "America/Atikokan" | "America/Bogota" | "America/Cancun" | "America/Cayman" | "America/Detroit" | "America/Eirunepe" | "America/Grand_Turk" | "America/Guayaquil" | "America/Havana" | "America/Indiana/Indianapolis" | "America/Indiana/Marengo" | "America/Indiana/Petersburg" | "America/Indiana/Vevay" | "America/Indiana/Vincennes" | "America/Indiana/Winamac" | "America/Iqaluit" | "America/Jamaica" | "America/Kentucky/Louisville" | "America/Kentucky/Monticello" | "America/Lima" | "America/Nassau" | "America/New_York" | "America/Nipigon" | "America/Panama" | "America/Pangnirtung" | "America/Port-au-Prince" | "America/Rio_Branco" | "America/Thunder_Bay" | "America/Toronto" | "America/Anguilla" | "America/Antigua" | "America/Aruba" | "America/Asuncion" | "America/Barbados" | "America/Blanc-Sablon" | "America/Boa_Vista" | "America/Campo_Grande" | "America/Caracas" | "America/Cuiaba" | "America/Curacao" | "America/Dominica" | "America/Glace_Bay" | "America/Goose_Bay" | "America/Grenada" | "America/Guadeloupe" | "America/Guyana" | "America/Halifax" | "America/Kralendijk" | "America/La_Paz" | "America/Lower_Princes" | "America/Manaus" | "America/Marigot" | "America/Martinique" | "America/Moncton" | "America/Montserrat" | "America/Porto_Velho" | "America/Port_of_Spain" | "America/Puerto_Rico" | "America/Santiago" | "America/Santo_Domingo" | "America/St_Barthelemy" | "America/St_Kitts" | "America/St_Lucia" | "America/St_Thomas" | "America/St_Vincent" | "America/Thule" | "America/Tortola" | "Atlantic/Bermuda" | "America/St_Johns" | "America/Araguaina" | "America/Argentina/Buenos_Aires" | "America/Argentina/Catamarca" | "America/Argentina/Cordoba" | "America/Argentina/Jujuy" | "America/Argentina/La_Rioja" | "America/Argentina/Mendoza" | "America/Argentina/Rio_Gallegos" | "America/Argentina/Salta" | "America/Argentina/San_Juan" | "America/Argentina/San_Luis" | "America/Argentina/Tucuman" | "America/Argentina/Ushuaia" | "America/Bahia" | "America/Belem" | "America/Cayenne" | "America/Fortaleza" | "America/Godthab" | "America/Maceio" | "America/Miquelon" | "America/Montevideo" | "America/Paramaribo" | "America/Punta_Arenas" | "America/Recife" | "America/Santarem" | "America/Sao_Paulo" | "Antarctica/Palmer" | "Antarctica/Rothera" | "Atlantic/Stanley" | "America/Noronha" | "Atlantic/South_Georgia" | "America/Scoresbysund" | "Atlantic/Azores" | "Atlantic/Cape_Verde" | "Africa/Abidjan" | "Africa/Accra" | "Africa/Bamako" | "Africa/Banjul" | "Africa/Bissau" | "Africa/Casablanca" | "Africa/Conakry" | "Africa/Dakar" | "Africa/El_Aaiun" | "Africa/Freetown" | "Africa/Lome" | "Africa/Monrovia" | "Africa/Nouakchott" | "Africa/Ouagadougou" | "Africa/Sao_Tome" | "America/Danmarkshavn" | "Antarctica/Troll" | "Atlantic/Canary" | "Atlantic/Faroe" | "Atlantic/Madeira" | "Atlantic/Reykjavik" | "Atlantic/St_Helena" | "Europe/Dublin" | "Europe/Guernsey" | "Europe/Isle_of_Man" | "Europe/Jersey" | "Europe/Lisbon" | "Europe/London" | "Africa/Algiers" | "Africa/Bangui" | "Africa/Brazzaville" | "Africa/Ceuta" | "Africa/Douala" | "Africa/Kinshasa" | "Africa/Lagos" | "Africa/Libreville" | "Africa/Luanda" | "Africa/Malabo" | "Africa/Ndjamena" | "Africa/Niamey" | "Africa/Porto-Novo" | "Africa/Tunis" | "Africa/Windhoek" | "Arctic/Longyearbyen" | "Europe/Amsterdam" | "Europe/Andorra" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Gibraltar" | "Europe/Ljubljana" | "Europe/Luxembourg" | "Europe/Madrid" | "Europe/Malta" | "Europe/Monaco" | "Europe/Oslo" | "Europe/Paris" | "Europe/Podgorica" | "Europe/Prague" | "Europe/Rome" | "Europe/San_Marino" | "Europe/Sarajevo" | "Europe/Skopje" | "Europe/Stockholm" | "Europe/Tirane" | "Europe/Vaduz" | "Europe/Vatican" | "Europe/Vienna" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zurich" | "Africa/Blantyre" | "Africa/Bujumbura" | "Africa/Cairo" | "Africa/Gaborone" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Juba" | "Africa/Khartoum" | "Africa/Kigali" | "Africa/Lubumbashi" | "Africa/Lusaka" | "Africa/Maputo" | "Africa/Maseru" | "Africa/Mbabane" | "Africa/Tripoli" | "Asia/Amman" | "Asia/Beirut" | "Asia/Damascus" | "Asia/Famagusta" | "Asia/Gaza" | "Asia/Hebron" | "Asia/Jerusalem" | "Asia/Nicosia" | "Europe/Athens" | "Europe/Bucharest" | "Europe/Chisinau" | "Europe/Helsinki" | "Europe/Kaliningrad" | "Europe/Kyiv" | "Europe/Mariehamn" | "Europe/Riga" | "Europe/Sofia" | "Europe/Tallinn" | "Europe/Uzhgorod" | "Europe/Vilnius" | "Europe/Zaporizhzhia" | "Africa/Addis_Ababa" | "Africa/Asmara" | "Africa/Dar_es_Salaam" | "Africa/Djibouti" | "Africa/Kampala" | "Africa/Mogadishu" | "Africa/Nairobi" | "Antarctica/Syowa" | "Asia/Aden" | "Asia/Baghdad" | "Asia/Bahrain" | "Asia/Kuwait" | "Asia/Qatar" | "Asia/Riyadh" | "Europe/Istanbul" | "Europe/Kirov" | "Europe/Minsk" | "Europe/Moscow" | "Europe/Simferopol" | "Europe/Volgograd" | "Indian/Antananarivo" | "Indian/Comoro" | "Indian/Mayotte" | "Asia/Tehran" | "Asia/Baku" | "Asia/Dubai" | "Asia/Muscat" | "Asia/Tbilisi" | "Asia/Yerevan" | "Europe/Astrakhan" | "Europe/Samara" | "Europe/Saratov" | "Europe/Ulyanovsk" | "Indian/Mahe" | "Indian/Mauritius" | "Indian/Reunion" | "Asia/Kabul" | "Antarctica/Mawson" | "Asia/Aqtau" | "Asia/Aqtobe" | "Asia/Ashgabat" | "Asia/Atyrau" | "Asia/Dushanbe" | "Asia/Karachi" | "Asia/Oral" | "Asia/Qyzylorda" | "Asia/Samarkand" | "Asia/Tashkent" | "Asia/Yekaterinburg" | "Indian/Kerguelen" | "Indian/Maldives" | "Asia/Colombo" | "Asia/Kolkata" | "Asia/Kathmandu" | "Antarctica/Vostok" | "Asia/Almaty" | "Asia/Bishkek" | "Asia/Dhaka" | "Asia/Omsk" | "Asia/Qostanay" | "Asia/Thimphu" | "Asia/Urumqi" | "Indian/Chagos" | "Asia/Yangon" | "Indian/Cocos" | "Antarctica/Davis" | "Asia/Bangkok" | "Asia/Barnaul" | "Asia/Hovd" | "Asia/Ho_Chi_Minh" | "Asia/Jakarta" | "Asia/Krasnoyarsk" | "Asia/Novokuznetsk" | "Asia/Novosibirsk" | "Asia/Phnom_Penh" | "Asia/Pontianak" | "Asia/Tomsk" | "Asia/Vientiane" | "Indian/Christmas" | "Asia/Brunei" | "Asia/Choibalsan" | "Asia/Hong_Kong" | "Asia/Irkutsk" | "Asia/Kuala_Lumpur" | "Asia/Kuching" | "Asia/Macau" | "Asia/Makassar" | "Asia/Manila" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Taipei" | "Asia/Ulaanbaatar" | "Australia/Perth" | "Australia/Eucla" | "Asia/Chita" | "Asia/Dili" | "Asia/Jayapura" | "Asia/Khandyga" | "Asia/Pyongyang" | "Asia/Seoul" | "Asia/Tokyo" | "Asia/Yakutsk" | "Pacific/Palau" | "Australia/Adelaide" | "Australia/Broken_Hill" | "Australia/Darwin" | "Antarctica/DumontDUrville" | "Antarctica/Macquarie" | "Asia/Ust-Nera" | "Asia/Vladivostok" | "Australia/Brisbane" | "Australia/Currie" | "Australia/Hobart" | "Australia/Lindeman" | "Australia/Melbourne" | "Australia/Sydney" | "Pacific/Chuuk" | "Pacific/Guam" | "Pacific/Port_Moresby" | "Pacific/Saipan" | "Australia/Lord_Howe" | "Antarctica/Casey" | "Asia/Magadan" | "Asia/Sakhalin" | "Asia/Srednekolymsk" | "Pacific/Bougainville" | "Pacific/Efate" | "Pacific/Guadalcanal" | "Pacific/Kosrae" | "Pacific/Norfolk" | "Pacific/Noumea" | "Pacific/Pohnpei" | "Antarctica/McMurdo" | "Asia/Anadyr" | "Asia/Kamchatka" | "Pacific/Auckland" | "Pacific/Fiji" | "Pacific/Funafuti" | "Pacific/Kwajalein" | "Pacific/Majuro" | "Pacific/Nauru" | "Pacific/Tarawa" | "Pacific/Wake" | "Pacific/Wallis" | "Pacific/Chatham" | "Pacific/Apia" | "Pacific/Enderbury" | "Pacific/Fakaofo" | "Pacific/Tongatapu" | "Pacific/Kiritimati";
|
|
115
|
+
type ScheduleTrigger<Args> = ScheduleTriggerInput & {
|
|
116
|
+
__args: Args;
|
|
117
|
+
};
|
|
118
|
+
declare function scheduleTrigger<T extends string>({
|
|
119
|
+
cron,
|
|
120
|
+
timezone
|
|
121
|
+
}: {
|
|
122
|
+
cron: StandardCRON<T> extends never ? never : T;
|
|
123
|
+
timezone?: Timezone;
|
|
124
|
+
}): ScheduleTrigger<EmptyObject>;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/configure/services/executor/trigger/webhook.d.ts
|
|
127
|
+
interface IncomingWebhookArgs<T extends IncomingWebhookRequest> {
|
|
128
|
+
body: T["body"];
|
|
129
|
+
headers: T["headers"];
|
|
130
|
+
method: "POST" | "GET" | "PUT" | "DELETE";
|
|
131
|
+
rawBody: string;
|
|
132
|
+
}
|
|
133
|
+
interface IncomingWebhookRequest {
|
|
134
|
+
body: Record<string, unknown>;
|
|
135
|
+
headers: Record<string, string>;
|
|
136
|
+
}
|
|
137
|
+
type IncomingWebhookTrigger<Args> = IncomingWebhookTrigger$1 & {
|
|
138
|
+
__args: Args;
|
|
139
|
+
};
|
|
140
|
+
declare function incomingWebhookTrigger<T extends IncomingWebhookRequest>(): IncomingWebhookTrigger<IncomingWebhookArgs<T>>;
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/configure/services/executor/trigger/index.d.ts
|
|
143
|
+
type Trigger<Args> = RecordTrigger<Args> | ResolverExecutedTrigger<Args> | ScheduleTrigger<Args> | IncomingWebhookTrigger<Args>;
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region src/configure/services/executor/executor.d.ts
|
|
146
|
+
type Executor<Args, O extends Operation<Args>> = Omit<ExecutorInput, "trigger" | "operation"> & {
|
|
147
|
+
trigger: Trigger<Args>;
|
|
148
|
+
operation: O;
|
|
149
|
+
};
|
|
150
|
+
declare function createExecutor<Args, O extends Operation<Args>>(config: Executor<Args, O>): Executor<Args, O>;
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/configure/index.d.ts
|
|
153
|
+
type TailorOutput<T> = output$1<T>;
|
|
154
|
+
type infer<T> = TailorOutput<T>;
|
|
155
|
+
type output<T> = TailorOutput<T>;
|
|
156
|
+
declare const t: {
|
|
157
|
+
uuid: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
158
|
+
type: "uuid";
|
|
159
|
+
array: Opt extends {
|
|
160
|
+
array: true;
|
|
161
|
+
} ? true : false;
|
|
162
|
+
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>, FieldMetadata>;
|
|
163
|
+
string: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
164
|
+
type: "string";
|
|
165
|
+
array: Opt extends {
|
|
166
|
+
array: true;
|
|
167
|
+
} ? true : false;
|
|
168
|
+
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>, FieldMetadata>;
|
|
169
|
+
bool: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
170
|
+
type: "boolean";
|
|
171
|
+
array: Opt extends {
|
|
172
|
+
array: true;
|
|
173
|
+
} ? true : false;
|
|
174
|
+
}, Opt["optional"] extends true ? ArrayFieldOutput<boolean, Opt> | null : ArrayFieldOutput<boolean, Opt>, FieldMetadata>;
|
|
175
|
+
int: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
176
|
+
type: "integer";
|
|
177
|
+
array: Opt extends {
|
|
178
|
+
array: true;
|
|
179
|
+
} ? true : false;
|
|
180
|
+
}, Opt["optional"] extends true ? ArrayFieldOutput<number, Opt> | null : ArrayFieldOutput<number, Opt>, FieldMetadata>;
|
|
181
|
+
float: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
182
|
+
type: "float";
|
|
183
|
+
array: Opt extends {
|
|
184
|
+
array: true;
|
|
185
|
+
} ? true : false;
|
|
186
|
+
}, Opt["optional"] extends true ? ArrayFieldOutput<number, Opt> | null : ArrayFieldOutput<number, Opt>, FieldMetadata>;
|
|
187
|
+
date: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
188
|
+
type: "date";
|
|
189
|
+
array: Opt extends {
|
|
190
|
+
array: true;
|
|
191
|
+
} ? true : false;
|
|
192
|
+
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>, FieldMetadata>;
|
|
193
|
+
datetime: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
194
|
+
type: "datetime";
|
|
195
|
+
array: Opt extends {
|
|
196
|
+
array: true;
|
|
197
|
+
} ? true : false;
|
|
198
|
+
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>, FieldMetadata>;
|
|
199
|
+
time: <const Opt extends FieldOptions>(options?: Opt) => TailorField<{
|
|
200
|
+
type: "time";
|
|
201
|
+
array: Opt extends {
|
|
202
|
+
array: true;
|
|
203
|
+
} ? true : false;
|
|
204
|
+
}, Opt["optional"] extends true ? ArrayFieldOutput<string, Opt> | null : ArrayFieldOutput<string, Opt>, FieldMetadata>;
|
|
205
|
+
enum: {
|
|
206
|
+
<const V extends AllowedValues>(...values: V): TailorField<{
|
|
207
|
+
type: "enum";
|
|
208
|
+
array: false;
|
|
209
|
+
}, FieldOutput<AllowedValuesOutput<V>, {
|
|
210
|
+
optional: false;
|
|
211
|
+
array: false;
|
|
212
|
+
}>>;
|
|
213
|
+
<const V extends AllowedValues, const Opt extends FieldOptions>(...args: [...V, Opt]): TailorField<{
|
|
214
|
+
type: "enum";
|
|
215
|
+
array: Opt extends {
|
|
216
|
+
array: true;
|
|
217
|
+
} ? true : false;
|
|
218
|
+
}, FieldOutput<AllowedValuesOutput<V>, Opt>>;
|
|
219
|
+
};
|
|
220
|
+
object: <const F extends Record<string, TailorField<any>>, const Opt extends FieldOptions>(fields: F, options?: Opt) => TailorField<{
|
|
221
|
+
type: "nested";
|
|
222
|
+
array: Opt extends {
|
|
223
|
+
array: true;
|
|
224
|
+
} ? true : false;
|
|
225
|
+
}, FieldOutput<InferFieldsOutput<F>, Opt>, FieldMetadata>;
|
|
226
|
+
};
|
|
227
|
+
declare namespace t {
|
|
228
|
+
type output<T> = TailorOutput<T>;
|
|
229
|
+
type infer<T> = TailorOutput<T>;
|
|
230
|
+
}
|
|
231
|
+
//#endregion
|
|
232
|
+
export { FunctionOperation$1 as FunctionOperation, GqlOperation$1 as GqlOperation, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookTrigger, Operation, RecordCreatedArgs, RecordDeletedArgs, RecordTrigger, RecordUpdatedArgs, ResolverExecutedArgs, ResolverExecutedTrigger, ScheduleTrigger, Trigger, WebhookOperation$1 as WebhookOperation, createExecutor, createResolver, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// This file is auto-generated by @tailor-platform/sdk
|
|
2
|
+
// Do not edit this file manually
|
|
3
|
+
// Regenerated automatically when running 'tailor-sdk apply' or 'tailor-sdk generate'
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
namespace TailorSDK {
|
|
7
|
+
interface AttributeMap {}
|
|
8
|
+
interface AttributeList {
|
|
9
|
+
__tuple: string[];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {};
|