@tailor-platform/sdk 1.80.0 → 1.81.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 +28 -0
- package/dist/application-B1_7Wm37.mjs +3 -0
- package/dist/{application-C1d52JP9.mjs → application-DDe0er6L.mjs} +149 -20
- package/dist/{application-C1d52JP9.mjs.map → application-DDe0er6L.mjs.map} +1 -1
- package/dist/cli/index.mjs +13 -28
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.mjs +2 -2
- package/dist/completion/zsh-worker.zsh +1 -1
- package/dist/configure/index.d.mts +3 -2
- package/dist/configure/index.mjs +9 -0
- package/dist/configure/index.mjs.map +1 -1
- package/dist/configure/services/idp/index.d.mts +1 -1
- package/dist/configure/services/idp/permission.d.mts +1 -16
- package/dist/configure/services/idp/types.d.mts +5 -1
- package/dist/configure/services/index.d.mts +3 -2
- package/dist/configure/services/resolver/index.d.mts +2 -1
- package/dist/configure/services/resolver/permission.d.mts +64 -0
- package/dist/configure/services/resolver/resolver.d.mts +14 -2
- package/dist/configure/services/tailordb/permission.d.mts +1 -16
- package/dist/configure/types/permission-operand.types.d.mts +20 -0
- package/dist/{globals-B-n_3uYu.mjs → globals-DUqEetIh.mjs} +18 -2
- package/dist/{globals-B-n_3uYu.mjs.map → globals-DUqEetIh.mjs.map} +1 -1
- package/dist/logger-B-fqZe2W.mjs +50 -0
- package/dist/logger-B-fqZe2W.mjs.map +1 -0
- package/dist/{register-typescript-runtime-Bd4bcLbW.mjs → register-typescript-runtime-QAWucsg0.mjs} +40 -9
- package/dist/register-typescript-runtime-QAWucsg0.mjs.map +1 -0
- package/dist/runtime/globals.d.mts +7 -0
- package/dist/runtime/index.d.mts +3 -1
- package/dist/runtime/index.mjs +2 -1
- package/dist/runtime/logger.d.mts +98 -0
- package/dist/runtime/logger.mjs +3 -0
- package/dist/{service_pb-BoLM0X4K.mjs → service_pb-BwZRiNug.mjs} +2 -2
- package/dist/{service_pb-BoLM0X4K.mjs.map → service_pb-BwZRiNug.mjs.map} +1 -1
- package/dist/{service_pb-r1T7kpJc.mjs → service_pb-wRkxUta6.mjs} +1 -1
- package/dist/types/auth.generated.d.mts +14 -2
- package/dist/types/executor.generated.d.mts +19 -0
- package/dist/types/http-adapter.generated.d.mts +5 -0
- package/dist/types/idp.generated.d.mts +30 -0
- package/dist/types/resolver.generated.d.mts +28 -2
- package/dist/types/tailordb.generated.d.mts +15 -1
- package/dist/vitest/environment.mjs +1 -1
- package/dist/vitest/index.d.mts +4 -2
- package/dist/vitest/index.mjs +83 -2
- package/dist/vitest/index.mjs.map +1 -1
- package/dist/vitest/mock.d.mts +2 -1
- package/dist/vitest/mocks/logger.d.mts +45 -0
- package/dist/vitest/setup.mjs +1 -1
- package/dist/{workspace_resource_pb-Db3fv68L.mjs → workspace_resource_pb-UGK1SSn_.mjs} +7 -2
- package/dist/{workspace_resource_pb-Db3fv68L.mjs.map → workspace_resource_pb-UGK1SSn_.mjs.map} +1 -1
- package/docs/runtime.md +4 -0
- package/docs/services/resolver.md +54 -0
- package/docs/testing.md +33 -6
- package/package.json +12 -7
- package/dist/application-Nlh9BHQf.mjs +0 -3
- package/dist/register-typescript-runtime-Bd4bcLbW.mjs.map +0 -1
|
@@ -3,6 +3,7 @@ import { ContextInvoker } from "./context.mjs";
|
|
|
3
3
|
import { TailorDBFileErrorCode } from "./file.mjs";
|
|
4
4
|
import { IconvInstance } from "./iconv.mjs";
|
|
5
5
|
import { ClientConfig, CreateUserInput, IdpClientInstance, ListUsersOptions, ListUsersResponse, SendPasswordResetEmailInput, UnenrollMfaInput, UpdateUserInput, User, UserQuery } from "./idp.mjs";
|
|
6
|
+
import { LogAttributeValue, LogAttributes } from "./logger.mjs";
|
|
6
7
|
import { TailorRuntime, TailordbClientInstance, TailordbCommandType, TailordbQueryResult, TailordbRuntime } from "./index.mjs";
|
|
7
8
|
//#region src/runtime/globals.d.ts
|
|
8
9
|
type TailorIdpClientConfig = ClientConfig;
|
|
@@ -18,6 +19,8 @@ type TailorIdpUserQuery = UserQuery;
|
|
|
18
19
|
type TailorWorkflowAuthInvoker = AuthInvoker;
|
|
19
20
|
type TailorWorkflowTriggerWorkflowOptions = TriggerWorkflowOptions;
|
|
20
21
|
type TailorWorkflowStartWorkflowOptions = StartWorkflowOptions;
|
|
22
|
+
type TailorLoggerLogAttributeValue = LogAttributeValue;
|
|
23
|
+
type TailorLoggerLogAttributes = LogAttributes;
|
|
21
24
|
declare global {
|
|
22
25
|
namespace tailordb {
|
|
23
26
|
type QueryResult<T> = TailordbQueryResult<T>;
|
|
@@ -83,6 +86,10 @@ declare global {
|
|
|
83
86
|
namespace context {
|
|
84
87
|
type Invoker = ContextInvoker;
|
|
85
88
|
}
|
|
89
|
+
namespace logger {
|
|
90
|
+
type LogAttributeValue = TailorLoggerLogAttributeValue;
|
|
91
|
+
type LogAttributes = TailorLoggerLogAttributes;
|
|
92
|
+
}
|
|
86
93
|
}
|
|
87
94
|
var tailor: TailorRuntime;
|
|
88
95
|
/** Custom error class for TailorDB File operations. */
|
package/dist/runtime/index.d.mts
CHANGED
|
@@ -5,6 +5,7 @@ import { TailorContextAPI, context_d_exports } from "./context.mjs";
|
|
|
5
5
|
import { TailorDBFileAPI, file_d_exports } from "./file.mjs";
|
|
6
6
|
import { TailorIconvAPI, iconv_d_exports } from "./iconv.mjs";
|
|
7
7
|
import { TailorIdpAPI, idp_d_exports } from "./idp.mjs";
|
|
8
|
+
import { TailorLoggerAPI, logger_d_exports } from "./logger.mjs";
|
|
8
9
|
import { TailorSecretmanagerAPI, secretmanager_d_exports } from "./secretmanager.mjs";
|
|
9
10
|
//#region src/runtime/index.d.ts
|
|
10
11
|
/** SQL command type recorded on a {@link TailordbQueryResult}. */
|
|
@@ -36,6 +37,7 @@ interface TailorRuntime {
|
|
|
36
37
|
workflow: TailorWorkflowAPI;
|
|
37
38
|
context: TailorContextAPI;
|
|
38
39
|
aigateway: TailorAigatewayAPI;
|
|
40
|
+
logger: TailorLoggerAPI;
|
|
39
41
|
}
|
|
40
42
|
/** Top-level `tailordb` runtime object. */
|
|
41
43
|
interface TailordbRuntime {
|
|
@@ -43,4 +45,4 @@ interface TailordbRuntime {
|
|
|
43
45
|
file: TailorDBFileAPI;
|
|
44
46
|
}
|
|
45
47
|
//#endregion
|
|
46
|
-
export { TailorRuntime, TailordbClientConstructor, TailordbClientInstance, TailordbCommandType, TailordbQueryResult, TailordbRuntime, aigateway_d_exports as aigateway, authconnection_d_exports as authconnection, context_d_exports as context, file_d_exports as file, iconv_d_exports as iconv, idp_d_exports as idp, secretmanager_d_exports as secretmanager, workflow_d_exports as workflow };
|
|
48
|
+
export { TailorRuntime, TailordbClientConstructor, TailordbClientInstance, TailordbCommandType, TailordbQueryResult, TailordbRuntime, aigateway_d_exports as aigateway, authconnection_d_exports as authconnection, context_d_exports as context, file_d_exports as file, iconv_d_exports as iconv, idp_d_exports as idp, logger_d_exports as logger, secretmanager_d_exports as secretmanager, workflow_d_exports as workflow };
|
package/dist/runtime/index.mjs
CHANGED
|
@@ -6,5 +6,6 @@ import { l as workflow_exports } from "../workflow-CkIDJpdg.mjs";
|
|
|
6
6
|
import { t as context_exports } from "../context-Bd266-ru.mjs";
|
|
7
7
|
import { a as file_exports } from "../file-_oUZo76X.mjs";
|
|
8
8
|
import { t as aigateway_exports } from "../aigateway-B3oZZE6v.mjs";
|
|
9
|
+
import { i as logger_exports } from "../logger-B-fqZe2W.mjs";
|
|
9
10
|
|
|
10
|
-
export { aigateway_exports as aigateway, authconnection_exports as authconnection, context_exports as context, file_exports as file, iconv_exports as iconv, idp_exports as idp, secretmanager_exports as secretmanager, workflow_exports as workflow };
|
|
11
|
+
export { aigateway_exports as aigateway, authconnection_exports as authconnection, context_exports as context, file_exports as file, iconv_exports as iconv, idp_exports as idp, logger_exports as logger, secretmanager_exports as secretmanager, workflow_exports as workflow };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
declare namespace logger_d_exports {
|
|
2
|
+
export { LogAttributeValue, LogAttributes, TailorLoggerAPI, debug, error, info, setAttributes, warn };
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Structured logging utilities.
|
|
6
|
+
*
|
|
7
|
+
* Thin typed wrapper around the platform-provided `tailor.logger` runtime API.
|
|
8
|
+
* At runtime this delegates to `globalThis.tailor.logger`. Use `mockLogger`
|
|
9
|
+
* from `@tailor-platform/sdk/vitest` to mock these calls in unit tests.
|
|
10
|
+
*
|
|
11
|
+
* Unlike `console.*`, each call carries a severity and structured attributes.
|
|
12
|
+
* The message is written to standard output, and the full entry with its
|
|
13
|
+
* attributes is exported over OpenTelemetry, where the attributes are queryable.
|
|
14
|
+
* @example
|
|
15
|
+
* import { logger } from "@tailor-platform/sdk/runtime";
|
|
16
|
+
*
|
|
17
|
+
* logger.setAttributes({ requestId: "r-123" });
|
|
18
|
+
* logger.info("order processed", { orderId: "o-1", total: 99.5 });
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* A single log attribute value. Values outside this union (`null`, nested
|
|
22
|
+
* objects, mixed-type arrays) are silently dropped by the platform.
|
|
23
|
+
*/
|
|
24
|
+
type LogAttributeValue = string | number | boolean | readonly string[] | readonly number[] | readonly boolean[];
|
|
25
|
+
/**
|
|
26
|
+
* Structured attributes attached to a log entry. The platform keeps at most 32
|
|
27
|
+
* entries, drops any entry whose key exceeds 128 bytes, and truncates string
|
|
28
|
+
* values over 4096 bytes and arrays over 64 elements.
|
|
29
|
+
*/
|
|
30
|
+
type LogAttributes = Record<string, LogAttributeValue>;
|
|
31
|
+
/**
|
|
32
|
+
* Platform API surface for `tailor.logger`. Describes the shape the platform
|
|
33
|
+
* runtime injects on `globalThis.tailor.logger`.
|
|
34
|
+
*
|
|
35
|
+
* Each method below is also re-exported as a top-level named export from this
|
|
36
|
+
* module so callers can either `import * as logger from
|
|
37
|
+
* "@tailor-platform/sdk/runtime/logger"` or pick individual methods.
|
|
38
|
+
*/
|
|
39
|
+
interface TailorLoggerAPI {
|
|
40
|
+
/**
|
|
41
|
+
* Emits a `debug`-severity log entry.
|
|
42
|
+
* @param message - The log message
|
|
43
|
+
* @param attributes - Structured attributes to attach to this entry
|
|
44
|
+
*/
|
|
45
|
+
debug(message: string, attributes?: LogAttributes): void;
|
|
46
|
+
/**
|
|
47
|
+
* Emits an `info`-severity log entry.
|
|
48
|
+
* @param message - The log message
|
|
49
|
+
* @param attributes - Structured attributes to attach to this entry
|
|
50
|
+
*/
|
|
51
|
+
info(message: string, attributes?: LogAttributes): void;
|
|
52
|
+
/**
|
|
53
|
+
* Emits a `warn`-severity log entry.
|
|
54
|
+
* @param message - The log message
|
|
55
|
+
* @param attributes - Structured attributes to attach to this entry
|
|
56
|
+
*/
|
|
57
|
+
warn(message: string, attributes?: LogAttributes): void;
|
|
58
|
+
/**
|
|
59
|
+
* Emits an `error`-severity log entry.
|
|
60
|
+
* @param message - The log message
|
|
61
|
+
* @param attributes - Structured attributes to attach to this entry
|
|
62
|
+
*/
|
|
63
|
+
error(message: string, attributes?: LogAttributes): void;
|
|
64
|
+
/**
|
|
65
|
+
* Merges attributes into every subsequent log entry from the current
|
|
66
|
+
* execution. Later keys overwrite earlier ones; per-call attributes passed to
|
|
67
|
+
* `debug`/`info`/`warn`/`error` take precedence.
|
|
68
|
+
* @param attributes - Attributes to attach to subsequent entries
|
|
69
|
+
*/
|
|
70
|
+
setAttributes(attributes: LogAttributes): void;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* See {@link TailorLoggerAPI.debug}.
|
|
74
|
+
* @param args - Forwarded to {@link TailorLoggerAPI.debug}
|
|
75
|
+
*/
|
|
76
|
+
declare const debug: TailorLoggerAPI["debug"];
|
|
77
|
+
/**
|
|
78
|
+
* See {@link TailorLoggerAPI.info}.
|
|
79
|
+
* @param args - Forwarded to {@link TailorLoggerAPI.info}
|
|
80
|
+
*/
|
|
81
|
+
declare const info: TailorLoggerAPI["info"];
|
|
82
|
+
/**
|
|
83
|
+
* See {@link TailorLoggerAPI.warn}.
|
|
84
|
+
* @param args - Forwarded to {@link TailorLoggerAPI.warn}
|
|
85
|
+
*/
|
|
86
|
+
declare const warn: TailorLoggerAPI["warn"];
|
|
87
|
+
/**
|
|
88
|
+
* See {@link TailorLoggerAPI.error}.
|
|
89
|
+
* @param args - Forwarded to {@link TailorLoggerAPI.error}
|
|
90
|
+
*/
|
|
91
|
+
declare const error: TailorLoggerAPI["error"];
|
|
92
|
+
/**
|
|
93
|
+
* See {@link TailorLoggerAPI.setAttributes}.
|
|
94
|
+
* @param args - Forwarded to {@link TailorLoggerAPI.setAttributes}
|
|
95
|
+
*/
|
|
96
|
+
declare const setAttributes: TailorLoggerAPI["setAttributes"];
|
|
97
|
+
//#endregion
|
|
98
|
+
export { LogAttributeValue, LogAttributes, TailorLoggerAPI, debug, error, info, logger_d_exports, setAttributes, warn };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as file_tailor_v1_secret_manager, F as file_tailor_v1_pipeline, G as file_tailor_v1_function_resource, Gt as file_tailor_fieldmask_v1_option, J as file_tailor_v1_executor, Nt as file_tailor_v1_auth_resource, Pt as file_tailor_v1_secret_manager_resource, Rt as file_tailor_v1_application, T as file_tailor_v1_staticwebsite, Ut as file_tailor_v1_aigateway, Wt as file_google_api_field_behavior, Xt as file_tailor_v1_resource, Zt as file_buf_validate_validate, c as file_tailor_v1_workflow, m as file_tailor_v1_tailordb, n as file_tailor_v1_workspace_resource, vt as file_tailor_v1_auth, z as file_tailor_v1_idp } from "./workspace_resource_pb-UGK1SSn_.mjs";
|
|
2
2
|
import { enumDesc, fileDesc, messageDesc, serviceDesc, tsEnum } from "@bufbuild/protobuf/codegenv2";
|
|
3
3
|
import { file_google_protobuf_duration, file_google_protobuf_field_mask, file_google_protobuf_struct, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
|
4
4
|
|
|
@@ -164,4 +164,4 @@ const OperatorService = /*@__PURE__*/ serviceDesc(file_tailor_v1_service, 0);
|
|
|
164
164
|
|
|
165
165
|
//#endregion
|
|
166
166
|
export { file_tailor_v1_service as i, PingRequestSchema as n, PingResponseSchema as r, OperatorService as t };
|
|
167
|
-
//# sourceMappingURL=service_pb-
|
|
167
|
+
//# sourceMappingURL=service_pb-BwZRiNug.mjs.map
|