@tailor-platform/sdk 1.25.4 → 1.26.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/{application-DegTCDd8.mjs → application-CxH6Yp54.mjs} +1 -1
  3. package/dist/{application-91Th6tm6.mjs → application-D9xahQRQ.mjs} +2066 -1968
  4. package/dist/application-D9xahQRQ.mjs.map +1 -0
  5. package/dist/cli/index.mjs +152 -3
  6. package/dist/cli/index.mjs.map +1 -1
  7. package/dist/cli/lib.d.mts +350 -8
  8. package/dist/cli/lib.mjs +2 -2
  9. package/dist/configure/index.d.mts +5 -5
  10. package/dist/configure/index.mjs.map +1 -1
  11. package/dist/{env-uBeVwE9B.d.mts → env-CSsVESbH.d.mts} +2 -2
  12. package/dist/{index-Bu12qy3m.d.mts → index-BJg0DTbR.d.mts} +4 -4
  13. package/dist/{index-CT53egux.d.mts → index-BKy-OC5C.d.mts} +2 -2
  14. package/dist/{index-cZilKprY.d.mts → index-BtYPY8ya.d.mts} +2 -2
  15. package/dist/{index-BD-K97-C.d.mts → index-DgRShBpu.d.mts} +2 -2
  16. package/dist/{index-D1J5SfyK.d.mts → index-DkJbItB-.d.mts} +2 -2
  17. package/dist/plugin/builtin/enum-constants/index.d.mts +1 -1
  18. package/dist/plugin/builtin/file-utils/index.d.mts +1 -1
  19. package/dist/plugin/builtin/kysely-type/index.d.mts +1 -1
  20. package/dist/plugin/builtin/seed/index.d.mts +1 -1
  21. package/dist/plugin/index.d.mts +2 -2
  22. package/dist/{plugin-zY5wvV82.d.mts → plugin-B1hNwcCC.d.mts} +15 -3
  23. package/dist/{query-kb_4EQp4.mjs → query-B8ml6ClT.mjs} +454 -358
  24. package/dist/query-B8ml6ClT.mjs.map +1 -0
  25. package/dist/utils/test/index.d.mts +2 -2
  26. package/dist/{workflow.generated-v1LXRuB6.d.mts → workflow.generated-Bm4b8hEk.d.mts} +2 -2
  27. package/docs/cli/setup.md +82 -0
  28. package/docs/cli-reference.md +8 -0
  29. package/docs/services/auth.md +33 -0
  30. package/package.json +4 -4
  31. package/dist/application-91Th6tm6.mjs.map +0 -1
  32. package/dist/query-kb_4EQp4.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
- import { V as TailorDBType, tt as TailorField } from "../../plugin-zY5wvV82.mjs";
2
- import { G as WORKFLOW_TEST_ENV_KEY, n as output } from "../../index-Bu12qy3m.mjs";
1
+ import { H as TailorDBType, nt as TailorField } from "../../plugin-B1hNwcCC.mjs";
2
+ import { G as WORKFLOW_TEST_ENV_KEY, n as output } from "../../index-BJg0DTbR.mjs";
3
3
  import { StandardSchemaV1 } from "@standard-schema/spec";
4
4
 
5
5
  //#region src/utils/test/mock.d.ts
@@ -1,4 +1,4 @@
1
- import { S as TailorDBServiceInput, T as AuthConfig, kt as BuiltinIdP } from "./plugin-zY5wvV82.mjs";
1
+ import { At as BuiltinIdP, S as TailorDBServiceInput, T as AuthConfig } from "./plugin-B1hNwcCC.mjs";
2
2
 
3
3
  //#region src/types/idp.generated.d.ts
