@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.
Files changed (55) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/application-B1_7Wm37.mjs +3 -0
  3. package/dist/{application-C1d52JP9.mjs → application-DDe0er6L.mjs} +149 -20
  4. package/dist/{application-C1d52JP9.mjs.map → application-DDe0er6L.mjs.map} +1 -1
  5. package/dist/cli/index.mjs +13 -28
  6. package/dist/cli/index.mjs.map +1 -1
  7. package/dist/cli/lib.mjs +2 -2
  8. package/dist/completion/zsh-worker.zsh +1 -1
  9. package/dist/configure/index.d.mts +3 -2
  10. package/dist/configure/index.mjs +9 -0
  11. package/dist/configure/index.mjs.map +1 -1
  12. package/dist/configure/services/idp/index.d.mts +1 -1
  13. package/dist/configure/services/idp/permission.d.mts +1 -16
  14. package/dist/configure/services/idp/types.d.mts +5 -1
  15. package/dist/configure/services/index.d.mts +3 -2
  16. package/dist/configure/services/resolver/index.d.mts +2 -1
  17. package/dist/configure/services/resolver/permission.d.mts +64 -0
  18. package/dist/configure/services/resolver/resolver.d.mts +14 -2
  19. package/dist/configure/services/tailordb/permission.d.mts +1 -16
  20. package/dist/configure/types/permission-operand.types.d.mts +20 -0
  21. package/dist/{globals-B-n_3uYu.mjs → globals-DUqEetIh.mjs} +18 -2
  22. package/dist/{globals-B-n_3uYu.mjs.map → globals-DUqEetIh.mjs.map} +1 -1
  23. package/dist/logger-B-fqZe2W.mjs +50 -0
  24. package/dist/logger-B-fqZe2W.mjs.map +1 -0
  25. package/dist/{register-typescript-runtime-Bd4bcLbW.mjs → register-typescript-runtime-QAWucsg0.mjs} +40 -9
  26. package/dist/register-typescript-runtime-QAWucsg0.mjs.map +1 -0
  27. package/dist/runtime/globals.d.mts +7 -0
  28. package/dist/runtime/index.d.mts +3 -1
  29. package/dist/runtime/index.mjs +2 -1
  30. package/dist/runtime/logger.d.mts +98 -0
  31. package/dist/runtime/logger.mjs +3 -0
  32. package/dist/{service_pb-BoLM0X4K.mjs → service_pb-BwZRiNug.mjs} +2 -2
  33. package/dist/{service_pb-BoLM0X4K.mjs.map → service_pb-BwZRiNug.mjs.map} +1 -1
  34. package/dist/{service_pb-r1T7kpJc.mjs → service_pb-wRkxUta6.mjs} +1 -1
  35. package/dist/types/auth.generated.d.mts +14 -2
  36. package/dist/types/executor.generated.d.mts +19 -0
  37. package/dist/types/http-adapter.generated.d.mts +5 -0
  38. package/dist/types/idp.generated.d.mts +30 -0
  39. package/dist/types/resolver.generated.d.mts +28 -2
  40. package/dist/types/tailordb.generated.d.mts +15 -1
  41. package/dist/vitest/environment.mjs +1 -1
  42. package/dist/vitest/index.d.mts +4 -2
  43. package/dist/vitest/index.mjs +83 -2
  44. package/dist/vitest/index.mjs.map +1 -1
  45. package/dist/vitest/mock.d.mts +2 -1
  46. package/dist/vitest/mocks/logger.d.mts +45 -0
  47. package/dist/vitest/setup.mjs +1 -1
  48. package/dist/{workspace_resource_pb-Db3fv68L.mjs → workspace_resource_pb-UGK1SSn_.mjs} +7 -2
  49. package/dist/{workspace_resource_pb-Db3fv68L.mjs.map → workspace_resource_pb-UGK1SSn_.mjs.map} +1 -1
  50. package/docs/runtime.md +4 -0
  51. package/docs/services/resolver.md +54 -0
  52. package/docs/testing.md +33 -6
  53. package/package.json +12 -7
  54. package/dist/application-Nlh9BHQf.mjs +0 -3
  55. 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. */
@@ -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 };
@@ -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 };
@@ -0,0 +1,3 @@
1
+ import { a as setAttributes, n as error, o as warn, r as info, t as debug } from "../logger-B-fqZe2W.mjs";
2
+
3
+ export { debug, error, info, setAttributes, warn };
@@ -1,4 +1,4 @@
1
- import { Ht as file_tailor_v1_aigateway, Lt as file_tailor_v1_application, Mt as file_tailor_v1_auth_resource, Nt as file_tailor_v1_secret_manager_resource, P as file_tailor_v1_pipeline, R as file_tailor_v1_idp, Ut as file_google_api_field_behavior, W as file_tailor_v1_function_resource, Wt as file_tailor_fieldmask_v1_option, Xt as file_buf_validate_validate, Yt as file_tailor_v1_resource, _t as file_tailor_v1_auth, c as file_tailor_v1_workflow, k as file_tailor_v1_secret_manager, m as file_tailor_v1_tailordb, n as file_tailor_v1_workspace_resource, q as file_tailor_v1_executor, w as file_tailor_v1_staticwebsite } from "./workspace_resource_pb-Db3fv68L.mjs";
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-BoLM0X4K.mjs.map
167
+ //# sourceMappingURL=service_pb-BwZRiNug.mjs.map