@corvushold/guard-sdk 0.9.0 → 0.11.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/dist/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -5
- package/dist/index.d.ts +26 -5
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -147,6 +147,7 @@ interface components {
|
|
|
147
147
|
suggestions?: string[];
|
|
148
148
|
tenant_id?: string;
|
|
149
149
|
tenant_name?: string;
|
|
150
|
+
tenants?: components["schemas"]["controller.TenantInfo"][];
|
|
150
151
|
user_exists?: boolean;
|
|
151
152
|
};
|
|
152
153
|
"controller.LoginOptionsResponse": {
|
|
@@ -167,6 +168,10 @@ interface components {
|
|
|
167
168
|
/** @description Tenant information (if discovered) */
|
|
168
169
|
tenant_id?: string;
|
|
169
170
|
tenant_name?: string;
|
|
171
|
+
/** @description If email is present in multiple tenants, list them so the UI can prompt the user.
|
|
172
|
+
* When multiple tenants are present, tenant_id/tenant_name will only be set when
|
|
173
|
+
* exactly one tenant is resolved; otherwise clients must let the user choose. */
|
|
174
|
+
tenants?: components["schemas"]["controller.TenantInfo"][];
|
|
170
175
|
/** @description If true, user exists and can use password login */
|
|
171
176
|
user_exists?: boolean;
|
|
172
177
|
};
|
|
@@ -185,6 +190,18 @@ interface components {
|
|
|
185
190
|
/** @description "google", "github", "microsoft", etc. */
|
|
186
191
|
provider?: string;
|
|
187
192
|
};
|
|
193
|
+
"controller.TenantInfo": {
|
|
194
|
+
/**
|
|
195
|
+
* @description Tenant ID (UUID)
|
|
196
|
+
* @example 3efda476-f0b9-47a8-b96b-5a543b88da3e
|
|
197
|
+
*/
|
|
198
|
+
id: string;
|
|
199
|
+
/**
|
|
200
|
+
* @description Tenant display name
|
|
201
|
+
* @example Acme Corp
|
|
202
|
+
*/
|
|
203
|
+
name: string;
|
|
204
|
+
};
|
|
188
205
|
"controller.adminUpdateNamesReq": {
|
|
189
206
|
first_name?: string;
|
|
190
207
|
last_name?: string;
|
|
@@ -841,6 +858,10 @@ interface LoginOptionsResp {
|
|
|
841
858
|
user_exists: boolean;
|
|
842
859
|
tenant_id?: string;
|
|
843
860
|
tenant_name?: string;
|
|
861
|
+
tenants?: Array<{
|
|
862
|
+
id: string;
|
|
863
|
+
name?: string;
|
|
864
|
+
}>;
|
|
844
865
|
domain_matched_sso?: SsoProviderOption;
|
|
845
866
|
}
|
|
846
867
|
interface CreateSsoProviderReq {
|
|
@@ -1070,7 +1091,7 @@ declare class GuardClient {
|
|
|
1070
1091
|
updateTenantSettings(tenantId: string, settings: TenantSettingsPutRequest): Promise<ResponseWrapper<unknown>>;
|
|
1071
1092
|
/**
|
|
1072
1093
|
* Start SSO flow with a provider slug.
|
|
1073
|
-
* Uses V2 tenant-scoped URLs: /auth/sso/t/{tenant_id}/{slug}/login
|
|
1094
|
+
* Uses V2 tenant-scoped URLs: /api/v1/auth/sso/t/{tenant_id}/{slug}/login
|
|
1074
1095
|
*
|
|
1075
1096
|
* @param providerSlug - The provider slug (e.g., 'okta', 'azure-ad', 'google-saml')
|
|
1076
1097
|
* @param params - Optional parameters for the SSO flow
|
|
@@ -1092,7 +1113,7 @@ declare class GuardClient {
|
|
|
1092
1113
|
}>>;
|
|
1093
1114
|
/**
|
|
1094
1115
|
* Handle SSO callback and exchange code for tokens.
|
|
1095
|
-
* Uses V2 tenant-scoped URLs: /auth/sso/t/{tenant_id}/{slug}/callback
|
|
1116
|
+
* Uses V2 tenant-scoped URLs: /api/v1/auth/sso/t/{tenant_id}/{slug}/callback
|
|
1096
1117
|
*
|
|
1097
1118
|
* @param providerSlug - The provider slug used in startSso
|
|
1098
1119
|
* @param params - Callback parameters (code, state from IdP redirect)
|
|
@@ -1140,7 +1161,7 @@ declare class GuardClient {
|
|
|
1140
1161
|
/**
|
|
1141
1162
|
* Get computed Service Provider (SP) URLs for SAML configuration.
|
|
1142
1163
|
* These URLs are needed by admins to configure their Identity Provider (IdP).
|
|
1143
|
-
* URLs use V2 tenant-scoped format: /auth/sso/t/{tenant_id}/{slug}/*
|
|
1164
|
+
* URLs use V2 tenant-scoped format: /api/v1/auth/sso/t/{tenant_id}/{slug}/*
|
|
1144
1165
|
*
|
|
1145
1166
|
* @param slug - The provider slug (e.g. 'okta', 'azure-ad')
|
|
1146
1167
|
* @param tenantId - Optional tenant ID (uses client's default if not provided)
|
|
@@ -1149,8 +1170,8 @@ declare class GuardClient {
|
|
|
1149
1170
|
* @example
|
|
1150
1171
|
* ```ts
|
|
1151
1172
|
* const spInfo = await client.ssoGetSPInfo('okta');
|
|
1152
|
-
* console.log(spInfo.data.entity_id); // https://api.example.com/auth/sso/t/{tenant_id}/okta/metadata
|
|
1153
|
-
* console.log(spInfo.data.acs_url); // https://api.example.com/auth/sso/t/{tenant_id}/okta/callback
|
|
1173
|
+
* console.log(spInfo.data.entity_id); // https://api.example.com/api/v1/auth/sso/t/{tenant_id}/okta/metadata
|
|
1174
|
+
* console.log(spInfo.data.acs_url); // https://api.example.com/api/v1/auth/sso/t/{tenant_id}/okta/callback
|
|
1154
1175
|
* console.log(spInfo.data.tenant_id); // The tenant UUID used in the URLs
|
|
1155
1176
|
* ```
|
|
1156
1177
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -147,6 +147,7 @@ interface components {
|
|
|
147
147
|
suggestions?: string[];
|
|
148
148
|
tenant_id?: string;
|
|
149
149
|
tenant_name?: string;
|
|
150
|
+
tenants?: components["schemas"]["controller.TenantInfo"][];
|
|
150
151
|
user_exists?: boolean;
|
|
151
152
|
};
|
|
152
153
|
"controller.LoginOptionsResponse": {
|
|
@@ -167,6 +168,10 @@ interface components {
|
|
|
167
168
|
/** @description Tenant information (if discovered) */
|
|
168
169
|
tenant_id?: string;
|
|
169
170
|
tenant_name?: string;
|
|
171
|
+
/** @description If email is present in multiple tenants, list them so the UI can prompt the user.
|
|
172
|
+
* When multiple tenants are present, tenant_id/tenant_name will only be set when
|
|
173
|
+
* exactly one tenant is resolved; otherwise clients must let the user choose. */
|
|
174
|
+
tenants?: components["schemas"]["controller.TenantInfo"][];
|
|
170
175
|
/** @description If true, user exists and can use password login */
|
|
171
176
|
user_exists?: boolean;
|
|
172
177
|
};
|
|
@@ -185,6 +190,18 @@ interface components {
|
|
|
185
190
|
/** @description "google", "github", "microsoft", etc. */
|
|
186
191
|
provider?: string;
|
|
187
192
|
};
|
|
193
|
+
"controller.TenantInfo": {
|
|
194
|
+
/**
|
|
195
|
+
* @description Tenant ID (UUID)
|
|
196
|
+
* @example 3efda476-f0b9-47a8-b96b-5a543b88da3e
|
|
197
|
+
*/
|
|
198
|
+
id: string;
|
|
199
|
+
/**
|
|
200
|
+
* @description Tenant display name
|
|
201
|
+
* @example Acme Corp
|
|
202
|
+
*/
|
|
203
|
+
name: string;
|
|
204
|
+
};
|
|
188
205
|
"controller.adminUpdateNamesReq": {
|
|
189
206
|
first_name?: string;
|
|
190
207
|
last_name?: string;
|
|
@@ -841,6 +858,10 @@ interface LoginOptionsResp {
|
|
|
841
858
|
user_exists: boolean;
|
|
842
859
|
tenant_id?: string;
|
|
843
860
|
tenant_name?: string;
|
|
861
|
+
tenants?: Array<{
|
|
862
|
+
id: string;
|
|
863
|
+
name?: string;
|
|
864
|
+
}>;
|
|
844
865
|
domain_matched_sso?: SsoProviderOption;
|
|
845
866
|
}
|
|
846
867
|
interface CreateSsoProviderReq {
|
|
@@ -1070,7 +1091,7 @@ declare class GuardClient {
|
|
|
1070
1091
|
updateTenantSettings(tenantId: string, settings: TenantSettingsPutRequest): Promise<ResponseWrapper<unknown>>;
|
|
1071
1092
|
/**
|
|
1072
1093
|
* Start SSO flow with a provider slug.
|
|
1073
|
-
* Uses V2 tenant-scoped URLs: /auth/sso/t/{tenant_id}/{slug}/login
|
|
1094
|
+
* Uses V2 tenant-scoped URLs: /api/v1/auth/sso/t/{tenant_id}/{slug}/login
|
|
1074
1095
|
*
|
|
1075
1096
|
* @param providerSlug - The provider slug (e.g., 'okta', 'azure-ad', 'google-saml')
|
|
1076
1097
|
* @param params - Optional parameters for the SSO flow
|
|
@@ -1092,7 +1113,7 @@ declare class GuardClient {
|
|
|
1092
1113
|
}>>;
|
|
1093
1114
|
/**
|
|
1094
1115
|
* Handle SSO callback and exchange code for tokens.
|
|
1095
|
-
* Uses V2 tenant-scoped URLs: /auth/sso/t/{tenant_id}/{slug}/callback
|
|
1116
|
+
* Uses V2 tenant-scoped URLs: /api/v1/auth/sso/t/{tenant_id}/{slug}/callback
|
|
1096
1117
|
*
|
|
1097
1118
|
* @param providerSlug - The provider slug used in startSso
|
|
1098
1119
|
* @param params - Callback parameters (code, state from IdP redirect)
|
|
@@ -1140,7 +1161,7 @@ declare class GuardClient {
|
|
|
1140
1161
|
/**
|
|
1141
1162
|
* Get computed Service Provider (SP) URLs for SAML configuration.
|
|
1142
1163
|
* These URLs are needed by admins to configure their Identity Provider (IdP).
|
|
1143
|
-
* URLs use V2 tenant-scoped format: /auth/sso/t/{tenant_id}/{slug}/*
|
|
1164
|
+
* URLs use V2 tenant-scoped format: /api/v1/auth/sso/t/{tenant_id}/{slug}/*
|
|
1144
1165
|
*
|
|
1145
1166
|
* @param slug - The provider slug (e.g. 'okta', 'azure-ad')
|
|
1146
1167
|
* @param tenantId - Optional tenant ID (uses client's default if not provided)
|
|
@@ -1149,8 +1170,8 @@ declare class GuardClient {
|
|
|
1149
1170
|
* @example
|
|
1150
1171
|
* ```ts
|
|
1151
1172
|
* const spInfo = await client.ssoGetSPInfo('okta');
|
|
1152
|
-
* console.log(spInfo.data.entity_id); // https://api.example.com/auth/sso/t/{tenant_id}/okta/metadata
|
|
1153
|
-
* console.log(spInfo.data.acs_url); // https://api.example.com/auth/sso/t/{tenant_id}/okta/callback
|
|
1173
|
+
* console.log(spInfo.data.entity_id); // https://api.example.com/api/v1/auth/sso/t/{tenant_id}/okta/metadata
|
|
1174
|
+
* console.log(spInfo.data.acs_url); // https://api.example.com/api/v1/auth/sso/t/{tenant_id}/okta/callback
|
|
1154
1175
|
* console.log(spInfo.data.tenant_id); // The tenant UUID used in the URLs
|
|
1155
1176
|
* ```
|
|
1156
1177
|
*/
|
package/dist/index.js
CHANGED
|
@@ -277,7 +277,7 @@ var HttpClient = class {
|
|
|
277
277
|
|
|
278
278
|
// package.json
|
|
279
279
|
var package_default = {
|
|
280
|
-
version: "0.
|
|
280
|
+
version: "0.11.0"};
|
|
281
281
|
|
|
282
282
|
// src/client.ts
|
|
283
283
|
function isTenantSelectionRequired(data) {
|
|
@@ -589,7 +589,7 @@ var GuardClient = class {
|
|
|
589
589
|
}
|
|
590
590
|
/**
|
|
591
591
|
* Start SSO flow with a provider slug.
|
|
592
|
-
* Uses V2 tenant-scoped URLs: /auth/sso/t/{tenant_id}/{slug}/login
|
|
592
|
+
* Uses V2 tenant-scoped URLs: /api/v1/auth/sso/t/{tenant_id}/{slug}/login
|
|
593
593
|
*
|
|
594
594
|
* @param providerSlug - The provider slug (e.g., 'okta', 'azure-ad', 'google-saml')
|
|
595
595
|
* @param params - Optional parameters for the SSO flow
|
|
@@ -636,7 +636,7 @@ var GuardClient = class {
|
|
|
636
636
|
}
|
|
637
637
|
/**
|
|
638
638
|
* Handle SSO callback and exchange code for tokens.
|
|
639
|
-
* Uses V2 tenant-scoped URLs: /auth/sso/t/{tenant_id}/{slug}/callback
|
|
639
|
+
* Uses V2 tenant-scoped URLs: /api/v1/auth/sso/t/{tenant_id}/{slug}/callback
|
|
640
640
|
*
|
|
641
641
|
* @param providerSlug - The provider slug used in startSso
|
|
642
642
|
* @param params - Callback parameters (code, state from IdP redirect)
|
|
@@ -803,7 +803,7 @@ var GuardClient = class {
|
|
|
803
803
|
/**
|
|
804
804
|
* Get computed Service Provider (SP) URLs for SAML configuration.
|
|
805
805
|
* These URLs are needed by admins to configure their Identity Provider (IdP).
|
|
806
|
-
* URLs use V2 tenant-scoped format: /auth/sso/t/{tenant_id}/{slug}/*
|
|
806
|
+
* URLs use V2 tenant-scoped format: /api/v1/auth/sso/t/{tenant_id}/{slug}/*
|
|
807
807
|
*
|
|
808
808
|
* @param slug - The provider slug (e.g. 'okta', 'azure-ad')
|
|
809
809
|
* @param tenantId - Optional tenant ID (uses client's default if not provided)
|
|
@@ -812,8 +812,8 @@ var GuardClient = class {
|
|
|
812
812
|
* @example
|
|
813
813
|
* ```ts
|
|
814
814
|
* const spInfo = await client.ssoGetSPInfo('okta');
|
|
815
|
-
* console.log(spInfo.data.entity_id); // https://api.example.com/auth/sso/t/{tenant_id}/okta/metadata
|
|
816
|
-
* console.log(spInfo.data.acs_url); // https://api.example.com/auth/sso/t/{tenant_id}/okta/callback
|
|
815
|
+
* console.log(spInfo.data.entity_id); // https://api.example.com/api/v1/auth/sso/t/{tenant_id}/okta/metadata
|
|
816
|
+
* console.log(spInfo.data.acs_url); // https://api.example.com/api/v1/auth/sso/t/{tenant_id}/okta/callback
|
|
817
817
|
* console.log(spInfo.data.tenant_id); // The tenant UUID used in the URLs
|
|
818
818
|
* ```
|
|
819
819
|
*/
|