@tailor-platform/sdk 0.16.2 → 0.17.0
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 +23 -0
- package/README.md +75 -8
- package/dist/cli/api.d.mts +6 -2
- package/dist/cli/api.mjs +1 -1
- package/dist/cli/index.mjs +51 -75
- package/dist/cli/index.mjs.map +1 -1
- package/dist/configure/index.d.mts +2 -2
- package/dist/{index-DOA9RfBq.d.mts → index-Bin7-j3v.d.mts} +2 -2
- package/dist/{resume-Yw6OGEYO.mjs → resume-B2ba5opn.mjs} +165 -122
- package/dist/{resume-Yw6OGEYO.mjs.map → resume-B2ba5opn.mjs.map} +1 -1
- package/dist/{types-DUYX8rv-.d.mts → types-Da_WnvA0.d.mts} +15 -1
- package/dist/utils/test/index.d.mts +9 -3
- package/dist/utils/test/index.mjs +8 -6
- package/dist/utils/test/index.mjs.map +1 -1
- package/docs/cli/application.md +136 -0
- package/docs/cli/auth.md +110 -0
- package/docs/cli/secret.md +125 -0
- package/docs/cli/user.md +183 -0
- package/docs/cli/workflow.md +144 -0
- package/docs/cli/workspace.md +122 -0
- package/docs/cli-reference.md +80 -801
- package/docs/configuration.md +36 -32
- package/docs/generator/builtin.md +194 -0
- package/docs/generator/custom.md +150 -0
- package/docs/generator/index.md +56 -0
- package/docs/quickstart.md +9 -4
- package/docs/services/auth.md +225 -0
- package/docs/services/executor.md +304 -0
- package/docs/services/idp.md +106 -0
- package/docs/services/resolver.md +213 -0
- package/docs/services/secret.md +116 -0
- package/docs/services/staticwebsite.md +132 -0
- package/docs/services/tailordb.md +305 -0
- package/docs/services/workflow.md +176 -0
- package/docs/testing.md +3 -1
- package/package.json +4 -3
- package/postinstall.mjs +1 -0
- package/docs/core-concepts.md +0 -609
|
@@ -1156,6 +1156,16 @@ declare const IdPSchema: z.core.$ZodBranded<z.ZodObject<{
|
|
|
1156
1156
|
en: "en";
|
|
1157
1157
|
ja: "ja";
|
|
1158
1158
|
}>>;
|
|
1159
|
+
userAuthPolicy: z.ZodOptional<z.ZodPipe<z.ZodObject<{
|
|
1160
|
+
useNonEmailIdentifier: z.ZodDefault<z.ZodBoolean>;
|
|
1161
|
+
allowSelfPasswordReset: z.ZodDefault<z.ZodBoolean>;
|
|
1162
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
1163
|
+
useNonEmailIdentifier: boolean;
|
|
1164
|
+
allowSelfPasswordReset: boolean;
|
|
1165
|
+
}, {
|
|
1166
|
+
useNonEmailIdentifier: boolean;
|
|
1167
|
+
allowSelfPasswordReset: boolean;
|
|
1168
|
+
}>>>;
|
|
1159
1169
|
}, z.core.$strip>, "IdPConfig">;
|
|
1160
1170
|
//#endregion
|
|
1161
1171
|
//#region src/parser/service/idp/types.d.ts
|
|
@@ -1180,6 +1190,10 @@ declare function defineIdp<const TClients extends string[]>(name: string, config
|
|
|
1180
1190
|
cel: string;
|
|
1181
1191
|
};
|
|
1182
1192
|
readonly lang?: "en" | "ja" | undefined;
|
|
1193
|
+
readonly userAuthPolicy?: {
|
|
1194
|
+
useNonEmailIdentifier?: boolean | undefined;
|
|
1195
|
+
allowSelfPasswordReset?: boolean | undefined;
|
|
1196
|
+
} | undefined;
|
|
1183
1197
|
readonly clients: TClients;
|
|
1184
1198
|
} & IdpDefinitionBrand;
|
|
1185
1199
|
type IdPExternalConfig = {
|
|
@@ -1479,4 +1493,4 @@ type Executor = z.infer<typeof ExecutorSchema>;
|
|
|
1479
1493
|
type ExecutorInput = z.input<typeof ExecutorSchema>;
|
|
1480
1494
|
//#endregion
|
|
1481
1495
|
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-
|
|
1496
|
+
//# sourceMappingURL=types-Da_WnvA0.d.mts.map
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
/// <reference path="./../../user-defined.d.ts" />
|
|
2
2
|
|
|
3
|
-
import { TailorDBType, TailorField
|
|
4
|
-
import { output } from "../../index-
|
|
3
|
+
import { TailorDBType, TailorField } from "../../types-Da_WnvA0.mjs";
|
|
4
|
+
import { output } from "../../index-Bin7-j3v.mjs";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
6
|
|
|
7
7
|
//#region src/utils/test/index.d.ts
|
|
8
8
|
/** Represents an unauthenticated user in the Tailor platform. */
|
|
9
|
-
declare const unauthenticatedTailorUser:
|
|
9
|
+
declare const unauthenticatedTailorUser: {
|
|
10
|
+
readonly id: "00000000-0000-0000-0000-000000000000";
|
|
11
|
+
readonly type: "";
|
|
12
|
+
readonly workspaceId: "00000000-0000-0000-0000-000000000000";
|
|
13
|
+
readonly attributes: null;
|
|
14
|
+
readonly attributeList: [];
|
|
15
|
+
};
|
|
10
16
|
/**
|
|
11
17
|
* Creates a hook function that processes TailorDB type fields
|
|
12
18
|
* - Uses existing id from data if provided, otherwise generates UUID for id fields
|
|
@@ -23,12 +23,14 @@ function createTailorDBHook(type) {
|
|
|
23
23
|
const field = value;
|
|
24
24
|
if (key === "id") hooked[key] = (data && typeof data === "object" ? data[key] : void 0) ?? crypto.randomUUID();
|
|
25
25
|
else if (field.type === "nested") hooked[key] = createTailorDBHook({ fields: field.fields })(data[key]);
|
|
26
|
-
else if (field.metadata.hooks?.create)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
else if (field.metadata.hooks?.create) {
|
|
27
|
+
hooked[key] = field.metadata.hooks.create({
|
|
28
|
+
value: data[key],
|
|
29
|
+
data,
|
|
30
|
+
user: unauthenticatedTailorUser
|
|
31
|
+
});
|
|
32
|
+
if (hooked[key] instanceof Date) hooked[key] = hooked[key].toISOString();
|
|
33
|
+
} else if (data && typeof data === "object") hooked[key] = data[key];
|
|
32
34
|
return hooked;
|
|
33
35
|
}, {});
|
|
34
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../src/utils/test/index.ts"],"sourcesContent":["import type { output, TailorUser } from \"@/configure\";\nimport type { TailorDBType } from \"@/configure/services/tailordb/schema\";\nimport type { TailorField } from \"@/configure/types/type\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\n\n/** Represents an unauthenticated user in the Tailor platform. */\nexport const unauthenticatedTailorUser = {\n id: \"00000000-0000-0000-0000-000000000000\",\n type: \"\",\n workspaceId: \"00000000-0000-0000-0000-000000000000\",\n attributes: null,\n attributeList: [],\n} as const satisfies TailorUser;\n\n/**\n * Creates a hook function that processes TailorDB type fields\n * - Uses existing id from data if provided, otherwise generates UUID for id fields\n * - Recursively processes nested types\n * - Executes hooks.create for fields with create hooks\n *\n * @template T - The output type of the hook function\n * @param type - TailorDB type definition\n * @returns A function that transforms input data according to field hooks\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function createTailorDBHook<T extends TailorDBType<any, any>>(type: T) {\n return (data: unknown) => {\n return Object.entries(type.fields).reduce(\n (hooked, [key, value]) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const field = value as TailorField<any, any, any>;\n if (key === \"id\") {\n // Use existing id from data if provided, otherwise generate new UUID\n const existingId =\n data && typeof data === \"object\"\n ? (data as Record<string, unknown>)[key]\n : undefined;\n hooked[key] = existingId ?? crypto.randomUUID();\n } else if (field.type === \"nested\") {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n hooked[key] = createTailorDBHook({ fields: field.fields } as any)(\n (data as Record<string, unknown>)[key],\n );\n } else if (field.metadata.hooks?.create) {\n hooked[key] = field.metadata.hooks.create({\n value: (data as Record<string, unknown>)[key],\n data: data,\n user: unauthenticatedTailorUser,\n });\n if (hooked[key] instanceof Date) {\n hooked[key] = hooked[key].toISOString();\n }\n } else if (data && typeof data === \"object\") {\n hooked[key] = (data as Record<string, unknown>)[key];\n }\n return hooked;\n },\n {} as Record<string, unknown>,\n ) as Partial<output<T>>;\n };\n}\n\n/**\n * Creates the standard schema definition for lines-db\n * This returns the first argument for defineSchema with the ~standard section\n *\n * @template T - The output type after validation\n * @param schemaType - TailorDB field schema for validation\n * @param hook - Hook function to transform data before validation\n * @returns Schema object with ~standard section for defineSchema\n */\nexport function createStandardSchema<T = Record<string, unknown>>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n schemaType: TailorField<any, T>,\n hook: (data: unknown) => Partial<T>,\n) {\n return {\n \"~standard\": {\n version: 1,\n vendor: \"@tailor-platform/sdk\",\n validate: (value: unknown) => {\n const hooked = hook(value);\n const result = schemaType.parse({\n value: hooked,\n data: hooked,\n user: unauthenticatedTailorUser,\n });\n if (result.issues) {\n return result;\n }\n return { value: hooked as T };\n },\n },\n } as const satisfies StandardSchemaV1<T>;\n}\n"],"mappings":";;AAMA,MAAa,4BAA4B;CACvC,IAAI;CACJ,MAAM;CACN,aAAa;CACb,YAAY;CACZ,eAAe,EAAE;CAClB;;;;;;;;;;;AAaD,SAAgB,mBAAqD,MAAS;AAC5E,SAAQ,SAAkB;AACxB,SAAO,OAAO,QAAQ,KAAK,OAAO,CAAC,QAChC,QAAQ,CAAC,KAAK,WAAW;GAExB,MAAM,QAAQ;AACd,OAAI,QAAQ,KAMV,QAAO,QAHL,QAAQ,OAAO,SAAS,WACnB,KAAiC,OAClC,WACsB,OAAO,YAAY;YACtC,MAAM,SAAS,SAExB,QAAO,OAAO,mBAAmB,EAAE,QAAQ,MAAM,QAAQ,CAAQ,CAC9D,KAAiC,KACnC;YACQ,MAAM,SAAS,OAAO,QAAQ;AACvC,WAAO,OAAO,MAAM,SAAS,MAAM,OAAO;KACxC,OAAQ,KAAiC;KACnC;KACN,MAAM;KACP,CAAC;AACF,QAAI,OAAO,gBAAgB,KACzB,QAAO,OAAO,OAAO,KAAK,aAAa;cAEhC,QAAQ,OAAO,SAAS,SACjC,QAAO,OAAQ,KAAiC;AAElD,UAAO;KAET,EAAE,CACH;;;;;;;;;;;;AAaL,SAAgB,qBAEd,YACA,MACA;AACA,QAAO,EACL,aAAa;EACX,SAAS;EACT,QAAQ;EACR,WAAW,UAAmB;GAC5B,MAAM,SAAS,KAAK,MAAM;GAC1B,MAAM,SAAS,WAAW,MAAM;IAC9B,OAAO;IACP,MAAM;IACN,MAAM;IACP,CAAC;AACF,OAAI,OAAO,OACT,QAAO;AAET,UAAO,EAAE,OAAO,QAAa;;EAEhC,EACF"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Application Commands
|
|
2
|
+
|
|
3
|
+
Commands for managing Tailor Platform applications. These commands work with `tailor.config.ts`.
|
|
4
|
+
|
|
5
|
+
## init
|
|
6
|
+
|
|
7
|
+
Initialize a new project using create-sdk.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
tailor-sdk init [name] [options]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Arguments:**
|
|
14
|
+
|
|
15
|
+
- `name` - Project name
|
|
16
|
+
|
|
17
|
+
**Options:**
|
|
18
|
+
|
|
19
|
+
- `-t, --template` - Template name
|
|
20
|
+
|
|
21
|
+
## generate
|
|
22
|
+
|
|
23
|
+
Generate files using Tailor configuration.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
tailor-sdk generate [options]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Options:**
|
|
30
|
+
|
|
31
|
+
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
32
|
+
- `-w, --watch` - Watch for type/resolver changes and regenerate
|
|
33
|
+
|
|
34
|
+
## apply
|
|
35
|
+
|
|
36
|
+
Apply Tailor configuration to deploy your application.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
tailor-sdk apply [options]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Options:**
|
|
43
|
+
|
|
44
|
+
- `-w, --workspace-id` - ID of the workspace to apply the configuration to
|
|
45
|
+
- `-p, --profile` - Workspace profile to use
|
|
46
|
+
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
47
|
+
- `-d, --dryRun` - Run the command without making any changes
|
|
48
|
+
- `-y, --yes` - Skip confirmation prompt
|
|
49
|
+
|
|
50
|
+
## remove
|
|
51
|
+
|
|
52
|
+
Remove all resources managed by the application from the workspace.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
tailor-sdk remove [options]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Options:**
|
|
59
|
+
|
|
60
|
+
- `-w, --workspace-id` - ID of the workspace to remove resources from
|
|
61
|
+
- `-p, --profile` - Workspace profile to use
|
|
62
|
+
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
63
|
+
- `-y, --yes` - Skip confirmation prompt
|
|
64
|
+
|
|
65
|
+
## show
|
|
66
|
+
|
|
67
|
+
Show information about the deployed application.
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
tailor-sdk show [options]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Options:**
|
|
74
|
+
|
|
75
|
+
- `-w, --workspace-id` - ID of the workspace to show the application from
|
|
76
|
+
- `-p, --profile` - Workspace profile to use
|
|
77
|
+
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
78
|
+
- `--json` - Output as JSON
|
|
79
|
+
|
|
80
|
+
## tailordb
|
|
81
|
+
|
|
82
|
+
Manage TailorDB tables and data.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
tailor-sdk tailordb <subcommand> [options]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### tailordb truncate
|
|
89
|
+
|
|
90
|
+
Truncate (delete all records from) TailorDB tables.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
tailor-sdk tailordb truncate [types...] [options]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Arguments:**
|
|
97
|
+
|
|
98
|
+
- `types...` - Space-separated list of type names to truncate (optional)
|
|
99
|
+
|
|
100
|
+
**Options:**
|
|
101
|
+
|
|
102
|
+
- `-a, --all` - Truncate all tables in all namespaces
|
|
103
|
+
- `-n, --namespace` - Truncate all tables in the specified namespace
|
|
104
|
+
- `-y, --yes` - Skip confirmation prompt
|
|
105
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
106
|
+
- `-p, --profile` - Workspace profile to use
|
|
107
|
+
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
108
|
+
|
|
109
|
+
**Usage Examples:**
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Truncate all tables in all namespaces (requires confirmation)
|
|
113
|
+
tailor-sdk tailordb truncate --all
|
|
114
|
+
|
|
115
|
+
# Truncate all tables in all namespaces (skip confirmation)
|
|
116
|
+
tailor-sdk tailordb truncate --all --yes
|
|
117
|
+
|
|
118
|
+
# Truncate all tables in a specific namespace
|
|
119
|
+
tailor-sdk tailordb truncate --namespace myNamespace
|
|
120
|
+
|
|
121
|
+
# Truncate specific types (namespace is auto-detected)
|
|
122
|
+
tailor-sdk tailordb truncate User Post Comment
|
|
123
|
+
|
|
124
|
+
# Truncate specific types with confirmation skipped
|
|
125
|
+
tailor-sdk tailordb truncate User Post --yes
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Notes:**
|
|
129
|
+
|
|
130
|
+
- You must specify exactly one of: `--all`, `--namespace`, or type names
|
|
131
|
+
- When truncating specific types, the namespace is automatically detected from your config
|
|
132
|
+
- Confirmation prompts vary based on the operation:
|
|
133
|
+
- `--all`: requires typing `truncate all`
|
|
134
|
+
- `--namespace`: requires typing `truncate <namespace-name>`
|
|
135
|
+
- Specific types: requires typing `yes`
|
|
136
|
+
- Use `--yes` flag to skip confirmation prompts (useful for scripts and CI/CD)
|
package/docs/cli/auth.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Auth Resource Commands
|
|
2
|
+
|
|
3
|
+
Commands for managing Auth service resources (machine users and OAuth2 clients).
|
|
4
|
+
|
|
5
|
+
## machineuser
|
|
6
|
+
|
|
7
|
+
Manage machine users in your Tailor Platform application.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
tailor-sdk machineuser <subcommand> [options]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### machineuser list
|
|
14
|
+
|
|
15
|
+
List all machine users in the application.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
tailor-sdk machineuser list [options]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Options:**
|
|
22
|
+
|
|
23
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
24
|
+
- `-p, --profile` - Workspace profile to use
|
|
25
|
+
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
26
|
+
- `--json` - Output as JSON
|
|
27
|
+
|
|
28
|
+
### machineuser token
|
|
29
|
+
|
|
30
|
+
Get an access token for a machine user.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
tailor-sdk machineuser token <name> [options]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Arguments:**
|
|
37
|
+
|
|
38
|
+
- `name` - Machine user name (required)
|
|
39
|
+
|
|
40
|
+
**Options:**
|
|
41
|
+
|
|
42
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
43
|
+
- `-p, --profile` - Workspace profile to use
|
|
44
|
+
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
45
|
+
- `--json` - Output as JSON
|
|
46
|
+
|
|
47
|
+
## oauth2client
|
|
48
|
+
|
|
49
|
+
Manage OAuth2 clients in your Tailor Platform application.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
tailor-sdk oauth2client <subcommand> [options]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### oauth2client list
|
|
56
|
+
|
|
57
|
+
List all OAuth2 clients in the application.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
tailor-sdk oauth2client list [options]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Options:**
|
|
64
|
+
|
|
65
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
66
|
+
- `-p, --profile` - Workspace profile to use
|
|
67
|
+
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
68
|
+
- `--json` - Output as JSON
|
|
69
|
+
|
|
70
|
+
**Output:**
|
|
71
|
+
|
|
72
|
+
Returns a list of OAuth2 clients with the following fields:
|
|
73
|
+
|
|
74
|
+
- `name` - Client name
|
|
75
|
+
- `description` - Client description
|
|
76
|
+
- `clientId` - OAuth2 client ID
|
|
77
|
+
- `grantTypes` - Supported grant types (e.g., `authorization_code`, `refresh_token`)
|
|
78
|
+
- `redirectUris` - Registered redirect URIs
|
|
79
|
+
- `createdAt` - Creation timestamp
|
|
80
|
+
|
|
81
|
+
### oauth2client get
|
|
82
|
+
|
|
83
|
+
Get OAuth2 client credentials (including client secret).
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
tailor-sdk oauth2client get <name> [options]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Arguments:**
|
|
90
|
+
|
|
91
|
+
- `name` - OAuth2 client name (required)
|
|
92
|
+
|
|
93
|
+
**Options:**
|
|
94
|
+
|
|
95
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
96
|
+
- `-p, --profile` - Workspace profile to use
|
|
97
|
+
- `-c, --config` - Path to the SDK config file (default: `tailor.config.ts`)
|
|
98
|
+
- `--json` - Output as JSON
|
|
99
|
+
|
|
100
|
+
**Output:**
|
|
101
|
+
|
|
102
|
+
Returns the OAuth2 client credentials with the following fields:
|
|
103
|
+
|
|
104
|
+
- `name` - Client name
|
|
105
|
+
- `description` - Client description
|
|
106
|
+
- `clientId` - OAuth2 client ID
|
|
107
|
+
- `clientSecret` - OAuth2 client secret
|
|
108
|
+
- `grantTypes` - Supported grant types
|
|
109
|
+
- `redirectUris` - Registered redirect URIs
|
|
110
|
+
- `createdAt` - Creation timestamp
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Secret Commands
|
|
2
|
+
|
|
3
|
+
Commands for managing Secret Manager vaults and secrets.
|
|
4
|
+
|
|
5
|
+
## secret
|
|
6
|
+
|
|
7
|
+
Manage Secret Manager vaults and secrets.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
tailor-sdk secret <subcommand> [options]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### secret vault
|
|
14
|
+
|
|
15
|
+
Manage Secret Manager vaults.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
tailor-sdk secret vault <subcommand> [options]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
#### secret vault create
|
|
22
|
+
|
|
23
|
+
Create a new Secret Manager vault.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
tailor-sdk secret vault create [options]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Options:**
|
|
30
|
+
|
|
31
|
+
- `--name` - Vault name (required)
|
|
32
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
33
|
+
- `-p, --profile` - Workspace profile to use
|
|
34
|
+
|
|
35
|
+
#### secret vault delete
|
|
36
|
+
|
|
37
|
+
Delete a Secret Manager vault.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
tailor-sdk secret vault delete [options]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Options:**
|
|
44
|
+
|
|
45
|
+
- `--name` - Vault name (required)
|
|
46
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
47
|
+
- `-p, --profile` - Workspace profile to use
|
|
48
|
+
- `-y, --yes` - Skip confirmation prompt
|
|
49
|
+
|
|
50
|
+
#### secret vault list
|
|
51
|
+
|
|
52
|
+
List all Secret Manager vaults in the workspace.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
tailor-sdk secret vault list [options]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Options:**
|
|
59
|
+
|
|
60
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
61
|
+
- `-p, --profile` - Workspace profile to use
|
|
62
|
+
- `--json` - Output as JSON
|
|
63
|
+
|
|
64
|
+
### secret create
|
|
65
|
+
|
|
66
|
+
Create a secret in a vault.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
tailor-sdk secret create [options]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Options:**
|
|
73
|
+
|
|
74
|
+
- `--vault-name` - Vault name (required)
|
|
75
|
+
- `--name` - Secret name (required)
|
|
76
|
+
- `--value` - Secret value (required)
|
|
77
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
78
|
+
- `-p, --profile` - Workspace profile to use
|
|
79
|
+
|
|
80
|
+
### secret update
|
|
81
|
+
|
|
82
|
+
Update a secret in a vault.
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
tailor-sdk secret update [options]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Options:**
|
|
89
|
+
|
|
90
|
+
- `--vault-name` - Vault name (required)
|
|
91
|
+
- `--name` - Secret name (required)
|
|
92
|
+
- `--value` - New secret value (required)
|
|
93
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
94
|
+
- `-p, --profile` - Workspace profile to use
|
|
95
|
+
|
|
96
|
+
### secret list
|
|
97
|
+
|
|
98
|
+
List all secrets in a vault.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
tailor-sdk secret list [options]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Options:**
|
|
105
|
+
|
|
106
|
+
- `--vault-name` - Vault name (required)
|
|
107
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
108
|
+
- `-p, --profile` - Workspace profile to use
|
|
109
|
+
- `--json` - Output as JSON
|
|
110
|
+
|
|
111
|
+
### secret delete
|
|
112
|
+
|
|
113
|
+
Delete a secret in a vault.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
tailor-sdk secret delete [options]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Options:**
|
|
120
|
+
|
|
121
|
+
- `--vault-name` - Vault name (required)
|
|
122
|
+
- `--name` - Secret name (required)
|
|
123
|
+
- `-w, --workspace-id` - ID of the workspace
|
|
124
|
+
- `-p, --profile` - Workspace profile to use
|
|
125
|
+
- `-y, --yes` - Skip confirmation prompt
|
package/docs/cli/user.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# User & Auth Commands
|
|
2
|
+
|
|
3
|
+
Commands for authentication and user management.
|
|
4
|
+
|
|
5
|
+
## login
|
|
6
|
+
|
|
7
|
+
Login to Tailor Platform.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
tailor-sdk login
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## logout
|
|
14
|
+
|
|
15
|
+
Logout from Tailor Platform.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
tailor-sdk logout
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## user
|
|
22
|
+
|
|
23
|
+
Manage Tailor Platform users.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
tailor-sdk user <subcommand> [options]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### user current
|
|
30
|
+
|
|
31
|
+
Show current user.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
tailor-sdk user current [options]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### user list
|
|
38
|
+
|
|
39
|
+
List all users.
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
tailor-sdk user list [options]
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Options:**
|
|
46
|
+
|
|
47
|
+
- `--json` - Output as JSON
|
|
48
|
+
|
|
49
|
+
### user use
|
|
50
|
+
|
|
51
|
+
Set current user.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
tailor-sdk user use <user>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Arguments:**
|
|
58
|
+
|
|
59
|
+
- `user` - User email (required)
|
|
60
|
+
|
|
61
|
+
### user pat
|
|
62
|
+
|
|
63
|
+
Manage personal access tokens.
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
tailor-sdk user pat <subcommand> [options]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
When no subcommand is provided, defaults to `list`.
|
|
70
|
+
|
|
71
|
+
#### user pat list
|
|
72
|
+
|
|
73
|
+
List all personal access tokens.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
tailor-sdk user pat list [options]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Options:**
|
|
80
|
+
|
|
81
|
+
- `--json` - Output as JSON
|
|
82
|
+
|
|
83
|
+
**Output (default):**
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
token-name-1: read/write
|
|
87
|
+
token-name-2: read
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Output (`--json`):**
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
[
|
|
94
|
+
{ "name": "token-name-1", "scopes": ["read", "write"] },
|
|
95
|
+
{ "name": "token-name-2", "scopes": ["read"] }
|
|
96
|
+
]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### user pat create
|
|
100
|
+
|
|
101
|
+
Create a new personal access token.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
tailor-sdk user pat create <name> [options]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Arguments:**
|
|
108
|
+
|
|
109
|
+
- `name` - Token name (required)
|
|
110
|
+
|
|
111
|
+
**Options:**
|
|
112
|
+
|
|
113
|
+
- `-w, --write` - Grant write permission (default: read-only)
|
|
114
|
+
- `--json` - Output as JSON
|
|
115
|
+
|
|
116
|
+
**Output (default):**
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
Personal access token created successfully.
|
|
120
|
+
|
|
121
|
+
name: token-name
|
|
122
|
+
scopes: read/write
|
|
123
|
+
token: tpp_xxxxxxxxxxxxx
|
|
124
|
+
|
|
125
|
+
Please save this token in a secure location. You won't be able to see it again.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Output (`--json`):**
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{ "name": "token-name", "scopes": ["read", "write"], "token": "eyJhbGc..." }
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### user pat delete
|
|
135
|
+
|
|
136
|
+
Delete a personal access token.
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
tailor-sdk user pat delete <name>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Arguments:**
|
|
143
|
+
|
|
144
|
+
- `name` - Token name (required)
|
|
145
|
+
|
|
146
|
+
#### user pat update
|
|
147
|
+
|
|
148
|
+
Update a personal access token (delete and recreate).
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
tailor-sdk user pat update <name> [options]
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Arguments:**
|
|
155
|
+
|
|
156
|
+
- `name` - Token name (required)
|
|
157
|
+
|
|
158
|
+
**Options:**
|
|
159
|
+
|
|
160
|
+
- `-w, --write` - Grant write permission (if not specified, keeps read-only)
|
|
161
|
+
- `--json` - Output as JSON
|
|
162
|
+
|
|
163
|
+
**Output (default):**
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
Personal access token updated successfully.
|
|
167
|
+
|
|
168
|
+
name: token-name
|
|
169
|
+
scopes: read/write
|
|
170
|
+
token: tpp_xxxxxxxxxxxxx
|
|
171
|
+
|
|
172
|
+
Please save this token in a secure location. You won't be able to see it again.
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Output (`--json`):**
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"name": "token-name",
|
|
180
|
+
"scopes": ["read", "write"],
|
|
181
|
+
"token": "tpp_xxxxxxxxxxxxx"
|
|
182
|
+
}
|
|
183
|
+
```
|