@clossir-tech/ts-sdk 0.10.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.
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
12
12
  * Get invitation info
13
13
  *
14
14
  * @remarks
15
- * Looks up invitation details by token. Returns whether the invited email belongs to an existing user.
15
+ * Looks up invitation details by token. `inviteAction` is computed by the same rule the accept route enforces, so it predicts the outcome of an unauthenticated `POST /auth/accept-invite`: `create_account` and `set_password` complete with a password; `sign_in` requires accepting with a bearer. `existingUser` is true when the invited email belongs to an active account.
16
16
  */
17
17
  export declare function authGetAuthInviteInfo(client: ClossirCore, token: string, options?: RequestOptions): APIPromise<Result<operations.GetAuthInviteInfoResponse, errors.ProblemDetailsError | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
18
  //# sourceMappingURL=auth-get-auth-invite-info.d.ts.map
@@ -15,7 +15,7 @@ import { APIPromise } from "../types/async.js";
15
15
  * Get invitation info
16
16
  *
17
17
  * @remarks
18
- * Looks up invitation details by token. Returns whether the invited email belongs to an existing user.
18
+ * Looks up invitation details by token. `inviteAction` is computed by the same rule the accept route enforces, so it predicts the outcome of an unauthenticated `POST /auth/accept-invite`: `create_account` and `set_password` complete with a password; `sign_in` requires accepting with a bearer. `existingUser` is true when the invited email belongs to an active account.
19
19
  */
