@tailor-platform/function-types 0.9.0 → 0.10.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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @tailor-platform/function-types
2
2
 
3
+ ## 0.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#190](https://github.com/tailor-platform/function/pull/190) [`09dfbcc`](https://github.com/tailor-platform/function/commit/09dfbccaa0449077bf0e768bb85939918de2709f) Thanks [@toiroakr](https://github.com/toiroakr)! - Deprecate this package in favor of `@tailor-platform/sdk`, which now covers the same `tailor.*` / `tailordb.*` runtime surface. The README documents the deprecation and migration steps.
8
+
9
+ ## 0.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#189](https://github.com/tailor-platform/function/pull/189) [`2e2f241`](https://github.com/tailor-platform/function/commit/2e2f241b0e9bb1480de7e376abbef3cd27aae30d) Thanks [@dragon3](https://github.com/dragon3)! - Add `tailor.aigateway.get(name)` types for resolving an AI Gateway URL in the caller's workspace.
14
+
15
+ ### Patch Changes
16
+
17
+ - [#180](https://github.com/tailor-platform/function/pull/180) [`a36c24f`](https://github.com/tailor-platform/function/commit/a36c24faa835a350617b4f29c6e848894bcdc1e3) Thanks [@k1LoW](https://github.com/k1LoW)! - Remove non-existent `updatedAt` field from `tailor.idp.User`
18
+
3
19
  ## 0.9.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -1,18 +1,56 @@
1
1
  # @tailor-platform/function-types
2
2
 
3
- ## Usage
3
+ **Deprecated.** These types are now built into [`@tailor-platform/sdk`](https://www.npmjs.com/package/@tailor-platform/sdk), which exposes the same `tailor.*` / `tailordb.*` runtime surface plus typed wrappers you can import directly instead of relying on ambient globals. New projects should use `@tailor-platform/sdk` instead of this package; existing projects should migrate using the steps below.
4
+
5
+ This package will no longer receive updates for new runtime APIs (e.g. it never picked up `tailor.aigateway.get()`, while `@tailor-platform/sdk` will keep gaining new runtime APIs).
6
+
7
+ ## Migrating to `@tailor-platform/sdk`
8
+
9
+ 1. Add `@tailor-platform/sdk` and remove this package:
10
+
11
+ ```sh
12
+ npm i -D @tailor-platform/sdk
13
+ npm uninstall @tailor-platform/function-types
14
+ ```
15
+
16
+ If your project already depends on `@tailor-platform/sdk` (e.g. for `tailor.config.ts`, resolvers, or workflows), you can skip the install step.
17
+
18
+ 2. Update `tsconfig.json` to load the runtime globals from the SDK instead:
19
+
20
+ ```diff
21
+ {
22
+ "compilerOptions": {
23
+ - "types": ["@tailor-platform/function-types"]
24
+ + "types": ["@tailor-platform/sdk/runtime/globals"]
25
+ }
26
+ }
27
+ ```
28
+
29
+ 3. No other code changes are required. The global `tailor.*` and `tailordb.*` identifiers keep the same names and shapes (including the legacy capitalized `Tailordb.Client`, which `@tailor-platform/sdk` also keeps around for compatibility with this package).
30
+
31
+ ### Prefer typed imports over ambient globals (optional)
32
+
33
+ Instead of relying on the ambient `tailor` / `tailordb` globals, `@tailor-platform/sdk/runtime` exposes the same APIs as regular imports, which is easier to trace and doesn't require the `tsconfig.json` `types` change above:
34
+
35
+ ```typescript
36
+ import { iconv, secretmanager, idp, workflow, context, authconnection, file } from "@tailor-platform/sdk/runtime";
37
+
38
+ const secret = await secretmanager.getSecret("my-vault", "API_KEY");
39
+ ```
40
+
41
+ ### Known gap: `tailor.aigateway`
42
+
43
+ `@tailor-platform/sdk` does not yet expose a runtime equivalent of `tailor.aigateway.get(name)`. If your code uses it, keep this package installed alongside `@tailor-platform/sdk` for that one namespace until the SDK adds support, or reach out to the SDK team if you need this migrated sooner.
44
+
45
+ ## Legacy usage (this package)
4
46
 
5
- Install package.
6
47
  ```sh
7
48
  npm i -D @tailor-platform/function-types
8
49
  ```
9
50
 
10
- Add types to `tsconfig.json`.
11
- ```
51
+ ```json
12
52
  {
13
- ...
14
53
  "compilerOptions": {
15
- ...
16
54
  "types": ["@tailor-platform/function-types"]
17
55
  }
18
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/function-types",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "description": "TypeScript types for Tailor Platform Function service",
5
5
  "repository": {
6
6
  "type": "git",
package/tailor.d.ts CHANGED
@@ -61,6 +61,27 @@ declare namespace tailor.authconnection {
61
61
  function getConnectionToken(connectionName: string): Promise<any>;
62
62
  }
63
63
 
64
+ declare namespace tailor.aigateway {
65
+ /**
66
+ * AIGateway describes a resolved AI Gateway in the caller's workspace.
67
+ */
68
+ interface AIGateway {
69
+ /**
70
+ * Base URL of the AI Gateway, e.g.
71
+ * `https://my-aigateway-<workspace_hash>.ai.erp.dev`. Requests to this URL
72
+ * are automatically authenticated for the calling workspace.
73
+ */
74
+ url: string;
75
+ }
76
+
77
+ /**
78
+ * get resolves a named AI Gateway in the caller's own workspace and returns
79
+ * it. The gateway's existence is verified at call time, so resolving a name
80
+ * that does not exist rejects rather than failing later inside `fetch`.
81
+ */
82
+ function get(name: string): Promise<AIGateway>;
83
+ }
84
+
64
85
  declare namespace tailor.iconv {
65
86
  /**
66
87
  * Convert string from one encoding to another
@@ -332,7 +353,6 @@ declare namespace tailor.idp {
332
353
  name: string;
333
354
  disabled: boolean;
334
355
  createdAt?: string;
335
- updatedAt?: string;
336
356
  }
337
357
 
338
358
  /**