@tailor-platform/sdk 0.16.0 → 0.16.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.
@@ -1380,7 +1380,7 @@ declare const FunctionOperationSchema: z.ZodObject<{
1380
1380
  declare const GqlOperationSchema: z.ZodObject<{
1381
1381
  kind: z.ZodLiteral<"graphql">;
1382
1382
  appName: z.ZodOptional<z.ZodString>;
1383
- query: z.ZodString;
1383
+ query: z.ZodPipe<z.ZodTransform<string, unknown>, z.ZodString>;
1384
1384
  variables: z.ZodOptional<z.ZodCustom<Function, Function>>;
1385
1385
  authInvoker: z.ZodOptional<z.ZodObject<{
1386
1386
  namespace: z.ZodString;
@@ -1396,6 +1396,15 @@ declare const WebhookOperationSchema: z.ZodObject<{
1396
1396
  key: z.ZodString;
1397
1397
  }, z.core.$strip>]>>>;
1398
1398
  }, z.core.$strip>;
1399
+ declare const WorkflowOperationSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
1400
+ kind: z.ZodLiteral<"workflow">;
1401
+ workflowName: z.ZodString;
1402
+ args: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodCustom<Function, Function>]>>;
1403
+ authInvoker: z.ZodOptional<z.ZodObject<{
1404
+ namespace: z.ZodString;
1405
+ machineUserName: z.ZodString;
1406
+ }, z.core.$strip>>;
1407
+ }, z.core.$strip>>;
1399
1408
  declare const ExecutorSchema: z.ZodObject<{
1400
1409
  name: z.ZodString;
1401
1410
  description: z.ZodOptional<z.ZodString>;
@@ -1419,7 +1428,7 @@ declare const ExecutorSchema: z.ZodObject<{
1419
1428
  }, z.core.$strip>, z.ZodObject<{
1420
1429
  kind: z.ZodLiteral<"incomingWebhook">;
1421
1430
  }, z.core.$strip>], "kind">;
1422
- operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
1431
+ operation: z.ZodUnion<readonly [z.ZodObject<{
1423
1432
  kind: z.ZodEnum<{
1424
1433
  function: "function";
1425
1434
  jobFunction: "jobFunction";
@@ -1432,7 +1441,7 @@ declare const ExecutorSchema: z.ZodObject<{
1432
1441
  }, z.core.$strip>, z.ZodObject<{
1433
1442
  kind: z.ZodLiteral<"graphql">;
1434
1443
  appName: z.ZodOptional<z.ZodString>;
1435
- query: z.ZodString;
1444
+ query: z.ZodPipe<z.ZodTransform<string, unknown>, z.ZodString>;
1436
1445
  variables: z.ZodOptional<z.ZodCustom<Function, Function>>;
1437
1446
  authInvoker: z.ZodOptional<z.ZodObject<{
1438
1447
  namespace: z.ZodString;
@@ -1446,7 +1455,15 @@ declare const ExecutorSchema: z.ZodObject<{
1446
1455
  vault: z.ZodString;
1447
1456
  key: z.ZodString;
1448
1457
  }, z.core.$strip>]>>>;
1449
- }, z.core.$strip>], "kind">;
1458
+ }, z.core.$strip>, z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodObject<{
1459
+ kind: z.ZodLiteral<"workflow">;
1460
+ workflowName: z.ZodString;
1461
+ args: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodCustom<Function, Function>]>>;
1462
+ authInvoker: z.ZodOptional<z.ZodObject<{
1463
+ namespace: z.ZodString;
1464
+ machineUserName: z.ZodString;
1465
+ }, z.core.$strip>>;
1466
+ }, z.core.$strip>>]>;
1450
1467
  }, z.core.$strip>;
1451
1468
  //#endregion
1452
1469
  //#region src/parser/service/executor/types.d.ts
@@ -1457,8 +1474,9 @@ type IncomingWebhookTrigger = z.infer<typeof IncomingWebhookTriggerSchema>;
1457
1474
  type FunctionOperation = z.infer<typeof FunctionOperationSchema>;
1458
1475
  type GqlOperation = z.infer<typeof GqlOperationSchema>;
1459
1476
  type WebhookOperation = z.infer<typeof WebhookOperationSchema>;
1477
+ type WorkflowOperation = z.infer<typeof WorkflowOperationSchema>;
1460
1478
  type Executor = z.infer<typeof ExecutorSchema>;
