@tailor-platform/sdk 0.11.3 → 0.12.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 +31 -0
- package/dist/cli/api.d.mts +54 -9
- package/dist/cli/api.mjs +8 -2
- package/dist/cli/api.mjs.map +1 -0
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +19 -2
- package/dist/cli/index.mjs.map +1 -1
- package/dist/configure/index.d.mts +4 -4
- package/dist/configure/index.mjs.map +1 -1
- package/dist/{index-Bx9tHHe8.d.mts → index-15r0QXT5.d.mts} +6 -10
- package/dist/job-CSwByDTq.mjs.map +1 -1
- package/dist/{token-BJq9rpG5.mjs → list-6vWylIIR.mjs} +406 -125
- package/dist/list-6vWylIIR.mjs.map +1 -0
- package/dist/{types-C5oBGPO0.d.mts → types-BvH0p5R9.d.mts} +10 -13
- package/dist/{plugin-generated.d.ts → user-defined.d.ts} +4 -6
- package/dist/utils/test/index.d.mts +3 -3
- package/docs/cli-reference.md +65 -0
- package/docs/core-concepts.md +7 -7
- package/package.json +6 -5
- package/postinstall.mjs +6 -8
- package/dist/token-BJq9rpG5.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference path="./
|
|
1
|
+
/// <reference path="./user-defined.d.ts" />
|
|
2
2
|
|
|
3
3
|
import * as zod34 from "zod";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -176,16 +176,12 @@ declare class TailorField<const Defined extends DefinedFieldMetadata = DefinedFi
|
|
|
176
176
|
}
|
|
177
177
|
//#endregion
|
|
178
178
|
//#region src/configure/types/user.d.ts
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
interface AttributeList {
|
|
183
|
-
__tuple?: [];
|
|
184
|
-
}
|
|
185
|
-
}
|
|
179
|
+
interface AttributeMap$1 {}
|
|
180
|
+
interface AttributeList$1 {
|
|
181
|
+
__tuple?: [];
|
|
186
182
|
}
|
|
187
|
-
type InferredAttributeMap = keyof
|
|
188
|
-
type InferredAttributeList =
|
|
183
|
+
type InferredAttributeMap = keyof AttributeMap$1 extends never ? Record<string, string | string[] | boolean | boolean[] | undefined> : AttributeMap$1;
|
|
184
|
+
type InferredAttributeList = AttributeList$1["__tuple"] extends [] ? string[] : AttributeList$1["__tuple"];
|
|
189
185
|
/** Represents a user in the Tailor platform. */
|
|
190
186
|
type TailorUser = {
|
|
191
187
|
/**
|
|
@@ -205,7 +201,8 @@ type TailorUser = {
|
|
|
205
201
|
* For unauthenticated users, this will be null.
|
|
206
202
|
*/
|
|
207
203
|
attributes: InferredAttributeMap | null;
|
|
208
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* A list of the user's attributes.
|
|
209
206
|
* For unauthenticated users, this will be an empty array.
|
|
210
207
|
*/
|
|
211
208
|
attributeList: InferredAttributeList;
|
|
@@ -1428,5 +1425,5 @@ type WebhookOperation = z.infer<typeof WebhookOperationSchema>;
|
|
|
1428
1425
|
type Executor = z.infer<typeof ExecutorSchema>;
|
|
1429
1426
|
type ExecutorInput = z.input<typeof ExecutorSchema>;
|
|
1430
1427
|
//#endregion
|
|
1431
|
-
export { AllowedValues, AllowedValuesOutput, AppConfig, ArrayFieldOutput, AuthConfig, AuthExternalConfig, AuthOwnConfig, type AuthServiceInput, type BuiltinIdP, CodeGeneratorBase, Executor, ExecutorInput, ExecutorServiceConfig, ExecutorServiceInput, FieldMetadata, FieldOptions, FieldOutput, FunctionOperation, Generator, GqlOperation, type IDToken, IdPConfig, IdPExternalConfig, type IdProviderConfig, IncomingWebhookTrigger, InferFieldsOutput, 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 };
|
|
1432
|
-
//# sourceMappingURL=types-
|
|
1428
|
+
export { AllowedValues, AllowedValuesOutput, AppConfig, ArrayFieldOutput, AttributeList$1 as AttributeList, AttributeMap$1 as AttributeMap, AuthConfig, AuthExternalConfig, AuthOwnConfig, type AuthServiceInput, type BuiltinIdP, CodeGeneratorBase, Executor, ExecutorInput, ExecutorServiceConfig, ExecutorServiceInput, FieldMetadata, FieldOptions, FieldOutput, FunctionOperation, Generator, GqlOperation, type IDToken, IdPConfig, IdPExternalConfig, type IdProviderConfig, IncomingWebhookTrigger, InferFieldsOutput, 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 };
|
|
1429
|
+
//# sourceMappingURL=types-BvH0p5R9.d.mts.map
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
// Do not edit this file manually
|
|
3
3
|
// Regenerated automatically when running 'tailor-sdk apply' or 'tailor-sdk generate'
|
|
4
4
|
|
|
5
|
-
declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
__tuple: string[];
|
|
10
|
-
}
|
|
5
|
+
declare module "@tailor-platform/sdk" {
|
|
6
|
+
interface AttributeMap {}
|
|
7
|
+
interface AttributeList {
|
|
8
|
+
__tuple: string[];
|
|
11
9
|
}
|
|
12
10
|
}
|
|
13
11
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference path="./../../
|
|
1
|
+
/// <reference path="./../../user-defined.d.ts" />
|
|
2
2
|
|
|
3
|
-
import { TailorDBType, TailorField, TailorUser } from "../../types-
|
|
4
|
-
import { output } from "../../index-
|
|
3
|
+
import { TailorDBType, TailorField, TailorUser } from "../../types-BvH0p5R9.mjs";
|
|
4
|
+
import { output } from "../../index-15r0QXT5.mjs";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
6
|
|
|
7
7
|
//#region src/utils/test/index.d.ts
|
package/docs/cli-reference.md
CHANGED
|
@@ -498,3 +498,68 @@ tailor-sdk machineuser token <name> [options]
|
|
|
498
498
|
- `-p, --profile` - Workspace profile to use
|
|
499
499
|
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
500
500
|
- `-f, --format` - Output format: `table` or `json` (default: `table`)
|
|
501
|
+
|
|
502
|
+
### oauth2client
|
|
503
|
+
|
|
504
|
+
Manage OAuth2 clients in your Tailor Platform application.
|
|
505
|
+
|
|
506
|
+
```bash
|
|
507
|
+
tailor-sdk oauth2client <subcommand> [options]
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
#### oauth2client list
|
|
511
|
+
|
|
512
|
+
List all OAuth2 clients in the application.
|
|
513
|
+
|
|
514
|
+
```bash
|
|
515
|
+
tailor-sdk oauth2client list [options]
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
**Options:**
|
|
519
|
+
|
|
520
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
521
|
+
- `-p, --profile` - Workspace profile to use
|
|
522
|
+
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
523
|
+
- `-f, --format` - Output format: `table` or `json` (default: `table`)
|
|
524
|
+
|
|
525
|
+
**Output:**
|
|
526
|
+
|
|
527
|
+
Returns a list of OAuth2 clients with the following fields:
|
|
528
|
+
|
|
529
|
+
- `name` - Client name
|
|
530
|
+
- `description` - Client description
|
|
531
|
+
- `clientId` - OAuth2 client ID
|
|
532
|
+
- `grantTypes` - Supported grant types (e.g., `authorization_code`, `refresh_token`)
|
|
533
|
+
- `redirectUris` - Registered redirect URIs
|
|
534
|
+
- `createdAt` - Creation timestamp
|
|
535
|
+
|
|
536
|
+
#### oauth2client get
|
|
537
|
+
|
|
538
|
+
Get OAuth2 client credentials (including client secret).
|
|
539
|
+
|
|
540
|
+
```bash
|
|
541
|
+
tailor-sdk oauth2client get <name> [options]
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
**Arguments:**
|
|
545
|
+
|
|
546
|
+
- `name` - OAuth2 client name (required)
|
|
547
|
+
|
|
548
|
+
**Options:**
|
|
549
|
+
|
|
550
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
551
|
+
- `-p, --profile` - Workspace profile to use
|
|
552
|
+
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
553
|
+
- `-f, --format` - Output format: `table` or `json` (default: `table`)
|
|
554
|
+
|
|
555
|
+
**Output:**
|
|
556
|
+
|
|
557
|
+
Returns the OAuth2 client credentials with the following fields:
|
|
558
|
+
|
|
559
|
+
- `name` - Client name
|
|
560
|
+
- `description` - Client description
|
|
561
|
+
- `clientId` - OAuth2 client ID
|
|
562
|
+
- `clientSecret` - OAuth2 client secret
|
|
563
|
+
- `grantTypes` - Supported grant types
|
|
564
|
+
- `redirectUris` - Registered redirect URIs
|
|
565
|
+
- `createdAt` - Creation timestamp
|
package/docs/core-concepts.md
CHANGED
|
@@ -511,13 +511,13 @@ Define Workflows in files matching glob patterns specified in `tailor.config.ts`
|
|
|
511
511
|
|
|
512
512
|
**Important**: All workflow components must follow these rules:
|
|
513
513
|
|
|
514
|
-
| Rule |
|
|
515
|
-
| ---------------------------------------------- |
|
|
516
|
-
| `createWorkflow` result must be default export |
|
|
517
|
-
| All jobs must be named exports |
|
|
518
|
-
| Job names must be unique |
|
|
519
|
-
| `mainJob` is required |
|
|
520
|
-
| Jobs in `deps` must be job objects |
|
|
514
|
+
| Rule | Description |
|
|
515
|
+
| ---------------------------------------------- | --------------------------------------------------- |
|
|
516
|
+
| `createWorkflow` result must be default export | Workflow files must export the workflow as default |
|
|
517
|
+
| All jobs must be named exports | Every job used in a workflow must be a named export |
|
|
518
|
+
| Job names must be unique | Job names must be unique across the entire project |
|
|
519
|
+
| `mainJob` is required | Every workflow must specify a `mainJob` |
|
|
520
|
+
| Jobs in `deps` must be job objects | Pass job objects, not strings |
|
|
521
521
|
|
|
522
522
|
#### Workflow Job Definition
|
|
523
523
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tailor-platform/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/configure/index.mjs",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"citty": "0.1.6",
|
|
51
51
|
"confbox": "0.2.2",
|
|
52
52
|
"consola": "3.4.2",
|
|
53
|
-
"es-toolkit": "1.
|
|
53
|
+
"es-toolkit": "1.42.0",
|
|
54
54
|
"inflection": "3.0.2",
|
|
55
55
|
"madge": "8.0.0",
|
|
56
56
|
"multiline-ts": "4.0.1",
|
|
@@ -72,14 +72,15 @@
|
|
|
72
72
|
"@tailor-platform/function-types": "0.7.2",
|
|
73
73
|
"@types/madge": "5.0.3",
|
|
74
74
|
"@types/node": "22.19.1",
|
|
75
|
-
"cross-env": "
|
|
75
|
+
"cross-env": "10.1.0",
|
|
76
76
|
"eslint": "9.39.1",
|
|
77
|
+
"eslint-plugin-jsdoc": "61.4.1",
|
|
77
78
|
"globals": "16.5.0",
|
|
78
79
|
"sonda": "0.10.0",
|
|
79
80
|
"tsdown": "0.15.6",
|
|
80
81
|
"typescript": "5.9.3",
|
|
81
|
-
"typescript-eslint": "8.
|
|
82
|
-
"vitest": "4.0.
|
|
82
|
+
"typescript-eslint": "8.48.0",
|
|
83
|
+
"vitest": "4.0.14"
|
|
83
84
|
},
|
|
84
85
|
"scripts": {
|
|
85
86
|
"test": "vitest",
|
package/postinstall.mjs
CHANGED
|
@@ -22,9 +22,9 @@ async function install() {
|
|
|
22
22
|
|
|
23
23
|
console.log("🔧 Initializing Tailor Platform SDK type definitions...");
|
|
24
24
|
|
|
25
|
-
// Create
|
|
25
|
+
// Create user-defined.d.ts in the dist directory
|
|
26
26
|
const distDir = resolve(__dirname, "dist");
|
|
27
|
-
const pluginTypesPath = resolve(distDir, "
|
|
27
|
+
const pluginTypesPath = resolve(distDir, "user-defined.d.ts");
|
|
28
28
|
|
|
29
29
|
// Check if dist directory exists
|
|
30
30
|
if (!existsSync(distDir)) {
|
|
@@ -59,12 +59,10 @@ async function install() {
|
|
|
59
59
|
// Do not edit this file manually
|
|
60
60
|
// Regenerated automatically when running 'tailor-sdk apply' or 'tailor-sdk generate'
|
|
61
61
|
|
|
62
|
-
declare
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
__tuple: string[];
|
|
67
|
-
}
|
|
62
|
+
declare module "@tailor-platform/sdk" {
|
|
63
|
+
interface AttributeMap {}
|
|
64
|
+
interface AttributeList {
|
|
65
|
+
__tuple: string[];
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
68
|
|