@oatfi/oatfi-sdk-ts 0.6.15 → 0.10.2
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/README.md +2 -2
- package/dist/commonjs/funcs/authenticationsToken.d.ts +1 -4
- package/dist/commonjs/funcs/authenticationsToken.d.ts.map +1 -1
- package/dist/commonjs/funcs/authenticationsToken.js +3 -6
- package/dist/commonjs/funcs/authenticationsToken.js.map +1 -1
- package/dist/commonjs/hooks/hooks.d.ts.map +1 -1
- package/dist/commonjs/hooks/hooks.js +2 -0
- package/dist/commonjs/hooks/hooks.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/logindto.d.ts +2 -54
- package/dist/commonjs/models/logindto.d.ts.map +1 -1
- package/dist/commonjs/models/logindto.js +3 -39
- package/dist/commonjs/models/logindto.js.map +1 -1
- package/dist/commonjs/sdk/authentications.d.ts +1 -4
- package/dist/commonjs/sdk/authentications.d.ts.map +1 -1
- package/dist/commonjs/sdk/authentications.js +1 -4
- package/dist/commonjs/sdk/authentications.js.map +1 -1
- package/dist/esm/funcs/authenticationsToken.d.ts +1 -4
- package/dist/esm/funcs/authenticationsToken.d.ts.map +1 -1
- package/dist/esm/funcs/authenticationsToken.js +3 -6
- package/dist/esm/funcs/authenticationsToken.js.map +1 -1
- package/dist/esm/hooks/hooks.d.ts.map +1 -1
- package/dist/esm/hooks/hooks.js +2 -0
- package/dist/esm/hooks/hooks.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/logindto.d.ts +2 -54
- package/dist/esm/models/logindto.d.ts.map +1 -1
- package/dist/esm/models/logindto.js +2 -38
- package/dist/esm/models/logindto.js.map +1 -1
- package/dist/esm/sdk/authentications.d.ts +1 -4
- package/dist/esm/sdk/authentications.d.ts.map +1 -1
- package/dist/esm/sdk/authentications.js +1 -4
- package/dist/esm/sdk/authentications.js.map +1 -1
- package/docs/sdks/authentications/README.md +2 -10
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +2 -2
- package/src/funcs/authenticationsToken.ts +3 -6
- package/src/hooks/hooks.ts +3 -0
- package/src/lib/config.ts +3 -3
- package/src/models/logindto.ts +4 -72
- package/src/sdk/authentications.ts +1 -4
package/README.md
CHANGED
|
@@ -323,7 +323,7 @@ run();
|
|
|
323
323
|
|
|
324
324
|
### [authentications](docs/sdks/authentications/README.md)
|
|
325
325
|
|
|
326
|
-
* [token](docs/sdks/authentications/README.md#token) -
|
|
326
|
+
* [token](docs/sdks/authentications/README.md#token) - Login with API Key
|
|
327
327
|
* [login](docs/sdks/authentications/README.md#login) - Login with email and password (Admin users only)
|
|
328
328
|
|
|
329
329
|
### [businesses](docs/sdks/businesses/README.md)
|
|
@@ -542,7 +542,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
|
|
|
542
542
|
- [`authenticationRefreshToken`](docs/sdks/authentication/README.md#refreshtoken) - Refresh access token
|
|
543
543
|
- [`authenticationResetPassword`](docs/sdks/authentication/README.md#resetpassword) - Reset password using token
|
|
544
544
|
- [`authenticationsLogin`](docs/sdks/authentications/README.md#login) - Login with email and password (Admin users only)
|
|
545
|
-
- [`authenticationsToken`](docs/sdks/authentications/README.md#token) -
|
|
545
|
+
- [`authenticationsToken`](docs/sdks/authentications/README.md#token) - Login with API Key
|
|
546
546
|
- [`authForgotPassword`](docs/sdks/auth/README.md#forgotpassword) - Request password reset email
|
|
547
547
|
- [`businessesCreate`](docs/sdks/businesses/README.md#create) - Create a new business
|
|
548
548
|
- [`businessesCreateBulk`](docs/sdks/businesses/README.md#createbulk) - Create multiple businesses
|
|
@@ -8,10 +8,7 @@ import * as models from "../models/index.js";
|
|
|
8
8
|
import { APIPromise } from "../types/async.js";
|
|
9
9
|
import { Result } from "../types/fp.js";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* Supports both API Key authentication (legacy) and OAuth2 Client Credentials flow. Use either api_key OR OAuth2 client credentials (grant_type, client_id, client_secret).
|
|
11
|
+
* Login with API Key
|
|
15
12
|
*/
|
|
16
13
|
export declare function authenticationsToken(client: OatFiSDKCore, request: models.LoginDto, options?: RequestOptions): APIPromise<Result<models.AuthResponseDto, OatFiSDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
17
14
|
//# sourceMappingURL=authenticationsToken.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationsToken.d.ts","sourceRoot":"","sources":["../../../src/funcs/authenticationsToken.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC
|
|
1
|
+
{"version":3,"file":"authenticationsToken.d.ts","sourceRoot":"","sources":["../../../src/funcs/authenticationsToken.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,MAAM,CAAC,QAAQ,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,MAAM,CAAC,eAAe,EACpB,aAAa,GACb,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -46,10 +46,7 @@ const url_js_1 = require("../lib/url.js");
|
|
|
46
46
|
const models = __importStar(require("../models/index.js"));
|
|
47
47
|
const async_js_1 = require("../types/async.js");
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* @remarks
|
|
52
|
-
* Supports both API Key authentication (legacy) and OAuth2 Client Credentials flow. Use either api_key OR OAuth2 client credentials (grant_type, client_id, client_secret).
|
|
49
|
+
* Login with API Key
|
|
53
50
|
*/
|
|
54
51
|
function authenticationsToken(client, request, options) {
|
|
55
52
|
return new async_js_1.APIPromise($do(client, request, options));
|
|
@@ -107,7 +104,7 @@ async function $do(client, request, options) {
|
|
|
107
104
|
const req = requestRes.value;
|
|
108
105
|
const doResult = await client._do(req, {
|
|
109
106
|
context,
|
|
110
|
-
errorCodes: ["
|
|
107
|
+
errorCodes: ["401", "429", "4XX", "5XX"],
|
|
111
108
|
retryConfig: context.retryConfig,
|
|
112
109
|
retryCodes: context.retryCodes,
|
|
113
110
|
});
|
|
@@ -115,7 +112,7 @@ async function $do(client, request, options) {
|
|
|
115
112
|
return [doResult, { status: "request-error", request: req }];
|
|
116
113
|
}
|
|
117
114
|
const response = doResult.value;
|
|
118
|
-
const [result] = await M.match(M.json(200, models.AuthResponseDto$inboundSchema), M.fail([
|
|
115
|
+
const [result] = await M.match(M.json(200, models.AuthResponseDto$inboundSchema), M.fail([401, 429, "4XX"]), M.fail("5XX"))(response, req);
|
|
119
116
|
if (!result.ok) {
|
|
120
117
|
return [result, { status: "complete", request: req, response }];
|
|
121
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationsToken.js","sourceRoot":"","sources":["../../../src/funcs/authenticationsToken.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"authenticationsToken.js","sourceRoot":"","sources":["../../../src/funcs/authenticationsToken.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BH,oDAsBC;AA9CD,sDAAiD;AACjD,sDAAwC;AACxC,wDAAkD;AAClD,kDAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAW3C,2DAA6C;AAC7C,gDAAwD;AAGxD;;GAEG;AACH,SAAgB,oBAAoB,CAClC,MAAoB,EACpB,OAAwB,EACxB,OAAwB;IAcxB,OAAO,IAAI,qBAAU,CAAC,GAAG,CACvB,MAAM,EACN,OAAO,EACP,OAAO,CACR,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,GAAG,CAChB,MAAoB,EACpB,OAAwB,EACxB,OAAwB;IAiBxB,MAAM,MAAM,GAAG,IAAA,sBAAS,EACtB,OAAO,EACP,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,KAAK,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,KAAK,CAAC;IAEhC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAW5B,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,6BAA6B,CAAC,EACjD,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,EACzB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACjB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/hooks/hooks.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EAEjB,KAAK,EACL,WAAW,EACZ,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/hooks/hooks.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,gBAAgB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8
|
class SDKHooks {
|
|
8
9
|
constructor() {
|
|
9
10
|
this.sdkInitHooks = [];
|
|
@@ -29,6 +30,7 @@ class SDKHooks {
|
|
|
29
30
|
this.registerAfterErrorHook(hook);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
33
|
+
(0, registration_js_1.initHooks)(this);
|
|
32
34
|
}
|
|
33
35
|
registerSDKInitHook(hook) {
|
|
34
36
|
this.sdkInitHooks.push(hook);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/hooks/hooks.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAkBH,MAAa,QAAQ;IAOnB;QANA,iBAAY,GAAkB,EAAE,CAAC;QACjC,6BAAwB,GAA8B,EAAE,CAAC;QACzD,uBAAkB,GAAwB,EAAE,CAAC;QAC7C,sBAAiB,GAAuB,EAAE,CAAC;QAC3C,oBAAe,GAAqB,EAAE,CAAC;QAGrC,MAAM,WAAW,GAAgB,EAAE,CAAC;QAEpC,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC/B,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;gBACtB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;YACjC,CAAC;YACD,IAAI,qBAAqB,IAAI,IAAI,EAAE,CAAC;gBAClC,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;YAC7C,CAAC;YACD,IAAI,eAAe,IAAI,IAAI,EAAE,CAAC;gBAC5B,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC;YACD,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;gBAC3B,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;YACtC,CAAC;YACD,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;gBACzB,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;
|
|
1
|
+
{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O,GAAG,CAAC;IACb,CAAC;IAED,KAAK,CAAC,UAAU,CACd,OAA0B,EAC1B,QAAyB,EACzB,KAAc;QAEd,IAAI,GAAG,GAAG,QAAQ,CAAC;QACnB,IAAI,GAAG,GAAG,KAAK,CAAC;QAEhB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACxC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YACxD,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;YACtB,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;QACrB,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACvC,CAAC;CACF;AA7GD,4BA6GC"}
|
|
@@ -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: "3.0.0";
|
|
34
|
-
readonly sdkVersion: "0.
|
|
35
|
-
readonly genVersion: "2.
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.
|
|
34
|
+
readonly sdkVersion: "0.10.2";
|
|
35
|
+
readonly genVersion: "2.731.6";
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.10.2 2.731.6 3.0.0 @oatfi/oatfi-sdk-ts";
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -39,8 +39,8 @@ function serverURLFromOptions(options) {
|
|
|
39
39
|
exports.SDK_METADATA = {
|
|
40
40
|
language: "typescript",
|
|
41
41
|
openapiDocVersion: "3.0.0",
|
|
42
|
-
sdkVersion: "0.
|
|
43
|
-
genVersion: "2.
|
|
44
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
42
|
+
sdkVersion: "0.10.2",
|
|
43
|
+
genVersion: "2.731.6",
|
|
44
|
+
userAgent: "speakeasy-sdk/typescript 0.10.2 2.731.6 3.0.0 @oatfi/oatfi-sdk-ts",
|
|
45
45
|
};
|
|
46
46
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,66 +1,14 @@
|
|
|
1
1
|
import * as z from "zod/v3";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
/**
|
|
6
|
-
* OAuth2 grant type - must be "client_credentials"
|
|
7
|
-
*/
|
|
8
|
-
export declare const GrantType: {
|
|
9
|
-
readonly ClientCredentials: "client_credentials";
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* OAuth2 grant type - must be "client_credentials"
|
|
13
|
-
*/
|
|
14
|
-
export type GrantType = ClosedEnum<typeof GrantType>;
|
|
15
4
|
export type LoginDto = {
|
|
16
|
-
|
|
17
|
-
* API key for authentication (legacy format)
|
|
18
|
-
*/
|
|
19
|
-
apiKey?: string | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* OAuth2 grant type - must be "client_credentials"
|
|
22
|
-
*/
|
|
23
|
-
grantType?: GrantType | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Client ID for OAuth2 authentication
|
|
26
|
-
*/
|
|
27
|
-
clientId?: string | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Client secret for OAuth2 authentication
|
|
30
|
-
*/
|
|
31
|
-
clientSecret?: string | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Space-separated list of scopes to request
|
|
34
|
-
*/
|
|
35
|
-
scope?: string | undefined;
|
|
5
|
+
apiKey: string;
|
|
36
6
|
};
|
|
37
7
|
/** @internal */
|
|
38
|
-
export declare const GrantType$inboundSchema: z.ZodNativeEnum<typeof GrantType>;
|
|
39
|
-
/** @internal */
|
|
40
|
-
export declare const GrantType$outboundSchema: z.ZodNativeEnum<typeof GrantType>;
|
|
41
|
-
/**
|
|
42
|
-
* @internal
|
|
43
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
44
|
-
*/
|
|
45
|
-
export declare namespace GrantType$ {
|
|
46
|
-
/** @deprecated use `GrantType$inboundSchema` instead. */
|
|
47
|
-
const inboundSchema: z.ZodNativeEnum<{
|
|
48
|
-
readonly ClientCredentials: "client_credentials";
|
|
49
|
-
}>;
|
|
50
|
-
/** @deprecated use `GrantType$outboundSchema` instead. */
|
|
51
|
-
const outboundSchema: z.ZodNativeEnum<{
|
|
52
|
-
readonly ClientCredentials: "client_credentials";
|
|
53
|
-
}>;
|
|
54
|
-
}
|
|
55
|
-
/** @internal */
|
|
56
8
|
export declare const LoginDto$inboundSchema: z.ZodType<LoginDto, z.ZodTypeDef, unknown>;
|
|
57
9
|
/** @internal */
|
|
58
10
|
export type LoginDto$Outbound = {
|
|
59
|
-
api_key
|
|
60
|
-
grant_type?: string | undefined;
|
|
61
|
-
client_id?: string | undefined;
|
|
62
|
-
client_secret?: string | undefined;
|
|
63
|
-
scope?: string | undefined;
|
|
11
|
+
api_key: string;
|
|
64
12
|
};
|
|
65
13
|
/** @internal */
|
|
66
14
|
export declare const LoginDto$outboundSchema: z.ZodType<LoginDto$Outbound, z.ZodTypeDef, LoginDto>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logindto.d.ts","sourceRoot":"","sources":["../../../src/models/logindto.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"logindto.d.ts","sourceRoot":"","sources":["../../../src/models/logindto.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,OAAO,CAC5C,QAAQ,EACR,CAAC,CAAC,UAAU,EACZ,OAAO,CAOP,CAAC;AAEH,gBAAgB;AAChB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAC7C,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,QAAQ,CAOR,CAAC;AAEH;;;GAGG;AACH,yBAAiB,SAAS,CAAC;IACzB,wDAAwD;IACjD,MAAM,aAAa,4CAAyB,CAAC;IACpD,yDAAyD;IAClD,MAAM,cAAc,sDAA0B,CAAC;IACtD,mDAAmD;IACnD,KAAY,QAAQ,GAAG,iBAAiB,CAAC;CAC1C;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEzD;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAM/C"}
|
|
@@ -36,62 +36,26 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.LoginDto$ = exports.LoginDto$outboundSchema = exports.LoginDto$inboundSchema =
|
|
39
|
+
exports.LoginDto$ = exports.LoginDto$outboundSchema = exports.LoginDto$inboundSchema = void 0;
|
|
40
40
|
exports.loginDtoToJSON = loginDtoToJSON;
|
|
41
41
|
exports.loginDtoFromJSON = loginDtoFromJSON;
|
|
42
42
|
const z = __importStar(require("zod/v3"));
|
|
43
43
|
const primitives_js_1 = require("../lib/primitives.js");
|
|
44
44
|
const schemas_js_1 = require("../lib/schemas.js");
|
|
45
|
-
/**
|
|
46
|
-
* OAuth2 grant type - must be "client_credentials"
|
|
47
|
-
*/
|
|
48
|
-
exports.GrantType = {
|
|
49
|
-
ClientCredentials: "client_credentials",
|
|
50
|
-
};
|
|
51
|
-
/** @internal */
|
|
52
|
-
exports.GrantType$inboundSchema = z
|
|
53
|
-
.nativeEnum(exports.GrantType);
|
|
54
|
-
/** @internal */
|
|
55
|
-
exports.GrantType$outboundSchema = exports.GrantType$inboundSchema;
|
|
56
|
-
/**
|
|
57
|
-
* @internal
|
|
58
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
59
|
-
*/
|
|
60
|
-
var GrantType$;
|
|
61
|
-
(function (GrantType$) {
|
|
62
|
-
/** @deprecated use `GrantType$inboundSchema` instead. */
|
|
63
|
-
GrantType$.inboundSchema = exports.GrantType$inboundSchema;
|
|
64
|
-
/** @deprecated use `GrantType$outboundSchema` instead. */
|
|
65
|
-
GrantType$.outboundSchema = exports.GrantType$outboundSchema;
|
|
66
|
-
})(GrantType$ || (exports.GrantType$ = GrantType$ = {}));
|
|
67
45
|
/** @internal */
|
|
68
46
|
exports.LoginDto$inboundSchema = z.object({
|
|
69
|
-
api_key: z.string()
|
|
70
|
-
grant_type: exports.GrantType$inboundSchema.optional(),
|
|
71
|
-
client_id: z.string().optional(),
|
|
72
|
-
client_secret: z.string().optional(),
|
|
73
|
-
scope: z.string().optional(),
|
|
47
|
+
api_key: z.string(),
|
|
74
48
|
}).transform((v) => {
|
|
75
49
|
return (0, primitives_js_1.remap)(v, {
|
|
76
50
|
"api_key": "apiKey",
|
|
77
|
-
"grant_type": "grantType",
|
|
78
|
-
"client_id": "clientId",
|
|
79
|
-
"client_secret": "clientSecret",
|
|
80
51
|
});
|
|
81
52
|
});
|
|
82
53
|
/** @internal */
|
|
83
54
|
exports.LoginDto$outboundSchema = z.object({
|
|
84
|
-
apiKey: z.string()
|
|
85
|
-
grantType: exports.GrantType$outboundSchema.optional(),
|
|
86
|
-
clientId: z.string().optional(),
|
|
87
|
-
clientSecret: z.string().optional(),
|
|
88
|
-
scope: z.string().optional(),
|
|
55
|
+
apiKey: z.string(),
|
|
89
56
|
}).transform((v) => {
|
|
90
57
|
return (0, primitives_js_1.remap)(v, {
|
|
91
58
|
apiKey: "api_key",
|
|
92
|
-
grantType: "grant_type",
|
|
93
|
-
clientId: "client_id",
|
|
94
|
-
clientSecret: "client_secret",
|
|
95
59
|
});
|
|
96
60
|
});
|
|
97
61
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logindto.js","sourceRoot":"","sources":["../../../src/models/logindto.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"logindto.js","sourceRoot":"","sources":["../../../src/models/logindto.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDH,wCAEC;AAED,4CAQC;AAlED,0CAA4B;AAC5B,wDAAuD;AACvD,kDAA8C;AAQ9C,gBAAgB;AACH,QAAA,sBAAsB,GAI/B,CAAC,CAAC,MAAM,CAAC;IACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,SAAS,EAAE,QAAQ;KACpB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAOH,gBAAgB;AACH,QAAA,uBAAuB,GAIhC,CAAC,CAAC,MAAM,CAAC;IACX,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,IAAiB,SAAS,CAOzB;AAPD,WAAiB,SAAS;IACxB,wDAAwD;IAC3C,uBAAa,GAAG,8BAAsB,CAAC;IACpD,yDAAyD;IAC5C,wBAAc,GAAG,+BAAuB,CAAC;AAGxD,CAAC,EAPgB,SAAS,yBAAT,SAAS,QAOzB;AAED,SAAgB,cAAc,CAAC,QAAkB;IAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,+BAAuB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,SAAgB,gBAAgB,CAC9B,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,8BAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAClD,sCAAsC,CACvC,CAAC;AACJ,CAAC"}
|
|
@@ -2,10 +2,7 @@ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
|
2
2
|
import * as models from "../models/index.js";
|
|
3
3
|
export declare class Authentications extends ClientSDK {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Supports both API Key authentication (legacy) and OAuth2 Client Credentials flow. Use either api_key OR OAuth2 client credentials (grant_type, client_id, client_secret).
|
|
5
|
+
* Login with API Key
|
|
9
6
|
*/
|
|
10
7
|
token(request: models.LoginDto, options?: RequestOptions): Promise<models.AuthResponseDto>;
|
|
11
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentications.d.ts","sourceRoot":"","sources":["../../../src/sdk/authentications.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAG7C,qBAAa,eAAgB,SAAQ,SAAS;IAC5C
|
|
1
|
+
{"version":3,"file":"authentications.d.ts","sourceRoot":"","sources":["../../../src/sdk/authentications.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAG7C,qBAAa,eAAgB,SAAQ,SAAS;IAC5C;;OAEG;IACG,KAAK,CACT,OAAO,EAAE,MAAM,CAAC,QAAQ,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAQlC;;OAEG;IACG,KAAK,CACT,OAAO,EAAE,MAAM,CAAC,YAAY,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;CAOnC"}
|
|
@@ -10,10 +10,7 @@ const sdks_js_1 = require("../lib/sdks.js");
|
|
|
10
10
|
const fp_js_1 = require("../types/fp.js");
|
|
11
11
|
class Authentications extends sdks_js_1.ClientSDK {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Supports both API Key authentication (legacy) and OAuth2 Client Credentials flow. Use either api_key OR OAuth2 client credentials (grant_type, client_id, client_secret).
|
|
13
|
+
* Login with API Key
|
|
17
14
|
*/
|
|
18
15
|
async token(request, options) {
|
|
19
16
|
return (0, fp_js_1.unwrapAsync)((0, authenticationsToken_js_1.authenticationsToken)(this, request, options));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentications.js","sourceRoot":"","sources":["../../../src/sdk/authentications.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,8EAAwE;AACxE,8EAAwE;AACxE,4CAA2D;AAE3D,0CAA6C;AAE7C,MAAa,eAAgB,SAAQ,mBAAS;IAC5C
|
|
1
|
+
{"version":3,"file":"authentications.js","sourceRoot":"","sources":["../../../src/sdk/authentications.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,8EAAwE;AACxE,8EAAwE;AACxE,4CAA2D;AAE3D,0CAA6C;AAE7C,MAAa,eAAgB,SAAQ,mBAAS;IAC5C;;OAEG;IACH,KAAK,CAAC,KAAK,CACT,OAAwB,EACxB,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8CAAoB,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CACT,OAA4B,EAC5B,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8CAAoB,EACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AA5BD,0CA4BC"}
|
|
@@ -8,10 +8,7 @@ import * as models from "../models/index.js";
|
|
|
8
8
|
import { APIPromise } from "../types/async.js";
|
|
9
9
|
import { Result } from "../types/fp.js";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* Supports both API Key authentication (legacy) and OAuth2 Client Credentials flow. Use either api_key OR OAuth2 client credentials (grant_type, client_id, client_secret).
|
|
11
|
+
* Login with API Key
|
|
15
12
|
*/
|
|
16
13
|
export declare function authenticationsToken(client: OatFiSDKCore, request: models.LoginDto, options?: RequestOptions): APIPromise<Result<models.AuthResponseDto, OatFiSDKError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
17
14
|
//# sourceMappingURL=authenticationsToken.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationsToken.d.ts","sourceRoot":"","sources":["../../../src/funcs/authenticationsToken.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC
|
|
1
|
+
{"version":3,"file":"authenticationsToken.d.ts","sourceRoot":"","sources":["../../../src/funcs/authenticationsToken.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,MAAM,CAAC,QAAQ,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,MAAM,CAAC,eAAe,EACpB,aAAa,GACb,uBAAuB,GACvB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,CACrB,CACF,CAMA"}
|
|
@@ -10,10 +10,7 @@ import { pathToFunc } from "../lib/url.js";
|
|
|
10
10
|
import * as models from "../models/index.js";
|
|
11
11
|
import { APIPromise } from "../types/async.js";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Supports both API Key authentication (legacy) and OAuth2 Client Credentials flow. Use either api_key OR OAuth2 client credentials (grant_type, client_id, client_secret).
|
|
13
|
+
* Login with API Key
|
|
17
14
|
*/
|
|
18
15
|
export function authenticationsToken(client, request, options) {
|
|
19
16
|
return new APIPromise($do(client, request, options));
|
|
@@ -71,7 +68,7 @@ async function $do(client, request, options) {
|
|
|
71
68
|
const req = requestRes.value;
|
|
72
69
|
const doResult = await client._do(req, {
|
|
73
70
|
context,
|
|
74
|
-
errorCodes: ["
|
|
71
|
+
errorCodes: ["401", "429", "4XX", "5XX"],
|
|
75
72
|
retryConfig: context.retryConfig,
|
|
76
73
|
retryCodes: context.retryCodes,
|
|
77
74
|
});
|
|
@@ -79,7 +76,7 @@ async function $do(client, request, options) {
|
|
|
79
76
|
return [doResult, { status: "request-error", request: req }];
|
|
80
77
|
}
|
|
81
78
|
const response = doResult.value;
|
|
82
|
-
const [result] = await M.match(M.json(200, models.AuthResponseDto$inboundSchema), M.fail([
|
|
79
|
+
const [result] = await M.match(M.json(200, models.AuthResponseDto$inboundSchema), M.fail([401, 429, "4XX"]), M.fail("5XX"))(response, req);
|
|
83
80
|
if (!result.ok) {
|
|
84
81
|
return [result, { status: "complete", request: req, response }];
|
|
85
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationsToken.js","sourceRoot":"","sources":["../../../src/funcs/authenticationsToken.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM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E,MAAM,CAAC,6BAA6B,CAAC,EACjD,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,EACzB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CACd,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IACjB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/hooks/hooks.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EAEjB,KAAK,EACL,WAAW,EACZ,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/hooks/hooks.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,0BAA0B,EAC1B,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EAEjB,KAAK,EACL,WAAW,EACZ,MAAM,YAAY,CAAC;AAIpB,qBAAa,QAAS,YAAW,KAAK;IACpC,YAAY,EAAE,WAAW,EAAE,CAAM;IACjC,wBAAwB,EAAE,uBAAuB,EAAE,CAAM;IACzD,kBAAkB,EAAE,iBAAiB,EAAE,CAAM;IAC7C,iBAAiB,EAAE,gBAAgB,EAAE,CAAM;IAC3C,eAAe,EAAE,cAAc,EAAE,CAAM;;IAyBvC,mBAAmB,CAAC,IAAI,EAAE,WAAW;IAIrC,+BAA+B,CAAC,IAAI,EAAE,uBAAuB;IAI7D,yBAAyB,CAAC,IAAI,EAAE,iBAAiB;IAIjD,wBAAwB,CAAC,IAAI,EAAE,gBAAgB;IAI/C,sBAAsB,CAAC,IAAI,EAAE,cAAc;IAI3C,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU;IAIrC,mBAAmB,CACjB,OAAO,EAAE,0BAA0B,EACnC,KAAK,EAAE,YAAY,GAClB,YAAY;IAUT,aAAa,CACjB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC;IAUb,YAAY,CAChB,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,QAAQ,CAAC;IAUd,UAAU,CACd,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,QAAQ,GAAG,IAAI,EACzB,KAAK,EAAE,OAAO,GACb,OAAO,CAAC;QAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;CAY1D"}
|
package/dist/esm/hooks/hooks.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
|
+
import { initHooks } from "./registration.js";
|
|
4
5
|
export class SDKHooks {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.sdkInitHooks = [];
|
|
@@ -26,6 +27,7 @@ export class SDKHooks {
|
|
|
26
27
|
this.registerAfterErrorHook(hook);
|
|
27
28
|
}
|
|
28
29
|
}
|
|
30
|
+
initHooks(this);
|
|
29
31
|
}
|
|
30
32
|
registerSDKInitHook(hook) {
|
|
31
33
|
this.sdkInitHooks.push(hook);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/hooks/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkBH,MAAM,OAAO,QAAQ;IAOnB;QANA,iBAAY,GAAkB,EAAE,CAAC;QACjC,6BAAwB,GAA8B,EAAE,CAAC;QACzD,uBAAkB,GAAwB,EAAE,CAAC;QAC7C,sBAAiB,GAAuB,EAAE,CAAC;QAC3C,oBAAe,GAAqB,EAAE,CAAC;QAGrC,MAAM,WAAW,GAAgB,EAAE,CAAC;QAEpC,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAC/B,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;gBACtB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;YACjC,CAAC;YACD,IAAI,qBAAqB,IAAI,IAAI,EAAE,CAAC;gBAClC,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;YAC7C,CAAC;YACD,IAAI,eAAe,IAAI,IAAI,EAAE,CAAC;gBAC5B,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC;YACD,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;gBAC3B,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;YACtC,CAAC;YACD,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;gBACzB,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/hooks/hooks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAkBH,OAAO,EAAE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,QAAyB,EACzB,KAAc;QAEd,IAAI,GAAG,GAAG,QAAQ,CAAC;QACnB,IAAI,GAAG,GAAG,KAAK,CAAC;QAEhB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACxC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;YACxD,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;YACtB,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;QACrB,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACvC,CAAC;CACF"}
|
package/dist/esm/lib/config.d.ts
CHANGED
|
@@ -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: "3.0.0";
|
|
34
|
-
readonly sdkVersion: "0.
|
|
35
|
-
readonly genVersion: "2.
|
|
36
|
-
readonly userAgent: "speakeasy-sdk/typescript 0.
|
|
34
|
+
readonly sdkVersion: "0.10.2";
|
|
35
|
+
readonly genVersion: "2.731.6";
|
|
36
|
+
readonly userAgent: "speakeasy-sdk/typescript 0.10.2 2.731.6 3.0.0 @oatfi/oatfi-sdk-ts";
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/esm/lib/config.js
CHANGED
|
@@ -35,8 +35,8 @@ export function serverURLFromOptions(options) {
|
|
|
35
35
|
export const SDK_METADATA = {
|
|
36
36
|
language: "typescript",
|
|
37
37
|
openapiDocVersion: "3.0.0",
|
|
38
|
-
sdkVersion: "0.
|
|
39
|
-
genVersion: "2.
|
|
40
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
38
|
+
sdkVersion: "0.10.2",
|
|
39
|
+
genVersion: "2.731.6",
|
|
40
|
+
userAgent: "speakeasy-sdk/typescript 0.10.2 2.731.6 3.0.0 @oatfi/oatfi-sdk-ts",
|
|
41
41
|
};
|
|
42
42
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,66 +1,14 @@
|
|
|
1
1
|
import * as z from "zod/v3";
|
|
2
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
3
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
/**
|
|
6
|
-
* OAuth2 grant type - must be "client_credentials"
|
|
7
|
-
*/
|
|
8
|
-
export declare const GrantType: {
|
|
9
|
-
readonly ClientCredentials: "client_credentials";
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* OAuth2 grant type - must be "client_credentials"
|
|
13
|
-
*/
|
|
14
|
-
export type GrantType = ClosedEnum<typeof GrantType>;
|
|
15
4
|
export type LoginDto = {
|
|
16
|
-
|
|
17
|
-
* API key for authentication (legacy format)
|
|
18
|
-
*/
|
|
19
|
-
apiKey?: string | undefined;
|
|
20
|
-
/**
|
|
21
|
-
* OAuth2 grant type - must be "client_credentials"
|
|
22
|
-
*/
|
|
23
|
-
grantType?: GrantType | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Client ID for OAuth2 authentication
|
|
26
|
-
*/
|
|
27
|
-
clientId?: string | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Client secret for OAuth2 authentication
|
|
30
|
-
*/
|
|
31
|
-
clientSecret?: string | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Space-separated list of scopes to request
|
|
34
|
-
*/
|
|
35
|
-
scope?: string | undefined;
|
|
5
|
+
apiKey: string;
|
|
36
6
|
};
|
|
37
7
|
/** @internal */
|
|
38
|
-
export declare const GrantType$inboundSchema: z.ZodNativeEnum<typeof GrantType>;
|
|
39
|
-
/** @internal */
|
|
40
|
-
export declare const GrantType$outboundSchema: z.ZodNativeEnum<typeof GrantType>;
|
|
41
|
-
/**
|
|
42
|
-
* @internal
|
|
43
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
44
|
-
*/
|
|
45
|
-
export declare namespace GrantType$ {
|
|
46
|
-
/** @deprecated use `GrantType$inboundSchema` instead. */
|
|
47
|
-
const inboundSchema: z.ZodNativeEnum<{
|
|
48
|
-
readonly ClientCredentials: "client_credentials";
|
|
49
|
-
}>;
|
|
50
|
-
/** @deprecated use `GrantType$outboundSchema` instead. */
|
|
51
|
-
const outboundSchema: z.ZodNativeEnum<{
|
|
52
|
-
readonly ClientCredentials: "client_credentials";
|
|
53
|
-
}>;
|
|
54
|
-
}
|
|
55
|
-
/** @internal */
|
|
56
8
|
export declare const LoginDto$inboundSchema: z.ZodType<LoginDto, z.ZodTypeDef, unknown>;
|
|
57
9
|
/** @internal */
|
|
58
10
|
export type LoginDto$Outbound = {
|
|
59
|
-
api_key
|
|
60
|
-
grant_type?: string | undefined;
|
|
61
|
-
client_id?: string | undefined;
|
|
62
|
-
client_secret?: string | undefined;
|
|
63
|
-
scope?: string | undefined;
|
|
11
|
+
api_key: string;
|
|
64
12
|
};
|
|
65
13
|
/** @internal */
|
|
66
14
|
export declare const LoginDto$outboundSchema: z.ZodType<LoginDto$Outbound, z.ZodTypeDef, LoginDto>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logindto.d.ts","sourceRoot":"","sources":["../../../src/models/logindto.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"logindto.d.ts","sourceRoot":"","sources":["../../../src/models/logindto.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,sBAAsB,EAAE,CAAC,CAAC,OAAO,CAC5C,QAAQ,EACR,CAAC,CAAC,UAAU,EACZ,OAAO,CAOP,CAAC;AAEH,gBAAgB;AAChB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,uBAAuB,EAAE,CAAC,CAAC,OAAO,CAC7C,iBAAiB,EACjB,CAAC,CAAC,UAAU,EACZ,QAAQ,CAOR,CAAC;AAEH;;;GAGG;AACH,yBAAiB,SAAS,CAAC;IACzB,wDAAwD;IACjD,MAAM,aAAa,4CAAyB,CAAC;IACpD,yDAAyD;IAClD,MAAM,cAAc,sDAA0B,CAAC;IACtD,mDAAmD;IACnD,KAAY,QAAQ,GAAG,iBAAiB,CAAC;CAC1C;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAEzD;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAM/C"}
|
|
@@ -4,56 +4,20 @@
|
|
|
4
4
|
import * as z from "zod/v3";
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
/**
|
|
8
|
-
* OAuth2 grant type - must be "client_credentials"
|
|
9
|
-
*/
|
|
10
|
-
export const GrantType = {
|
|
11
|
-
ClientCredentials: "client_credentials",
|
|
12
|
-
};
|
|
13
|
-
/** @internal */
|
|
14
|
-
export const GrantType$inboundSchema = z
|
|
15
|
-
.nativeEnum(GrantType);
|
|
16
|
-
/** @internal */
|
|
17
|
-
export const GrantType$outboundSchema = GrantType$inboundSchema;
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
21
|
-
*/
|
|
22
|
-
export var GrantType$;
|
|
23
|
-
(function (GrantType$) {
|
|
24
|
-
/** @deprecated use `GrantType$inboundSchema` instead. */
|
|
25
|
-
GrantType$.inboundSchema = GrantType$inboundSchema;
|
|
26
|
-
/** @deprecated use `GrantType$outboundSchema` instead. */
|
|
27
|
-
GrantType$.outboundSchema = GrantType$outboundSchema;
|
|
28
|
-
})(GrantType$ || (GrantType$ = {}));
|
|
29
7
|
/** @internal */
|
|
30
8
|
export const LoginDto$inboundSchema = z.object({
|
|
31
|
-
api_key: z.string()
|
|
32
|
-
grant_type: GrantType$inboundSchema.optional(),
|
|
33
|
-
client_id: z.string().optional(),
|
|
34
|
-
client_secret: z.string().optional(),
|
|
35
|
-
scope: z.string().optional(),
|
|
9
|
+
api_key: z.string(),
|
|
36
10
|
}).transform((v) => {
|
|
37
11
|
return remap$(v, {
|
|
38
12
|
"api_key": "apiKey",
|
|
39
|
-
"grant_type": "grantType",
|
|
40
|
-
"client_id": "clientId",
|
|
41
|
-
"client_secret": "clientSecret",
|
|
42
13
|
});
|
|
43
14
|
});
|
|
44
15
|
/** @internal */
|
|
45
16
|
export const LoginDto$outboundSchema = z.object({
|
|
46
|
-
apiKey: z.string()
|
|
47
|
-
grantType: GrantType$outboundSchema.optional(),
|
|
48
|
-
clientId: z.string().optional(),
|
|
49
|
-
clientSecret: z.string().optional(),
|
|
50
|
-
scope: z.string().optional(),
|
|
17
|
+
apiKey: z.string(),
|
|
51
18
|
}).transform((v) => {
|
|
52
19
|
return remap$(v, {
|
|
53
20
|
apiKey: "api_key",
|
|
54
|
-
grantType: "grant_type",
|
|
55
|
-
clientId: "client_id",
|
|
56
|
-
clientSecret: "client_secret",
|
|
57
21
|
});
|
|
58
22
|
});
|
|
59
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logindto.js","sourceRoot":"","sources":["../../../src/models/logindto.ts"],"names":[],"mappings":"AAA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AAC,SAAS,CAAC,uBAAuB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAClD,sCAAsC,CACvC,CAAC;AACJ,CAAC"}
|
|
@@ -2,10 +2,7 @@ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
|
2
2
|
import * as models from "../models/index.js";
|
|
3
3
|
export declare class Authentications extends ClientSDK {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Supports both API Key authentication (legacy) and OAuth2 Client Credentials flow. Use either api_key OR OAuth2 client credentials (grant_type, client_id, client_secret).
|
|
5
|
+
* Login with API Key
|
|
9
6
|
*/
|
|
10
7
|
token(request: models.LoginDto, options?: RequestOptions): Promise<models.AuthResponseDto>;
|
|
11
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentications.d.ts","sourceRoot":"","sources":["../../../src/sdk/authentications.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAG7C,qBAAa,eAAgB,SAAQ,SAAS;IAC5C
|
|
1
|
+
{"version":3,"file":"authentications.d.ts","sourceRoot":"","sources":["../../../src/sdk/authentications.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAG7C,qBAAa,eAAgB,SAAQ,SAAS;IAC5C;;OAEG;IACG,KAAK,CACT,OAAO,EAAE,MAAM,CAAC,QAAQ,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAQlC;;OAEG;IACG,KAAK,CACT,OAAO,EAAE,MAAM,CAAC,YAAY,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;CAOnC"}
|
|
@@ -7,10 +7,7 @@ import { ClientSDK } from "../lib/sdks.js";
|
|
|
7
7
|
import { unwrapAsync } from "../types/fp.js";
|
|
8
8
|
export class Authentications extends ClientSDK {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* Supports both API Key authentication (legacy) and OAuth2 Client Credentials flow. Use either api_key OR OAuth2 client credentials (grant_type, client_id, client_secret).
|
|
10
|
+
* Login with API Key
|
|
14
11
|
*/
|
|
15
12
|
async token(request, options) {
|
|
16
13
|
return unwrapAsync(authenticationsToken(this, request, options));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authentications.js","sourceRoot":"","sources":["../../../src/sdk/authentications.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C
|
|
1
|
+
{"version":3,"file":"authentications.js","sourceRoot":"","sources":["../../../src/sdk/authentications.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C;;OAEG;IACH,KAAK,CAAC,KAAK,CACT,OAAwB,EACxB,OAAwB;QAExB,OAAO,WAAW,CAAC,oBAAoB,CACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CACT,OAA4B,EAC5B,OAAwB;QAExB,OAAO,WAAW,CAAC,oBAAoB,CACrC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
|
-
* [token](#token) -
|
|
8
|
+
* [token](#token) - Login with API Key
|
|
9
9
|
* [login](#login) - Login with email and password (Admin users only)
|
|
10
10
|
|
|
11
11
|
## token
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Login with API Key
|
|
14
14
|
|
|
15
15
|
### Example Usage
|
|
16
16
|
|
|
@@ -25,10 +25,6 @@ const oatFiSDK = new OatFiSDK({
|
|
|
25
25
|
async function run() {
|
|
26
26
|
const result = await oatFiSDK.authentications.token({
|
|
27
27
|
apiKey: "api-key-123",
|
|
28
|
-
grantType: "client_credentials",
|
|
29
|
-
clientId: "your-client-id",
|
|
30
|
-
clientSecret: "your-client-secret",
|
|
31
|
-
scope: "read write",
|
|
32
28
|
});
|
|
33
29
|
|
|
34
30
|
console.log(result);
|
|
@@ -54,10 +50,6 @@ const oatFiSDK = new OatFiSDKCore({
|
|
|
54
50
|
async function run() {
|
|
55
51
|
const res = await authenticationsToken(oatFiSDK, {
|
|
56
52
|
apiKey: "api-key-123",
|
|
57
|
-
grantType: "client_credentials",
|
|
58
|
-
clientId: "your-client-id",
|
|
59
|
-
clientSecret: "your-client-secret",
|
|
60
|
-
scope: "read write",
|
|
61
53
|
});
|
|
62
54
|
if (res.ok) {
|
|
63
55
|
const { value: result } = res;
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -25,10 +25,7 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
25
25
|
import { Result } from "../types/fp.js";
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* Supports both API Key authentication (legacy) and OAuth2 Client Credentials flow. Use either api_key OR OAuth2 client credentials (grant_type, client_id, client_secret).
|
|
28
|
+
* Login with API Key
|
|
32
29
|
*/
|
|
33
30
|
export function authenticationsToken(
|
|
34
31
|
client: OatFiSDKCore,
|
|
@@ -138,7 +135,7 @@ async function $do(
|
|
|
138
135
|
|
|
139
136
|
const doResult = await client._do(req, {
|
|
140
137
|
context,
|
|
141
|
-
errorCodes: ["
|
|
138
|
+
errorCodes: ["401", "429", "4XX", "5XX"],
|
|
142
139
|
retryConfig: context.retryConfig,
|
|
143
140
|
retryCodes: context.retryCodes,
|
|
144
141
|
});
|
|
@@ -159,7 +156,7 @@ async function $do(
|
|
|
159
156
|
| SDKValidationError
|
|
160
157
|
>(
|
|
161
158
|
M.json(200, models.AuthResponseDto$inboundSchema),
|
|
162
|
-
M.fail([
|
|
159
|
+
M.fail([401, 429, "4XX"]),
|
|
163
160
|
M.fail("5XX"),
|
|
164
161
|
)(response, req);
|
|
165
162
|
if (!result.ok) {
|
package/src/hooks/hooks.ts
CHANGED
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
SDKInitHook,
|
|
19
19
|
} from "./types.js";
|
|
20
20
|
|
|
21
|
+
import { initHooks } from "./registration.js";
|
|
22
|
+
|
|
21
23
|
export class SDKHooks implements Hooks {
|
|
22
24
|
sdkInitHooks: SDKInitHook[] = [];
|
|
23
25
|
beforeCreateRequestHooks: BeforeCreateRequestHook[] = [];
|
|
@@ -45,6 +47,7 @@ export class SDKHooks implements Hooks {
|
|
|
45
47
|
this.registerAfterErrorHook(hook);
|
|
46
48
|
}
|
|
47
49
|
}
|
|
50
|
+
initHooks(this);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
registerSDKInitHook(hook: SDKInitHook) {
|
package/src/lib/config.ts
CHANGED
|
@@ -69,8 +69,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
69
69
|
export const SDK_METADATA = {
|
|
70
70
|
language: "typescript",
|
|
71
71
|
openapiDocVersion: "3.0.0",
|
|
72
|
-
sdkVersion: "0.
|
|
73
|
-
genVersion: "2.
|
|
72
|
+
sdkVersion: "0.10.2",
|
|
73
|
+
genVersion: "2.731.6",
|
|
74
74
|
userAgent:
|
|
75
|
-
"speakeasy-sdk/typescript 0.
|
|
75
|
+
"speakeasy-sdk/typescript 0.10.2 2.731.6 3.0.0 @oatfi/oatfi-sdk-ts",
|
|
76
76
|
} as const;
|
package/src/models/logindto.ts
CHANGED
|
@@ -5,90 +5,29 @@
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import { ClosedEnum } from "../types/enums.js";
|
|
9
8
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
9
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
11
10
|
|
|
12
|
-
/**
|
|
13
|
-
* OAuth2 grant type - must be "client_credentials"
|
|
14
|
-
*/
|
|
15
|
-
export const GrantType = {
|
|
16
|
-
ClientCredentials: "client_credentials",
|
|
17
|
-
} as const;
|
|
18
|
-
/**
|
|
19
|
-
* OAuth2 grant type - must be "client_credentials"
|
|
20
|
-
*/
|
|
21
|
-
export type GrantType = ClosedEnum<typeof GrantType>;
|
|
22
|
-
|
|
23
11
|
export type LoginDto = {
|
|
24
|
-
|
|
25
|
-
* API key for authentication (legacy format)
|
|
26
|
-
*/
|
|
27
|
-
apiKey?: string | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* OAuth2 grant type - must be "client_credentials"
|
|
30
|
-
*/
|
|
31
|
-
grantType?: GrantType | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Client ID for OAuth2 authentication
|
|
34
|
-
*/
|
|
35
|
-
clientId?: string | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Client secret for OAuth2 authentication
|
|
38
|
-
*/
|
|
39
|
-
clientSecret?: string | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Space-separated list of scopes to request
|
|
42
|
-
*/
|
|
43
|
-
scope?: string | undefined;
|
|
12
|
+
apiKey: string;
|
|
44
13
|
};
|
|
45
14
|
|
|
46
|
-
/** @internal */
|
|
47
|
-
export const GrantType$inboundSchema: z.ZodNativeEnum<typeof GrantType> = z
|
|
48
|
-
.nativeEnum(GrantType);
|
|
49
|
-
|
|
50
|
-
/** @internal */
|
|
51
|
-
export const GrantType$outboundSchema: z.ZodNativeEnum<typeof GrantType> =
|
|
52
|
-
GrantType$inboundSchema;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @internal
|
|
56
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
57
|
-
*/
|
|
58
|
-
export namespace GrantType$ {
|
|
59
|
-
/** @deprecated use `GrantType$inboundSchema` instead. */
|
|
60
|
-
export const inboundSchema = GrantType$inboundSchema;
|
|
61
|
-
/** @deprecated use `GrantType$outboundSchema` instead. */
|
|
62
|
-
export const outboundSchema = GrantType$outboundSchema;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
15
|
/** @internal */
|
|
66
16
|
export const LoginDto$inboundSchema: z.ZodType<
|
|
67
17
|
LoginDto,
|
|
68
18
|
z.ZodTypeDef,
|
|
69
19
|
unknown
|
|
70
20
|
> = z.object({
|
|
71
|
-
api_key: z.string()
|
|
72
|
-
grant_type: GrantType$inboundSchema.optional(),
|
|
73
|
-
client_id: z.string().optional(),
|
|
74
|
-
client_secret: z.string().optional(),
|
|
75
|
-
scope: z.string().optional(),
|
|
21
|
+
api_key: z.string(),
|
|
76
22
|
}).transform((v) => {
|
|
77
23
|
return remap$(v, {
|
|
78
24
|
"api_key": "apiKey",
|
|
79
|
-
"grant_type": "grantType",
|
|
80
|
-
"client_id": "clientId",
|
|
81
|
-
"client_secret": "clientSecret",
|
|
82
25
|
});
|
|
83
26
|
});
|
|
84
27
|
|
|
85
28
|
/** @internal */
|
|
86
29
|
export type LoginDto$Outbound = {
|
|
87
|
-
api_key
|
|
88
|
-
grant_type?: string | undefined;
|
|
89
|
-
client_id?: string | undefined;
|
|
90
|
-
client_secret?: string | undefined;
|
|
91
|
-
scope?: string | undefined;
|
|
30
|
+
api_key: string;
|
|
92
31
|
};
|
|
93
32
|
|
|
94
33
|
/** @internal */
|
|
@@ -97,17 +36,10 @@ export const LoginDto$outboundSchema: z.ZodType<
|
|
|
97
36
|
z.ZodTypeDef,
|
|
98
37
|
LoginDto
|
|
99
38
|
> = z.object({
|
|
100
|
-
apiKey: z.string()
|
|
101
|
-
grantType: GrantType$outboundSchema.optional(),
|
|
102
|
-
clientId: z.string().optional(),
|
|
103
|
-
clientSecret: z.string().optional(),
|
|
104
|
-
scope: z.string().optional(),
|
|
39
|
+
apiKey: z.string(),
|
|
105
40
|
}).transform((v) => {
|
|
106
41
|
return remap$(v, {
|
|
107
42
|
apiKey: "api_key",
|
|
108
|
-
grantType: "grant_type",
|
|
109
|
-
clientId: "client_id",
|
|
110
|
-
clientSecret: "client_secret",
|
|
111
43
|
});
|
|
112
44
|
});
|
|
113
45
|
|
|
@@ -10,10 +10,7 @@ import { unwrapAsync } from "../types/fp.js";
|
|
|
10
10
|
|
|
11
11
|
export class Authentications extends ClientSDK {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* Supports both API Key authentication (legacy) and OAuth2 Client Credentials flow. Use either api_key OR OAuth2 client credentials (grant_type, client_id, client_secret).
|
|
13
|
+
* Login with API Key
|
|
17
14
|
*/
|
|
18
15
|
async token(
|
|
19
16
|
request: models.LoginDto,
|