@tailor-platform/sdk 1.4.0 → 1.4.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/CHANGELOG.md +24 -0
- package/dist/cli/index.mjs +35 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +2 -1
- package/dist/cli/lib.mjs +1 -1
- package/dist/configure/index.d.mts +2 -2
- package/dist/{index-CTExbeYE.d.mts → index-lDsl6VDv.d.mts} +8 -3
- package/dist/{list-1cs_CGF8.mjs → list-QT92XcP3.mjs} +42 -2
- package/dist/{list-1cs_CGF8.mjs.map → list-QT92XcP3.mjs.map} +1 -1
- package/dist/{types-Yxg4lgU0.d.mts → types-BWzDv7TK.d.mts} +12 -17
- package/dist/utils/test/index.d.mts +2 -2
- package/docs/cli/application.md +14 -0
- package/docs/cli/workspace.md +2 -0
- package/package.json +2 -2
package/dist/cli/lib.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference path="./../user-defined.d.ts" />
|
|
2
|
-
import { H as IdProviderConfig, R as ParsedTailorDBType, W as OAuth2ClientInput, d as AppConfig, m as Generator, t as Executor
|
|
2
|
+
import { H as IdProviderConfig, R as ParsedTailorDBType, W as OAuth2ClientInput, _t as Resolver, d as AppConfig, m as Generator, t as Executor } from "../types-BWzDv7TK.mjs";
|
|
3
|
+
import "citty";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { OAuth2Client } from "@badgateway/oauth2-client";
|
|
5
6
|
import "@bufbuild/protobuf/wkt";
|
package/dist/cli/lib.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../chunk-CIV_ash9.mjs";
|
|
2
2
|
import "../config-CBpYlVa-.mjs";
|
|
3
|
-
import { D as getOAuth2Client, H as loadWorkspaceId, I as generateUserTypes, L as loadConfig, M as generate, O as getMachineUserToken, P as apply, R as apiCall, S as remove, T as listOAuth2Clients, V as loadAccessToken, _ as listWorkflowExecutions, b as show, c as resumeWorkflow, f as listWorkflows, g as getWorkflowExecution, i as deleteWorkspace, j as listMachineUsers, m as getWorkflow, n as listWorkspaces, o as createWorkspace, u as startWorkflow, v as truncate } from "../list-
|
|
3
|
+
import { D as getOAuth2Client, H as loadWorkspaceId, I as generateUserTypes, L as loadConfig, M as generate, O as getMachineUserToken, P as apply, R as apiCall, S as remove, T as listOAuth2Clients, V as loadAccessToken, _ as listWorkflowExecutions, b as show, c as resumeWorkflow, f as listWorkflows, g as getWorkflowExecution, i as deleteWorkspace, j as listMachineUsers, m as getWorkflow, n as listWorkspaces, o as createWorkspace, u as startWorkflow, v as truncate } from "../list-QT92XcP3.mjs";
|
|
4
4
|
import { register } from "node:module";
|
|
5
5
|
|
|
6
6
|
//#region src/cli/lib.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference path="./../user-defined.d.ts" />
|
|
2
|
-
import { $ as TenantProviderConfig, A as AuthOwnConfig, B as BuiltinIdP, C as ResolverServiceConfig, D as AuthConfig, E as ExecutorServiceInput, F as db, G as OIDC, H as IdProviderConfig, J as SCIMAttributeMapping, K as SAML, M as TailorDBField, N as TailorDBInstance, O as AuthExternalConfig, P as TailorDBType, Q as SCIMResource, S as ResolverExternalConfig, T as ExecutorServiceConfig, U as OAuth2ClientGrantType, V as IDToken, W as OAuth2ClientInput, X as SCIMAuthorization, Y as SCIMAttributeType, Z as SCIMConfig, _ as StaticWebsiteConfig, _t as
|
|
3
|
-
import { A as createWorkflow, C as FunctionOperation, D as WorkflowOperation, E as WebhookOperation, F as WorkflowJobOutput, I as createWorkflowJob, L as createResolver, M as WorkflowJob, N as WorkflowJobContext, O as Workflow, P as WorkflowJobInput, S as resolverExecutedTrigger, T as Operation, _ as ResolverExecutedArgs, a as Trigger, b as recordDeletedTrigger, c as IncomingWebhookTrigger, d as ScheduleTrigger, f as scheduleTrigger, g as RecordUpdatedArgs, h as RecordTrigger, i as createExecutor, j as WORKFLOW_JOB_BRAND, k as WorkflowConfig, l as incomingWebhookTrigger, m as RecordDeletedArgs, n as output, o as IncomingWebhookArgs, p as RecordCreatedArgs, r as t, s as IncomingWebhookRequest, t as infer, u as ScheduleArgs, v as ResolverExecutedTrigger, w as GqlOperation, x as recordUpdatedTrigger, y as recordCreatedTrigger } from "../index-
|
|
2
|
+
import { $ as TenantProviderConfig, A as AuthOwnConfig, B as BuiltinIdP, C as ResolverServiceConfig, D as AuthConfig, E as ExecutorServiceInput, F as db, G as OIDC, H as IdProviderConfig, J as SCIMAttributeMapping, K as SAML, M as TailorDBField, N as TailorDBInstance, O as AuthExternalConfig, P as TailorDBType, Q as SCIMResource, S as ResolverExternalConfig, T as ExecutorServiceConfig, U as OAuth2ClientGrantType, V as IDToken, W as OAuth2ClientInput, X as SCIMAuthorization, Y as SCIMAttributeType, Z as SCIMConfig, _ as StaticWebsiteConfig, _t as Resolver, at as PermissionCondition, b as IdPExternalConfig, ct as unsafeAllowAllGqlPermission, dt as AttributeMap, et as UserAttributeKey, f as defineConfig, ft as TailorUser, g as WorkflowServiceInput, gt as QueryType, h as WorkflowServiceConfig, ht as TailorField, it as ValueOperand, j as defineAuth, k as AuthInvoker, lt as unsafeAllowAllTypePermission, nt as UserAttributeMap, ot as TailorTypeGqlPermission, p as defineGenerators, pt as unauthenticatedTailorUser, q as SCIMAttribute, rt as UsernameFieldKey, st as TailorTypePermission, tt as UserAttributeListKey, ut as AttributeList, v as defineStaticWebSite, w as ResolverServiceInput, x as defineIdp, y as IdPConfig, z as AuthServiceInput } from "../types-BWzDv7TK.mjs";
|
|
3
|
+
import { A as createWorkflow, C as FunctionOperation, D as WorkflowOperation, E as WebhookOperation, F as WorkflowJobOutput, I as createWorkflowJob, L as createResolver, M as WorkflowJob, N as WorkflowJobContext, O as Workflow, P as WorkflowJobInput, R as Env, S as resolverExecutedTrigger, T as Operation, _ as ResolverExecutedArgs, a as Trigger, b as recordDeletedTrigger, c as IncomingWebhookTrigger, d as ScheduleTrigger, f as scheduleTrigger, g as RecordUpdatedArgs, h as RecordTrigger, i as createExecutor, j as WORKFLOW_JOB_BRAND, k as WorkflowConfig, l as incomingWebhookTrigger, m as RecordDeletedArgs, n as output, o as IncomingWebhookArgs, p as RecordCreatedArgs, r as t, s as IncomingWebhookRequest, t as infer, u as ScheduleArgs, v as ResolverExecutedTrigger, w as GqlOperation, x as recordUpdatedTrigger, y as recordCreatedTrigger } from "../index-lDsl6VDv.mjs";
|
|
4
4
|
export { AttributeList, AttributeMap, AuthConfig, AuthExternalConfig, AuthInvoker, AuthOwnConfig, AuthServiceInput, BuiltinIdP, Env, ExecutorServiceConfig, ExecutorServiceInput, FunctionOperation, GqlOperation, IDToken, IdPConfig, IdPExternalConfig, IdProviderConfig, IncomingWebhookArgs, IncomingWebhookRequest, IncomingWebhookTrigger, OAuth2ClientInput as OAuth2Client, OAuth2ClientGrantType, OIDC, Operation, PermissionCondition, QueryType, RecordCreatedArgs, RecordDeletedArgs, RecordTrigger, RecordUpdatedArgs, Resolver, ResolverExecutedArgs, ResolverExecutedTrigger, ResolverExternalConfig, ResolverServiceConfig, ResolverServiceInput, SAML, SCIMAttribute, SCIMAttributeMapping, SCIMAttributeType, SCIMAuthorization, SCIMConfig, SCIMResource, ScheduleArgs, ScheduleTrigger, StaticWebsiteConfig, TailorDBField, TailorDBInstance, TailorDBType, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, TenantProviderConfig, Trigger, UserAttributeKey, UserAttributeListKey, UserAttributeMap, UsernameFieldKey, ValueOperand, WORKFLOW_JOB_BRAND, WebhookOperation, Workflow, WorkflowConfig, WorkflowJob, WorkflowJobContext, WorkflowJobInput, WorkflowJobOutput, WorkflowOperation, WorkflowServiceConfig, WorkflowServiceInput, createExecutor, createResolver, createWorkflow, createWorkflowJob, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, incomingWebhookTrigger, infer, output, recordCreatedTrigger, recordDeletedTrigger, recordUpdatedTrigger, resolverExecutedTrigger, scheduleTrigger, t, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
/// <reference path="./user-defined.d.ts" />
|
|
2
|
-
import { Ct as
|
|
2
|
+
import { Ct as TailorFieldType, Et as output$1, I as AllowedValues, L as AllowedValuesOutput, P as TailorDBType, St as FieldOutput, Tt as JsonCompatible, a as IncomingWebhookTrigger$1, bt as FieldMetadata, c as ScheduleTriggerInput, ft as TailorUser, ht as TailorField, i as GqlOperation$1, k as AuthInvoker, l as WebhookOperation$1, mt as TailorAnyField, n as ExecutorInput, o as RecordTrigger$1, r as FunctionOperation$1, s as ResolverExecutedTrigger$1, u as WorkflowOperation$1, vt as ResolverInput, wt as InferFieldsOutput, xt as FieldOptions, yt as ArrayFieldOutput } from "./types-BWzDv7TK.mjs";
|
|
3
3
|
import { JsonPrimitive, Jsonifiable, Jsonify } from "type-fest";
|
|
4
4
|
import { Client } from "@urql/core";
|
|
5
5
|
import { StandardCRON } from "ts-cron-validator";
|
|
6
6
|
|
|
7
|
+
//#region src/configure/types/env.d.ts
|
|
8
|
+
interface Env {}
|
|
9
|
+
/** Represents environment variables in the Tailor platform. */
|
|
10
|
+
type TailorEnv = keyof Env extends never ? Record<string, string> : Env;
|
|
11
|
+
//#endregion
|
|
7
12
|
//#region src/configure/services/resolver/resolver.d.ts
|
|
8
13
|
type Context<Input extends Record<string, TailorAnyField> | undefined> = {
|
|
9
14
|
input: Input extends Record<string, TailorAnyField> ? InferFieldsOutput<Input> : never;
|
|
@@ -425,5 +430,5 @@ declare namespace t {
|
|
|
425
430
|
type infer<T> = TailorOutput<T>;
|
|
426
431
|
}
|
|
427
432
|
//#endregion
|
|
428
|
-
export { createWorkflow as A, FunctionOperation as C, WorkflowOperation as D, WebhookOperation as E, WorkflowJobOutput as F, createWorkflowJob as I, createResolver as L, WorkflowJob as M, WorkflowJobContext as N, Workflow as O, WorkflowJobInput as P, resolverExecutedTrigger as S, Operation as T, ResolverExecutedArgs as _, Trigger as a, recordDeletedTrigger as b, IncomingWebhookTrigger as c, ScheduleTrigger as d, scheduleTrigger as f, RecordUpdatedArgs as g, RecordTrigger as h, createExecutor as i, WORKFLOW_JOB_BRAND as j, WorkflowConfig as k, incomingWebhookTrigger as l, RecordDeletedArgs as m, output as n, IncomingWebhookArgs as o, RecordCreatedArgs as p, t as r, IncomingWebhookRequest as s, infer as t, ScheduleArgs as u, ResolverExecutedTrigger as v, GqlOperation as w, recordUpdatedTrigger as x, recordCreatedTrigger as y };
|
|
429
|
-
//# sourceMappingURL=index-
|
|
433
|
+
export { createWorkflow as A, FunctionOperation as C, WorkflowOperation as D, WebhookOperation as E, WorkflowJobOutput as F, createWorkflowJob as I, createResolver as L, WorkflowJob as M, WorkflowJobContext as N, Workflow as O, WorkflowJobInput as P, Env as R, resolverExecutedTrigger as S, Operation as T, ResolverExecutedArgs as _, Trigger as a, recordDeletedTrigger as b, IncomingWebhookTrigger as c, ScheduleTrigger as d, scheduleTrigger as f, RecordUpdatedArgs as g, RecordTrigger as h, createExecutor as i, WORKFLOW_JOB_BRAND as j, WorkflowConfig as k, incomingWebhookTrigger as l, RecordDeletedArgs as m, output as n, IncomingWebhookArgs as o, RecordCreatedArgs as p, t as r, IncomingWebhookRequest as s, infer as t, ScheduleArgs as u, ResolverExecutedTrigger as v, GqlOperation as w, recordUpdatedTrigger as x, recordCreatedTrigger as y };
|
|
434
|
+
//# sourceMappingURL=index-lDsl6VDv.d.mts.map
|
|
@@ -104826,7 +104826,7 @@ async function planWorkflow(client, workspaceId, appName, workflows, mainJobDeps
|
|
|
104826
104826
|
const existing = existingWorkflows[workflow.name];
|
|
104827
104827
|
const metaRequest = await buildMetaRequest(workflowTrn(workspaceId, workflow.name), appName);
|
|
104828
104828
|
const usedJobNames = mainJobDeps[workflow.mainJob.name];
|
|
104829
|
-
if (!usedJobNames) throw new Error(`
|
|
104829
|
+
if (!usedJobNames) throw new Error(`Job "${workflow.mainJob.name}" (mainJob of workflow "${workflow.name}") was not found.\n\nPossible causes:\n - The job is not exported as a named export\n - The file containing the job is not included in workflow.files glob pattern\n\nSolution:\n export const ${workflow.mainJob.name} = createWorkflowJob({ name: "${workflow.mainJob.name}", ... })`);
|
|
104830
104830
|
if (existing) {
|
|
104831
104831
|
if (!existing.label) unmanaged.push({
|
|
104832
104832
|
resourceType: "Workflow",
|
|
@@ -107380,6 +107380,15 @@ const createCommand = defineCommand({
|
|
|
107380
107380
|
type: "string",
|
|
107381
107381
|
description: "Folder ID to workspace associate with",
|
|
107382
107382
|
alias: "f"
|
|
107383
|
+
},
|
|
107384
|
+
"profile-name": {
|
|
107385
|
+
type: "string",
|
|
107386
|
+
description: "Profile name to create",
|
|
107387
|
+
alias: "p"
|
|
107388
|
+
},
|
|
107389
|
+
"profile-user": {
|
|
107390
|
+
type: "string",
|
|
107391
|
+
description: "User email for the profile (defaults to current user)"
|
|
107383
107392
|
}
|
|
107384
107393
|
},
|
|
107385
107394
|
run: withCommonArgs(async (args) => {
|
|
@@ -107390,8 +107399,39 @@ const createCommand = defineCommand({
|
|
|
107390
107399
|
organizationId: args["organization-id"],
|
|
107391
107400
|
folderId: args["folder-id"]
|
|
107392
107401
|
});
|
|
107402
|
+
let profileInfo;
|
|
107403
|
+
const profileName = args["profile-name"];
|
|
107404
|
+
if (profileName) {
|
|
107405
|
+
const config = readPlatformConfig();
|
|
107406
|
+
if (config.profiles[profileName]) throw new Error(`Profile "${profileName}" already exists.`);
|
|
107407
|
+
const profileUser = args["profile-user"] || config.current_user;
|
|
107408
|
+
if (!profileUser) throw new Error("Current user not found. Please login or specify --profile-user to create a profile.");
|
|
107409
|
+
if (!config.users[profileUser]) throw new Error(`User "${profileUser}" not found.\nPlease verify your user name and login using 'tailor-sdk login' command.`);
|
|
107410
|
+
config.profiles[profileName] = {
|
|
107411
|
+
user: profileUser,
|
|
107412
|
+
workspace_id: workspace.id
|
|
107413
|
+
};
|
|
107414
|
+
writePlatformConfig(config);
|
|
107415
|
+
profileInfo = {
|
|
107416
|
+
name: profileName,
|
|
107417
|
+
user: profileUser,
|
|
107418
|
+
workspaceId: workspace.id
|
|
107419
|
+
};
|
|
107420
|
+
if (!args.json) logger.success(`Profile "${profileName}" created successfully.`);
|
|
107421
|
+
}
|
|
107393
107422
|
if (!args.json) logger.success(`Workspace "${args.name}" created successfully.`);
|
|
107423
|
+
if (args.json && profileInfo) {
|
|
107424
|
+
logger.out({
|
|
107425
|
+
...workspace,
|
|
107426
|
+
profile: profileInfo
|
|
107427
|
+
});
|
|
107428
|
+
return;
|
|
107429
|
+
}
|
|
107394
107430
|
logger.out(workspace);
|
|
107431
|
+
if (profileInfo) {
|
|
107432
|
+
logger.out("Profile:");
|
|
107433
|
+
logger.out(profileInfo);
|
|
107434
|
+
}
|
|
107395
107435
|
})
|
|
107396
107436
|
});
|
|
107397
107437
|
|
|
@@ -107516,4 +107556,4 @@ const listCommand = defineCommand({
|
|
|
107516
107556
|
|
|
107517
107557
|
//#endregion
|
|
107518
107558
|
export { deploymentArgs as $, listCommand$3 as A, fetchLatestToken as B, removeCommand as C, getOAuth2Client as D, getCommand$1 as E, applyCommand as F, fetchAll as G, loadWorkspaceId as H, generateUserTypes as I, initOperatorClient as J, fetchUserInfo as K, loadConfig as L, generate as M, generateCommand as N, getMachineUserToken as O, apply as P, confirmationArgs as Q, apiCall as R, remove as S, listOAuth2Clients as T, readPlatformConfig as U, loadAccessToken as V, writePlatformConfig as W, PATScope as X, readPackageJson as Y, commonArgs as Z, listWorkflowExecutions as _, createCommand as a, show as b, resumeWorkflow as c, listCommand$1 as d, jsonArgs as et, listWorkflows as f, getWorkflowExecution as g, executionsCommand as h, deleteWorkspace as i, listMachineUsers as j, tokenCommand as k, startCommand as l, getWorkflow as m, listWorkspaces as n, workspaceArgs as nt, createWorkspace as o, getCommand as p, initOAuth2Client as q, deleteCommand as r, logger as rt, resumeCommand as s, listCommand as t, withCommonArgs as tt, startWorkflow as u, truncate as v, listCommand$2 as w, showCommand as x, truncateCommand as y, apiCommand as z };
|
|
107519
|
-
//# sourceMappingURL=list-
|
|
107559
|
+
//# sourceMappingURL=list-QT92XcP3.mjs.map
|