1461
1479
  type ExecutorInput = z.input<typeof ExecutorSchema>;
1462
1480
  //#endregion
1463
- export { AllowedValues, AllowedValuesOutput, AppConfig, ArrayFieldOutput, AttributeList$1 as AttributeList, AttributeMap$1 as AttributeMap, AuthConfig, AuthExternalConfig, AuthInvoker$1 as AuthInvoker, AuthOwnConfig, type AuthServiceInput, type BuiltinIdP, CodeGeneratorBase, Executor, ExecutorInput, ExecutorServiceConfig, ExecutorServiceInput, FieldMetadata, FieldOptions, FieldOutput, FunctionOperation, Generator, GqlOperation, type IDToken, IdPConfig, IdPExternalConfig, type IdProviderConfig, IncomingWebhookTrigger, InferFieldsOutput, JsonCompatible, type OAuth2Client, type OAuth2ClientGrantType, type OIDC, PermissionCondition, QueryType, RecordTrigger, Resolver, ResolverExecutedTrigger, ResolverExternalConfig, ResolverInput, ResolverServiceConfig, ResolverServiceInput, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleTriggerInput, StaticWebsiteConfig, TailorDBField, TailorDBInstance, TailorDBType, TailorDBTypeConfig, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, type TenantProviderConfig, type UserAttributeKey, type UserAttributeListKey, type UserAttributeMap, type UsernameFieldKey, type ValueOperand, WebhookOperation, WorkflowServiceConfig, WorkflowServiceInput, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, output, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
1464
- //# sourceMappingURL=types-DGKSzhtb.d.mts.map
1481
+ export { AllowedValues, AllowedValuesOutput, AppConfig, ArrayFieldOutput, AttributeList$1 as AttributeList, AttributeMap$1 as AttributeMap, AuthConfig, AuthExternalConfig, AuthInvoker$1 as AuthInvoker, AuthOwnConfig, type AuthServiceInput, type BuiltinIdP, CodeGeneratorBase, Executor, ExecutorInput, ExecutorServiceConfig, ExecutorServiceInput, FieldMetadata, FieldOptions, FieldOutput, FunctionOperation, Generator, GqlOperation, type IDToken, IdPConfig, IdPExternalConfig, type IdProviderConfig, IncomingWebhookTrigger, InferFieldsOutput, JsonCompatible, type OAuth2Client, type OAuth2ClientGrantType, type OIDC, PermissionCondition, QueryType, RecordTrigger, Resolver, ResolverExecutedTrigger, ResolverExternalConfig, ResolverInput, ResolverServiceConfig, ResolverServiceInput, type SAML, type SCIMAttribute, type SCIMAttributeMapping, type SCIMAttributeType, type SCIMAuthorization, type SCIMConfig, type SCIMResource, ScheduleTriggerInput, StaticWebsiteConfig, TailorDBField, TailorDBInstance, TailorDBType, TailorDBTypeConfig, TailorField, TailorTypeGqlPermission, TailorTypePermission, TailorUser, type TenantProviderConfig, type UserAttributeKey, type UserAttributeListKey, type UserAttributeMap, type UsernameFieldKey, type ValueOperand, WebhookOperation, WorkflowOperation, WorkflowServiceConfig, WorkflowServiceInput, db, defineAuth, defineConfig, defineGenerators, defineIdp, defineStaticWebSite, output, unauthenticatedTailorUser, unsafeAllowAllGqlPermission, unsafeAllowAllTypePermission };
1482
+ //# sourceMappingURL=types-DUYX8rv-.d.mts.map
@@ -1,7 +1,7 @@
1
1
  /// <reference path="./../../user-defined.d.ts" />
2
2
 
3
- import { TailorDBType, TailorField, TailorUser } from "../../types-DGKSzhtb.mjs";
4
- import { output } from "../../index-BcDejW72.mjs";
3
+ import { TailorDBType, TailorField, TailorUser } from "../../types-DUYX8rv-.mjs";
4
+ import { output } from "../../index-DOA9RfBq.mjs";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
6
 
7
7
  //#region src/utils/test/index.d.ts
@@ -564,6 +564,147 @@ Returns the OAuth2 client credentials with the following fields:
564
564
  - `redirectUris` - Registered redirect URIs
565
565
  - `createdAt` - Creation timestamp
566
566
 
567
+ ### workflow
568
+
569
+ Manage workflows and workflow executions.
570
+
571
+ ```bash
572
+ tailor-sdk workflow <subcommand> [options]
573
+ ```
574
+
575
+ #### workflow list
576
+
577
+ List all workflows in the workspace.
578
+
579
+ ```bash
580
+ tailor-sdk workflow list [options]
581
+ ```
582
+
583
+ **Options:**
584
+
585
+ - `-w, --workspace-id` - ID of the workspace
586
+ - `-p, --profile` - Workspace profile to use
587
+ - `-f, --format` - Output format: `table` or `json` (default: `table`)
588
+
589
+ #### workflow get
590
+
591
+ Get workflow details.
592
+
593
+ ```bash
594
+ tailor-sdk workflow get <nameOrId> [options]
595
+ ```
596
+
597
+ **Arguments:**
598
+
599
+ - `nameOrId` - Workflow name or ID (required)
600
+
601
+ **Options:**
602
+
603
+ - `-w, --workspace-id` - ID of the workspace
604
+ - `-p, --profile` - Workspace profile to use
605
+ - `-f, --format` - Output format: `table` or `json` (default: `table`)
606
+
607
+ #### workflow start
608
+
609
+ Start a workflow execution.
610
+
611
+ ```bash
612
+ tailor-sdk workflow start <nameOrId> [options]
613
+ ```
614
+
615
+ **Arguments:**
616
+
617
+ - `nameOrId` - Workflow name or ID (required)
618
+
619
+ **Options:**
620
+
621
+ - `-m, --machineuser` - Machine user name (required)
622
+ - `-g, --arg` - Workflow argument (JSON string)
623
+ - `-w, --workspace-id` - ID of the workspace
624
+ - `-p, --profile` - Workspace profile to use
625
+ - `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
626
+ - `--wait` - Wait for execution to complete
627
+ - `--interval` - Polling interval when using --wait (default: `3s`)
628
+ - `-f, --format` - Output format: `table` or `json` (default: `table`)
629
+
630
+ **Usage Examples:**
631
+
632
+ ```bash
633
+ # Start a workflow
634
+ tailor-sdk workflow start my-workflow -m admin-machine-user
635
+
636
+ # Start with argument
637
+ tailor-sdk workflow start my-workflow -m admin -g '{"userId": "123"}'
638
+
639
+ # Start and wait for completion
640
+ tailor-sdk workflow start my-workflow -m admin --wait
641
+ ```
642
+
643
+ #### workflow executions
644
+
645
+ List or get workflow executions.
646
+
647
+ ```bash
648
+ tailor-sdk workflow executions [executionId] [options]
649
+ ```
650
+
651
+ **Arguments:**
652
+
653
+ - `executionId` - Execution ID (optional, if provided shows details)
654
+
655
+ **Options:**
656
+
657
+ - `-w, --workspace-id` - ID of the workspace
658
+ - `-p, --profile` - Workspace profile to use
659
+ - `-n, --workflow-name` - Filter by workflow name (list mode only)
660
+ - `-s, --status` - Filter by status: `PENDING`, `PENDING_RESUME`, `RUNNING`, `SUCCESS`, `FAILED` (list mode only)
661
+ - `--wait` - Wait for execution to complete (detail mode only)
662
+ - `--interval` - Polling interval when using --wait (default: `3s`)
663
+ - `--logs` - Display job execution logs (detail mode only)
664
+ - `-f, --format` - Output format: `table` or `json` (default: `table`)
665
+
666
+ **Usage Examples:**
667
+
668
+ ```bash
669
+ # List all executions
670
+ tailor-sdk workflow executions
671
+
672
+ # Filter by workflow name
673
+ tailor-sdk workflow executions -n my-workflow
674
+
675
+ # Filter by status
676
+ tailor-sdk workflow executions -s RUNNING
677
+
678
+ # Get execution details
679
+ tailor-sdk workflow executions <execution-id>
680
+
681
+ # Get execution details with logs
682
+ tailor-sdk workflow executions <execution-id> --logs
683
+
684
+ # Wait for execution to complete
685
+ tailor-sdk workflow executions <execution-id> --wait
686
+ ```
687
+
688
+ #### workflow resume
689
+
690
+ Resume a failed or pending workflow execution.
691
+
692
+ ```bash
693
+ tailor-sdk workflow resume <executionId> [options]
694
+ ```
695
+
696
+ **Arguments:**
697
+
698
+ - `executionId` - Failed or pending execution ID (required)
699
+
700
+ **Options:**
701
+
702
+ - `-w, --workspace-id` - ID of the workspace
703
+ - `-p, --profile` - Workspace profile to use
704
+ - `--wait` - Wait for execution to complete after resuming
705
+ - `--interval` - Polling interval when using --wait (default: `3s`)
706
+ - `-f, --format` - Output format: `table` or `json` (default: `table`)
707
+
567
708
  ### secret
568
709
 
569
710
  Manage Secret Manager vaults and secrets.
@@ -8,18 +8,18 @@ Define TailorDB Types in files matching glob patterns specified in `tailor.confi
8
8
 
9
9
  Define TailorDB Fields using methods like `db.string()`, `db.int()`, etc. All TailorDB Field types are supported:
10
10
 
11
- | Method | TailorDB | TypeScript |
12
- | --------------- | -------- | ---------- |
13
- | `db.string()` | String | string |
14
- | `db.int()` | Integer | number |
15
- | `db.float()` | Float | number |
16
- | `db.bool()` | Boolean | boolean |
17
- | `db.date()` | Date | string |
18
- | `db.datetime()` | DateTime | string |
19
- | `db.time()` | Time | string |
20
- | `db.uuid()` | UUID | string |
21
- | `db.enum()` | Enum | string |
22
- | `db.object()` | Nested | object |
11
+ | Method | TailorDB | TypeScript |
12
+ | --------------- | -------- | -------------- |
13
+ | `db.string()` | String | string |
14
+ | `db.int()` | Integer | number |
15
+ | `db.float()` | Float | number |
16
+ | `db.bool()` | Boolean | boolean |
17
+ | `db.date()` | Date | string |
18
+ | `db.datetime()` | DateTime | string \| Date |
19
+ | `db.time()` | Time | string |
20
+ | `db.uuid()` | UUID | string |
21
+ | `db.enum()` | Enum | string |
22
+ | `db.object()` | Nested | object |
23
23
 
24
24
  **Enum fields** - specify allowed values as arguments:
25
25
 
@@ -438,7 +438,7 @@ createExecutor({
438
438
  "Content-Type": "application/json",
439
439
  "X-API-Key": { vault: "api-keys", key: "external-api" },
440
440
  },
441
- body: ({ newRecord }) => ({
441
+ requestBody: ({ newRecord }) => ({
442
442
  id: newRecord.id,
443
443
  timestamp: new Date(),
444
444
  data: newRecord,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "0.16.0",
3
+ "version": "0.16.2",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/configure/index.mjs",
@@ -55,23 +55,23 @@
55
55
  "madge": "8.0.0",
56
56
  "multiline-ts": "4.0.1",
57
57
  "open": "10.2.0",
58
- "ora": "^9.0.0",
58
+ "ora": "9.0.0",
59
59
  "oxc-parser": "0.98.0",
60
60
  "pkg-types": "2.3.0",
61
61
  "rolldown": "1.0.0-beta.41",
62
62
  "table": "6.9.0",
63
63
  "ts-cron-validator": "1.1.5",
64
64
  "tsx": "4.21.0",
65
- "type-fest": "5.2.0",
65
+ "type-fest": "5.3.1",
66
66
  "uuid": "13.0.0",
67
67
  "xdg-basedir": "5.1.0",
68
68
  "zod": "4.1.13"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@eslint/js": "9.39.1",
72
- "@tailor-platform/function-types": "0.7.2",
72
+ "@tailor-platform/function-types": "0.8.0",
73
73
  "@types/madge": "5.0.3",
74
- "@types/node": "22.19.1",
74
+ "@types/node": "22.19.2",
75
75
  "cross-env": "10.1.0",
76
76
  "eslint": "9.39.1",
77
77
  "eslint-plugin-jsdoc": "61.4.1",
@@ -79,7 +79,7 @@
79
79
  "sonda": "0.10.1",
80
80
  "tsdown": "0.15.6",
81
81
  "typescript": "5.9.3",
82
- "typescript-eslint": "8.48.0",
82
+ "typescript-eslint": "8.49.0",
83
83
  "vitest": "4.0.14"
84
84
  },
85
85
  "scripts": {