@steamsets/client-ts 0.1.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/.devcontainer/README.md +35 -0
- package/README.md +389 -0
- package/core.d.ts +10 -0
- package/core.d.ts.map +1 -0
- package/core.js +17 -0
- package/core.js.map +1 -0
- package/docs/sdks/account/README.md +97 -0
- package/docs/sdks/liveness/README.md +51 -0
- package/docs/sdks/steamsets/README.md +7 -0
- package/funcs/accountAccountV1Apps.d.ts +13 -0
- package/funcs/accountAccountV1Apps.d.ts.map +1 -0
- package/funcs/accountAccountV1Apps.js +82 -0
- package/funcs/accountAccountV1Apps.js.map +1 -0
- package/funcs/accountAccountV1Badge.d.ts +13 -0
- package/funcs/accountAccountV1Badge.d.ts.map +1 -0
- package/funcs/accountAccountV1Badge.js +82 -0
- package/funcs/accountAccountV1Badge.js.map +1 -0
- package/funcs/livenessLiveness.d.ts +16 -0
- package/funcs/livenessLiveness.d.ts.map +1 -0
- package/funcs/livenessLiveness.js +83 -0
- package/funcs/livenessLiveness.js.map +1 -0
- package/hooks/hooks.d.ts +24 -0
- package/hooks/hooks.d.ts.map +1 -0
- package/hooks/hooks.js +66 -0
- package/hooks/hooks.js.map +1 -0
- package/hooks/index.d.ts +3 -0
- package/hooks/index.d.ts.map +1 -0
- package/hooks/index.js +22 -0
- package/hooks/index.js.map +1 -0
- package/hooks/types.d.ts +72 -0
- package/hooks/types.d.ts.map +1 -0
- package/hooks/types.js +6 -0
- package/hooks/types.js.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +22 -0
- package/index.js.map +1 -0
- package/lib/base64.d.ts +10 -0
- package/lib/base64.d.ts.map +1 -0
- package/lib/base64.js +61 -0
- package/lib/base64.js.map +1 -0
- package/lib/config.d.ts +36 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +34 -0
- package/lib/config.js.map +1 -0
- package/lib/dlv.d.ts +14 -0
- package/lib/dlv.d.ts.map +1 -0
- package/lib/dlv.js +49 -0
- package/lib/dlv.js.map +1 -0
- package/lib/encodings.d.ts +51 -0
- package/lib/encodings.d.ts.map +1 -0
- package/lib/encodings.js +343 -0
- package/lib/encodings.js.map +1 -0
- package/lib/http.d.ts +66 -0
- package/lib/http.d.ts.map +1 -0
- package/lib/http.js +217 -0
- package/lib/http.js.map +1 -0
- package/lib/is-plain-object.d.ts +2 -0
- package/lib/is-plain-object.d.ts.map +1 -0
- package/lib/is-plain-object.js +41 -0
- package/lib/is-plain-object.js.map +1 -0
- package/lib/matchers.d.ts +64 -0
- package/lib/matchers.d.ts.map +1 -0
- package/lib/matchers.js +209 -0
- package/lib/matchers.js.map +1 -0
- package/lib/primitives.d.ts +16 -0
- package/lib/primitives.d.ts.map +1 -0
- package/lib/primitives.js +29 -0
- package/lib/primitives.js.map +1 -0
- package/lib/retries.d.ts +18 -0
- package/lib/retries.d.ts.map +1 -0
- package/lib/retries.js +130 -0
- package/lib/retries.js.map +1 -0
- package/lib/schemas.d.ts +19 -0
- package/lib/schemas.d.ts.map +1 -0
- package/lib/schemas.js +59 -0
- package/lib/schemas.js.map +1 -0
- package/lib/sdks.d.ts +57 -0
- package/lib/sdks.d.ts.map +1 -0
- package/lib/sdks.js +159 -0
- package/lib/sdks.js.map +1 -0
- package/lib/security.d.ts +60 -0
- package/lib/security.d.ts.map +1 -0
- package/lib/security.js +130 -0
- package/lib/security.js.map +1 -0
- package/lib/url.d.ts +5 -0
- package/lib/url.d.ts.map +1 -0
- package/lib/url.js +25 -0
- package/lib/url.js.map +1 -0
- package/models/components/errordetail.d.ts +38 -0
- package/models/components/errordetail.d.ts.map +1 -0
- package/models/components/errordetail.js +54 -0
- package/models/components/errordetail.js.map +1 -0
- package/models/components/index.d.ts +8 -0
- package/models/components/index.d.ts.map +1 -0
- package/models/components/index.js +27 -0
- package/models/components/index.js.map +1 -0
- package/models/components/security.d.ts +27 -0
- package/models/components/security.d.ts.map +1 -0
- package/models/components/security.js +52 -0
- package/models/components/security.js.map +1 -0
- package/models/components/v1accountsappsresponsebody.d.ts +31 -0
- package/models/components/v1accountsappsresponsebody.d.ts.map +1 -0
- package/models/components/v1accountsappsresponsebody.js +66 -0
- package/models/components/v1accountsappsresponsebody.js.map +1 -0
- package/models/components/v1app.d.ts +53 -0
- package/models/components/v1app.d.ts.map +1 -0
- package/models/components/v1app.js +60 -0
- package/models/components/v1app.js.map +1 -0
- package/models/components/v1badge.d.ts +51 -0
- package/models/components/v1badge.d.ts.map +1 -0
- package/models/components/v1badge.js +79 -0
- package/models/components/v1badge.js.map +1 -0
- package/models/components/v1badgesappsresponsebody.d.ts +31 -0
- package/models/components/v1badgesappsresponsebody.d.ts.map +1 -0
- package/models/components/v1badgesappsresponsebody.js +66 -0
- package/models/components/v1badgesappsresponsebody.js.map +1 -0
- package/models/components/v1livenessresponsebody.d.ts +33 -0
- package/models/components/v1livenessresponsebody.d.ts.map +1 -0
- package/models/components/v1livenessresponsebody.js +65 -0
- package/models/components/v1livenessresponsebody.js.map +1 -0
- package/models/errors/errormodel.d.ts +98 -0
- package/models/errors/errormodel.d.ts.map +1 -0
- package/models/errors/errormodel.js +113 -0
- package/models/errors/errormodel.js.map +1 -0
- package/models/errors/httpclienterrors.d.ts +44 -0
- package/models/errors/httpclienterrors.d.ts.map +1 -0
- package/models/errors/httpclienterrors.js +78 -0
- package/models/errors/httpclienterrors.js.map +1 -0
- package/models/errors/index.d.ts +4 -0
- package/models/errors/index.d.ts.map +1 -0
- package/models/errors/index.js +23 -0
- package/models/errors/index.js.map +1 -0
- package/models/errors/sdkerror.d.ts +8 -0
- package/models/errors/sdkerror.d.ts.map +1 -0
- package/models/errors/sdkerror.js +21 -0
- package/models/errors/sdkerror.js.map +1 -0
- package/models/errors/sdkvalidationerror.d.ts +17 -0
- package/models/errors/sdkvalidationerror.d.ts.map +1 -0
- package/models/errors/sdkvalidationerror.js +107 -0
- package/models/errors/sdkvalidationerror.js.map +1 -0
- package/ns/LICENSE +201 -0
- package/ns/README.md +1 -0
- package/package.json +31 -0
- package/sdk/account.d.ts +13 -0
- package/sdk/account.d.ts.map +1 -0
- package/sdk/account.js +26 -0
- package/sdk/account.js.map +1 -0
- package/sdk/index.d.ts +2 -0
- package/sdk/index.d.ts.map +1 -0
- package/sdk/index.js +21 -0
- package/sdk/index.js.map +1 -0
- package/sdk/liveness.d.ts +12 -0
- package/sdk/liveness.d.ts.map +1 -0
- package/sdk/liveness.js +22 -0
- package/sdk/liveness.js.map +1 -0
- package/sdk/sdk.d.ts +10 -0
- package/sdk/sdk.d.ts.map +1 -0
- package/sdk/sdk.js +21 -0
- package/sdk/sdk.js.map +1 -0
- package/src/core.ts +13 -0
- package/src/funcs/accountAccountV1Apps.ts +109 -0
- package/src/funcs/accountAccountV1Badge.ts +109 -0
- package/src/funcs/livenessLiveness.ts +110 -0
- package/src/hooks/hooks.ts +99 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/types.ts +89 -0
- package/src/index.ts +6 -0
- package/src/lib/base64.ts +37 -0
- package/src/lib/config.ts +60 -0
- package/src/lib/dlv.ts +53 -0
- package/src/lib/encodings.ts +449 -0
- package/src/lib/http.ts +323 -0
- package/src/lib/is-plain-object.ts +43 -0
- package/src/lib/matchers.ts +308 -0
- package/src/lib/primitives.ts +40 -0
- package/src/lib/retries.ts +187 -0
- package/src/lib/schemas.ts +74 -0
- package/src/lib/sdks.ts +261 -0
- package/src/lib/security.ts +198 -0
- package/src/lib/url.ts +33 -0
- package/src/models/components/errordetail.ts +58 -0
- package/src/models/components/index.ts +11 -0
- package/src/models/components/security.ts +42 -0
- package/src/models/components/v1accountsappsresponsebody.ts +66 -0
- package/src/models/components/v1app.ts +75 -0
- package/src/models/components/v1badge.ts +92 -0
- package/src/models/components/v1badgesappsresponsebody.ts +71 -0
- package/src/models/components/v1livenessresponsebody.ts +68 -0
- package/src/models/errors/errormodel.ts +174 -0
- package/src/models/errors/httpclienterrors.ts +62 -0
- package/src/models/errors/index.ts +7 -0
- package/src/models/errors/sdkerror.ts +25 -0
- package/src/models/errors/sdkvalidationerror.ts +95 -0
- package/src/sdk/account.ts +25 -0
- package/src/sdk/index.ts +5 -0
- package/src/sdk/liveness.ts +20 -0
- package/src/sdk/sdk.ts +19 -0
- package/src/types/blobs.ts +31 -0
- package/src/types/enums.ts +16 -0
- package/src/types/fp.ts +50 -0
- package/src/types/index.ts +11 -0
- package/src/types/operations.ts +99 -0
- package/src/types/rfcdate.ts +54 -0
- package/types/blobs.d.ts +4 -0
- package/types/blobs.d.ts.map +1 -0
- package/types/blobs.js +52 -0
- package/types/blobs.js.map +1 -0
- package/types/enums.d.ts +12 -0
- package/types/enums.d.ts.map +1 -0
- package/types/enums.js +10 -0
- package/types/enums.js.map +1 -0
- package/types/fp.d.ts +31 -0
- package/types/fp.d.ts.map +1 -0
- package/types/fp.js +37 -0
- package/types/fp.js.map +1 -0
- package/types/index.d.ts +8 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.js +16 -0
- package/types/index.js.map +1 -0
- package/types/operations.d.ts +25 -0
- package/types/operations.d.ts.map +1 -0
- package/types/operations.js +80 -0
- package/types/operations.js.map +1 -0
- package/types/rfcdate.d.ts +21 -0
- package/types/rfcdate.d.ts.map +1 -0
- package/types/rfcdate.js +46 -0
- package/types/rfcdate.js.map +1 -0
package/sdk/liveness.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Liveness = void 0;
|
|
7
|
+
const livenessLiveness_js_1 = require("../funcs/livenessLiveness.js");
|
|
8
|
+
const sdks_js_1 = require("../lib/sdks.js");
|
|
9
|
+
const fp_js_1 = require("../types/fp.js");
|
|
10
|
+
class Liveness extends sdks_js_1.ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* Liveness check
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* This endpoint checks if the service is alive.
|
|
16
|
+
*/
|
|
17
|
+
async liveness(options) {
|
|
18
|
+
return (0, fp_js_1.unwrapAsync)((0, livenessLiveness_js_1.livenessLiveness)(this, options));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.Liveness = Liveness;
|
|
22
|
+
//# sourceMappingURL=liveness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveness.js","sourceRoot":"","sources":["../src/sdk/liveness.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,sEAAgE;AAChE,4CAA2D;AAE3D,0CAA6C;AAE7C,MAAa,QAAS,SAAQ,mBAAS;IACnC;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAwB;QACnC,OAAO,IAAA,mBAAW,EAAC,IAAA,sCAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACxD,CAAC;CACJ;AAVD,4BAUC"}
|
package/sdk/sdk.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ClientSDK } from "../lib/sdks.js";
|
|
2
|
+
import { Account } from "./account.js";
|
|
3
|
+
import { Liveness } from "./liveness.js";
|
|
4
|
+
export declare class SteamSets extends ClientSDK {
|
|
5
|
+
private _account?;
|
|
6
|
+
get account(): Account;
|
|
7
|
+
private _liveness?;
|
|
8
|
+
get liveness(): Liveness;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=sdk.d.ts.map
|
package/sdk/sdk.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../src/sdk/sdk.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,qBAAa,SAAU,SAAQ,SAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,OAAO,CAAC,SAAS,CAAC,CAAW;IAC7B,IAAI,QAAQ,IAAI,QAAQ,CAEvB;CACJ"}
|
package/sdk/sdk.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SteamSets = void 0;
|
|
7
|
+
const sdks_js_1 = require("../lib/sdks.js");
|
|
8
|
+
const account_js_1 = require("./account.js");
|
|
9
|
+
const liveness_js_1 = require("./liveness.js");
|
|
10
|
+
class SteamSets extends sdks_js_1.ClientSDK {
|
|
11
|
+
get account() {
|
|
12
|
+
var _a;
|
|
13
|
+
return ((_a = this._account) !== null && _a !== void 0 ? _a : (this._account = new account_js_1.Account(this.options$)));
|
|
14
|
+
}
|
|
15
|
+
get liveness() {
|
|
16
|
+
var _a;
|
|
17
|
+
return ((_a = this._liveness) !== null && _a !== void 0 ? _a : (this._liveness = new liveness_js_1.Liveness(this.options$)));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.SteamSets = SteamSets;
|
|
21
|
+
//# sourceMappingURL=sdk.js.map
|
package/sdk/sdk.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.js","sourceRoot":"","sources":["../src/sdk/sdk.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,4CAA2C;AAC3C,6CAAuC;AACvC,+CAAyC;AAEzC,MAAa,SAAU,SAAQ,mBAAS;IAEpC,IAAI,OAAO;;QACP,OAAO,OAAC,IAAI,CAAC,QAAQ,oCAAb,IAAI,CAAC,QAAQ,GAAK,IAAI,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC1D,CAAC;IAGD,IAAI,QAAQ;;QACR,OAAO,OAAC,IAAI,CAAC,SAAS,oCAAd,IAAI,CAAC,SAAS,GAAK,IAAI,sBAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC5D,CAAC;CACJ;AAVD,8BAUC"}
|
package/src/core.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ClientSDK } from "./lib/sdks.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A minimal client to use when calling standalone SDK functions. Typically, an
|
|
9
|
+
* instance of this class would be instantiated once at the start of an
|
|
10
|
+
* application and passed around through some dependency injection mechanism to
|
|
11
|
+
* parts of an application that need to make SDK calls.
|
|
12
|
+
*/
|
|
13
|
+
export class SteamSetsCore extends ClientSDK {}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SteamSetsCore } from "../core.js";
|
|
6
|
+
import * as m$ from "../lib/matchers.js";
|
|
7
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
8
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
9
|
+
import { pathToFunc } from "../lib/url.js";
|
|
10
|
+
import * as components from "../models/components/index.js";
|
|
11
|
+
import {
|
|
12
|
+
ConnectionError,
|
|
13
|
+
InvalidRequestError,
|
|
14
|
+
RequestAbortedError,
|
|
15
|
+
RequestTimeoutError,
|
|
16
|
+
UnexpectedClientError,
|
|
17
|
+
} from "../models/errors/httpclienterrors.js";
|
|
18
|
+
import * as errors from "../models/errors/index.js";
|
|
19
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
20
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
|
+
import { Result } from "../types/fp.js";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get Account Apps
|
|
25
|
+
*/
|
|
26
|
+
export async function accountAccountV1Apps(
|
|
27
|
+
client$: SteamSetsCore,
|
|
28
|
+
options?: RequestOptions
|
|
29
|
+
): Promise<
|
|
30
|
+
Result<
|
|
31
|
+
components.V1AccountsAppsResponseBody,
|
|
32
|
+
| errors.ErrorModel
|
|
33
|
+
| SDKError
|
|
34
|
+
| SDKValidationError
|
|
35
|
+
| UnexpectedClientError
|
|
36
|
+
| InvalidRequestError
|
|
37
|
+
| RequestAbortedError
|
|
38
|
+
| RequestTimeoutError
|
|
39
|
+
| ConnectionError
|
|
40
|
+
>
|
|
41
|
+
> {
|
|
42
|
+
const path$ = pathToFunc("/account.v1.AccountService/GetApps")();
|
|
43
|
+
|
|
44
|
+
const headers$ = new Headers({
|
|
45
|
+
Accept: "application/json",
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const security$ = await extractSecurity(client$.options$.security);
|
|
49
|
+
const context = {
|
|
50
|
+
operationID: "account.v1.apps",
|
|
51
|
+
oAuth2Scopes: [],
|
|
52
|
+
securitySource: client$.options$.security,
|
|
53
|
+
};
|
|
54
|
+
const securitySettings$ = resolveGlobalSecurity(security$);
|
|
55
|
+
|
|
56
|
+
const requestRes = client$.createRequest$(
|
|
57
|
+
context,
|
|
58
|
+
{
|
|
59
|
+
security: securitySettings$,
|
|
60
|
+
method: "POST",
|
|
61
|
+
path: path$,
|
|
62
|
+
headers: headers$,
|
|
63
|
+
timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
|
|
64
|
+
},
|
|
65
|
+
options
|
|
66
|
+
);
|
|
67
|
+
if (!requestRes.ok) {
|
|
68
|
+
return requestRes;
|
|
69
|
+
}
|
|
70
|
+
const request$ = requestRes.value;
|
|
71
|
+
|
|
72
|
+
const doResult = await client$.do$(request$, {
|
|
73
|
+
context,
|
|
74
|
+
errorCodes: ["400", "4XX", "500", "5XX"],
|
|
75
|
+
retryConfig: options?.retries || client$.options$.retryConfig,
|
|
76
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
77
|
+
});
|
|
78
|
+
if (!doResult.ok) {
|
|
79
|
+
return doResult;
|
|
80
|
+
}
|
|
81
|
+
const response = doResult.value;
|
|
82
|
+
|
|
83
|
+
const responseFields$ = {
|
|
84
|
+
HttpMeta: { Response: response, Request: request$ },
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const [result$] = await m$.match<
|
|
88
|
+
components.V1AccountsAppsResponseBody,
|
|
89
|
+
| errors.ErrorModel
|
|
90
|
+
| SDKError
|
|
91
|
+
| SDKValidationError
|
|
92
|
+
| UnexpectedClientError
|
|
93
|
+
| InvalidRequestError
|
|
94
|
+
| RequestAbortedError
|
|
95
|
+
| RequestTimeoutError
|
|
96
|
+
| ConnectionError
|
|
97
|
+
>(
|
|
98
|
+
m$.json(200, components.V1AccountsAppsResponseBody$inboundSchema),
|
|
99
|
+
m$.jsonErr([400, 500], errors.ErrorModel$inboundSchema, {
|
|
100
|
+
ctype: "application/problem+json",
|
|
101
|
+
}),
|
|
102
|
+
m$.fail(["4XX", "5XX"])
|
|
103
|
+
)(response, { extraFields: responseFields$ });
|
|
104
|
+
if (!result$.ok) {
|
|
105
|
+
return result$;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return result$;
|
|
109
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SteamSetsCore } from "../core.js";
|
|
6
|
+
import * as m$ from "../lib/matchers.js";
|
|
7
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
8
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
9
|
+
import { pathToFunc } from "../lib/url.js";
|
|
10
|
+
import * as components from "../models/components/index.js";
|
|
11
|
+
import {
|
|
12
|
+
ConnectionError,
|
|
13
|
+
InvalidRequestError,
|
|
14
|
+
RequestAbortedError,
|
|
15
|
+
RequestTimeoutError,
|
|
16
|
+
UnexpectedClientError,
|
|
17
|
+
} from "../models/errors/httpclienterrors.js";
|
|
18
|
+
import * as errors from "../models/errors/index.js";
|
|
19
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
20
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
|
+
import { Result } from "../types/fp.js";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get Account Badges
|
|
25
|
+
*/
|
|
26
|
+
export async function accountAccountV1Badge(
|
|
27
|
+
client$: SteamSetsCore,
|
|
28
|
+
options?: RequestOptions
|
|
29
|
+
): Promise<
|
|
30
|
+
Result<
|
|
31
|
+
components.V1BadgesAppsResponseBody,
|
|
32
|
+
| errors.ErrorModel
|
|
33
|
+
| SDKError
|
|
34
|
+
| SDKValidationError
|
|
35
|
+
| UnexpectedClientError
|
|
36
|
+
| InvalidRequestError
|
|
37
|
+
| RequestAbortedError
|
|
38
|
+
| RequestTimeoutError
|
|
39
|
+
| ConnectionError
|
|
40
|
+
>
|
|
41
|
+
> {
|
|
42
|
+
const path$ = pathToFunc("/account.v1.AccountService/GetBadges")();
|
|
43
|
+
|
|
44
|
+
const headers$ = new Headers({
|
|
45
|
+
Accept: "application/json",
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const security$ = await extractSecurity(client$.options$.security);
|
|
49
|
+
const context = {
|
|
50
|
+
operationID: "account.v1.badge",
|
|
51
|
+
oAuth2Scopes: [],
|
|
52
|
+
securitySource: client$.options$.security,
|
|
53
|
+
};
|
|
54
|
+
const securitySettings$ = resolveGlobalSecurity(security$);
|
|
55
|
+
|
|
56
|
+
const requestRes = client$.createRequest$(
|
|
57
|
+
context,
|
|
58
|
+
{
|
|
59
|
+
security: securitySettings$,
|
|
60
|
+
method: "POST",
|
|
61
|
+
path: path$,
|
|
62
|
+
headers: headers$,
|
|
63
|
+
timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
|
|
64
|
+
},
|
|
65
|
+
options
|
|
66
|
+
);
|
|
67
|
+
if (!requestRes.ok) {
|
|
68
|
+
return requestRes;
|
|
69
|
+
}
|
|
70
|
+
const request$ = requestRes.value;
|
|
71
|
+
|
|
72
|
+
const doResult = await client$.do$(request$, {
|
|
73
|
+
context,
|
|
74
|
+
errorCodes: ["400", "4XX", "500", "5XX"],
|
|
75
|
+
retryConfig: options?.retries || client$.options$.retryConfig,
|
|
76
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
77
|
+
});
|
|
78
|
+
if (!doResult.ok) {
|
|
79
|
+
return doResult;
|
|
80
|
+
}
|
|
81
|
+
const response = doResult.value;
|
|
82
|
+
|
|
83
|
+
const responseFields$ = {
|
|
84
|
+
HttpMeta: { Response: response, Request: request$ },
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const [result$] = await m$.match<
|
|
88
|
+
components.V1BadgesAppsResponseBody,
|
|
89
|
+
| errors.ErrorModel
|
|
90
|
+
| SDKError
|
|
91
|
+
| SDKValidationError
|
|
92
|
+
| UnexpectedClientError
|
|
93
|
+
| InvalidRequestError
|
|
94
|
+
| RequestAbortedError
|
|
95
|
+
| RequestTimeoutError
|
|
96
|
+
| ConnectionError
|
|
97
|
+
>(
|
|
98
|
+
m$.json(200, components.V1BadgesAppsResponseBody$inboundSchema),
|
|
99
|
+
m$.jsonErr([400, 500], errors.ErrorModel$inboundSchema, {
|
|
100
|
+
ctype: "application/problem+json",
|
|
101
|
+
}),
|
|
102
|
+
m$.fail(["4XX", "5XX"])
|
|
103
|
+
)(response, { extraFields: responseFields$ });
|
|
104
|
+
if (!result$.ok) {
|
|
105
|
+
return result$;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return result$;
|
|
109
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SteamSetsCore } from "../core.js";
|
|
6
|
+
import * as m$ from "../lib/matchers.js";
|
|
7
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
8
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
9
|
+
import { pathToFunc } from "../lib/url.js";
|
|
10
|
+
import * as components from "../models/components/index.js";
|
|
11
|
+
import {
|
|
12
|
+
ConnectionError,
|
|
13
|
+
InvalidRequestError,
|
|
14
|
+
RequestAbortedError,
|
|
15
|
+
RequestTimeoutError,
|
|
16
|
+
UnexpectedClientError,
|
|
17
|
+
} from "../models/errors/httpclienterrors.js";
|
|
18
|
+
import * as errors from "../models/errors/index.js";
|
|
19
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
20
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
|
+
import { Result } from "../types/fp.js";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Liveness check
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* This endpoint checks if the service is alive.
|
|
28
|
+
*/
|
|
29
|
+
export async function livenessLiveness(
|
|
30
|
+
client$: SteamSetsCore,
|
|
31
|
+
options?: RequestOptions
|
|
32
|
+
): Promise<
|
|
33
|
+
Result<
|
|
34
|
+
components.V1LivenessResponseBody,
|
|
35
|
+
| errors.ErrorModel
|
|
36
|
+
| SDKError
|
|
37
|
+
| SDKValidationError
|
|
38
|
+
| UnexpectedClientError
|
|
39
|
+
| InvalidRequestError
|
|
40
|
+
| RequestAbortedError
|
|
41
|
+
| RequestTimeoutError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
>
|
|
44
|
+
> {
|
|
45
|
+
const path$ = pathToFunc("/v1/liveness")();
|
|
46
|
+
|
|
47
|
+
const headers$ = new Headers({
|
|
48
|
+
Accept: "application/json",
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const security$ = await extractSecurity(client$.options$.security);
|
|
52
|
+
const context = {
|
|
53
|
+
operationID: "liveness",
|
|
54
|
+
oAuth2Scopes: [],
|
|
55
|
+
securitySource: client$.options$.security,
|
|
56
|
+
};
|
|
57
|
+
const securitySettings$ = resolveGlobalSecurity(security$);
|
|
58
|
+
|
|
59
|
+
const requestRes = client$.createRequest$(
|
|
60
|
+
context,
|
|
61
|
+
{
|
|
62
|
+
security: securitySettings$,
|
|
63
|
+
method: "GET",
|
|
64
|
+
path: path$,
|
|
65
|
+
headers: headers$,
|
|
66
|
+
timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
|
|
67
|
+
},
|
|
68
|
+
options
|
|
69
|
+
);
|
|
70
|
+
if (!requestRes.ok) {
|
|
71
|
+
return requestRes;
|
|
72
|
+
}
|
|
73
|
+
const request$ = requestRes.value;
|
|
74
|
+
|
|
75
|
+
const doResult = await client$.do$(request$, {
|
|
76
|
+
context,
|
|
77
|
+
errorCodes: ["4XX", "500", "5XX"],
|
|
78
|
+
retryConfig: options?.retries || client$.options$.retryConfig,
|
|
79
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
80
|
+
});
|
|
81
|
+
if (!doResult.ok) {
|
|
82
|
+
return doResult;
|
|
83
|
+
}
|
|
84
|
+
const response = doResult.value;
|
|
85
|
+
|
|
86
|
+
const responseFields$ = {
|
|
87
|
+
HttpMeta: { Response: response, Request: request$ },
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const [result$] = await m$.match<
|
|
91
|
+
components.V1LivenessResponseBody,
|
|
92
|
+
| errors.ErrorModel
|
|
93
|
+
| SDKError
|
|
94
|
+
| SDKValidationError
|
|
95
|
+
| UnexpectedClientError
|
|
96
|
+
| InvalidRequestError
|
|
97
|
+
| RequestAbortedError
|
|
98
|
+
| RequestTimeoutError
|
|
99
|
+
| ConnectionError
|
|
100
|
+
>(
|
|
101
|
+
m$.json(200, components.V1LivenessResponseBody$inboundSchema),
|
|
102
|
+
m$.jsonErr(500, errors.ErrorModel$inboundSchema, { ctype: "application/problem+json" }),
|
|
103
|
+
m$.fail(["4XX", "5XX"])
|
|
104
|
+
)(response, { extraFields: responseFields$ });
|
|
105
|
+
if (!result$.ok) {
|
|
106
|
+
return result$;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return result$;
|
|
110
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { RequestInput } from "../lib/http.js";
|
|
6
|
+
import {
|
|
7
|
+
AfterErrorContext,
|
|
8
|
+
AfterErrorHook,
|
|
9
|
+
AfterSuccessContext,
|
|
10
|
+
AfterSuccessHook,
|
|
11
|
+
BeforeRequestContext,
|
|
12
|
+
BeforeRequestHook,
|
|
13
|
+
BeforeCreateRequestHook,
|
|
14
|
+
BeforeCreateRequestContext,
|
|
15
|
+
Hooks,
|
|
16
|
+
SDKInitHook,
|
|
17
|
+
SDKInitOptions,
|
|
18
|
+
} from "./types.js";
|
|
19
|
+
|
|
20
|
+
export class SDKHooks implements Hooks {
|
|
21
|
+
sdkInitHooks: SDKInitHook[] = [];
|
|
22
|
+
beforeCreateRequestHooks: BeforeCreateRequestHook[] = [];
|
|
23
|
+
beforeRequestHooks: BeforeRequestHook[] = [];
|
|
24
|
+
afterSuccessHooks: AfterSuccessHook[] = [];
|
|
25
|
+
afterErrorHooks: AfterErrorHook[] = [];
|
|
26
|
+
|
|
27
|
+
constructor() {}
|
|
28
|
+
|
|
29
|
+
registerSDKInitHook(hook: SDKInitHook) {
|
|
30
|
+
this.sdkInitHooks.push(hook);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) {
|
|
34
|
+
this.beforeCreateRequestHooks.push(hook);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
registerBeforeRequestHook(hook: BeforeRequestHook) {
|
|
38
|
+
this.beforeRequestHooks.push(hook);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
registerAfterSuccessHook(hook: AfterSuccessHook) {
|
|
42
|
+
this.afterSuccessHooks.push(hook);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
registerAfterErrorHook(hook: AfterErrorHook) {
|
|
46
|
+
this.afterErrorHooks.push(hook);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
sdkInit(opts: SDKInitOptions): SDKInitOptions {
|
|
50
|
+
return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
beforeCreateRequest(hookCtx: BeforeCreateRequestContext, input: RequestInput): RequestInput {
|
|
54
|
+
let inp = input;
|
|
55
|
+
|
|
56
|
+
for (const hook of this.beforeCreateRequestHooks) {
|
|
57
|
+
inp = hook.beforeCreateRequest(hookCtx, inp);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return inp;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async beforeRequest(hookCtx: BeforeRequestContext, request: Request): Promise<Request> {
|
|
64
|
+
let req = request;
|
|
65
|
+
|
|
66
|
+
for (const hook of this.beforeRequestHooks) {
|
|
67
|
+
req = await hook.beforeRequest(hookCtx, req);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return req;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async afterSuccess(hookCtx: AfterSuccessContext, response: Response): Promise<Response> {
|
|
74
|
+
let res = response;
|
|
75
|
+
|
|
76
|
+
for (const hook of this.afterSuccessHooks) {
|
|
77
|
+
res = await hook.afterSuccess(hookCtx, res);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return res;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async afterError(
|
|
84
|
+
hookCtx: AfterErrorContext,
|
|
85
|
+
response: Response | null,
|
|
86
|
+
error: unknown
|
|
87
|
+
): Promise<{ response: Response | null; error: unknown }> {
|
|
88
|
+
let res = response;
|
|
89
|
+
let err = error;
|
|
90
|
+
|
|
91
|
+
for (const hook of this.afterErrorHooks) {
|
|
92
|
+
const result = await hook.afterError(hookCtx, res, err);
|
|
93
|
+
res = result.response;
|
|
94
|
+
err = result.error;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return { response: res, error: err };
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { HTTPClient, RequestInput } from "../lib/http.js";
|
|
6
|
+
|
|
7
|
+
export type HookContext = {
|
|
8
|
+
operationID: string;
|
|
9
|
+
oAuth2Scopes?: string[];
|
|
10
|
+
securitySource?: any | (() => Promise<any>);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type Awaitable<T> = T | Promise<T>;
|
|
14
|
+
|
|
15
|
+
export type SDKInitOptions = {
|
|
16
|
+
baseURL: URL | null;
|
|
17
|
+
client: HTTPClient;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type BeforeCreateRequestContext = HookContext & {};
|
|
21
|
+
export type BeforeRequestContext = HookContext & {};
|
|
22
|
+
export type AfterSuccessContext = HookContext & {};
|
|
23
|
+
export type AfterErrorContext = HookContext & {};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* SDKInitHook is called when the SDK is initializing. The
|
|
27
|
+
* hook can return a new baseURL and HTTP client to be used by the SDK.
|
|
28
|
+
*/
|
|
29
|
+
export interface SDKInitHook {
|
|
30
|
+
sdkInit: (opts: SDKInitOptions) => SDKInitOptions;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface BeforeCreateRequestHook {
|
|
34
|
+
/**
|
|
35
|
+
* A hook that is called before the SDK creates a `Request` object. The hook
|
|
36
|
+
* can modify how a request is constructed since certain modifications, like
|
|
37
|
+
* changing the request URL, cannot be done on a request object directly.
|
|
38
|
+
*/
|
|
39
|
+
beforeCreateRequest: (hookCtx: BeforeCreateRequestContext, input: RequestInput) => RequestInput;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface BeforeRequestHook {
|
|
43
|
+
/**
|
|
44
|
+
* A hook that is called before the SDK sends a request. The hook can
|
|
45
|
+
* introduce instrumentation code such as logging, tracing and metrics or
|
|
46
|
+
* replace the request before it is sent or throw an error to stop the
|
|
47
|
+
* request from being sent.
|
|
48
|
+
*/
|
|
49
|
+
beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable<Request>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface AfterSuccessHook {
|
|
53
|
+
/**
|
|
54
|
+
* A hook that is called after the SDK receives a response. The hook can
|
|
55
|
+
* introduce instrumentation code such as logging, tracing and metrics or
|
|
56
|
+
* modify the response before it is handled or throw an error to stop the
|
|
57
|
+
* response from being handled.
|
|
58
|
+
*/
|
|
59
|
+
afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable<Response>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface AfterErrorHook {
|
|
63
|
+
/**
|
|
64
|
+
* A hook that is called after the SDK encounters an error, or a
|
|
65
|
+
* non-successful response. The hook can introduce instrumentation code such
|
|
66
|
+
* as logging, tracing and metrics or modify the response or error values.
|
|
67
|
+
*/
|
|
68
|
+
afterError: (
|
|
69
|
+
hookCtx: AfterErrorContext,
|
|
70
|
+
response: Response | null,
|
|
71
|
+
error: unknown
|
|
72
|
+
) => Awaitable<{
|
|
73
|
+
response: Response | null;
|
|
74
|
+
error: unknown;
|
|
75
|
+
}>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface Hooks {
|
|
79
|
+
/** Registers a hook to be used by the SDK for initialization event. */
|
|
80
|
+
registerSDKInitHook(hook: SDKInitHook): void;
|
|
81
|
+
/** Registers a hook to be used by the SDK for to modify `Request` construction. */
|
|
82
|
+
registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void;
|
|
83
|
+
/** Registers a hook to be used by the SDK for the before request event. */
|
|
84
|
+
registerBeforeRequestHook(hook: BeforeRequestHook): void;
|
|
85
|
+
/** Registers a hook to be used by the SDK for the after success event. */
|
|
86
|
+
registerAfterSuccessHook(hook: AfterSuccessHook): void;
|
|
87
|
+
/** Registers a hook to be used by the SDK for the after error event. */
|
|
88
|
+
registerAfterErrorHook(hook: AfterErrorHook): void;
|
|
89
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export function bytesToBase64(u8arr: Uint8Array): string {
|
|
8
|
+
return btoa(String.fromCodePoint(...u8arr));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function bytesFromBase64(encoded: string): Uint8Array {
|
|
12
|
+
return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function stringToBytes(str: string): Uint8Array {
|
|
16
|
+
return new TextEncoder().encode(str);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function stringFromBytes(u8arr: Uint8Array): string {
|
|
20
|
+
return new TextDecoder().decode(u8arr);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function stringToBase64(str: string): string {
|
|
24
|
+
return bytesToBase64(stringToBytes(str));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function stringFromBase64(b64str: string): string {
|
|
28
|
+
return stringFromBytes(bytesFromBase64(b64str));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const zodOutbound = z
|
|
32
|
+
.instanceof(Uint8Array)
|
|
33
|
+
.or(z.string().transform(stringToBytes));
|
|
34
|
+
|
|
35
|
+
export const zodInbound = z
|
|
36
|
+
.instanceof(Uint8Array)
|
|
37
|
+
.or(z.string().transform(bytesFromBase64));
|