@tailor-platform/sdk 1.85.1 → 1.85.3
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 +18 -0
- package/dist/application-CzmT8-Nh.mjs +3 -0
- package/dist/{application-m5tYtz0-.mjs → application-D9j1a2Xc.mjs} +51 -6
- package/dist/application-D9j1a2Xc.mjs.map +1 -0
- package/dist/cli/index.mjs +7 -7
- 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/{register-typescript-runtime-nG-n9lPw.mjs → register-typescript-runtime-D1FNkMrS.mjs} +46 -43
- package/dist/register-typescript-runtime-D1FNkMrS.mjs.map +1 -0
- package/dist/{service_pb-D5--My_M.mjs → service_pb-DGK0mNn_.mjs} +2 -2
- package/dist/{service_pb-D5--My_M.mjs.map → service_pb-DGK0mNn_.mjs.map} +1 -1
- package/dist/{service_pb-i8CmnQP4.mjs → service_pb-_V6qjFDF.mjs} +1 -1
- package/dist/tailor-proto/src/tailor/v1/idp_resource_pb.d.mts +5 -1
- package/dist/types/idp.generated.d.mts +1 -1
- package/dist/{workspace_resource_pb-DXnO2AT-.mjs → workspace_resource_pb-6X2GIZDj.mjs} +2 -2
- package/dist/{workspace_resource_pb-DXnO2AT-.mjs.map → workspace_resource_pb-6X2GIZDj.mjs.map} +1 -1
- package/docs/services/idp.md +6 -3
- package/docs/services/workflow.md +1 -1
- package/package.json +1 -1
- package/dist/application-C-zsrNjn.mjs +0 -3
- package/dist/application-m5tYtz0-.mjs.map +0 -1
- package/dist/register-typescript-runtime-nG-n9lPw.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @tailor-platform/sdk
|
|
2
2
|
|
|
3
|
+
## 1.85.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2642](https://github.com/tailor-platform/sdk/pull/2642) [`0806be7`](https://github.com/tailor-platform/sdk/commit/0806be713533a3d67aa56c0a5b5a6e33657dbc12) Thanks [@dqn](https://github.com/dqn)! - Find types in TailorDB namespaces with more than 50 types in `tailor-sdk tailordb truncate <types...>`, and in `tailor-sdk query --engine sql` for apps with more than one TailorDB namespace. Types created after the first 50 in a namespace were reported as `The following types were not found in any namespace` or `Could not find namespace for types in query`. When listing a namespace's types fails, both commands now stop with that error instead of skipping that namespace and continuing with the others.
|
|
8
|
+
|
|
9
|
+
## 1.85.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#2592](https://github.com/tailor-platform/sdk/pull/2592) [`9e4a644`](https://github.com/tailor-platform/sdk/commit/9e4a644807dae43f42f5cf0f2ccaaa7f3bfe0651) Thanks [@k1LoW](https://github.com/k1LoW)! - Fix function execution logs coming back empty. The logs that `tailor-sdk function test-run`, `function logs`, `workflow executions --logs`, `executor jobs --logs`, TailorDB migrations, seeding, and `executeScript()` show are now read from the platform's structured log entries, joined with newlines, instead of the deprecated flat `logs` field the platform no longer fills.
|
|
14
|
+
|
|
15
|
+
- [#2592](https://github.com/tailor-platform/sdk/pull/2592) [`c84153e`](https://github.com/tailor-platform/sdk/commit/c84153ebc1c758585739914d074dd85f0e6eaf39) Thanks [@k1LoW](https://github.com/k1LoW)! - Accept IdP `userAuthPolicy.allowedEmailDomains: ["*"]`, the lone entry that allows every email domain. `tailor-sdk deploy` used to reject it with "must be a valid hostname" during pre-flight validation because the bundled protobuf descriptors carried the platform's older hostname-only rule. Each entry is now validated locally: it must be a hostname or `"*"`, entries must be unique when compared case-insensitively and number at most 100, and `"*"` cannot sit alongside another entry. Entries that differ only in letter case, such as `["Example.com", "example.com"]`, used to deploy and be merged into one domain by the platform, and are now rejected so the list says what is stored.
|
|
16
|
+
|
|
17
|
+
`tailor-sdk deploy` also warns on an IdP service that leaves `allowedEmailDomains` empty. An empty list still allows every domain, but a future platform release requires that state to be explicit, so set `["*"]` to keep the current behavior or list the domains you accept.
|
|
18
|
+
|
|
19
|
+
Fixes a plan diff that re-applied `allowedEmailDomains` on every deploy when an entry was written in mixed case.
|
|
20
|
+
|
|
3
21
|
## 1.85.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -182,7 +182,7 @@ function initOAuth2Client(config) {
|
|
|
182
182
|
*/
|
|
183
183
|
async function initOperatorClient(accessToken, config) {
|
|
184
184
|
const platformConfig = config ?? getPlatformConfigForToken(accessToken);
|
|
185
|
-
const [{ createTracingInterceptor }, { OperatorService }] = await Promise.all([import("./interceptor-D-q1rvRl.mjs"), import("./service_pb-
|
|
185
|
+
const [{ createTracingInterceptor }, { OperatorService }] = await Promise.all([import("./interceptor-D-q1rvRl.mjs"), import("./service_pb-_V6qjFDF.mjs")]);
|
|
186
186
|
const interceptors = [
|
|
187
187
|
await userAgentInterceptor(),
|
|
188
188
|
await bearerTokenInterceptor(accessToken),
|
|
@@ -5376,6 +5376,51 @@ const AIGatewaySchema = z.object({
|
|
|
5376
5376
|
cors: z.array(z.string()).optional().describe("Allowed CORS origins for browser-based clients. Each entry is `*`, `http(s)://*`, `http(s)://*.example.com`, or `http(s)://app.example.com`, optionally with `:port`. Empty list disables cross-origin access.")
|
|
5377
5377
|
}).brand("AIGatewayConfig");
|
|
5378
5378
|
|
|
5379
|
+
//#endregion
|
|
5380
|
+
//#region src/parser/service/idp/email-domains.ts
|
|
5381
|
+
/**
|
|
5382
|
+
* The `allowedEmailDomains` entry that permits every email domain. It has to be
|
|
5383
|
+
* the only entry in the list.
|
|
5384
|
+
*/
|
|
5385
|
+
const ALL_EMAIL_DOMAINS = "*";
|
|
5386
|
+
/**
|
|
5387
|
+
* A single `allowedEmailDomains` entry: a hostname, or {@link ALL_EMAIL_DOMAINS}.
|
|
5388
|
+
*
|
|
5389
|
+
* Two forms the platform accepts are rejected here, because each stores an entry
|
|
5390
|
+
* that can never match: surrounding whitespace, which the platform trims and then
|
|
5391
|
+
* echoes back normalized as a permanent diff in every later plan, and a trailing
|
|
5392
|
+
* dot, which a domain taken from an email address never carries. Elsewhere this
|
|
5393
|
+
* is looser than the platform's own check, so nothing else it accepts is rejected
|
|
5394
|
+
* here.
|
|
5395
|
+
*/
|
|
5396
|
+
const allowedEmailDomainPattern = /^(\*|[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/;
|
|
5397
|
+
/**
|
|
5398
|
+
* Whether the list carries the all-domains entry.
|
|
5399
|
+
*
|
|
5400
|
+
* Trimming mirrors the platform, which trims before comparing, so a padded
|
|
5401
|
+
* entry cannot slip past the exclusivity check here either.
|
|
5402
|
+
* @param domains - Raw `allowedEmailDomains` entries
|
|
5403
|
+
* @returns Whether any entry is the all-domains entry
|
|
5404
|
+
*/
|
|
5405
|
+
function containsAllEmailDomains(domains) {
|
|
5406
|
+
return domains.some((domain) => domain.trim() === "*");
|
|
5407
|
+
}
|
|
5408
|
+
/**
|
|
5409
|
+
* Whether a policy leaves the accepted email domains implicit.
|
|
5410
|
+
*
|
|
5411
|
+
* An empty or omitted `allowedEmailDomains` currently means "every domain", but
|
|
5412
|
+
* the platform is moving that meaning behind an explicit `["*"]`, so the CLI
|
|
5413
|
+
* warns about such policies to nudge authors into declaring their intent while
|
|
5414
|
+
* both forms still work. Namespaces with `useNonEmailIdentifier` never reach
|
|
5415
|
+
* domain validation and cannot set the field at all, so they are not affected.
|
|
5416
|
+
* @param policy - The IdP user auth policy from user config
|
|
5417
|
+
* @returns Whether the CLI should warn about an implicit all-domains state
|
|
5418
|
+
*/
|
|
5419
|
+
function hasImplicitAllEmailDomains(policy) {
|
|
5420
|
+
if (policy?.useNonEmailIdentifier === true) return false;
|
|
5421
|
+
return !policy?.allowedEmailDomains || policy.allowedEmailDomains.length === 0;
|
|
5422
|
+
}
|
|
5423
|
+
|
|
5379
5424
|
//#endregion
|
|
5380
5425
|
//#region src/parser/service/idp/schema.ts
|
|
5381
5426
|
/**
|
|
@@ -5421,7 +5466,7 @@ const IdPUserAuthPolicySchema = z.object({
|
|
|
5421
5466
|
passwordRequireNumeric: z.boolean().optional().describe("Require numeric characters in passwords"),
|
|
5422
5467
|
passwordMinLength: z.number().int().refine((val) => val >= 6 && val <= 30, { message: "passwordMinLength must be between 6 and 30" }).optional().describe("Minimum password length (6-30)"),
|
|
5423
5468
|
passwordMaxLength: z.number().int().refine((val) => val >= 6 && val <= 4096, { message: "passwordMaxLength must be between 6 and 4096" }).optional().describe("Maximum password length (6-4096)"),
|
|
5424
|
-
allowedEmailDomains: z.array(z.string()).optional().describe(
|
|
5469
|
+
allowedEmailDomains: z.array(z.string().regex(allowedEmailDomainPattern, `must be a hostname, or ${"*"} to allow all email domains`)).max(100, "allowedEmailDomains accepts at most 100 entries").refine((domains) => new Set(domains.map((d) => d.toLowerCase())).size === domains.length, { message: "allowedEmailDomains entries must be unique, compared case-insensitively" }).refine((domains) => domains.length <= 1 || !containsAllEmailDomains(domains), { message: `allowedEmailDomains cannot contain other entries when ${"*"} is set` }).optional().describe(`Restrict registration to these email domains. A lone ${"*"} entry allows every domain`),
|
|
5425
5470
|
allowGoogleOauth: z.boolean().optional().describe("Enable Google OAuth login"),
|
|
5426
5471
|
allowMicrosoftOauth: z.boolean().optional().describe("Enable Microsoft OAuth login"),
|
|
5427
5472
|
disablePasswordAuth: z.boolean().optional().describe("Disable password-based authentication"),
|
|
@@ -5439,13 +5484,13 @@ const IdPUserAuthPolicySchema = z.object({
|
|
|
5439
5484
|
message: "allowGoogleOauth cannot be set when useNonEmailIdentifier is true",
|
|
5440
5485
|
path: ["allowGoogleOauth"]
|
|
5441
5486
|
}).refine((data) => !data.allowGoogleOauth || data.allowedEmailDomains && data.allowedEmailDomains.length > 0, {
|
|
5442
|
-
message:
|
|
5487
|
+
message: `allowGoogleOauth requires a non-empty allowedEmailDomains (["${"*"}"] to allow every domain)`,
|
|
5443
5488
|
path: ["allowGoogleOauth"]
|
|
5444
5489
|
}).refine((data) => !data.allowMicrosoftOauth || !data.useNonEmailIdentifier, {
|
|
5445
5490
|
message: "allowMicrosoftOauth cannot be set when useNonEmailIdentifier is true",
|
|
5446
5491
|
path: ["allowMicrosoftOauth"]
|
|
5447
5492
|
}).refine((data) => !data.allowMicrosoftOauth || data.allowedEmailDomains && data.allowedEmailDomains.length > 0, {
|
|
5448
|
-
message:
|
|
5493
|
+
message: `allowMicrosoftOauth requires a non-empty allowedEmailDomains (["${"*"}"] to allow every domain)`,
|
|
5449
5494
|
path: ["allowMicrosoftOauth"]
|
|
5450
5495
|
}).refine((data) => !data.allowMicrosoftOauth || data.disablePasswordAuth === true, {
|
|
5451
5496
|
message: "allowMicrosoftOauth requires disablePasswordAuth to be enabled",
|
|
@@ -5934,5 +5979,5 @@ async function loadApplication(params) {
|
|
|
5934
5979
|
}
|
|
5935
5980
|
|
|
5936
5981
|
//#endregion
|
|
5937
|
-
export {
|
|
5938
|
-
//# sourceMappingURL=application-
|
|
5982
|
+
export { byName as $, getDistDir as A, fetchPlatformMachineUserToken as B, composeFunctionTreeshakeOptions as C, getPluginGenerationDependencies as D, createBundleLog as E, defaultPlatformBaseUrl as F, getPlatformBaseUrl as G, getConsoleBaseUrl as H, fetchAll as I, isDefaultPlatform as J, initOAuth2Client as K, fetchAllTolerant as L, hashFile as M, MAX_PAGE_SIZE as N, hasGenerationHooks as O, closeConnectionPool as P, resolveStaticWebsiteUrls as Q, fetchMachineUserToken as R, platformBundleDefinePlugin as S, resolveBundleLogLevel as T, getOAuth2ClientId as U, fetchUserInfo as V, getOrNull as W, normalizeBaseUrl as X, isNotFoundError as Y, rememberPlatformConfigForToken as Z, TailorDBTypeSchema as _, resolverBundleKey as a, createTsconfigPathsPlugin as b, WorkflowJobSchema as c, INVOKER_EXPR as d, createApplyLimiter as et, buildExecutorArgsExpr as f, assertUniqueTailorDBTypeNamesWithExternal as g, assertUniqueLocalTailorDBTypeNames as h, hasImplicitAllEmailDomains as i, hashContent as j, createBundleCache as k, ResolverSchema as l, buildResolverPermissionAndInputCheckExpr as m, generatePluginFilesIfNeeded as n, resolveInlineSourcemap as o, buildResolverOperationHookExpr as p, initOperatorClient as q, loadApplication as r, WorkflowJobFunctionExecutionPolicySchema as s, defineApplication as t, LOG_LEVELS as tt, HTTP_METHODS as u, stringifyFunction as v, createLogLevelTreeshakeOptions as w, resolveTSConfigWithFallback as x, createGeneratedEntryResolverPlugin as y, fetchPaged as z };
|
|
5983
|
+
//# sourceMappingURL=application-D9j1a2Xc.mjs.map
|