@steamsets/client-ts 0.34.1 → 0.34.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/funcs/statsSubscribe.d.ts +20 -0
- package/funcs/statsSubscribe.d.ts.map +1 -0
- package/funcs/statsSubscribe.js +128 -0
- package/funcs/statsSubscribe.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/eventstatsheartbeatdata.d.ts +10 -0
- package/models/components/eventstatsheartbeatdata.d.ts.map +1 -0
- package/models/components/eventstatsheartbeatdata.js +50 -0
- package/models/components/eventstatsheartbeatdata.js.map +1 -0
- package/models/components/eventstatsupdateddata.d.ts +13 -0
- package/models/components/eventstatsupdateddata.d.ts.map +1 -0
- package/models/components/eventstatsupdateddata.js +51 -0
- package/models/components/eventstatsupdateddata.js.map +1 -0
- package/models/components/index.d.ts +2 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -0
- package/models/components/index.js.map +1 -1
- package/models/components/v1appbadge.d.ts +12 -0
- package/models/components/v1appbadge.d.ts.map +1 -1
- package/models/components/v1appbadge.js +3 -0
- package/models/components/v1appbadge.js.map +1 -1
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/statssubscribe.d.ts +81 -0
- package/models/operations/statssubscribe.d.ts.map +1 -0
- package/models/operations/statssubscribe.js +140 -0
- package/models/operations/statssubscribe.js.map +1 -0
- package/package.json +1 -1
- package/sdk/stats.d.ts +8 -0
- package/sdk/stats.d.ts.map +1 -1
- package/sdk/stats.js +10 -1
- package/sdk/stats.js.map +1 -1
- package/src/funcs/statsSubscribe.ts +168 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/eventstatsheartbeatdata.ts +31 -0
- package/src/models/components/eventstatsupdateddata.ts +33 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/v1appbadge.ts +15 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/statssubscribe.ts +228 -0
- package/src/sdk/stats.ts +18 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.StatsSubscribeResponse$inboundSchema = exports.StatsSubscribeServerSentEvents$inboundSchema = exports.EventStatsHeartbeat$inboundSchema = exports.EventStatsSnapshot$inboundSchema = exports.EventStatsUpdated$inboundSchema = void 0;
|
|
40
|
+
exports.eventStatsUpdatedFromJSON = eventStatsUpdatedFromJSON;
|
|
41
|
+
exports.eventStatsSnapshotFromJSON = eventStatsSnapshotFromJSON;
|
|
42
|
+
exports.eventStatsHeartbeatFromJSON = eventStatsHeartbeatFromJSON;
|
|
43
|
+
exports.statsSubscribeServerSentEventsFromJSON = statsSubscribeServerSentEventsFromJSON;
|
|
44
|
+
exports.statsSubscribeResponseFromJSON = statsSubscribeResponseFromJSON;
|
|
45
|
+
const z = __importStar(require("zod/v3"));
|
|
46
|
+
const event_streams_js_1 = require("../../lib/event-streams.js");
|
|
47
|
+
const primitives_js_1 = require("../../lib/primitives.js");
|
|
48
|
+
const schemas_js_1 = require("../../lib/schemas.js");
|
|
49
|
+
const components = __importStar(require("../components/index.js"));
|
|
50
|
+
/** @internal */
|
|
51
|
+
exports.EventStatsUpdated$inboundSchema = z.object({
|
|
52
|
+
data: z.string().transform((v, ctx) => {
|
|
53
|
+
try {
|
|
54
|
+
return JSON.parse(v);
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
58
|
+
return z.NEVER;
|
|
59
|
+
}
|
|
60
|
+
}).pipe(components.EventStatsUpdatedData$inboundSchema),
|
|
61
|
+
event: z.literal("stats-updated"),
|
|
62
|
+
id: z.string().optional(),
|
|
63
|
+
retry: z.number().int().optional(),
|
|
64
|
+
});
|
|
65
|
+
function eventStatsUpdatedFromJSON(jsonString) {
|
|
66
|
+
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EventStatsUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventStatsUpdated' from JSON`);
|
|
67
|
+
}
|
|
68
|
+
/** @internal */
|
|
69
|
+
exports.EventStatsSnapshot$inboundSchema = z.object({
|
|
70
|
+
data: z.string().transform((v, ctx) => {
|
|
71
|
+
try {
|
|
72
|
+
return JSON.parse(v);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
76
|
+
return z.NEVER;
|
|
77
|
+
}
|
|
78
|
+
}).pipe(components.V1Stats$inboundSchema),
|
|
79
|
+
event: z.literal("stats-snapshot"),
|
|
80
|
+
id: z.string().optional(),
|
|
81
|
+
retry: z.number().int().optional(),
|
|
82
|
+
});
|
|
83
|
+
function eventStatsSnapshotFromJSON(jsonString) {
|
|
84
|
+
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EventStatsSnapshot$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventStatsSnapshot' from JSON`);
|
|
85
|
+
}
|
|
86
|
+
/** @internal */
|
|
87
|
+
exports.EventStatsHeartbeat$inboundSchema = z.object({
|
|
88
|
+
data: z.string().transform((v, ctx) => {
|
|
89
|
+
try {
|
|
90
|
+
return JSON.parse(v);
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
ctx.addIssue({ code: "custom", message: `malformed json: ${err}` });
|
|
94
|
+
return z.NEVER;
|
|
95
|
+
}
|
|
96
|
+
}).pipe(components.EventStatsHeartbeatData$inboundSchema),
|
|
97
|
+
event: z.literal("stats-heartbeat"),
|
|
98
|
+
id: z.string().optional(),
|
|
99
|
+
retry: z.number().int().optional(),
|
|
100
|
+
});
|
|
101
|
+
function eventStatsHeartbeatFromJSON(jsonString) {
|
|
102
|
+
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.EventStatsHeartbeat$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EventStatsHeartbeat' from JSON`);
|
|
103
|
+
}
|
|
104
|
+
/** @internal */
|
|
105
|
+
exports.StatsSubscribeServerSentEvents$inboundSchema = z.union([
|
|
106
|
+
z.lazy(() => exports.EventStatsHeartbeat$inboundSchema),
|
|
107
|
+
z.lazy(() => exports.EventStatsSnapshot$inboundSchema),
|
|
108
|
+
z.lazy(() => exports.EventStatsUpdated$inboundSchema),
|
|
109
|
+
]);
|
|
110
|
+
function statsSubscribeServerSentEventsFromJSON(jsonString) {
|
|
111
|
+
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.StatsSubscribeServerSentEvents$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StatsSubscribeServerSentEvents' from JSON`);
|
|
112
|
+
}
|
|
113
|
+
/** @internal */
|
|
114
|
+
exports.StatsSubscribeResponse$inboundSchema = z.object({
|
|
115
|
+
HttpMeta: components.HTTPMetadata$inboundSchema,
|
|
116
|
+
"Server Sent Events": z.instanceof((ReadableStream))
|
|
117
|
+
.transform(stream => {
|
|
118
|
+
return new event_streams_js_1.EventStream(stream, rawEvent => {
|
|
119
|
+
return {
|
|
120
|
+
done: false,
|
|
121
|
+
value: z.union([
|
|
122
|
+
z.lazy(() => exports.EventStatsHeartbeat$inboundSchema),
|
|
123
|
+
z.lazy(() => exports.EventStatsSnapshot$inboundSchema),
|
|
124
|
+
z.lazy(() => exports.EventStatsUpdated$inboundSchema),
|
|
125
|
+
]).parse(rawEvent),
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
}).optional(),
|
|
129
|
+
ErrorModel: components.ErrorModel$inboundSchema.optional(),
|
|
130
|
+
}).transform((v) => {
|
|
131
|
+
return (0, primitives_js_1.remap)(v, {
|
|
132
|
+
"HttpMeta": "httpMeta",
|
|
133
|
+
"Server Sent Events": "serverSentEvents",
|
|
134
|
+
"ErrorModel": "errorModel",
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
function statsSubscribeResponseFromJSON(jsonString) {
|
|
138
|
+
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.StatsSubscribeResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StatsSubscribeResponse' from JSON`);
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=statssubscribe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statssubscribe.js","sourceRoot":"","sources":["../../src/models/operations/statssubscribe.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGH,8DAQC;AAqBD,gEAQC;AAqBD,kEAQC;AAaD,wFAQC;AA+BD,wEAQC;AA/ND,0CAA4B;AAC5B,iEAAyD;AACzD,2DAA0D;AAC1D,qDAAiD;AAEjD,mEAAqD;AAyErD,gBAAgB;AACH,QAAA,+BAA+B,GAIxC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;QACpC,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,GAAG,EAAE,EAAE,CAAC,CAAC;YACpE,OAAO,CAAC,CAAC,KAAK,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,mCAAmC,CAAC;IACvD,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;IACjC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAEH,SAAgB,yBAAyB,CACvC,UAAkB;IAElB,OAAO,IAAA,sBAAS,E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@
|
|
|
1
|
+
import { SubscribeAcceptEnum } from "../funcs/statsSubscribe.js";
|
|
1
2
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
3
|
import * as operations from "../models/operations/index.js";
|
|
4
|
+
export { SubscribeAcceptEnum } from "../funcs/statsSubscribe.js";
|
|
3
5
|
export declare class Stats extends ClientSDK {
|
|
4
6
|
/**
|
|
5
7
|
* Get platform statistics
|
|
6
8
|
*/
|
|
7
9
|
get(options?: RequestOptions): Promise<operations.StatsGetStatsResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Server-sent-events stream of platform stats. Emits a snapshot, then deltas as the queues commit them.
|
|
12
|
+
*/
|
|
13
|
+
subscribe(options?: RequestOptions & {
|
|
14
|
+
acceptHeaderOverride?: SubscribeAcceptEnum;
|
|
15
|
+
}): Promise<operations.StatsSubscribeResponse>;
|
|
8
16
|
}
|
|
9
17
|
//# sourceMappingURL=stats.d.ts.map
|
package/sdk/stats.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../src/sdk/stats.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,qBAAa,KAAM,SAAQ,SAAS;IAClC;;OAEG;IACG,GAAG,CACP,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../src/sdk/stats.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,qBAAa,KAAM,SAAQ,SAAS;IAClC;;OAEG;IACG,GAAG,CACP,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC;IAO5C;;OAEG;IACG,SAAS,CACb,OAAO,CAAC,EAAE,cAAc,GAAG;QAAE,oBAAoB,CAAC,EAAE,mBAAmB,CAAA;KAAE,GACxE,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC;CAM9C"}
|
package/sdk/stats.js
CHANGED
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Stats = void 0;
|
|
6
|
+
exports.Stats = exports.SubscribeAcceptEnum = void 0;
|
|
7
7
|
const statsGet_js_1 = require("../funcs/statsGet.js");
|
|
8
|
+
const statsSubscribe_js_1 = require("../funcs/statsSubscribe.js");
|
|
8
9
|
const sdks_js_1 = require("../lib/sdks.js");
|
|
9
10
|
const fp_js_1 = require("../types/fp.js");
|
|
11
|
+
var statsSubscribe_js_2 = require("../funcs/statsSubscribe.js");
|
|
12
|
+
Object.defineProperty(exports, "SubscribeAcceptEnum", { enumerable: true, get: function () { return statsSubscribe_js_2.SubscribeAcceptEnum; } });
|
|
10
13
|
class Stats extends sdks_js_1.ClientSDK {
|
|
11
14
|
/**
|
|
12
15
|
* Get platform statistics
|
|
@@ -14,6 +17,12 @@ class Stats extends sdks_js_1.ClientSDK {
|
|
|
14
17
|
async get(options) {
|
|
15
18
|
return (0, fp_js_1.unwrapAsync)((0, statsGet_js_1.statsGet)(this, options));
|
|
16
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Server-sent-events stream of platform stats. Emits a snapshot, then deltas as the queues commit them.
|
|
22
|
+
*/
|
|
23
|
+
async subscribe(options) {
|
|
24
|
+
return (0, fp_js_1.unwrapAsync)((0, statsSubscribe_js_1.statsSubscribe)(this, options));
|
|
25
|
+
}
|
|
17
26
|
}
|
|
18
27
|
exports.Stats = Stats;
|
|
19
28
|
//# sourceMappingURL=stats.js.map
|
package/sdk/stats.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../src/sdk/stats.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,sDAAgD;AAChD,4CAA2D;AAE3D,0CAA6C;AAE7C,MAAa,KAAM,SAAQ,mBAAS;IAClC;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,sBAAQ,EACzB,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../src/sdk/stats.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,sDAAgD;AAChD,kEAGoC;AACpC,4CAA2D;AAE3D,0CAA6C;AAE7C,gEAAiE;AAAxD,wHAAA,mBAAmB,OAAA;AAE5B,MAAa,KAAM,SAAQ,mBAAS;IAClC;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,sBAAQ,EACzB,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CACb,OAAyE;QAEzE,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AAxBD,sBAwBC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SteamSetsCore } from "../core.js";
|
|
6
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../models/errors/httpclienterrors.js";
|
|
19
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
20
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
|
+
import { SteamSetsError } from "../models/errors/steamsetserror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
export enum SubscribeAcceptEnum {
|
|
27
|
+
applicationProblemPlusJson = "application/problem+json",
|
|
28
|
+
textEventStream = "text/event-stream",
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Server-sent-events stream of platform stats. Emits a snapshot, then deltas as the queues commit them.
|
|
33
|
+
*/
|
|
34
|
+
export function statsSubscribe(
|
|
35
|
+
client: SteamSetsCore,
|
|
36
|
+
options?: RequestOptions & { acceptHeaderOverride?: SubscribeAcceptEnum },
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.StatsSubscribeResponse,
|
|
40
|
+
| SteamSetsError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
options,
|
|
53
|
+
));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function $do(
|
|
57
|
+
client: SteamSetsCore,
|
|
58
|
+
options?: RequestOptions & { acceptHeaderOverride?: SubscribeAcceptEnum },
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
operations.StatsSubscribeResponse,
|
|
63
|
+
| SteamSetsError
|
|
64
|
+
| ResponseValidationError
|
|
65
|
+
| ConnectionError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| InvalidRequestError
|
|
69
|
+
| UnexpectedClientError
|
|
70
|
+
| SDKValidationError
|
|
71
|
+
>,
|
|
72
|
+
APICall,
|
|
73
|
+
]
|
|
74
|
+
> {
|
|
75
|
+
const path = pathToFunc("/v1/stats.subscribe")();
|
|
76
|
+
|
|
77
|
+
const headers = new Headers(compactMap({
|
|
78
|
+
Accept: options?.acceptHeaderOverride
|
|
79
|
+
|| "application/problem+json;q=1, text/event-stream;q=0",
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
83
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
84
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
85
|
+
|
|
86
|
+
const context = {
|
|
87
|
+
options: client._options,
|
|
88
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
89
|
+
operationID: "stats.subscribe",
|
|
90
|
+
oAuth2Scopes: null,
|
|
91
|
+
|
|
92
|
+
resolvedSecurity: requestSecurity,
|
|
93
|
+
|
|
94
|
+
securitySource: client._options.token,
|
|
95
|
+
retryConfig: options?.retries
|
|
96
|
+
|| client._options.retryConfig
|
|
97
|
+
|| {
|
|
98
|
+
strategy: "backoff",
|
|
99
|
+
backoff: {
|
|
100
|
+
initialInterval: 500,
|
|
101
|
+
maxInterval: 5000,
|
|
102
|
+
exponent: 1.5,
|
|
103
|
+
maxElapsedTime: 60000,
|
|
104
|
+
},
|
|
105
|
+
retryConnectionErrors: true,
|
|
106
|
+
}
|
|
107
|
+
|| { strategy: "none" },
|
|
108
|
+
retryCodes: options?.retryCodes || ["501", "502", "503", "504"],
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const requestRes = client._createRequest(context, {
|
|
112
|
+
security: requestSecurity,
|
|
113
|
+
method: "GET",
|
|
114
|
+
baseURL: options?.serverURL,
|
|
115
|
+
path: path,
|
|
116
|
+
headers: headers,
|
|
117
|
+
uaHeader: "x-speakeasy-user-agent",
|
|
118
|
+
userAgent: client._options.userAgent,
|
|
119
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
120
|
+
}, options);
|
|
121
|
+
if (!requestRes.ok) {
|
|
122
|
+
return [requestRes, { status: "invalid" }];
|
|
123
|
+
}
|
|
124
|
+
const req = requestRes.value;
|
|
125
|
+
|
|
126
|
+
const doResult = await client._do(req, {
|
|
127
|
+
context,
|
|
128
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
129
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
130
|
+
retryConfig: context.retryConfig,
|
|
131
|
+
retryCodes: context.retryCodes,
|
|
132
|
+
});
|
|
133
|
+
if (!doResult.ok) {
|
|
134
|
+
return [doResult, { status: "request-error", request: req }];
|
|
135
|
+
}
|
|
136
|
+
const response = doResult.value;
|
|
137
|
+
|
|
138
|
+
const responseFields = {
|
|
139
|
+
HttpMeta: { Response: response, Request: req },
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const [result] = await M.match<
|
|
143
|
+
operations.StatsSubscribeResponse,
|
|
144
|
+
| SteamSetsError
|
|
145
|
+
| ResponseValidationError
|
|
146
|
+
| ConnectionError
|
|
147
|
+
| RequestAbortedError
|
|
148
|
+
| RequestTimeoutError
|
|
149
|
+
| InvalidRequestError
|
|
150
|
+
| UnexpectedClientError
|
|
151
|
+
| SDKValidationError
|
|
152
|
+
>(
|
|
153
|
+
M.sse(200, operations.StatsSubscribeResponse$inboundSchema, {
|
|
154
|
+
key: "Server Sent Events",
|
|
155
|
+
}),
|
|
156
|
+
M.fail("4XX"),
|
|
157
|
+
M.fail("5XX"),
|
|
158
|
+
M.json("default", operations.StatsSubscribeResponse$inboundSchema, {
|
|
159
|
+
ctype: "application/problem+json",
|
|
160
|
+
key: "ErrorModel",
|
|
161
|
+
}),
|
|
162
|
+
)(response, req, { extraFields: responseFields });
|
|
163
|
+
if (!result.ok) {
|
|
164
|
+
return [result, { status: "complete", request: req, response }];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -59,8 +59,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
59
59
|
export const SDK_METADATA = {
|
|
60
60
|
language: "typescript",
|
|
61
61
|
openapiDocVersion: "1.0.0",
|
|
62
|
-
sdkVersion: "0.34.
|
|
63
|
-
genVersion: "2.881.
|
|
62
|
+
sdkVersion: "0.34.3",
|
|
63
|
+
genVersion: "2.881.17",
|
|
64
64
|
userAgent:
|
|
65
|
-
"speakeasy-sdk/typescript 0.34.
|
|
65
|
+
"speakeasy-sdk/typescript 0.34.3 2.881.17 1.0.0 @steamsets/client-ts",
|
|
66
66
|
} as const;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type EventStatsHeartbeatData = {
|
|
11
|
+
heartbeat: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const EventStatsHeartbeatData$inboundSchema: z.ZodType<
|
|
16
|
+
EventStatsHeartbeatData,
|
|
17
|
+
z.ZodTypeDef,
|
|
18
|
+
unknown
|
|
19
|
+
> = z.object({
|
|
20
|
+
heartbeat: z.number().int(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export function eventStatsHeartbeatDataFromJSON(
|
|
24
|
+
jsonString: string,
|
|
25
|
+
): SafeParseResult<EventStatsHeartbeatData, SDKValidationError> {
|
|
26
|
+
return safeParse(
|
|
27
|
+
jsonString,
|
|
28
|
+
(x) => EventStatsHeartbeatData$inboundSchema.parse(JSON.parse(x)),
|
|
29
|
+
`Failed to parse 'EventStatsHeartbeatData' from JSON`,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type EventStatsUpdatedData = {
|
|
11
|
+
date: string;
|
|
12
|
+
deltas: { [k: string]: number };
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const EventStatsUpdatedData$inboundSchema: z.ZodType<
|
|
17
|
+
EventStatsUpdatedData,
|
|
18
|
+
z.ZodTypeDef,
|
|
19
|
+
unknown
|
|
20
|
+
> = z.object({
|
|
21
|
+
date: z.string(),
|
|
22
|
+
deltas: z.record(z.number().int()),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export function eventStatsUpdatedDataFromJSON(
|
|
26
|
+
jsonString: string,
|
|
27
|
+
): SafeParseResult<EventStatsUpdatedData, SDKValidationError> {
|
|
28
|
+
return safeParse(
|
|
29
|
+
jsonString,
|
|
30
|
+
(x) => EventStatsUpdatedData$inboundSchema.parse(JSON.parse(x)),
|
|
31
|
+
`Failed to parse 'EventStatsUpdatedData' from JSON`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -42,6 +42,8 @@ export * from "./developerappanalyticstimeseriespoint.js";
|
|
|
42
42
|
export * from "./errordetail.js";
|
|
43
43
|
export * from "./errormodel.js";
|
|
44
44
|
export * from "./eventmarketpricetickdata.js";
|
|
45
|
+
export * from "./eventstatsheartbeatdata.js";
|
|
46
|
+
export * from "./eventstatsupdateddata.js";
|
|
45
47
|
export * from "./findownersrequestbody.js";
|
|
46
48
|
export * from "./findownersresponsebody.js";
|
|
47
49
|
export * from "./friendpath.js";
|
|
@@ -26,13 +26,25 @@ export type V1AppBadge = {
|
|
|
26
26
|
* The XP the badge gives per level
|
|
27
27
|
*/
|
|
28
28
|
baseXp: number;
|
|
29
|
+
/**
|
|
30
|
+
* Total trading cards Steam defines for this app (per side; foil and normal share the same count)
|
|
31
|
+
*/
|
|
32
|
+
cardCount: number;
|
|
29
33
|
firstCompletion: Date | null;
|
|
30
34
|
highestLevel: number;
|
|
31
35
|
isEvent: boolean;
|
|
32
36
|
isFoil: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the cards needed for this badge are non-marketable on Steam (cannot be bought/sold)
|
|
39
|
+
*/
|
|
40
|
+
isNmc: boolean;
|
|
33
41
|
isSale: boolean;
|
|
34
42
|
lastCompletion: Date | null;
|
|
35
43
|
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* Whether none of the cards for this badge currently have a market listing
|
|
46
|
+
*/
|
|
47
|
+
noListing: boolean;
|
|
36
48
|
/**
|
|
37
49
|
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
38
50
|
*/
|
|
@@ -55,17 +67,20 @@ export const V1AppBadge$inboundSchema: z.ZodType<
|
|
|
55
67
|
badgeImage: z.string(),
|
|
56
68
|
baseLevel: z.number().int(),
|
|
57
69
|
baseXp: z.number().int(),
|
|
70
|
+
cardCount: z.number().int(),
|
|
58
71
|
firstCompletion: z.nullable(
|
|
59
72
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
60
73
|
),
|
|
61
74
|
highestLevel: z.number().int(),
|
|
62
75
|
isEvent: z.boolean(),
|
|
63
76
|
isFoil: z.boolean(),
|
|
77
|
+
isNmc: z.boolean(),
|
|
64
78
|
isSale: z.boolean(),
|
|
65
79
|
lastCompletion: z.nullable(
|
|
66
80
|
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
67
81
|
),
|
|
68
82
|
name: z.string(),
|
|
83
|
+
noListing: z.boolean(),
|
|
69
84
|
price: z.number().int(),
|
|
70
85
|
scarcity: z.number().int(),
|
|
71
86
|
steamId: z.number().int(),
|
|
@@ -97,5 +97,6 @@ export * from "./maintenancelist.js";
|
|
|
97
97
|
export * from "./searchgettrending.js";
|
|
98
98
|
export * from "./staffliststaff.js";
|
|
99
99
|
export * from "./statsgetstats.js";
|
|
100
|
+
export * from "./statssubscribe.js";
|
|
100
101
|
export * from "./streamglobalfeed.js";
|
|
101
102
|
export * from "./trackevent.js";
|