20
20
  export function authGetAuthInviteInfo(client, token, options) {
21
21
  return new APIPromise($do(client, token, options));
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
12
12
  * Accept invitation
13
13
  *
14
14
  * @remarks
15
- * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required to create a new account. An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
15
+ * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required; the outcome then depends on the invited email's account and matches `inviteAction` from `GET /auth/invite-info`: `create_account` creates the account (or sets the first password on a placeholder), `set_password` sets the password on an account that has none, or replaces the unproven password of a registration that never verified its email, and `sign_in` answers 403 `sign_in_required` without writing anything. The password is validated before any account is written (422 `weak_password`). An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
16
16
  */
17
17
  export declare function authPostAuthAcceptInvite(client: ClossirCore, request: operations.PostAuthAcceptInviteRequest, options?: RequestOptions): APIPromise<Result<operations.PostAuthAcceptInviteResponse, errors.ProblemDetailsError | SDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
18
18
  //# sourceMappingURL=auth-post-auth-accept-invite.d.ts.map
@@ -16,7 +16,7 @@ import { APIPromise } from "../types/async.js";
16
16
  * Accept invitation
17
17
  *
18
18
  * @remarks
19
- * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required to create a new account. An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
19
+ * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required; the outcome then depends on the invited email's account and matches `inviteAction` from `GET /auth/invite-info`: `create_account` creates the account (or sets the first password on a placeholder), `set_password` sets the password on an account that has none, or replaces the unproven password of a registration that never verified its email, and `sign_in` answers 403 `sign_in_required` without writing anything. The password is validated before any account is written (422 `weak_password`). An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
20
20
  */
21
21
  export function authPostAuthAcceptInvite(client, request, options) {
22
22
  return new APIPromise($do(client, request, options));
@@ -31,8 +31,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
31
31
  export declare const SDK_METADATA: {
32
32
  readonly language: "typescript";
33
33
  readonly openapiDocVersion: "2.0.0";
34
- readonly sdkVersion: "0.10.0";
34
+ readonly sdkVersion: "0.10.1";
35
35
  readonly genVersion: "2.916.4";
36
- readonly userAgent: "speakeasy-sdk/typescript 0.10.0 2.916.4 2.0.0 @clossir-tech/ts-sdk";
36
+ readonly userAgent: "speakeasy-sdk/typescript 0.10.1 2.916.4 2.0.0 @clossir-tech/ts-sdk";
37
37
  };
38
38
  //# sourceMappingURL=config.d.ts.map
package/esm/lib/config.js CHANGED
@@ -31,8 +31,8 @@ export function serverURLFromOptions(options) {
31
31
  export const SDK_METADATA = {
32
32
  language: "typescript",
33
33
  openapiDocVersion: "2.0.0",
34
- sdkVersion: "0.10.0",
34
+ sdkVersion: "0.10.1",
35
35
  genVersion: "2.916.4",
36
- userAgent: "speakeasy-sdk/typescript 0.10.0 2.916.4 2.0.0 @clossir-tech/ts-sdk",
36
+ userAgent: "speakeasy-sdk/typescript 0.10.1 2.916.4 2.0.0 @clossir-tech/ts-sdk",
37
37
  };
38
38
  //# sourceMappingURL=config.js.map
@@ -1,4 +1,5 @@
1
1
  import * as z from "zod/v4-mini";
2
+ import { OpenEnum } from "../../types/enums.js";
2
3
  import { Result as SafeParseResult } from "../../types/fp.js";
3
4
  import { SDKValidationError } from "../errors/sdk-validation-error.js";
4
5
  export type GetAuthInviteInfoRequest = {
@@ -7,6 +8,18 @@ export type GetAuthInviteInfoRequest = {
7
8
  */
8
9
  token: string;
9
10
  };
11
+ /**
12
+ * What `POST /auth/accept-invite` WITHOUT a bearer will do for this invitation. `create_account`: no usable account yet; the password creates it. `set_password`: an account exists with no proven password; the password is set (for an unverified registration it REPLACES the one they registered with). `sign_in`: the account has credentials (or is suspended); the caller must sign in and accept with a bearer — a no-bearer accept answers 403 `sign_in_required`.
13
+ */
14
+ export declare const InviteAction: {
15
+ readonly CreateAccount: "create_account";
16
+ readonly SetPassword: "set_password";
17
+ readonly SignIn: "sign_in";
18
+ };
19
+ /**
20
+ * What `POST /auth/accept-invite` WITHOUT a bearer will do for this invitation. `create_account`: no usable account yet; the password creates it. `set_password`: an account exists with no proven password; the password is set (for an unverified registration it REPLACES the one they registered with). `sign_in`: the account has credentials (or is suspended); the caller must sign in and accept with a bearer — a no-bearer accept answers 403 `sign_in_required`.
21
+ */
22
+ export type InviteAction = OpenEnum<typeof InviteAction>;
10
23
  /**
11
24
  * Response
12
25
  */
@@ -15,7 +28,14 @@ export type GetAuthInviteInfoResponse = {
15
28
  role: string;
16
29
  orgName: string;
17
30
  orgId: string;
31
+ /**
32
+ * True when the invited email belongs to an `active` account.
33
+ */
18
34
  existingUser: boolean;
35
+ /**
36
+ * What `POST /auth/accept-invite` WITHOUT a bearer will do for this invitation. `create_account`: no usable account yet; the password creates it. `set_password`: an account exists with no proven password; the password is set (for an unverified registration it REPLACES the one they registered with). `sign_in`: the account has credentials (or is suspended); the caller must sign in and accept with a bearer — a no-bearer accept answers 403 `sign_in_required`.
37
+ */
38
+ inviteAction: InviteAction;
19
39
  };
20
40
  /** @internal */
21
41
  export type GetAuthInviteInfoRequest$Outbound = {
@@ -25,6 +45,8 @@ export type GetAuthInviteInfoRequest$Outbound = {
25
45
  export declare const GetAuthInviteInfoRequest$outboundSchema: z.ZodMiniType<GetAuthInviteInfoRequest$Outbound, GetAuthInviteInfoRequest>;
26
46
  export declare function getAuthInviteInfoRequestToJSON(getAuthInviteInfoRequest: GetAuthInviteInfoRequest): string;
27
47
  /** @internal */
48
+ export declare const InviteAction$inboundSchema: z.ZodMiniType<InviteAction, unknown>;
49
+ /** @internal */
28
50
  export declare const GetAuthInviteInfoResponse$inboundSchema: z.ZodMiniType<GetAuthInviteInfoResponse, unknown>;
29
51
  export declare function getAuthInviteInfoResponseFromJSON(jsonString: string): SafeParseResult<GetAuthInviteInfoResponse, SDKValidationError>;
30
52
  //# sourceMappingURL=get-auth-invite-info.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-auth-invite-info.d.ts","sourceRoot":"","sources":["../../../src/models/operations/get-auth-invite-info.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,iCAAiC,GAAG;IAC9C,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,uCAAuC,EAAE,CAAC,CAAC,WAAW,CACjE,iCAAiC,EACjC,wBAAwB,CAGxB,CAAC;AAEH,wBAAgB,8BAA8B,CAC5C,wBAAwB,EAAE,wBAAwB,GACjD,MAAM,CAIR;AAED,gBAAgB;AAChB,eAAO,MAAM,uCAAuC,EAAE,CAAC,CAAC,WAAW,CACjE,yBAAyB,EACzB,OAAO,CAOP,CAAC;AAEH,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,yBAAyB,EAAE,kBAAkB,CAAC,CAMhE"}
1
+ {"version":3,"file":"get-auth-invite-info.d.ts","sourceRoot":"","sources":["../../../src/models/operations/get-auth-invite-info.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAGjC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF,gBAAgB;AAChB,MAAM,MAAM,iCAAiC,GAAG;IAC9C,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,uCAAuC,EAAE,CAAC,CAAC,WAAW,CACjE,iCAAiC,EACjC,wBAAwB,CAGxB,CAAC;AAEH,wBAAgB,8BAA8B,CAC5C,wBAAwB,EAAE,wBAAwB,GACjD,MAAM,CAIR;AAED,gBAAgB;AAChB,eAAO,MAAM,0BAA0B,EAAE,CAAC,CAAC,WAAW,CAAC,YAAY,EAAE,OAAO,CACrC,CAAC;AAExC,gBAAgB;AAChB,eAAO,MAAM,uCAAuC,EAAE,CAAC,CAAC,WAAW,CACjE,yBAAyB,EACzB,OAAO,CAQP,CAAC;AAEH,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,yBAAyB,EAAE,kBAAkB,CAAC,CAMhE"}
@@ -3,7 +3,16 @@
3
3
  */
4
4
  import * as z from "zod/v4-mini";
5
5
  import { safeParse } from "../../lib/schemas.js";
6
+ import * as openEnums from "../../types/enums.js";
6
7
  import * as types from "../../types/primitives.js";
8
+ /**
9
+ * What `POST /auth/accept-invite` WITHOUT a bearer will do for this invitation. `create_account`: no usable account yet; the password creates it. `set_password`: an account exists with no proven password; the password is set (for an unverified registration it REPLACES the one they registered with). `sign_in`: the account has credentials (or is suspended); the caller must sign in and accept with a bearer — a no-bearer accept answers 403 `sign_in_required`.
10
+ */
11
+ export const InviteAction = {
12
+ CreateAccount: "create_account",
13
+ SetPassword: "set_password",
14
+ SignIn: "sign_in",
15
+ };
7
16
  /** @internal */
8
17
  export const GetAuthInviteInfoRequest$outboundSchema = z.object({
9
18
  token: z.string(),
@@ -12,12 +21,15 @@ export function getAuthInviteInfoRequestToJSON(getAuthInviteInfoRequest) {
12
21
  return JSON.stringify(GetAuthInviteInfoRequest$outboundSchema.parse(getAuthInviteInfoRequest));
13
22
  }
14
23
  /** @internal */
24
+ export const InviteAction$inboundSchema = openEnums.inboundSchema(InviteAction);
25
+ /** @internal */
15
26
  export const GetAuthInviteInfoResponse$inboundSchema = z.object({
16
27
  email: types.string(),
17
28
  role: types.string(),
18
29
  orgName: types.string(),
19
30
  orgId: types.string(),
20
31
  existingUser: types.boolean(),
32
+ inviteAction: InviteAction$inboundSchema,
21
33
  });
22
34
  export function getAuthInviteInfoResponseFromJSON(jsonString) {
23
35
  return safeParse(jsonString, (x) => GetAuthInviteInfoResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAuthInviteInfoResponse' from JSON`);
@@ -1 +1 @@
1
- {"version":3,"file":"get-auth-invite-info.js","sourceRoot":"","sources":["../../../src/models/operations/get-auth-invite-info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AA0BnD,gBAAgB;AAChB,MAAM,CAAC,MAAM,uCAAuC,GAGhD,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAEH,MAAM,UAAU,8BAA8B,CAC5C,wBAAkD,EAC1C;IACR,OAAO,IAAI,CAAC,SAAS,CACnB,uCAAuC,CAAC,KAAK,CAAC,wBAAwB,CAAC,CACxE,CAAC;AAAA,CACH;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,uCAAuC,GAGhD,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE;IACvB,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,KAAK,CAAC,OAAO,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,UAAU,iCAAiC,CAC/C,UAAkB,EAC8C;IAChE,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,uCAAuC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACnE,uDAAuD,CACxD,CAAC;AAAA,CACH"}
1
+ {"version":3,"file":"get-auth-invite-info.js","sourceRoot":"","sources":["../../../src/models/operations/get-auth-invite-info.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAGlD,OAAO,KAAK,KAAK,MAAM,2BAA2B,CAAC;AAUnD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,aAAa,EAAE,gBAAgB;IAC/B,WAAW,EAAE,cAAc;IAC3B,MAAM,EAAE,SAAS;CACT,CAAC;AA6BX,gBAAgB;AAChB,MAAM,CAAC,MAAM,uCAAuC,GAGhD,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAEH,MAAM,UAAU,8BAA8B,CAC5C,wBAAkD,EAC1C;IACR,OAAO,IAAI,CAAC,SAAS,CACnB,uCAAuC,CAAC,KAAK,CAAC,wBAAwB,CAAC,CACxE,CAAC;AAAA,CACH;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,0BAA0B,GACrC,SAAS,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;AAExC,gBAAgB;AAChB,MAAM,CAAC,MAAM,uCAAuC,GAGhD,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE;IACvB,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE;IACrB,YAAY,EAAE,KAAK,CAAC,OAAO,EAAE;IAC7B,YAAY,EAAE,0BAA0B;CACzC,CAAC,CAAC;AAEH,MAAM,UAAU,iCAAiC,CAC/C,UAAkB,EAC8C;IAChE,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,uCAAuC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACnE,uDAAuD,CACxD,CAAC;AAAA,CACH"}
package/esm/sdk/auth.d.ts CHANGED
@@ -68,14 +68,14 @@ export declare class Auth extends ClientSDK {
68
68
  * Get invitation info
69
69
  *
70
70
  * @remarks
71
- * Looks up invitation details by token. Returns whether the invited email belongs to an existing user.
71
+ * Looks up invitation details by token. `inviteAction` is computed by the same rule the accept route enforces, so it predicts the outcome of an unauthenticated `POST /auth/accept-invite`: `create_account` and `set_password` complete with a password; `sign_in` requires accepting with a bearer. `existingUser` is true when the invited email belongs to an active account.
72
72
  */
73
73
  getAuthInviteInfo(token: string, options?: RequestOptions): Promise<operations.GetAuthInviteInfoResponse>;
74
74
  /**
75
75
  * Accept invitation
76
76
  *
77
77
  * @remarks
78
- * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required to create a new account. An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
78
+ * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required; the outcome then depends on the invited email's account and matches `inviteAction` from `GET /auth/invite-info`: `create_account` creates the account (or sets the first password on a placeholder), `set_password` sets the password on an account that has none, or replaces the unproven password of a registration that never verified its email, and `sign_in` answers 403 `sign_in_required` without writing anything. The password is validated before any account is written (422 `weak_password`). An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
79
79
  */
80
80
  postAuthAcceptInvite(request: operations.PostAuthAcceptInviteRequest, options?: RequestOptions): Promise<operations.PostAuthAcceptInviteResponse>;
81
81
  /**
package/esm/sdk/auth.js CHANGED
@@ -102,7 +102,7 @@ export class Auth extends ClientSDK {
102
102
  * Get invitation info
103
103
  *
104
104
  * @remarks
105
- * Looks up invitation details by token. Returns whether the invited email belongs to an existing user.
105
+ * Looks up invitation details by token. `inviteAction` is computed by the same rule the accept route enforces, so it predicts the outcome of an unauthenticated `POST /auth/accept-invite`: `create_account` and `set_password` complete with a password; `sign_in` requires accepting with a bearer. `existingUser` is true when the invited email belongs to an active account.
106
106
  */
107
107
  async getAuthInviteInfo(token, options) {
108
108
  return unwrapAsync(authGetAuthInviteInfo(this, token, options));
@@ -111,7 +111,7 @@ export class Auth extends ClientSDK {
111
111
  * Accept invitation
112
112
  *
113
113
  * @remarks
114
- * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required to create a new account. An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
114
+ * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required; the outcome then depends on the invited email's account and matches `inviteAction` from `GET /auth/invite-info`: `create_account` creates the account (or sets the first password on a placeholder), `set_password` sets the password on an account that has none, or replaces the unproven password of a registration that never verified its email, and `sign_in` answers 403 `sign_in_required` without writing anything. The password is validated before any account is written (422 `weak_password`). An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
115
115
  */
116
116
  async postAuthAcceptInvite(request, options) {
117
117
  return unwrapAsync(authPostAuthAcceptInvite(this, request, options));
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@clossir-tech/ts-sdk",
5
- "version": "0.10.0",
5
+ "version": "0.10.1",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@clossir-tech/ts-sdk",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "author": "Clossir Team",
5
5
  "description": "TypeScript SDK for the Clossir platform API",
6
6
  "homepage": "https://docs.clossir.com",
7
7
  "publishConfig": {
8
- "registry": "https://registry.npmjs.org",
9
- "access": "public"
8
+ "access": "public",
9
+ "registry": "https://registry.npmjs.org"
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
30
30
  * Get invitation info
31
31
  *
32
32
  * @remarks
33
- * Looks up invitation details by token. Returns whether the invited email belongs to an existing user.
33
+ * Looks up invitation details by token. `inviteAction` is computed by the same rule the accept route enforces, so it predicts the outcome of an unauthenticated `POST /auth/accept-invite`: `create_account` and `set_password` complete with a password; `sign_in` requires accepting with a bearer. `existingUser` is true when the invited email belongs to an active account.
34
34
  */
35
35
  export function authGetAuthInviteInfo(
36
36
  client: ClossirCore,
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
31
31
  * Accept invitation
32
32
  *
33
33
  * @remarks
34
- * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required to create a new account. An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
34
+ * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required; the outcome then depends on the invited email's account and matches `inviteAction` from `GET /auth/invite-info`: `create_account` creates the account (or sets the first password on a placeholder), `set_password` sets the password on an account that has none, or replaces the unproven password of a registration that never verified its email, and `sign_in` answers 403 `sign_in_required` without writing anything. The password is validated before any account is written (422 `weak_password`). An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
35
35
  */
36
36
  export function authPostAuthAcceptInvite(
37
37
  client: ClossirCore,
package/src/lib/config.ts CHANGED
@@ -65,8 +65,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
67
  openapiDocVersion: "2.0.0",
68
- sdkVersion: "0.10.0",
68
+ sdkVersion: "0.10.1",
69
69
  genVersion: "2.916.4",
70
70
  userAgent:
71
- "speakeasy-sdk/typescript 0.10.0 2.916.4 2.0.0 @clossir-tech/ts-sdk",
71
+ "speakeasy-sdk/typescript 0.10.1 2.916.4 2.0.0 @clossir-tech/ts-sdk",
72
72
  } as const;
@@ -4,6 +4,8 @@
4
4
 
5
5
  import * as z from "zod/v4-mini";
6
6
  import { safeParse } from "../../lib/schemas.js";
7
+ import * as openEnums from "../../types/enums.js";
8
+ import { OpenEnum } from "../../types/enums.js";
7
9
  import { Result as SafeParseResult } from "../../types/fp.js";
8
10
  import * as types from "../../types/primitives.js";
9
11
  import { SDKValidationError } from "../errors/sdk-validation-error.js";
@@ -15,6 +17,19 @@ export type GetAuthInviteInfoRequest = {
15
17
  token: string;
16
18
  };
17
19
 
20
+ /**
21
+ * What `POST /auth/accept-invite` WITHOUT a bearer will do for this invitation. `create_account`: no usable account yet; the password creates it. `set_password`: an account exists with no proven password; the password is set (for an unverified registration it REPLACES the one they registered with). `sign_in`: the account has credentials (or is suspended); the caller must sign in and accept with a bearer — a no-bearer accept answers 403 `sign_in_required`.
22
+ */
23
+ export const InviteAction = {
24
+ CreateAccount: "create_account",
25
+ SetPassword: "set_password",
26
+ SignIn: "sign_in",
27
+ } as const;
28
+ /**
29
+ * What `POST /auth/accept-invite` WITHOUT a bearer will do for this invitation. `create_account`: no usable account yet; the password creates it. `set_password`: an account exists with no proven password; the password is set (for an unverified registration it REPLACES the one they registered with). `sign_in`: the account has credentials (or is suspended); the caller must sign in and accept with a bearer — a no-bearer accept answers 403 `sign_in_required`.
30
+ */
31
+ export type InviteAction = OpenEnum<typeof InviteAction>;
32
+
18
33
  /**
19
34
  * Response
20
35
  */
@@ -23,7 +38,14 @@ export type GetAuthInviteInfoResponse = {
23
38
  role: string;
24
39
  orgName: string;
25
40
  orgId: string;
41
+ /**
42
+ * True when the invited email belongs to an `active` account.
43
+ */
26
44
  existingUser: boolean;
45
+ /**
46
+ * What `POST /auth/accept-invite` WITHOUT a bearer will do for this invitation. `create_account`: no usable account yet; the password creates it. `set_password`: an account exists with no proven password; the password is set (for an unverified registration it REPLACES the one they registered with). `sign_in`: the account has credentials (or is suspended); the caller must sign in and accept with a bearer — a no-bearer accept answers 403 `sign_in_required`.
47
+ */
48
+ inviteAction: InviteAction;
27
49
  };
28
50
 
29
51
  /** @internal */
@@ -47,6 +69,10 @@ export function getAuthInviteInfoRequestToJSON(
47
69
  );
48
70
  }
49
71
 
72
+ /** @internal */
73
+ export const InviteAction$inboundSchema: z.ZodMiniType<InviteAction, unknown> =
74
+ openEnums.inboundSchema(InviteAction);
75
+
50
76
  /** @internal */
51
77
  export const GetAuthInviteInfoResponse$inboundSchema: z.ZodMiniType<
52
78
  GetAuthInviteInfoResponse,
@@ -57,6 +83,7 @@ export const GetAuthInviteInfoResponse$inboundSchema: z.ZodMiniType<
57
83
  orgName: types.string(),
58
84
  orgId: types.string(),
59
85
  existingUser: types.boolean(),
86
+ inviteAction: InviteAction$inboundSchema,
60
87
  });
61
88
 
62
89
  export function getAuthInviteInfoResponseFromJSON(
package/src/sdk/auth.ts CHANGED
@@ -173,7 +173,7 @@ export class Auth extends ClientSDK {
173
173
  * Get invitation info
174
174
  *
175
175
  * @remarks
176
- * Looks up invitation details by token. Returns whether the invited email belongs to an existing user.
176
+ * Looks up invitation details by token. `inviteAction` is computed by the same rule the accept route enforces, so it predicts the outcome of an unauthenticated `POST /auth/accept-invite`: `create_account` and `set_password` complete with a password; `sign_in` requires accepting with a bearer. `existingUser` is true when the invited email belongs to an active account.
177
177
  */
178
178
  async getAuthInviteInfo(
179
179
  token: string,
@@ -190,7 +190,7 @@ export class Auth extends ClientSDK {
190
190
  * Accept invitation
191
191
  *
192
192
  * @remarks
193
- * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required to create a new account. An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
193
+ * Accepts an organization invitation. The bearer token is OPTIONAL. With a valid bearer, the caller's account email must match the invitation email (otherwise 403 `email_mismatch`) and no `password` is needed. With no bearer, or an invalid/expired one, the request is treated as anonymous and `password` is required; the outcome then depends on the invited email's account and matches `inviteAction` from `GET /auth/invite-info`: `create_account` creates the account (or sets the first password on a placeholder), `set_password` sets the password on an account that has none, or replaces the unproven password of a registration that never verified its email, and `sign_in` answers 403 `sign_in_required` without writing anything. The password is validated before any account is written (422 `weak_password`). An SDK client configured with `bearerAuth` sends it automatically, so creating a NEW account for a different email must use a client without `bearerAuth`.
194
194
  */
195
195
  async postAuthAcceptInvite(
196
196
  request: operations.PostAuthAcceptInviteRequest,