4
4
  /**
@@ -191,4 +191,4 @@ type RetryPolicy = {
191
191
  };
192
192
  //#endregion
193
193
  export { IdPGqlOperations as _, ResolverExternalConfig as a, WorkflowServiceConfig as c, defineStaticWebSite as d, SecretsConfig as f, IdpDefinitionBrand as g, IdPExternalConfig as h, ExecutorServiceInput as i, WorkflowServiceInput as l, IdPConfig as m, AppConfig as n, ResolverServiceConfig as o, defineSecretManager as p, ExecutorServiceConfig as r, ResolverServiceInput as s, RetryPolicy as t, StaticWebsiteConfig as u, IdPGqlOperationsInput as v, IdPInput as y };
194
- //# sourceMappingURL=workflow.generated-v1LXRuB6.d.mts.map
194
+ //# sourceMappingURL=workflow.generated-Bm4b8hEk.d.mts.map
@@ -0,0 +1,82 @@
1
+ # Setup Commands
2
+
3
+ Commands for setting up project infrastructure.
4
+
5
+ <!-- politty:command:setup:heading:start -->
6
+
7
+ ## setup
8
+
9
+ <!-- politty:command:setup:heading:end -->
10
+
11
+ <!-- politty:command:setup:description:start -->
12
+
13
+ Set up project infrastructure.
14
+
15
+ <!-- politty:command:setup:description:end -->
16
+
17
+ <!-- politty:command:setup:usage:start -->
18
+
19
+ **Usage**
20
+
21
+ ```
22
+ tailor-sdk setup [command]
23
+ ```
24
+
25
+ <!-- politty:command:setup:usage:end -->
26
+
27
+ <!-- politty:command:setup:subcommands:start -->
28
+
29
+ **Commands**
30
+
31
+ | Command | Description |
32
+ | ------------------------------- | ------------------------------------------------------- |
33
+ | [`setup github`](#setup-github) | Generate GitHub Actions workflow for deployment. (beta) |
34
+
35
+ <!-- politty:command:setup:subcommands:end -->
36
+
37
+ <!-- politty:command:setup:global-options-link:start -->
38
+
39
+ See [Global Options](../cli-reference.md#global-options) for options available to all commands.
40
+
41
+ <!-- politty:command:setup:global-options-link:end -->
42
+ <!-- politty:command:setup github:heading:start -->
43
+
44
+ ### setup github
45
+
46
+ <!-- politty:command:setup github:heading:end -->
47
+
48
+ <!-- politty:command:setup github:description:start -->
49
+
50
+ Generate GitHub Actions workflow for deployment. (beta)
51
+
52
+ <!-- politty:command:setup github:description:end -->
53
+
54
+ <!-- politty:command:setup github:usage:start -->
55
+
56
+ **Usage**
57
+
58
+ ```
59
+ tailor-sdk setup github [options]
60
+ ```
61
+
62
+ <!-- politty:command:setup github:usage:end -->
63
+
64
+ <!-- politty:command:setup github:options:start -->
65
+
66
+ **Options**
67
+
68
+ | Option | Alias | Description | Required | Default |
69
+ | --------------------------------------- | ----- | ----------------------------------- | -------- | ------- |
70
+ | `--workspace-name <WORKSPACE_NAME>` | `-n` | Workspace name | Yes | - |
71
+ | `--workspace-region <WORKSPACE_REGION>` | `-r` | Workspace region | Yes | - |
72
+ | `--organization-id <ORGANIZATION_ID>` | `-o` | Organization ID | Yes | - |
73
+ | `--folder-id <FOLDER_ID>` | `-f` | Folder ID | Yes | - |
74
+ | `--dir <DIR>` | `-d` | App directory (for monorepo setups) | No | `"."` |
75
+
76
+ <!-- politty:command:setup github:options:end -->
77
+
78
+ <!-- politty:command:setup github:global-options-link:start -->
79
+
80
+ See [Global Options](../cli-reference.md#global-options) for options available to all commands.
81
+
82
+ <!-- politty:command:setup github:global-options-link:end -->
@@ -203,6 +203,14 @@ Commands for managing and deploying static websites.
203
203
  | [staticwebsite list](./cli/staticwebsite.md#staticwebsite-list) | List static websites in a workspace |
204
204
  | [staticwebsite get](./cli/staticwebsite.md#staticwebsite-get) | Get details of a static website |
205
205
 
206
+ ### [Setup Commands](./cli/setup.md)
207
+
208
+ Commands for setting up project infrastructure.
209
+
210
+ | Command | Description |
211
+ | ------------------------------------------- | ----------------------------------------------- |
212
+ | [setup github](./cli/setup.md#setup-github) | Generate GitHub Actions workflow for deployment |
213
+
206
214
  ### [Completion](./cli/completion.md)
207
215
 
208
216
  Generate shell completion scripts for bash, zsh, and fish.
@@ -341,6 +341,39 @@ idProvider: idp.provider("my-provider", "my-client"),
341
341
 
342
342
  See [IdP](./idp.md) for configuring identity providers.
343
343
 
344
+ ## Before Login Hook
345
+
346
+ Run custom logic before a user logs in. This is useful for JIT (Just-In-Time) user provisioning — automatically creating or updating user records when a user authenticates for the first time.
347
+
348
+ ```typescript
349
+ import { defineAuth } from "@tailor-platform/sdk";
350
+ import { user } from "./tailordb/user";
351
+
352
+ export const auth = defineAuth("my-auth", {
353
+ userProfile: {
354
+ type: user,
355
+ usernameField: "email",
356
+ },
357
+ machineUsers: {
358
+ "hook-invoker": {
359
+ attributes: { role: "ADMIN" },
360
+ },
361
+ },
362
+ hooks: {
363
+ beforeLogin: {
364
+ handler: async ({ claims, idpConfigName }) => {
365
+ // Provision or update user based on IdP claims
366
+ },
367
+ invoker: "hook-invoker",
368
+ },
369
+ },
370
+ });
371
+ ```
372
+
373
+ **handler**: An async function that receives `{ claims, idpConfigName }` and is called before each login. `claims` contains the token claims from the identity provider, and `idpConfigName` is the name of the IdP configuration used for authentication.
374
+
375
+ **invoker**: The machine user whose permissions are used to execute the hook. Must reference a machine user defined in the same auth configuration.
376
+
344
377
  ## CLI Commands
345
378
 
346
379
  Manage Auth resources using the CLI:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "1.25.4",
3
+ "version": "1.26.0",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -132,9 +132,9 @@
132
132
  "@types/mime-types": "3.0.1",
133
133
  "@types/node": "24.12.0",
134
134
  "@typescript/native-preview": "7.0.0-dev.20260308.1",
135
- "@vitest/coverage-v8": "4.0.18",
135
+ "@vitest/coverage-v8": "4.1.0",
136
136
  "eslint": "9.39.4",
137
- "eslint-plugin-jsdoc": "62.7.1",
137
+ "eslint-plugin-jsdoc": "62.8.0",
138
138
  "eslint-plugin-oxlint": "1.39.0",
139
139
  "oxlint": "1.39.0",
140
140
  "oxlint-tsgolint": "0.16.0",
@@ -142,7 +142,7 @@
142
142
  "tsdown": "0.21.2",
143
143
  "typescript": "5.9.3",
144
144
  "typescript-eslint": "8.57.0",
145
- "vitest": "4.0.18",
145
+ "vitest": "4.1.0",
146
146
  "zinfer": "0.1.7"
147
147
  },
148
148
  "scripts": {