@djvlc/openapi-user-client 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -20,286 +20,2339 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- UserApiClient: () => UserApiClient,
23
+ AbortError: () => import_openapi_client_core2.AbortError,
24
+ ActionApi: () => ActionApi,
25
+ ActionContextFromJSON: () => ActionContextFromJSON,
26
+ ActionContextFromJSONTyped: () => ActionContextFromJSONTyped,
27
+ ActionContextToJSON: () => ActionContextToJSON,
28
+ ActionContextToJSONTyped: () => ActionContextToJSONTyped,
29
+ ActionExecuteRequestFromJSON: () => ActionExecuteRequestFromJSON,
30
+ ActionExecuteRequestFromJSONTyped: () => ActionExecuteRequestFromJSONTyped,
31
+ ActionExecuteRequestToJSON: () => ActionExecuteRequestToJSON,
32
+ ActionExecuteRequestToJSONTyped: () => ActionExecuteRequestToJSONTyped,
33
+ ActionExecuteResponseFromJSON: () => ActionExecuteResponseFromJSON,
34
+ ActionExecuteResponseFromJSONTyped: () => ActionExecuteResponseFromJSONTyped,
35
+ ActionExecuteResponseToJSON: () => ActionExecuteResponseToJSON,
36
+ ActionExecuteResponseToJSONTyped: () => ActionExecuteResponseToJSONTyped,
37
+ ActivityApi: () => ActivityApi,
38
+ ActivityStateActivityInfoFromJSON: () => ActivityStateActivityInfoFromJSON,
39
+ ActivityStateActivityInfoFromJSONTyped: () => ActivityStateActivityInfoFromJSONTyped,
40
+ ActivityStateActivityInfoToJSON: () => ActivityStateActivityInfoToJSON,
41
+ ActivityStateActivityInfoToJSONTyped: () => ActivityStateActivityInfoToJSONTyped,
42
+ ActivityStateFromJSON: () => ActivityStateFromJSON,
43
+ ActivityStateFromJSONTyped: () => ActivityStateFromJSONTyped,
44
+ ActivityStateResponseFromJSON: () => ActivityStateResponseFromJSON,
45
+ ActivityStateResponseFromJSONTyped: () => ActivityStateResponseFromJSONTyped,
46
+ ActivityStateResponseToJSON: () => ActivityStateResponseToJSON,
47
+ ActivityStateResponseToJSONTyped: () => ActivityStateResponseToJSONTyped,
48
+ ActivityStateStatusEnum: () => ActivityStateStatusEnum,
49
+ ActivityStateToJSON: () => ActivityStateToJSON,
50
+ ActivityStateToJSONTyped: () => ActivityStateToJSONTyped,
51
+ BaseResponseVoFromJSON: () => BaseResponseVoFromJSON,
52
+ BaseResponseVoFromJSONTyped: () => BaseResponseVoFromJSONTyped,
53
+ BaseResponseVoToJSON: () => BaseResponseVoToJSON,
54
+ BaseResponseVoToJSONTyped: () => BaseResponseVoToJSONTyped,
55
+ BlockedComponentFromJSON: () => BlockedComponentFromJSON,
56
+ BlockedComponentFromJSONTyped: () => BlockedComponentFromJSONTyped,
57
+ BlockedComponentToJSON: () => BlockedComponentToJSON,
58
+ BlockedComponentToJSONTyped: () => BlockedComponentToJSONTyped,
59
+ Configuration: () => import_openapi_client_core2.Configuration,
60
+ DataApi: () => DataApi,
61
+ DataQueryContextFromJSON: () => DataQueryContextFromJSON,
62
+ DataQueryContextFromJSONTyped: () => DataQueryContextFromJSONTyped,
63
+ DataQueryContextToJSON: () => DataQueryContextToJSON,
64
+ DataQueryContextToJSONTyped: () => DataQueryContextToJSONTyped,
65
+ DataQueryRequestFromJSON: () => DataQueryRequestFromJSON,
66
+ DataQueryRequestFromJSONTyped: () => DataQueryRequestFromJSONTyped,
67
+ DataQueryRequestToJSON: () => DataQueryRequestToJSON,
68
+ DataQueryRequestToJSONTyped: () => DataQueryRequestToJSONTyped,
69
+ DataQueryResponseFromJSON: () => DataQueryResponseFromJSON,
70
+ DataQueryResponseFromJSONTyped: () => DataQueryResponseFromJSONTyped,
71
+ DataQueryResponseToJSON: () => DataQueryResponseToJSON,
72
+ DataQueryResponseToJSONTyped: () => DataQueryResponseToJSONTyped,
73
+ DjvApiError: () => import_openapi_client_core2.DjvApiError,
74
+ ErrorDetailFromJSON: () => ErrorDetailFromJSON,
75
+ ErrorDetailFromJSONTyped: () => ErrorDetailFromJSONTyped,
76
+ ErrorDetailToJSON: () => ErrorDetailToJSON,
77
+ ErrorDetailToJSONTyped: () => ErrorDetailToJSONTyped,
78
+ ErrorResponseVoFromJSON: () => ErrorResponseVoFromJSON,
79
+ ErrorResponseVoFromJSONTyped: () => ErrorResponseVoFromJSONTyped,
80
+ ErrorResponseVoToJSON: () => ErrorResponseVoToJSON,
81
+ ErrorResponseVoToJSONTyped: () => ErrorResponseVoToJSONTyped,
82
+ ExecuteActionBatch200ResponseFromJSON: () => ExecuteActionBatch200ResponseFromJSON,
83
+ ExecuteActionBatch200ResponseFromJSONTyped: () => ExecuteActionBatch200ResponseFromJSONTyped,
84
+ ExecuteActionBatch200ResponseToJSON: () => ExecuteActionBatch200ResponseToJSON,
85
+ ExecuteActionBatch200ResponseToJSONTyped: () => ExecuteActionBatch200ResponseToJSONTyped,
86
+ ExecuteActionBatchRequestFromJSON: () => ExecuteActionBatchRequestFromJSON,
87
+ ExecuteActionBatchRequestFromJSONTyped: () => ExecuteActionBatchRequestFromJSONTyped,
88
+ ExecuteActionBatchRequestToJSON: () => ExecuteActionBatchRequestToJSON,
89
+ ExecuteActionBatchRequestToJSONTyped: () => ExecuteActionBatchRequestToJSONTyped,
90
+ GetActivityStateBatch200ResponseFromJSON: () => GetActivityStateBatch200ResponseFromJSON,
91
+ GetActivityStateBatch200ResponseFromJSONTyped: () => GetActivityStateBatch200ResponseFromJSONTyped,
92
+ GetActivityStateBatch200ResponseToJSON: () => GetActivityStateBatch200ResponseToJSON,
93
+ GetActivityStateBatch200ResponseToJSONTyped: () => GetActivityStateBatch200ResponseToJSONTyped,
94
+ GetActivityStateBatchRequestFromJSON: () => GetActivityStateBatchRequestFromJSON,
95
+ GetActivityStateBatchRequestFromJSONTyped: () => GetActivityStateBatchRequestFromJSONTyped,
96
+ GetActivityStateBatchRequestToJSON: () => GetActivityStateBatchRequestToJSON,
97
+ GetActivityStateBatchRequestToJSONTyped: () => GetActivityStateBatchRequestToJSONTyped,
98
+ HealthApi: () => HealthApi,
99
+ HealthResponseChecksValueFromJSON: () => HealthResponseChecksValueFromJSON,
100
+ HealthResponseChecksValueFromJSONTyped: () => HealthResponseChecksValueFromJSONTyped,
101
+ HealthResponseChecksValueToJSON: () => HealthResponseChecksValueToJSON,
102
+ HealthResponseChecksValueToJSONTyped: () => HealthResponseChecksValueToJSONTyped,
103
+ HealthResponseFromJSON: () => HealthResponseFromJSON,
104
+ HealthResponseFromJSONTyped: () => HealthResponseFromJSONTyped,
105
+ HealthResponseStatusEnum: () => HealthResponseStatusEnum,
106
+ HealthResponseToJSON: () => HealthResponseToJSON,
107
+ HealthResponseToJSONTyped: () => HealthResponseToJSONTyped,
108
+ ManifestItemFromJSON: () => ManifestItemFromJSON,
109
+ ManifestItemFromJSONTyped: () => ManifestItemFromJSONTyped,
110
+ ManifestItemToJSON: () => ManifestItemToJSON,
111
+ ManifestItemToJSONTyped: () => ManifestItemToJSONTyped,
112
+ NetworkError: () => import_openapi_client_core2.NetworkError,
113
+ PageApi: () => PageApi,
114
+ PageManifestFromJSON: () => PageManifestFromJSON,
115
+ PageManifestFromJSONTyped: () => PageManifestFromJSONTyped,
116
+ PageManifestToJSON: () => PageManifestToJSON,
117
+ PageManifestToJSONTyped: () => PageManifestToJSONTyped,
118
+ PageResolveResponseFromJSON: () => PageResolveResponseFromJSON,
119
+ PageResolveResponseFromJSONTyped: () => PageResolveResponseFromJSONTyped,
120
+ PageResolveResponseToJSON: () => PageResolveResponseToJSON,
121
+ PageResolveResponseToJSONTyped: () => PageResolveResponseToJSONTyped,
122
+ PageResolveResultFromJSON: () => PageResolveResultFromJSON,
123
+ PageResolveResultFromJSONTyped: () => PageResolveResultFromJSONTyped,
124
+ PageResolveResultToJSON: () => PageResolveResultToJSON,
125
+ PageResolveResultToJSONTyped: () => PageResolveResultToJSONTyped,
126
+ QueryDataBatch200ResponseFromJSON: () => QueryDataBatch200ResponseFromJSON,
127
+ QueryDataBatch200ResponseFromJSONTyped: () => QueryDataBatch200ResponseFromJSONTyped,
128
+ QueryDataBatch200ResponseToJSON: () => QueryDataBatch200ResponseToJSON,
129
+ QueryDataBatch200ResponseToJSONTyped: () => QueryDataBatch200ResponseToJSONTyped,
130
+ QueryDataBatchRequestFromJSON: () => QueryDataBatchRequestFromJSON,
131
+ QueryDataBatchRequestFromJSONTyped: () => QueryDataBatchRequestFromJSONTyped,
132
+ QueryDataBatchRequestToJSON: () => QueryDataBatchRequestToJSON,
133
+ QueryDataBatchRequestToJSONTyped: () => QueryDataBatchRequestToJSONTyped,
134
+ ResolvePageBatch200ResponseFromJSON: () => ResolvePageBatch200ResponseFromJSON,
135
+ ResolvePageBatch200ResponseFromJSONTyped: () => ResolvePageBatch200ResponseFromJSONTyped,
136
+ ResolvePageBatch200ResponseToJSON: () => ResolvePageBatch200ResponseToJSON,
137
+ ResolvePageBatch200ResponseToJSONTyped: () => ResolvePageBatch200ResponseToJSONTyped,
138
+ ResolvePageBatchRequestChannelEnum: () => ResolvePageBatchRequestChannelEnum,
139
+ ResolvePageBatchRequestFromJSON: () => ResolvePageBatchRequestFromJSON,
140
+ ResolvePageBatchRequestFromJSONTyped: () => ResolvePageBatchRequestFromJSONTyped,
141
+ ResolvePageBatchRequestToJSON: () => ResolvePageBatchRequestToJSON,
142
+ ResolvePageBatchRequestToJSONTyped: () => ResolvePageBatchRequestToJSONTyped,
143
+ ResolvePageChannelEnum: () => ResolvePageChannelEnum,
144
+ RuntimeConfigFromJSON: () => RuntimeConfigFromJSON,
145
+ RuntimeConfigFromJSONTyped: () => RuntimeConfigFromJSONTyped,
146
+ RuntimeConfigReportConfigFromJSON: () => RuntimeConfigReportConfigFromJSON,
147
+ RuntimeConfigReportConfigFromJSONTyped: () => RuntimeConfigReportConfigFromJSONTyped,
148
+ RuntimeConfigReportConfigToJSON: () => RuntimeConfigReportConfigToJSON,
149
+ RuntimeConfigReportConfigToJSONTyped: () => RuntimeConfigReportConfigToJSONTyped,
150
+ RuntimeConfigToJSON: () => RuntimeConfigToJSON,
151
+ RuntimeConfigToJSONTyped: () => RuntimeConfigToJSONTyped,
152
+ TimeoutError: () => import_openapi_client_core2.TimeoutError,
153
+ TraceContextFromJSON: () => TraceContextFromJSON,
154
+ TraceContextFromJSONTyped: () => TraceContextFromJSONTyped,
155
+ TraceContextToJSON: () => TraceContextToJSON,
156
+ TraceContextToJSONTyped: () => TraceContextToJSONTyped,
157
+ TrackApi: () => TrackApi,
158
+ TrackContextFromJSON: () => TrackContextFromJSON,
159
+ TrackContextFromJSONTyped: () => TrackContextFromJSONTyped,
160
+ TrackContextToJSON: () => TrackContextToJSON,
161
+ TrackContextToJSONTyped: () => TrackContextToJSONTyped,
162
+ TrackEventEventTypeEnum: () => TrackEventEventTypeEnum,
163
+ TrackEventFromJSON: () => TrackEventFromJSON,
164
+ TrackEventFromJSONTyped: () => TrackEventFromJSONTyped,
165
+ TrackEventToJSON: () => TrackEventToJSON,
166
+ TrackEventToJSONTyped: () => TrackEventToJSONTyped,
167
+ TrackRequestFromJSON: () => TrackRequestFromJSON,
168
+ TrackRequestFromJSONTyped: () => TrackRequestFromJSONTyped,
169
+ TrackRequestToJSON: () => TrackRequestToJSON,
170
+ TrackRequestToJSONTyped: () => TrackRequestToJSONTyped,
171
+ UserActivityStateFromJSON: () => UserActivityStateFromJSON,
172
+ UserActivityStateFromJSONTyped: () => UserActivityStateFromJSONTyped,
173
+ UserActivityStateProgressFromJSON: () => UserActivityStateProgressFromJSON,
174
+ UserActivityStateProgressFromJSONTyped: () => UserActivityStateProgressFromJSONTyped,
175
+ UserActivityStateProgressToJSON: () => UserActivityStateProgressToJSON,
176
+ UserActivityStateProgressToJSONTyped: () => UserActivityStateProgressToJSONTyped,
177
+ UserActivityStateToJSON: () => UserActivityStateToJSON,
178
+ UserActivityStateToJSONTyped: () => UserActivityStateToJSONTyped,
179
+ createConsoleLogger: () => import_openapi_client_core2.createConsoleLogger,
180
+ createSilentLogger: () => import_openapi_client_core2.createSilentLogger,
24
181
  createUserClient: () => createUserClient,
25
- default: () => index_default
182
+ instanceOfActionContext: () => instanceOfActionContext,
183
+ instanceOfActionExecuteRequest: () => instanceOfActionExecuteRequest,
184
+ instanceOfActionExecuteResponse: () => instanceOfActionExecuteResponse,
185
+ instanceOfActivityState: () => instanceOfActivityState,
186
+ instanceOfActivityStateActivityInfo: () => instanceOfActivityStateActivityInfo,
187
+ instanceOfActivityStateResponse: () => instanceOfActivityStateResponse,
188
+ instanceOfBaseResponseVo: () => instanceOfBaseResponseVo,
189
+ instanceOfBlockedComponent: () => instanceOfBlockedComponent,
190
+ instanceOfDataQueryContext: () => instanceOfDataQueryContext,
191
+ instanceOfDataQueryRequest: () => instanceOfDataQueryRequest,
192
+ instanceOfDataQueryResponse: () => instanceOfDataQueryResponse,
193
+ instanceOfErrorDetail: () => instanceOfErrorDetail,
194
+ instanceOfErrorResponseVo: () => instanceOfErrorResponseVo,
195
+ instanceOfExecuteActionBatch200Response: () => instanceOfExecuteActionBatch200Response,
196
+ instanceOfExecuteActionBatchRequest: () => instanceOfExecuteActionBatchRequest,
197
+ instanceOfGetActivityStateBatch200Response: () => instanceOfGetActivityStateBatch200Response,
198
+ instanceOfGetActivityStateBatchRequest: () => instanceOfGetActivityStateBatchRequest,
199
+ instanceOfHealthResponse: () => instanceOfHealthResponse,
200
+ instanceOfHealthResponseChecksValue: () => instanceOfHealthResponseChecksValue,
201
+ instanceOfManifestItem: () => instanceOfManifestItem,
202
+ instanceOfPageManifest: () => instanceOfPageManifest,
203
+ instanceOfPageResolveResponse: () => instanceOfPageResolveResponse,
204
+ instanceOfPageResolveResult: () => instanceOfPageResolveResult,
205
+ instanceOfQueryDataBatch200Response: () => instanceOfQueryDataBatch200Response,
206
+ instanceOfQueryDataBatchRequest: () => instanceOfQueryDataBatchRequest,
207
+ instanceOfResolvePageBatch200Response: () => instanceOfResolvePageBatch200Response,
208
+ instanceOfResolvePageBatchRequest: () => instanceOfResolvePageBatchRequest,
209
+ instanceOfRuntimeConfig: () => instanceOfRuntimeConfig,
210
+ instanceOfRuntimeConfigReportConfig: () => instanceOfRuntimeConfigReportConfig,
211
+ instanceOfTraceContext: () => instanceOfTraceContext,
212
+ instanceOfTrackContext: () => instanceOfTrackContext,
213
+ instanceOfTrackEvent: () => instanceOfTrackEvent,
214
+ instanceOfTrackRequest: () => instanceOfTrackRequest,
215
+ instanceOfUserActivityState: () => instanceOfUserActivityState,
216
+ instanceOfUserActivityStateProgress: () => instanceOfUserActivityStateProgress,
217
+ isRetryableError: () => import_openapi_client_core2.isRetryableError
26
218
  });
27
219
  module.exports = __toCommonJS(index_exports);
28
- var UserApiClient = class {
29
- constructor(config) {
30
- this.config = {
31
- timeout: 1e4,
32
- ...config
220
+ var import_openapi_client_core = require("@djvlc/openapi-client-core");
221
+
222
+ // src/gen/apis/index.ts
223
+ var apis_exports = {};
224
+ __export(apis_exports, {
225
+ ActionApi: () => ActionApi,
226
+ ActivityApi: () => ActivityApi,
227
+ DataApi: () => DataApi,
228
+ HealthApi: () => HealthApi,
229
+ PageApi: () => PageApi,
230
+ ResolvePageChannelEnum: () => ResolvePageChannelEnum,
231
+ TrackApi: () => TrackApi
232
+ });
233
+
234
+ // src/gen/runtime.ts
235
+ var BASE_PATH = "https://api.djvlc.com".replace(/\/+$/, "");
236
+ var Configuration = class {
237
+ constructor(configuration = {}) {
238
+ this.configuration = configuration;
239
+ }
240
+ set config(configuration) {
241
+ this.configuration = configuration;
242
+ }
243
+ get basePath() {
244
+ return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
245
+ }
246
+ get fetchApi() {
247
+ return this.configuration.fetchApi;
248
+ }
249
+ get middleware() {
250
+ return this.configuration.middleware || [];
251
+ }
252
+ get queryParamsStringify() {
253
+ return this.configuration.queryParamsStringify || querystring;
254
+ }
255
+ get username() {
256
+ return this.configuration.username;
257
+ }
258
+ get password() {
259
+ return this.configuration.password;
260
+ }
261
+ get apiKey() {
262
+ const apiKey = this.configuration.apiKey;
263
+ if (apiKey) {
264
+ return typeof apiKey === "function" ? apiKey : () => apiKey;
265
+ }
266
+ return void 0;
267
+ }
268
+ get accessToken() {
269
+ const accessToken = this.configuration.accessToken;
270
+ if (accessToken) {
271
+ return typeof accessToken === "function" ? accessToken : async () => accessToken;
272
+ }
273
+ return void 0;
274
+ }
275
+ get headers() {
276
+ return this.configuration.headers;
277
+ }
278
+ get credentials() {
279
+ return this.configuration.credentials;
280
+ }
281
+ };
282
+ var DefaultConfig = new Configuration();
283
+ var _BaseAPI = class _BaseAPI {
284
+ constructor(configuration = DefaultConfig) {
285
+ this.configuration = configuration;
286
+ this.fetchApi = async (url, init) => {
287
+ let fetchParams = { url, init };
288
+ for (const middleware of this.middleware) {
289
+ if (middleware.pre) {
290
+ fetchParams = await middleware.pre({
291
+ fetch: this.fetchApi,
292
+ ...fetchParams
293
+ }) || fetchParams;
294
+ }
295
+ }
296
+ let response = void 0;
297
+ try {
298
+ response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
299
+ } catch (e) {
300
+ for (const middleware of this.middleware) {
301
+ if (middleware.onError) {
302
+ response = await middleware.onError({
303
+ fetch: this.fetchApi,
304
+ url: fetchParams.url,
305
+ init: fetchParams.init,
306
+ error: e,
307
+ response: response ? response.clone() : void 0
308
+ }) || response;
309
+ }
310
+ }
311
+ if (response === void 0) {
312
+ if (e instanceof Error) {
313
+ throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
314
+ } else {
315
+ throw e;
316
+ }
317
+ }
318
+ }
319
+ for (const middleware of this.middleware) {
320
+ if (middleware.post) {
321
+ response = await middleware.post({
322
+ fetch: this.fetchApi,
323
+ url: fetchParams.url,
324
+ init: fetchParams.init,
325
+ response: response.clone()
326
+ }) || response;
327
+ }
328
+ }
329
+ return response;
33
330
  };
331
+ this.middleware = configuration.middleware;
332
+ }
333
+ withMiddleware(...middlewares) {
334
+ const next = this.clone();
335
+ next.middleware = next.middleware.concat(...middlewares);
336
+ return next;
337
+ }
338
+ withPreMiddleware(...preMiddlewares) {
339
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
340
+ return this.withMiddleware(...middlewares);
341
+ }
342
+ withPostMiddleware(...postMiddlewares) {
343
+ const middlewares = postMiddlewares.map((post) => ({ post }));
344
+ return this.withMiddleware(...middlewares);
34
345
  }
35
346
  /**
36
- * 获取认证 Token
347
+ * Check if the given MIME is a JSON MIME.
348
+ * JSON MIME examples:
349
+ * application/json
350
+ * application/json; charset=UTF8
351
+ * APPLICATION/JSON
352
+ * application/vnd.company+json
353
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
354
+ * @return True if the given MIME is JSON, false otherwise.
37
355
  */
38
- async getAuthToken() {
39
- if (this.config.getToken) {
40
- return this.config.getToken();
356
+ isJsonMime(mime) {
357
+ if (!mime) {
358
+ return false;
41
359
  }
42
- return this.config.token;
360
+ return _BaseAPI.jsonRegex.test(mime);
43
361
  }
44
- /**
45
- * 获取通用请求头
46
- */
47
- async getCommonHeaders() {
48
- const headers = {
49
- "Content-Type": "application/json",
50
- ...this.config.headers
51
- };
52
- const token = await this.getAuthToken();
53
- if (token) {
54
- headers["Authorization"] = `Bearer ${token}`;
362
+ async request(context, initOverrides) {
363
+ const { url, init } = await this.createFetchParams(context, initOverrides);
364
+ const response = await this.fetchApi(url, init);
365
+ if (response && (response.status >= 200 && response.status < 300)) {
366
+ return response;
55
367
  }
56
- if (this.config.deviceId) {
57
- headers["x-device-id"] = this.config.deviceId;
368
+ throw new ResponseError(response, "Response returned an error code");
369
+ }
370
+ async createFetchParams(context, initOverrides) {
371
+ let url = this.configuration.basePath + context.path;
372
+ if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
373
+ url += "?" + this.configuration.queryParamsStringify(context.query);
58
374
  }
59
- if (this.config.channel) {
60
- headers["x-channel"] = this.config.channel;
375
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
376
+ Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
377
+ const initOverrideFn = typeof initOverrides === "function" ? initOverrides : async () => initOverrides;
378
+ const initParams = {
379
+ method: context.method,
380
+ headers,
381
+ body: context.body,
382
+ credentials: this.configuration.credentials
383
+ };
384
+ const overriddenInit = {
385
+ ...initParams,
386
+ ...await initOverrideFn({
387
+ init: initParams,
388
+ context
389
+ })
390
+ };
391
+ let body;
392
+ if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
393
+ body = overriddenInit.body;
394
+ } else if (this.isJsonMime(headers["Content-Type"])) {
395
+ body = JSON.stringify(overriddenInit.body);
396
+ } else {
397
+ body = overriddenInit.body;
61
398
  }
62
- if (this.config.getTraceHeaders) {
63
- Object.assign(headers, this.config.getTraceHeaders());
399
+ const init = {
400
+ ...overriddenInit,
401
+ body
402
+ };
403
+ return { url, init };
404
+ }
405
+ /**
406
+ * Create a shallow clone of `this` by constructing a new instance
407
+ * and then shallow cloning data members.
408
+ */
409
+ clone() {
410
+ const constructor = this.constructor;
411
+ const next = new constructor(this.configuration);
412
+ next.middleware = this.middleware.slice();
413
+ return next;
414
+ }
415
+ };
416
+ _BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
417
+ var BaseAPI = _BaseAPI;
418
+ function isBlob(value) {
419
+ return typeof Blob !== "undefined" && value instanceof Blob;
420
+ }
421
+ function isFormData(value) {
422
+ return typeof FormData !== "undefined" && value instanceof FormData;
423
+ }
424
+ var ResponseError = class extends Error {
425
+ constructor(response, msg) {
426
+ super(msg);
427
+ this.response = response;
428
+ this.name = "ResponseError";
429
+ }
430
+ };
431
+ var FetchError = class extends Error {
432
+ constructor(cause, msg) {
433
+ super(msg);
434
+ this.cause = cause;
435
+ this.name = "FetchError";
436
+ }
437
+ };
438
+ var RequiredError = class extends Error {
439
+ constructor(field, msg) {
440
+ super(msg);
441
+ this.field = field;
442
+ this.name = "RequiredError";
443
+ }
444
+ };
445
+ function querystring(params, prefix = "") {
446
+ return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
447
+ }
448
+ function querystringSingleKey(key, value, keyPrefix = "") {
449
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
450
+ if (value instanceof Array) {
451
+ const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
452
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
453
+ }
454
+ if (value instanceof Set) {
455
+ const valueAsArray = Array.from(value);
456
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
457
+ }
458
+ if (value instanceof Date) {
459
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
460
+ }
461
+ if (value instanceof Object) {
462
+ return querystring(value, fullKey);
463
+ }
464
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
465
+ }
466
+ function mapValues(data, fn) {
467
+ const result = {};
468
+ for (const key of Object.keys(data)) {
469
+ result[key] = fn(data[key]);
470
+ }
471
+ return result;
472
+ }
473
+ var JSONApiResponse = class {
474
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
475
+ this.raw = raw;
476
+ this.transformer = transformer;
477
+ }
478
+ async value() {
479
+ return this.transformer(await this.raw.json());
480
+ }
481
+ };
482
+ var VoidApiResponse = class {
483
+ constructor(raw) {
484
+ this.raw = raw;
485
+ }
486
+ async value() {
487
+ return void 0;
488
+ }
489
+ };
490
+
491
+ // src/gen/models/ActionContext.ts
492
+ function instanceOfActionContext(value) {
493
+ return true;
494
+ }
495
+ function ActionContextFromJSON(json) {
496
+ return ActionContextFromJSONTyped(json, false);
497
+ }
498
+ function ActionContextFromJSONTyped(json, ignoreDiscriminator) {
499
+ if (json == null) {
500
+ return json;
501
+ }
502
+ return {
503
+ "pageVersionId": json["pageVersionId"] == null ? void 0 : json["pageVersionId"],
504
+ "componentVersion": json["componentVersion"] == null ? void 0 : json["componentVersion"],
505
+ "uid": json["uid"] == null ? void 0 : json["uid"],
506
+ "deviceId": json["deviceId"] == null ? void 0 : json["deviceId"],
507
+ "channel": json["channel"] == null ? void 0 : json["channel"],
508
+ "traceId": json["traceId"] == null ? void 0 : json["traceId"],
509
+ "extra": json["extra"] == null ? void 0 : json["extra"]
510
+ };
511
+ }
512
+ function ActionContextToJSON(json) {
513
+ return ActionContextToJSONTyped(json, false);
514
+ }
515
+ function ActionContextToJSONTyped(value, ignoreDiscriminator = false) {
516
+ if (value == null) {
517
+ return value;
518
+ }
519
+ return {
520
+ "pageVersionId": value["pageVersionId"],
521
+ "componentVersion": value["componentVersion"],
522
+ "uid": value["uid"],
523
+ "deviceId": value["deviceId"],
524
+ "channel": value["channel"],
525
+ "traceId": value["traceId"],
526
+ "extra": value["extra"]
527
+ };
528
+ }
529
+
530
+ // src/gen/models/ActionExecuteRequest.ts
531
+ function instanceOfActionExecuteRequest(value) {
532
+ if (!("actionType" in value) || value["actionType"] === void 0) return false;
533
+ if (!("params" in value) || value["params"] === void 0) return false;
534
+ if (!("context" in value) || value["context"] === void 0) return false;
535
+ return true;
536
+ }
537
+ function ActionExecuteRequestFromJSON(json) {
538
+ return ActionExecuteRequestFromJSONTyped(json, false);
539
+ }
540
+ function ActionExecuteRequestFromJSONTyped(json, ignoreDiscriminator) {
541
+ if (json == null) {
542
+ return json;
543
+ }
544
+ return {
545
+ "actionType": json["actionType"],
546
+ "params": json["params"],
547
+ "context": ActionContextFromJSON(json["context"]),
548
+ "idempotencyKey": json["idempotencyKey"] == null ? void 0 : json["idempotencyKey"]
549
+ };
550
+ }
551
+ function ActionExecuteRequestToJSON(json) {
552
+ return ActionExecuteRequestToJSONTyped(json, false);
553
+ }
554
+ function ActionExecuteRequestToJSONTyped(value, ignoreDiscriminator = false) {
555
+ if (value == null) {
556
+ return value;
557
+ }
558
+ return {
559
+ "actionType": value["actionType"],
560
+ "params": value["params"],
561
+ "context": ActionContextToJSON(value["context"]),
562
+ "idempotencyKey": value["idempotencyKey"]
563
+ };
564
+ }
565
+
566
+ // src/gen/models/ActionExecuteResponse.ts
567
+ function instanceOfActionExecuteResponse(value) {
568
+ if (!("success" in value) || value["success"] === void 0) return false;
569
+ return true;
570
+ }
571
+ function ActionExecuteResponseFromJSON(json) {
572
+ return ActionExecuteResponseFromJSONTyped(json, false);
573
+ }
574
+ function ActionExecuteResponseFromJSONTyped(json, ignoreDiscriminator) {
575
+ if (json == null) {
576
+ return json;
577
+ }
578
+ return {
579
+ "success": json["success"],
580
+ "data": json["data"] == null ? void 0 : json["data"],
581
+ "code": json["code"] == null ? void 0 : json["code"],
582
+ "message": json["message"] == null ? void 0 : json["message"],
583
+ "traceId": json["traceId"] == null ? void 0 : json["traceId"]
584
+ };
585
+ }
586
+ function ActionExecuteResponseToJSON(json) {
587
+ return ActionExecuteResponseToJSONTyped(json, false);
588
+ }
589
+ function ActionExecuteResponseToJSONTyped(value, ignoreDiscriminator = false) {
590
+ if (value == null) {
591
+ return value;
592
+ }
593
+ return {
594
+ "success": value["success"],
595
+ "data": value["data"],
596
+ "code": value["code"],
597
+ "message": value["message"],
598
+ "traceId": value["traceId"]
599
+ };
600
+ }
601
+
602
+ // src/gen/models/UserActivityStateProgress.ts
603
+ function instanceOfUserActivityStateProgress(value) {
604
+ return true;
605
+ }
606
+ function UserActivityStateProgressFromJSON(json) {
607
+ return UserActivityStateProgressFromJSONTyped(json, false);
608
+ }
609
+ function UserActivityStateProgressFromJSONTyped(json, ignoreDiscriminator) {
610
+ if (json == null) {
611
+ return json;
612
+ }
613
+ return {
614
+ "current": json["current"] == null ? void 0 : json["current"],
615
+ "target": json["target"] == null ? void 0 : json["target"],
616
+ "percentage": json["percentage"] == null ? void 0 : json["percentage"]
617
+ };
618
+ }
619
+ function UserActivityStateProgressToJSON(json) {
620
+ return UserActivityStateProgressToJSONTyped(json, false);
621
+ }
622
+ function UserActivityStateProgressToJSONTyped(value, ignoreDiscriminator = false) {
623
+ if (value == null) {
624
+ return value;
625
+ }
626
+ return {
627
+ "current": value["current"],
628
+ "target": value["target"],
629
+ "percentage": value["percentage"]
630
+ };
631
+ }
632
+
633
+ // src/gen/models/UserActivityState.ts
634
+ function instanceOfUserActivityState(value) {
635
+ return true;
636
+ }
637
+ function UserActivityStateFromJSON(json) {
638
+ return UserActivityStateFromJSONTyped(json, false);
639
+ }
640
+ function UserActivityStateFromJSONTyped(json, ignoreDiscriminator) {
641
+ if (json == null) {
642
+ return json;
643
+ }
644
+ return {
645
+ "participated": json["participated"] == null ? void 0 : json["participated"],
646
+ "claimedCount": json["claimedCount"] == null ? void 0 : json["claimedCount"],
647
+ "remainingCount": json["remainingCount"] == null ? void 0 : json["remainingCount"],
648
+ "lastClaimedAt": json["lastClaimedAt"] == null ? void 0 : json["lastClaimedAt"],
649
+ "consecutiveDays": json["consecutiveDays"] == null ? void 0 : json["consecutiveDays"],
650
+ "progress": json["progress"] == null ? void 0 : UserActivityStateProgressFromJSON(json["progress"])
651
+ };
652
+ }
653
+ function UserActivityStateToJSON(json) {
654
+ return UserActivityStateToJSONTyped(json, false);
655
+ }
656
+ function UserActivityStateToJSONTyped(value, ignoreDiscriminator = false) {
657
+ if (value == null) {
658
+ return value;
659
+ }
660
+ return {
661
+ "participated": value["participated"],
662
+ "claimedCount": value["claimedCount"],
663
+ "remainingCount": value["remainingCount"],
664
+ "lastClaimedAt": value["lastClaimedAt"],
665
+ "consecutiveDays": value["consecutiveDays"],
666
+ "progress": UserActivityStateProgressToJSON(value["progress"])
667
+ };
668
+ }
669
+
670
+ // src/gen/models/ActivityStateActivityInfo.ts
671
+ function instanceOfActivityStateActivityInfo(value) {
672
+ return true;
673
+ }
674
+ function ActivityStateActivityInfoFromJSON(json) {
675
+ return ActivityStateActivityInfoFromJSONTyped(json, false);
676
+ }
677
+ function ActivityStateActivityInfoFromJSONTyped(json, ignoreDiscriminator) {
678
+ if (json == null) {
679
+ return json;
680
+ }
681
+ return {
682
+ "name": json["name"] == null ? void 0 : json["name"],
683
+ "startTime": json["startTime"] == null ? void 0 : json["startTime"],
684
+ "endTime": json["endTime"] == null ? void 0 : json["endTime"]
685
+ };
686
+ }
687
+ function ActivityStateActivityInfoToJSON(json) {
688
+ return ActivityStateActivityInfoToJSONTyped(json, false);
689
+ }
690
+ function ActivityStateActivityInfoToJSONTyped(value, ignoreDiscriminator = false) {
691
+ if (value == null) {
692
+ return value;
693
+ }
694
+ return {
695
+ "name": value["name"],
696
+ "startTime": value["startTime"],
697
+ "endTime": value["endTime"]
698
+ };
699
+ }
700
+
701
+ // src/gen/models/ActivityState.ts
702
+ var ActivityStateStatusEnum = {
703
+ not_started: "not_started",
704
+ active: "active",
705
+ paused: "paused",
706
+ ended: "ended"
707
+ };
708
+ function instanceOfActivityState(value) {
709
+ return true;
710
+ }
711
+ function ActivityStateFromJSON(json) {
712
+ return ActivityStateFromJSONTyped(json, false);
713
+ }
714
+ function ActivityStateFromJSONTyped(json, ignoreDiscriminator) {
715
+ if (json == null) {
716
+ return json;
717
+ }
718
+ return {
719
+ "activityId": json["activityId"] == null ? void 0 : json["activityId"],
720
+ "status": json["status"] == null ? void 0 : json["status"],
721
+ "userState": json["userState"] == null ? void 0 : UserActivityStateFromJSON(json["userState"]),
722
+ "activityInfo": json["activityInfo"] == null ? void 0 : ActivityStateActivityInfoFromJSON(json["activityInfo"])
723
+ };
724
+ }
725
+ function ActivityStateToJSON(json) {
726
+ return ActivityStateToJSONTyped(json, false);
727
+ }
728
+ function ActivityStateToJSONTyped(value, ignoreDiscriminator = false) {
729
+ if (value == null) {
730
+ return value;
731
+ }
732
+ return {
733
+ "activityId": value["activityId"],
734
+ "status": value["status"],
735
+ "userState": UserActivityStateToJSON(value["userState"]),
736
+ "activityInfo": ActivityStateActivityInfoToJSON(value["activityInfo"])
737
+ };
738
+ }
739
+
740
+ // src/gen/models/ActivityStateResponse.ts
741
+ function instanceOfActivityStateResponse(value) {
742
+ if (!("success" in value) || value["success"] === void 0) return false;
743
+ return true;
744
+ }
745
+ function ActivityStateResponseFromJSON(json) {
746
+ return ActivityStateResponseFromJSONTyped(json, false);
747
+ }
748
+ function ActivityStateResponseFromJSONTyped(json, ignoreDiscriminator) {
749
+ if (json == null) {
750
+ return json;
751
+ }
752
+ return {
753
+ "success": json["success"],
754
+ "data": json["data"] == null ? void 0 : ActivityStateFromJSON(json["data"]),
755
+ "code": json["code"] == null ? void 0 : json["code"],
756
+ "message": json["message"] == null ? void 0 : json["message"],
757
+ "traceId": json["traceId"] == null ? void 0 : json["traceId"]
758
+ };
759
+ }
760
+ function ActivityStateResponseToJSON(json) {
761
+ return ActivityStateResponseToJSONTyped(json, false);
762
+ }
763
+ function ActivityStateResponseToJSONTyped(value, ignoreDiscriminator = false) {
764
+ if (value == null) {
765
+ return value;
766
+ }
767
+ return {
768
+ "success": value["success"],
769
+ "data": ActivityStateToJSON(value["data"]),
770
+ "code": value["code"],
771
+ "message": value["message"],
772
+ "traceId": value["traceId"]
773
+ };
774
+ }
775
+
776
+ // src/gen/models/BaseResponseVo.ts
777
+ function instanceOfBaseResponseVo(value) {
778
+ if (!("success" in value) || value["success"] === void 0) return false;
779
+ if (!("code" in value) || value["code"] === void 0) return false;
780
+ if (!("message" in value) || value["message"] === void 0) return false;
781
+ if (!("data" in value) || value["data"] === void 0) return false;
782
+ if (!("timestamp" in value) || value["timestamp"] === void 0) return false;
783
+ if (!("path" in value) || value["path"] === void 0) return false;
784
+ return true;
785
+ }
786
+ function BaseResponseVoFromJSON(json) {
787
+ return BaseResponseVoFromJSONTyped(json, false);
788
+ }
789
+ function BaseResponseVoFromJSONTyped(json, ignoreDiscriminator) {
790
+ if (json == null) {
791
+ return json;
792
+ }
793
+ return {
794
+ "success": json["success"],
795
+ "code": json["code"],
796
+ "message": json["message"],
797
+ "data": json["data"],
798
+ "timestamp": json["timestamp"],
799
+ "path": json["path"],
800
+ "requestId": json["requestId"] == null ? void 0 : json["requestId"]
801
+ };
802
+ }
803
+ function BaseResponseVoToJSON(json) {
804
+ return BaseResponseVoToJSONTyped(json, false);
805
+ }
806
+ function BaseResponseVoToJSONTyped(value, ignoreDiscriminator = false) {
807
+ if (value == null) {
808
+ return value;
809
+ }
810
+ return {
811
+ "success": value["success"],
812
+ "code": value["code"],
813
+ "message": value["message"],
814
+ "data": value["data"],
815
+ "timestamp": value["timestamp"],
816
+ "path": value["path"],
817
+ "requestId": value["requestId"]
818
+ };
819
+ }
820
+
821
+ // src/gen/models/BlockedComponent.ts
822
+ function instanceOfBlockedComponent(value) {
823
+ if (!("name" in value) || value["name"] === void 0) return false;
824
+ if (!("version" in value) || value["version"] === void 0) return false;
825
+ if (!("reason" in value) || value["reason"] === void 0) return false;
826
+ if (!("blockedAt" in value) || value["blockedAt"] === void 0) return false;
827
+ return true;
828
+ }
829
+ function BlockedComponentFromJSON(json) {
830
+ return BlockedComponentFromJSONTyped(json, false);
831
+ }
832
+ function BlockedComponentFromJSONTyped(json, ignoreDiscriminator) {
833
+ if (json == null) {
834
+ return json;
835
+ }
836
+ return {
837
+ "name": json["name"],
838
+ "version": json["version"],
839
+ "reason": json["reason"],
840
+ "blockedAt": json["blockedAt"],
841
+ "fallbackComponent": json["fallbackComponent"] == null ? void 0 : json["fallbackComponent"]
842
+ };
843
+ }
844
+ function BlockedComponentToJSON(json) {
845
+ return BlockedComponentToJSONTyped(json, false);
846
+ }
847
+ function BlockedComponentToJSONTyped(value, ignoreDiscriminator = false) {
848
+ if (value == null) {
849
+ return value;
850
+ }
851
+ return {
852
+ "name": value["name"],
853
+ "version": value["version"],
854
+ "reason": value["reason"],
855
+ "blockedAt": value["blockedAt"],
856
+ "fallbackComponent": value["fallbackComponent"]
857
+ };
858
+ }
859
+
860
+ // src/gen/models/DataQueryContext.ts
861
+ function instanceOfDataQueryContext(value) {
862
+ return true;
863
+ }
864
+ function DataQueryContextFromJSON(json) {
865
+ return DataQueryContextFromJSONTyped(json, false);
866
+ }
867
+ function DataQueryContextFromJSONTyped(json, ignoreDiscriminator) {
868
+ if (json == null) {
869
+ return json;
870
+ }
871
+ return {
872
+ "pageVersionId": json["pageVersionId"] == null ? void 0 : json["pageVersionId"],
873
+ "uid": json["uid"] == null ? void 0 : json["uid"],
874
+ "traceId": json["traceId"] == null ? void 0 : json["traceId"]
875
+ };
876
+ }
877
+ function DataQueryContextToJSON(json) {
878
+ return DataQueryContextToJSONTyped(json, false);
879
+ }
880
+ function DataQueryContextToJSONTyped(value, ignoreDiscriminator = false) {
881
+ if (value == null) {
882
+ return value;
883
+ }
884
+ return {
885
+ "pageVersionId": value["pageVersionId"],
886
+ "uid": value["uid"],
887
+ "traceId": value["traceId"]
888
+ };
889
+ }
890
+
891
+ // src/gen/models/DataQueryRequest.ts
892
+ function instanceOfDataQueryRequest(value) {
893
+ if (!("queryVersionId" in value) || value["queryVersionId"] === void 0) return false;
894
+ if (!("params" in value) || value["params"] === void 0) return false;
895
+ return true;
896
+ }
897
+ function DataQueryRequestFromJSON(json) {
898
+ return DataQueryRequestFromJSONTyped(json, false);
899
+ }
900
+ function DataQueryRequestFromJSONTyped(json, ignoreDiscriminator) {
901
+ if (json == null) {
902
+ return json;
903
+ }
904
+ return {
905
+ "queryVersionId": json["queryVersionId"],
906
+ "params": json["params"],
907
+ "context": json["context"] == null ? void 0 : DataQueryContextFromJSON(json["context"])
908
+ };
909
+ }
910
+ function DataQueryRequestToJSON(json) {
911
+ return DataQueryRequestToJSONTyped(json, false);
912
+ }
913
+ function DataQueryRequestToJSONTyped(value, ignoreDiscriminator = false) {
914
+ if (value == null) {
915
+ return value;
916
+ }
917
+ return {
918
+ "queryVersionId": value["queryVersionId"],
919
+ "params": value["params"],
920
+ "context": DataQueryContextToJSON(value["context"])
921
+ };
922
+ }
923
+
924
+ // src/gen/models/DataQueryResponse.ts
925
+ function instanceOfDataQueryResponse(value) {
926
+ if (!("success" in value) || value["success"] === void 0) return false;
927
+ return true;
928
+ }
929
+ function DataQueryResponseFromJSON(json) {
930
+ return DataQueryResponseFromJSONTyped(json, false);
931
+ }
932
+ function DataQueryResponseFromJSONTyped(json, ignoreDiscriminator) {
933
+ if (json == null) {
934
+ return json;
935
+ }
936
+ return {
937
+ "success": json["success"],
938
+ "data": json["data"] == null ? void 0 : json["data"],
939
+ "fromCache": json["fromCache"] == null ? void 0 : json["fromCache"],
940
+ "cacheTime": json["cacheTime"] == null ? void 0 : json["cacheTime"],
941
+ "code": json["code"] == null ? void 0 : json["code"],
942
+ "message": json["message"] == null ? void 0 : json["message"],
943
+ "traceId": json["traceId"] == null ? void 0 : json["traceId"]
944
+ };
945
+ }
946
+ function DataQueryResponseToJSON(json) {
947
+ return DataQueryResponseToJSONTyped(json, false);
948
+ }
949
+ function DataQueryResponseToJSONTyped(value, ignoreDiscriminator = false) {
950
+ if (value == null) {
951
+ return value;
952
+ }
953
+ return {
954
+ "success": value["success"],
955
+ "data": value["data"],
956
+ "fromCache": value["fromCache"],
957
+ "cacheTime": value["cacheTime"],
958
+ "code": value["code"],
959
+ "message": value["message"],
960
+ "traceId": value["traceId"]
961
+ };
962
+ }
963
+
964
+ // src/gen/models/ErrorDetail.ts
965
+ function instanceOfErrorDetail(value) {
966
+ return true;
967
+ }
968
+ function ErrorDetailFromJSON(json) {
969
+ return ErrorDetailFromJSONTyped(json, false);
970
+ }
971
+ function ErrorDetailFromJSONTyped(json, ignoreDiscriminator) {
972
+ if (json == null) {
973
+ return json;
974
+ }
975
+ return {
976
+ "field": json["field"] == null ? void 0 : json["field"],
977
+ "code": json["code"] == null ? void 0 : json["code"],
978
+ "message": json["message"] == null ? void 0 : json["message"]
979
+ };
980
+ }
981
+ function ErrorDetailToJSON(json) {
982
+ return ErrorDetailToJSONTyped(json, false);
983
+ }
984
+ function ErrorDetailToJSONTyped(value, ignoreDiscriminator = false) {
985
+ if (value == null) {
986
+ return value;
987
+ }
988
+ return {
989
+ "field": value["field"],
990
+ "code": value["code"],
991
+ "message": value["message"]
992
+ };
993
+ }
994
+
995
+ // src/gen/models/ErrorResponseVo.ts
996
+ function instanceOfErrorResponseVo(value) {
997
+ if (!("success" in value) || value["success"] === void 0) return false;
998
+ if (!("code" in value) || value["code"] === void 0) return false;
999
+ if (!("message" in value) || value["message"] === void 0) return false;
1000
+ if (!("timestamp" in value) || value["timestamp"] === void 0) return false;
1001
+ if (!("path" in value) || value["path"] === void 0) return false;
1002
+ return true;
1003
+ }
1004
+ function ErrorResponseVoFromJSON(json) {
1005
+ return ErrorResponseVoFromJSONTyped(json, false);
1006
+ }
1007
+ function ErrorResponseVoFromJSONTyped(json, ignoreDiscriminator) {
1008
+ if (json == null) {
1009
+ return json;
1010
+ }
1011
+ return {
1012
+ "success": json["success"],
1013
+ "code": json["code"],
1014
+ "message": json["message"],
1015
+ "timestamp": json["timestamp"],
1016
+ "path": json["path"],
1017
+ "requestId": json["requestId"] == null ? void 0 : json["requestId"],
1018
+ "details": json["details"] == null ? void 0 : json["details"].map(ErrorDetailFromJSON)
1019
+ };
1020
+ }
1021
+ function ErrorResponseVoToJSON(json) {
1022
+ return ErrorResponseVoToJSONTyped(json, false);
1023
+ }
1024
+ function ErrorResponseVoToJSONTyped(value, ignoreDiscriminator = false) {
1025
+ if (value == null) {
1026
+ return value;
1027
+ }
1028
+ return {
1029
+ "success": value["success"],
1030
+ "code": value["code"],
1031
+ "message": value["message"],
1032
+ "timestamp": value["timestamp"],
1033
+ "path": value["path"],
1034
+ "requestId": value["requestId"],
1035
+ "details": value["details"] == null ? void 0 : value["details"].map(ErrorDetailToJSON)
1036
+ };
1037
+ }
1038
+
1039
+ // src/gen/models/ExecuteActionBatch200Response.ts
1040
+ function instanceOfExecuteActionBatch200Response(value) {
1041
+ if (!("success" in value) || value["success"] === void 0) return false;
1042
+ return true;
1043
+ }
1044
+ function ExecuteActionBatch200ResponseFromJSON(json) {
1045
+ return ExecuteActionBatch200ResponseFromJSONTyped(json, false);
1046
+ }
1047
+ function ExecuteActionBatch200ResponseFromJSONTyped(json, ignoreDiscriminator) {
1048
+ if (json == null) {
1049
+ return json;
1050
+ }
1051
+ return {
1052
+ "success": json["success"],
1053
+ "data": json["data"] == null ? void 0 : json["data"].map(ActionExecuteResponseFromJSON),
1054
+ "traceId": json["traceId"] == null ? void 0 : json["traceId"]
1055
+ };
1056
+ }
1057
+ function ExecuteActionBatch200ResponseToJSON(json) {
1058
+ return ExecuteActionBatch200ResponseToJSONTyped(json, false);
1059
+ }
1060
+ function ExecuteActionBatch200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
1061
+ if (value == null) {
1062
+ return value;
1063
+ }
1064
+ return {
1065
+ "success": value["success"],
1066
+ "data": value["data"] == null ? void 0 : value["data"].map(ActionExecuteResponseToJSON),
1067
+ "traceId": value["traceId"]
1068
+ };
1069
+ }
1070
+
1071
+ // src/gen/models/ExecuteActionBatchRequest.ts
1072
+ function instanceOfExecuteActionBatchRequest(value) {
1073
+ if (!("actions" in value) || value["actions"] === void 0) return false;
1074
+ return true;
1075
+ }
1076
+ function ExecuteActionBatchRequestFromJSON(json) {
1077
+ return ExecuteActionBatchRequestFromJSONTyped(json, false);
1078
+ }
1079
+ function ExecuteActionBatchRequestFromJSONTyped(json, ignoreDiscriminator) {
1080
+ if (json == null) {
1081
+ return json;
1082
+ }
1083
+ return {
1084
+ "actions": json["actions"].map(ActionExecuteRequestFromJSON),
1085
+ "stopOnError": json["stopOnError"] == null ? void 0 : json["stopOnError"]
1086
+ };
1087
+ }
1088
+ function ExecuteActionBatchRequestToJSON(json) {
1089
+ return ExecuteActionBatchRequestToJSONTyped(json, false);
1090
+ }
1091
+ function ExecuteActionBatchRequestToJSONTyped(value, ignoreDiscriminator = false) {
1092
+ if (value == null) {
1093
+ return value;
1094
+ }
1095
+ return {
1096
+ "actions": value["actions"].map(ActionExecuteRequestToJSON),
1097
+ "stopOnError": value["stopOnError"]
1098
+ };
1099
+ }
1100
+
1101
+ // src/gen/models/GetActivityStateBatch200Response.ts
1102
+ function instanceOfGetActivityStateBatch200Response(value) {
1103
+ if (!("success" in value) || value["success"] === void 0) return false;
1104
+ return true;
1105
+ }
1106
+ function GetActivityStateBatch200ResponseFromJSON(json) {
1107
+ return GetActivityStateBatch200ResponseFromJSONTyped(json, false);
1108
+ }
1109
+ function GetActivityStateBatch200ResponseFromJSONTyped(json, ignoreDiscriminator) {
1110
+ if (json == null) {
1111
+ return json;
1112
+ }
1113
+ return {
1114
+ "success": json["success"],
1115
+ "data": json["data"] == null ? void 0 : json["data"].map(ActivityStateFromJSON),
1116
+ "traceId": json["traceId"] == null ? void 0 : json["traceId"]
1117
+ };
1118
+ }
1119
+ function GetActivityStateBatch200ResponseToJSON(json) {
1120
+ return GetActivityStateBatch200ResponseToJSONTyped(json, false);
1121
+ }
1122
+ function GetActivityStateBatch200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
1123
+ if (value == null) {
1124
+ return value;
1125
+ }
1126
+ return {
1127
+ "success": value["success"],
1128
+ "data": value["data"] == null ? void 0 : value["data"].map(ActivityStateToJSON),
1129
+ "traceId": value["traceId"]
1130
+ };
1131
+ }
1132
+
1133
+ // src/gen/models/GetActivityStateBatchRequest.ts
1134
+ function instanceOfGetActivityStateBatchRequest(value) {
1135
+ if (!("activityIds" in value) || value["activityIds"] === void 0) return false;
1136
+ return true;
1137
+ }
1138
+ function GetActivityStateBatchRequestFromJSON(json) {
1139
+ return GetActivityStateBatchRequestFromJSONTyped(json, false);
1140
+ }
1141
+ function GetActivityStateBatchRequestFromJSONTyped(json, ignoreDiscriminator) {
1142
+ if (json == null) {
1143
+ return json;
1144
+ }
1145
+ return {
1146
+ "activityIds": json["activityIds"],
1147
+ "uid": json["uid"] == null ? void 0 : json["uid"]
1148
+ };
1149
+ }
1150
+ function GetActivityStateBatchRequestToJSON(json) {
1151
+ return GetActivityStateBatchRequestToJSONTyped(json, false);
1152
+ }
1153
+ function GetActivityStateBatchRequestToJSONTyped(value, ignoreDiscriminator = false) {
1154
+ if (value == null) {
1155
+ return value;
1156
+ }
1157
+ return {
1158
+ "activityIds": value["activityIds"],
1159
+ "uid": value["uid"]
1160
+ };
1161
+ }
1162
+
1163
+ // src/gen/models/HealthResponseChecksValue.ts
1164
+ function instanceOfHealthResponseChecksValue(value) {
1165
+ return true;
1166
+ }
1167
+ function HealthResponseChecksValueFromJSON(json) {
1168
+ return HealthResponseChecksValueFromJSONTyped(json, false);
1169
+ }
1170
+ function HealthResponseChecksValueFromJSONTyped(json, ignoreDiscriminator) {
1171
+ if (json == null) {
1172
+ return json;
1173
+ }
1174
+ return {
1175
+ "status": json["status"] == null ? void 0 : json["status"],
1176
+ "latency": json["latency"] == null ? void 0 : json["latency"]
1177
+ };
1178
+ }
1179
+ function HealthResponseChecksValueToJSON(json) {
1180
+ return HealthResponseChecksValueToJSONTyped(json, false);
1181
+ }
1182
+ function HealthResponseChecksValueToJSONTyped(value, ignoreDiscriminator = false) {
1183
+ if (value == null) {
1184
+ return value;
1185
+ }
1186
+ return {
1187
+ "status": value["status"],
1188
+ "latency": value["latency"]
1189
+ };
1190
+ }
1191
+
1192
+ // src/gen/models/HealthResponse.ts
1193
+ var HealthResponseStatusEnum = {
1194
+ healthy: "healthy",
1195
+ degraded: "degraded",
1196
+ unhealthy: "unhealthy"
1197
+ };
1198
+ function instanceOfHealthResponse(value) {
1199
+ if (!("status" in value) || value["status"] === void 0) return false;
1200
+ if (!("version" in value) || value["version"] === void 0) return false;
1201
+ return true;
1202
+ }
1203
+ function HealthResponseFromJSON(json) {
1204
+ return HealthResponseFromJSONTyped(json, false);
1205
+ }
1206
+ function HealthResponseFromJSONTyped(json, ignoreDiscriminator) {
1207
+ if (json == null) {
1208
+ return json;
1209
+ }
1210
+ return {
1211
+ "status": json["status"],
1212
+ "version": json["version"],
1213
+ "service": json["service"] == null ? void 0 : json["service"],
1214
+ "timestamp": json["timestamp"] == null ? void 0 : json["timestamp"],
1215
+ "checks": json["checks"] == null ? void 0 : mapValues(json["checks"], HealthResponseChecksValueFromJSON)
1216
+ };
1217
+ }
1218
+ function HealthResponseToJSON(json) {
1219
+ return HealthResponseToJSONTyped(json, false);
1220
+ }
1221
+ function HealthResponseToJSONTyped(value, ignoreDiscriminator = false) {
1222
+ if (value == null) {
1223
+ return value;
1224
+ }
1225
+ return {
1226
+ "status": value["status"],
1227
+ "version": value["version"],
1228
+ "service": value["service"],
1229
+ "timestamp": value["timestamp"],
1230
+ "checks": value["checks"] == null ? void 0 : mapValues(value["checks"], HealthResponseChecksValueToJSON)
1231
+ };
1232
+ }
1233
+
1234
+ // src/gen/models/ManifestItem.ts
1235
+ function instanceOfManifestItem(value) {
1236
+ if (!("name" in value) || value["name"] === void 0) return false;
1237
+ if (!("version" in value) || value["version"] === void 0) return false;
1238
+ if (!("entryUrl" in value) || value["entryUrl"] === void 0) return false;
1239
+ if (!("integrity" in value) || value["integrity"] === void 0) return false;
1240
+ return true;
1241
+ }
1242
+ function ManifestItemFromJSON(json) {
1243
+ return ManifestItemFromJSONTyped(json, false);
1244
+ }
1245
+ function ManifestItemFromJSONTyped(json, ignoreDiscriminator) {
1246
+ if (json == null) {
1247
+ return json;
1248
+ }
1249
+ return {
1250
+ "name": json["name"],
1251
+ "version": json["version"],
1252
+ "entryUrl": json["entryUrl"],
1253
+ "integrity": json["integrity"],
1254
+ "critical": json["critical"] == null ? void 0 : json["critical"],
1255
+ "fallbackUrl": json["fallbackUrl"] == null ? void 0 : json["fallbackUrl"]
1256
+ };
1257
+ }
1258
+ function ManifestItemToJSON(json) {
1259
+ return ManifestItemToJSONTyped(json, false);
1260
+ }
1261
+ function ManifestItemToJSONTyped(value, ignoreDiscriminator = false) {
1262
+ if (value == null) {
1263
+ return value;
1264
+ }
1265
+ return {
1266
+ "name": value["name"],
1267
+ "version": value["version"],
1268
+ "entryUrl": value["entryUrl"],
1269
+ "integrity": value["integrity"],
1270
+ "critical": value["critical"],
1271
+ "fallbackUrl": value["fallbackUrl"]
1272
+ };
1273
+ }
1274
+
1275
+ // src/gen/models/PageManifest.ts
1276
+ function instanceOfPageManifest(value) {
1277
+ if (!("manifestVersion" in value) || value["manifestVersion"] === void 0) return false;
1278
+ if (!("contentHash" in value) || value["contentHash"] === void 0) return false;
1279
+ if (!("runtimeVersion" in value) || value["runtimeVersion"] === void 0) return false;
1280
+ if (!("components" in value) || value["components"] === void 0) return false;
1281
+ if (!("generatedAt" in value) || value["generatedAt"] === void 0) return false;
1282
+ return true;
1283
+ }
1284
+ function PageManifestFromJSON(json) {
1285
+ return PageManifestFromJSONTyped(json, false);
1286
+ }
1287
+ function PageManifestFromJSONTyped(json, ignoreDiscriminator) {
1288
+ if (json == null) {
1289
+ return json;
1290
+ }
1291
+ return {
1292
+ "manifestVersion": json["manifestVersion"],
1293
+ "contentHash": json["contentHash"],
1294
+ "runtimeVersion": json["runtimeVersion"],
1295
+ "components": json["components"].map(ManifestItemFromJSON),
1296
+ "generatedAt": json["generatedAt"]
1297
+ };
1298
+ }
1299
+ function PageManifestToJSON(json) {
1300
+ return PageManifestToJSONTyped(json, false);
1301
+ }
1302
+ function PageManifestToJSONTyped(value, ignoreDiscriminator = false) {
1303
+ if (value == null) {
1304
+ return value;
1305
+ }
1306
+ return {
1307
+ "manifestVersion": value["manifestVersion"],
1308
+ "contentHash": value["contentHash"],
1309
+ "runtimeVersion": value["runtimeVersion"],
1310
+ "components": value["components"].map(ManifestItemToJSON),
1311
+ "generatedAt": value["generatedAt"]
1312
+ };
1313
+ }
1314
+
1315
+ // src/gen/models/RuntimeConfigReportConfig.ts
1316
+ function instanceOfRuntimeConfigReportConfig(value) {
1317
+ return true;
1318
+ }
1319
+ function RuntimeConfigReportConfigFromJSON(json) {
1320
+ return RuntimeConfigReportConfigFromJSONTyped(json, false);
1321
+ }
1322
+ function RuntimeConfigReportConfigFromJSONTyped(json, ignoreDiscriminator) {
1323
+ if (json == null) {
1324
+ return json;
1325
+ }
1326
+ return {
1327
+ "enabled": json["enabled"] == null ? void 0 : json["enabled"],
1328
+ "sampleRate": json["sampleRate"] == null ? void 0 : json["sampleRate"],
1329
+ "endpoint": json["endpoint"] == null ? void 0 : json["endpoint"]
1330
+ };
1331
+ }
1332
+ function RuntimeConfigReportConfigToJSON(json) {
1333
+ return RuntimeConfigReportConfigToJSONTyped(json, false);
1334
+ }
1335
+ function RuntimeConfigReportConfigToJSONTyped(value, ignoreDiscriminator = false) {
1336
+ if (value == null) {
1337
+ return value;
1338
+ }
1339
+ return {
1340
+ "enabled": value["enabled"],
1341
+ "sampleRate": value["sampleRate"],
1342
+ "endpoint": value["endpoint"]
1343
+ };
1344
+ }
1345
+
1346
+ // src/gen/models/RuntimeConfig.ts
1347
+ function instanceOfRuntimeConfig(value) {
1348
+ return true;
1349
+ }
1350
+ function RuntimeConfigFromJSON(json) {
1351
+ return RuntimeConfigFromJSONTyped(json, false);
1352
+ }
1353
+ function RuntimeConfigFromJSONTyped(json, ignoreDiscriminator) {
1354
+ if (json == null) {
1355
+ return json;
1356
+ }
1357
+ return {
1358
+ "killSwitches": json["killSwitches"] == null ? void 0 : json["killSwitches"],
1359
+ "blockedComponents": json["blockedComponents"] == null ? void 0 : json["blockedComponents"].map(BlockedComponentFromJSON),
1360
+ "features": json["features"] == null ? void 0 : json["features"],
1361
+ "debug": json["debug"] == null ? void 0 : json["debug"],
1362
+ "reportConfig": json["reportConfig"] == null ? void 0 : RuntimeConfigReportConfigFromJSON(json["reportConfig"])
1363
+ };
1364
+ }
1365
+ function RuntimeConfigToJSON(json) {
1366
+ return RuntimeConfigToJSONTyped(json, false);
1367
+ }
1368
+ function RuntimeConfigToJSONTyped(value, ignoreDiscriminator = false) {
1369
+ if (value == null) {
1370
+ return value;
1371
+ }
1372
+ return {
1373
+ "killSwitches": value["killSwitches"],
1374
+ "blockedComponents": value["blockedComponents"] == null ? void 0 : value["blockedComponents"].map(BlockedComponentToJSON),
1375
+ "features": value["features"],
1376
+ "debug": value["debug"],
1377
+ "reportConfig": RuntimeConfigReportConfigToJSON(value["reportConfig"])
1378
+ };
1379
+ }
1380
+
1381
+ // src/gen/models/PageResolveResult.ts
1382
+ function instanceOfPageResolveResult(value) {
1383
+ if (!("pageUid" in value) || value["pageUid"] === void 0) return false;
1384
+ if (!("pageVersionId" in value) || value["pageVersionId"] === void 0) return false;
1385
+ if (!("pageJson" in value) || value["pageJson"] === void 0) return false;
1386
+ if (!("manifest" in value) || value["manifest"] === void 0) return false;
1387
+ if (!("runtimeConfig" in value) || value["runtimeConfig"] === void 0) return false;
1388
+ if (!("runtimeVersion" in value) || value["runtimeVersion"] === void 0) return false;
1389
+ return true;
1390
+ }
1391
+ function PageResolveResultFromJSON(json) {
1392
+ return PageResolveResultFromJSONTyped(json, false);
1393
+ }
1394
+ function PageResolveResultFromJSONTyped(json, ignoreDiscriminator) {
1395
+ if (json == null) {
1396
+ return json;
1397
+ }
1398
+ return {
1399
+ "pageUid": json["pageUid"],
1400
+ "pageVersionId": json["pageVersionId"],
1401
+ "pageJson": json["pageJson"],
1402
+ "manifest": PageManifestFromJSON(json["manifest"]),
1403
+ "runtimeConfig": RuntimeConfigFromJSON(json["runtimeConfig"]),
1404
+ "runtimeVersion": json["runtimeVersion"],
1405
+ "isPreview": json["isPreview"] == null ? void 0 : json["isPreview"]
1406
+ };
1407
+ }
1408
+ function PageResolveResultToJSON(json) {
1409
+ return PageResolveResultToJSONTyped(json, false);
1410
+ }
1411
+ function PageResolveResultToJSONTyped(value, ignoreDiscriminator = false) {
1412
+ if (value == null) {
1413
+ return value;
1414
+ }
1415
+ return {
1416
+ "pageUid": value["pageUid"],
1417
+ "pageVersionId": value["pageVersionId"],
1418
+ "pageJson": value["pageJson"],
1419
+ "manifest": PageManifestToJSON(value["manifest"]),
1420
+ "runtimeConfig": RuntimeConfigToJSON(value["runtimeConfig"]),
1421
+ "runtimeVersion": value["runtimeVersion"],
1422
+ "isPreview": value["isPreview"]
1423
+ };
1424
+ }
1425
+
1426
+ // src/gen/models/PageResolveResponse.ts
1427
+ function instanceOfPageResolveResponse(value) {
1428
+ if (!("success" in value) || value["success"] === void 0) return false;
1429
+ return true;
1430
+ }
1431
+ function PageResolveResponseFromJSON(json) {
1432
+ return PageResolveResponseFromJSONTyped(json, false);
1433
+ }
1434
+ function PageResolveResponseFromJSONTyped(json, ignoreDiscriminator) {
1435
+ if (json == null) {
1436
+ return json;
1437
+ }
1438
+ return {
1439
+ "success": json["success"],
1440
+ "data": json["data"] == null ? void 0 : PageResolveResultFromJSON(json["data"]),
1441
+ "code": json["code"] == null ? void 0 : json["code"],
1442
+ "message": json["message"] == null ? void 0 : json["message"],
1443
+ "traceId": json["traceId"] == null ? void 0 : json["traceId"]
1444
+ };
1445
+ }
1446
+ function PageResolveResponseToJSON(json) {
1447
+ return PageResolveResponseToJSONTyped(json, false);
1448
+ }
1449
+ function PageResolveResponseToJSONTyped(value, ignoreDiscriminator = false) {
1450
+ if (value == null) {
1451
+ return value;
1452
+ }
1453
+ return {
1454
+ "success": value["success"],
1455
+ "data": PageResolveResultToJSON(value["data"]),
1456
+ "code": value["code"],
1457
+ "message": value["message"],
1458
+ "traceId": value["traceId"]
1459
+ };
1460
+ }
1461
+
1462
+ // src/gen/models/QueryDataBatch200Response.ts
1463
+ function instanceOfQueryDataBatch200Response(value) {
1464
+ if (!("success" in value) || value["success"] === void 0) return false;
1465
+ return true;
1466
+ }
1467
+ function QueryDataBatch200ResponseFromJSON(json) {
1468
+ return QueryDataBatch200ResponseFromJSONTyped(json, false);
1469
+ }
1470
+ function QueryDataBatch200ResponseFromJSONTyped(json, ignoreDiscriminator) {
1471
+ if (json == null) {
1472
+ return json;
1473
+ }
1474
+ return {
1475
+ "success": json["success"],
1476
+ "data": json["data"] == null ? void 0 : json["data"].map(DataQueryResponseFromJSON),
1477
+ "traceId": json["traceId"] == null ? void 0 : json["traceId"]
1478
+ };
1479
+ }
1480
+ function QueryDataBatch200ResponseToJSON(json) {
1481
+ return QueryDataBatch200ResponseToJSONTyped(json, false);
1482
+ }
1483
+ function QueryDataBatch200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
1484
+ if (value == null) {
1485
+ return value;
1486
+ }
1487
+ return {
1488
+ "success": value["success"],
1489
+ "data": value["data"] == null ? void 0 : value["data"].map(DataQueryResponseToJSON),
1490
+ "traceId": value["traceId"]
1491
+ };
1492
+ }
1493
+
1494
+ // src/gen/models/QueryDataBatchRequest.ts
1495
+ function instanceOfQueryDataBatchRequest(value) {
1496
+ if (!("queries" in value) || value["queries"] === void 0) return false;
1497
+ return true;
1498
+ }
1499
+ function QueryDataBatchRequestFromJSON(json) {
1500
+ return QueryDataBatchRequestFromJSONTyped(json, false);
1501
+ }
1502
+ function QueryDataBatchRequestFromJSONTyped(json, ignoreDiscriminator) {
1503
+ if (json == null) {
1504
+ return json;
1505
+ }
1506
+ return {
1507
+ "queries": json["queries"].map(DataQueryRequestFromJSON)
1508
+ };
1509
+ }
1510
+ function QueryDataBatchRequestToJSON(json) {
1511
+ return QueryDataBatchRequestToJSONTyped(json, false);
1512
+ }
1513
+ function QueryDataBatchRequestToJSONTyped(value, ignoreDiscriminator = false) {
1514
+ if (value == null) {
1515
+ return value;
1516
+ }
1517
+ return {
1518
+ "queries": value["queries"].map(DataQueryRequestToJSON)
1519
+ };
1520
+ }
1521
+
1522
+ // src/gen/models/ResolvePageBatch200Response.ts
1523
+ function instanceOfResolvePageBatch200Response(value) {
1524
+ if (!("success" in value) || value["success"] === void 0) return false;
1525
+ return true;
1526
+ }
1527
+ function ResolvePageBatch200ResponseFromJSON(json) {
1528
+ return ResolvePageBatch200ResponseFromJSONTyped(json, false);
1529
+ }
1530
+ function ResolvePageBatch200ResponseFromJSONTyped(json, ignoreDiscriminator) {
1531
+ if (json == null) {
1532
+ return json;
1533
+ }
1534
+ return {
1535
+ "success": json["success"],
1536
+ "data": json["data"] == null ? void 0 : json["data"].map(PageResolveResultFromJSON),
1537
+ "traceId": json["traceId"] == null ? void 0 : json["traceId"]
1538
+ };
1539
+ }
1540
+ function ResolvePageBatch200ResponseToJSON(json) {
1541
+ return ResolvePageBatch200ResponseToJSONTyped(json, false);
1542
+ }
1543
+ function ResolvePageBatch200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
1544
+ if (value == null) {
1545
+ return value;
1546
+ }
1547
+ return {
1548
+ "success": value["success"],
1549
+ "data": value["data"] == null ? void 0 : value["data"].map(PageResolveResultToJSON),
1550
+ "traceId": value["traceId"]
1551
+ };
1552
+ }
1553
+
1554
+ // src/gen/models/ResolvePageBatchRequest.ts
1555
+ var ResolvePageBatchRequestChannelEnum = {
1556
+ preview: "preview",
1557
+ prod: "prod",
1558
+ gray: "gray"
1559
+ };
1560
+ function instanceOfResolvePageBatchRequest(value) {
1561
+ if (!("pageUids" in value) || value["pageUids"] === void 0) return false;
1562
+ return true;
1563
+ }
1564
+ function ResolvePageBatchRequestFromJSON(json) {
1565
+ return ResolvePageBatchRequestFromJSONTyped(json, false);
1566
+ }
1567
+ function ResolvePageBatchRequestFromJSONTyped(json, ignoreDiscriminator) {
1568
+ if (json == null) {
1569
+ return json;
1570
+ }
1571
+ return {
1572
+ "pageUids": json["pageUids"],
1573
+ "channel": json["channel"] == null ? void 0 : json["channel"]
1574
+ };
1575
+ }
1576
+ function ResolvePageBatchRequestToJSON(json) {
1577
+ return ResolvePageBatchRequestToJSONTyped(json, false);
1578
+ }
1579
+ function ResolvePageBatchRequestToJSONTyped(value, ignoreDiscriminator = false) {
1580
+ if (value == null) {
1581
+ return value;
1582
+ }
1583
+ return {
1584
+ "pageUids": value["pageUids"],
1585
+ "channel": value["channel"]
1586
+ };
1587
+ }
1588
+
1589
+ // src/gen/models/TraceContext.ts
1590
+ function instanceOfTraceContext(value) {
1591
+ return true;
1592
+ }
1593
+ function TraceContextFromJSON(json) {
1594
+ return TraceContextFromJSONTyped(json, false);
1595
+ }
1596
+ function TraceContextFromJSONTyped(json, ignoreDiscriminator) {
1597
+ if (json == null) {
1598
+ return json;
1599
+ }
1600
+ return {
1601
+ "traceId": json["traceId"] == null ? void 0 : json["traceId"],
1602
+ "spanId": json["spanId"] == null ? void 0 : json["spanId"],
1603
+ "pageVersionId": json["pageVersionId"] == null ? void 0 : json["pageVersionId"],
1604
+ "componentVersion": json["componentVersion"] == null ? void 0 : json["componentVersion"],
1605
+ "actionId": json["actionId"] == null ? void 0 : json["actionId"]
1606
+ };
1607
+ }
1608
+ function TraceContextToJSON(json) {
1609
+ return TraceContextToJSONTyped(json, false);
1610
+ }
1611
+ function TraceContextToJSONTyped(value, ignoreDiscriminator = false) {
1612
+ if (value == null) {
1613
+ return value;
1614
+ }
1615
+ return {
1616
+ "traceId": value["traceId"],
1617
+ "spanId": value["spanId"],
1618
+ "pageVersionId": value["pageVersionId"],
1619
+ "componentVersion": value["componentVersion"],
1620
+ "actionId": value["actionId"]
1621
+ };
1622
+ }
1623
+
1624
+ // src/gen/models/TrackContext.ts
1625
+ function instanceOfTrackContext(value) {
1626
+ return true;
1627
+ }
1628
+ function TrackContextFromJSON(json) {
1629
+ return TrackContextFromJSONTyped(json, false);
1630
+ }
1631
+ function TrackContextFromJSONTyped(json, ignoreDiscriminator) {
1632
+ if (json == null) {
1633
+ return json;
1634
+ }
1635
+ return {
1636
+ "pageVersionId": json["pageVersionId"] == null ? void 0 : json["pageVersionId"],
1637
+ "componentVersion": json["componentVersion"] == null ? void 0 : json["componentVersion"],
1638
+ "actionId": json["actionId"] == null ? void 0 : json["actionId"],
1639
+ "sessionId": json["sessionId"] == null ? void 0 : json["sessionId"],
1640
+ "deviceId": json["deviceId"] == null ? void 0 : json["deviceId"],
1641
+ "uid": json["uid"] == null ? void 0 : json["uid"],
1642
+ "channel": json["channel"] == null ? void 0 : json["channel"]
1643
+ };
1644
+ }
1645
+ function TrackContextToJSON(json) {
1646
+ return TrackContextToJSONTyped(json, false);
1647
+ }
1648
+ function TrackContextToJSONTyped(value, ignoreDiscriminator = false) {
1649
+ if (value == null) {
1650
+ return value;
1651
+ }
1652
+ return {
1653
+ "pageVersionId": value["pageVersionId"],
1654
+ "componentVersion": value["componentVersion"],
1655
+ "actionId": value["actionId"],
1656
+ "sessionId": value["sessionId"],
1657
+ "deviceId": value["deviceId"],
1658
+ "uid": value["uid"],
1659
+ "channel": value["channel"]
1660
+ };
1661
+ }
1662
+
1663
+ // src/gen/models/TrackEvent.ts
1664
+ var TrackEventEventTypeEnum = {
1665
+ page_view: "page_view",
1666
+ component_view: "component_view",
1667
+ component_click: "component_click",
1668
+ action_trigger: "action_trigger",
1669
+ action_result: "action_result",
1670
+ error: "error",
1671
+ performance: "performance",
1672
+ custom: "custom"
1673
+ };
1674
+ function instanceOfTrackEvent(value) {
1675
+ if (!("eventName" in value) || value["eventName"] === void 0) return false;
1676
+ return true;
1677
+ }
1678
+ function TrackEventFromJSON(json) {
1679
+ return TrackEventFromJSONTyped(json, false);
1680
+ }
1681
+ function TrackEventFromJSONTyped(json, ignoreDiscriminator) {
1682
+ if (json == null) {
1683
+ return json;
1684
+ }
1685
+ return {
1686
+ "eventName": json["eventName"],
1687
+ "eventType": json["eventType"] == null ? void 0 : json["eventType"],
1688
+ "params": json["params"] == null ? void 0 : json["params"],
1689
+ "timestamp": json["timestamp"] == null ? void 0 : json["timestamp"],
1690
+ "context": json["context"] == null ? void 0 : TrackContextFromJSON(json["context"])
1691
+ };
1692
+ }
1693
+ function TrackEventToJSON(json) {
1694
+ return TrackEventToJSONTyped(json, false);
1695
+ }
1696
+ function TrackEventToJSONTyped(value, ignoreDiscriminator = false) {
1697
+ if (value == null) {
1698
+ return value;
1699
+ }
1700
+ return {
1701
+ "eventName": value["eventName"],
1702
+ "eventType": value["eventType"],
1703
+ "params": value["params"],
1704
+ "timestamp": value["timestamp"],
1705
+ "context": TrackContextToJSON(value["context"])
1706
+ };
1707
+ }
1708
+
1709
+ // src/gen/models/TrackRequest.ts
1710
+ function instanceOfTrackRequest(value) {
1711
+ if (!("events" in value) || value["events"] === void 0) return false;
1712
+ return true;
1713
+ }
1714
+ function TrackRequestFromJSON(json) {
1715
+ return TrackRequestFromJSONTyped(json, false);
1716
+ }
1717
+ function TrackRequestFromJSONTyped(json, ignoreDiscriminator) {
1718
+ if (json == null) {
1719
+ return json;
1720
+ }
1721
+ return {
1722
+ "events": json["events"].map(TrackEventFromJSON)
1723
+ };
1724
+ }
1725
+ function TrackRequestToJSON(json) {
1726
+ return TrackRequestToJSONTyped(json, false);
1727
+ }
1728
+ function TrackRequestToJSONTyped(value, ignoreDiscriminator = false) {
1729
+ if (value == null) {
1730
+ return value;
1731
+ }
1732
+ return {
1733
+ "events": value["events"].map(TrackEventToJSON)
1734
+ };
1735
+ }
1736
+
1737
+ // src/gen/apis/ActionApi.ts
1738
+ var ActionApi = class extends BaseAPI {
1739
+ /**
1740
+ * 所有业务动作的统一入口,包含: - 认证/鉴权 - 风控检查(限流、黑名单) - 幂等处理 - 审计记录
1741
+ * 执行动作
1742
+ */
1743
+ async executeActionRaw(requestParameters, initOverrides) {
1744
+ if (requestParameters["actionExecuteRequest"] == null) {
1745
+ throw new RequiredError(
1746
+ "actionExecuteRequest",
1747
+ 'Required parameter "actionExecuteRequest" was null or undefined when calling executeAction().'
1748
+ );
64
1749
  }
65
- return headers;
1750
+ const queryParameters = {};
1751
+ const headerParameters = {};
1752
+ headerParameters["Content-Type"] = "application/json";
1753
+ let urlPath = `/api/actions/execute`;
1754
+ const response = await this.request({
1755
+ path: urlPath,
1756
+ method: "POST",
1757
+ headers: headerParameters,
1758
+ query: queryParameters,
1759
+ body: ActionExecuteRequestToJSON(requestParameters["actionExecuteRequest"])
1760
+ }, initOverrides);
1761
+ return new JSONApiResponse(response, (jsonValue) => ActionExecuteResponseFromJSON(jsonValue));
66
1762
  }
67
1763
  /**
68
- * 发送请求
1764
+ * 所有业务动作的统一入口,包含: - 认证/鉴权 - 风控检查(限流、黑名单) - 幂等处理 - 审计记录
1765
+ * 执行动作
69
1766
  */
70
- async request(method, path, options) {
71
- let url = `${this.config.baseUrl}${path}`;
72
- if (options?.params) {
73
- const searchParams = new URLSearchParams();
74
- Object.entries(options.params).forEach(([key, value]) => {
75
- if (value !== void 0) {
76
- searchParams.append(key, value);
77
- }
78
- });
79
- const queryString = searchParams.toString();
80
- if (queryString) {
81
- url += `?${queryString}`;
82
- }
1767
+ async executeAction(requestParameters, initOverrides) {
1768
+ const response = await this.executeActionRaw(requestParameters, initOverrides);
1769
+ return await response.value();
1770
+ }
1771
+ /**
1772
+ * 批量执行多个动作(原子性不保证)
1773
+ * 批量执行动作
1774
+ */
1775
+ async executeActionBatchRaw(requestParameters, initOverrides) {
1776
+ if (requestParameters["executeActionBatchRequest"] == null) {
1777
+ throw new RequiredError(
1778
+ "executeActionBatchRequest",
1779
+ 'Required parameter "executeActionBatchRequest" was null or undefined when calling executeActionBatch().'
1780
+ );
83
1781
  }
84
- const commonHeaders = await this.getCommonHeaders();
85
- let requestConfig = {
86
- method,
87
- headers: {
88
- ...commonHeaders,
89
- ...options?.headers
90
- },
91
- body: options?.body ? JSON.stringify(options.body) : void 0
92
- };
93
- if (this.config.onRequest) {
94
- requestConfig = this.config.onRequest(requestConfig);
1782
+ const queryParameters = {};
1783
+ const headerParameters = {};
1784
+ headerParameters["Content-Type"] = "application/json";
1785
+ let urlPath = `/api/actions/batch`;
1786
+ const response = await this.request({
1787
+ path: urlPath,
1788
+ method: "POST",
1789
+ headers: headerParameters,
1790
+ query: queryParameters,
1791
+ body: ExecuteActionBatchRequestToJSON(requestParameters["executeActionBatchRequest"])
1792
+ }, initOverrides);
1793
+ return new JSONApiResponse(response, (jsonValue) => ExecuteActionBatch200ResponseFromJSON(jsonValue));
1794
+ }
1795
+ /**
1796
+ * 批量执行多个动作(原子性不保证)
1797
+ * 批量执行动作
1798
+ */
1799
+ async executeActionBatch(requestParameters, initOverrides) {
1800
+ const response = await this.executeActionBatchRaw(requestParameters, initOverrides);
1801
+ return await response.value();
1802
+ }
1803
+ };
1804
+
1805
+ // src/gen/apis/ActivityApi.ts
1806
+ var ActivityApi = class extends BaseAPI {
1807
+ /**
1808
+ * 获取用户在指定活动中的状态
1809
+ * 查询活动状态
1810
+ */
1811
+ async getActivityStateRaw(requestParameters, initOverrides) {
1812
+ if (requestParameters["activityId"] == null) {
1813
+ throw new RequiredError(
1814
+ "activityId",
1815
+ 'Required parameter "activityId" was null or undefined when calling getActivityState().'
1816
+ );
95
1817
  }
96
- try {
97
- const controller = new AbortController();
98
- const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);
99
- const response = await fetch(url, {
100
- ...requestConfig,
101
- signal: controller.signal
102
- });
103
- clearTimeout(timeoutId);
104
- let result = await response.json();
105
- if (this.config.onResponse) {
106
- result = this.config.onResponse(result);
107
- }
108
- if (!result.success) {
109
- const error = new Error(result.message || "Request failed");
110
- error.code = result.code;
111
- throw error;
112
- }
113
- return result.data;
114
- } catch (error) {
115
- if (this.config.onError) {
116
- this.config.onError(error);
117
- }
118
- throw error;
1818
+ const queryParameters = {};
1819
+ if (requestParameters["activityId"] != null) {
1820
+ queryParameters["activityId"] = requestParameters["activityId"];
119
1821
  }
1822
+ if (requestParameters["uid"] != null) {
1823
+ queryParameters["uid"] = requestParameters["uid"];
1824
+ }
1825
+ const headerParameters = {};
1826
+ let urlPath = `/api/activity/state`;
1827
+ const response = await this.request({
1828
+ path: urlPath,
1829
+ method: "GET",
1830
+ headers: headerParameters,
1831
+ query: queryParameters
1832
+ }, initOverrides);
1833
+ return new JSONApiResponse(response, (jsonValue) => ActivityStateResponseFromJSON(jsonValue));
120
1834
  }
121
1835
  /**
122
- * 发送请求(返回完整响应)
1836
+ * 获取用户在指定活动中的状态
1837
+ * 查询活动状态
123
1838
  */
124
- async requestFull(method, path, options) {
125
- let url = `${this.config.baseUrl}${path}`;
126
- if (options?.params) {
127
- const searchParams = new URLSearchParams();
128
- Object.entries(options.params).forEach(([key, value]) => {
129
- if (value !== void 0) {
130
- searchParams.append(key, value);
131
- }
132
- });
133
- const queryString = searchParams.toString();
134
- if (queryString) {
135
- url += `?${queryString}`;
136
- }
1839
+ async getActivityState(requestParameters, initOverrides) {
1840
+ const response = await this.getActivityStateRaw(requestParameters, initOverrides);
1841
+ return await response.value();
1842
+ }
1843
+ /**
1844
+ * 批量获取用户在多个活动中的状态
1845
+ * 批量查询活动状态
1846
+ */
1847
+ async getActivityStateBatchRaw(requestParameters, initOverrides) {
1848
+ if (requestParameters["getActivityStateBatchRequest"] == null) {
1849
+ throw new RequiredError(
1850
+ "getActivityStateBatchRequest",
1851
+ 'Required parameter "getActivityStateBatchRequest" was null or undefined when calling getActivityStateBatch().'
1852
+ );
137
1853
  }
138
- const commonHeaders = await this.getCommonHeaders();
139
- let requestConfig = {
140
- method,
141
- headers: commonHeaders,
142
- body: options?.body ? JSON.stringify(options.body) : void 0
143
- };
144
- if (this.config.onRequest) {
145
- requestConfig = this.config.onRequest(requestConfig);
1854
+ const queryParameters = {};
1855
+ const headerParameters = {};
1856
+ headerParameters["Content-Type"] = "application/json";
1857
+ let urlPath = `/api/activity/state/batch`;
1858
+ const response = await this.request({
1859
+ path: urlPath,
1860
+ method: "POST",
1861
+ headers: headerParameters,
1862
+ query: queryParameters,
1863
+ body: GetActivityStateBatchRequestToJSON(requestParameters["getActivityStateBatchRequest"])
1864
+ }, initOverrides);
1865
+ return new JSONApiResponse(response, (jsonValue) => GetActivityStateBatch200ResponseFromJSON(jsonValue));
1866
+ }
1867
+ /**
1868
+ * 批量获取用户在多个活动中的状态
1869
+ * 批量查询活动状态
1870
+ */
1871
+ async getActivityStateBatch(requestParameters, initOverrides) {
1872
+ const response = await this.getActivityStateBatchRaw(requestParameters, initOverrides);
1873
+ return await response.value();
1874
+ }
1875
+ };
1876
+
1877
+ // src/gen/apis/DataApi.ts
1878
+ var DataApi = class extends BaseAPI {
1879
+ /**
1880
+ * 数据查询代理,支持: - 白名单校验 - 字段裁剪/脱敏 - 缓存 - 审计
1881
+ * 查询数据
1882
+ */
1883
+ async queryDataRaw(requestParameters, initOverrides) {
1884
+ if (requestParameters["dataQueryRequest"] == null) {
1885
+ throw new RequiredError(
1886
+ "dataQueryRequest",
1887
+ 'Required parameter "dataQueryRequest" was null or undefined when calling queryData().'
1888
+ );
146
1889
  }
147
- try {
148
- const controller = new AbortController();
149
- const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);
150
- const response = await fetch(url, {
151
- ...requestConfig,
152
- signal: controller.signal
153
- });
154
- clearTimeout(timeoutId);
155
- let result = await response.json();
156
- if (this.config.onResponse) {
157
- result = this.config.onResponse(result);
158
- }
159
- return result;
160
- } catch (error) {
161
- if (this.config.onError) {
162
- this.config.onError(error);
163
- }
164
- throw error;
1890
+ const queryParameters = {};
1891
+ const headerParameters = {};
1892
+ headerParameters["Content-Type"] = "application/json";
1893
+ let urlPath = `/api/data/query`;
1894
+ const response = await this.request({
1895
+ path: urlPath,
1896
+ method: "POST",
1897
+ headers: headerParameters,
1898
+ query: queryParameters,
1899
+ body: DataQueryRequestToJSON(requestParameters["dataQueryRequest"])
1900
+ }, initOverrides);
1901
+ return new JSONApiResponse(response, (jsonValue) => DataQueryResponseFromJSON(jsonValue));
1902
+ }
1903
+ /**
1904
+ * 数据查询代理,支持: - 白名单校验 - 字段裁剪/脱敏 - 缓存 - 审计
1905
+ * 查询数据
1906
+ */
1907
+ async queryData(requestParameters, initOverrides) {
1908
+ const response = await this.queryDataRaw(requestParameters, initOverrides);
1909
+ return await response.value();
1910
+ }
1911
+ /**
1912
+ * 批量执行多个数据查询
1913
+ * 批量查询数据
1914
+ */
1915
+ async queryDataBatchRaw(requestParameters, initOverrides) {
1916
+ if (requestParameters["queryDataBatchRequest"] == null) {
1917
+ throw new RequiredError(
1918
+ "queryDataBatchRequest",
1919
+ 'Required parameter "queryDataBatchRequest" was null or undefined when calling queryDataBatch().'
1920
+ );
165
1921
  }
1922
+ const queryParameters = {};
1923
+ const headerParameters = {};
1924
+ headerParameters["Content-Type"] = "application/json";
1925
+ let urlPath = `/api/data/query/batch`;
1926
+ const response = await this.request({
1927
+ path: urlPath,
1928
+ method: "POST",
1929
+ headers: headerParameters,
1930
+ query: queryParameters,
1931
+ body: QueryDataBatchRequestToJSON(requestParameters["queryDataBatchRequest"])
1932
+ }, initOverrides);
1933
+ return new JSONApiResponse(response, (jsonValue) => QueryDataBatch200ResponseFromJSON(jsonValue));
166
1934
  }
167
- // ==================== 页面解析 ====================
168
1935
  /**
169
- * 解析页面
170
- * GET /api/page/resolve
1936
+ * 批量执行多个数据查询
1937
+ * 批量查询数据
171
1938
  */
172
- async resolvePage(params) {
173
- return this.request("GET", "/api/page/resolve", {
174
- params: {
175
- pageUid: params.pageUid,
176
- channel: params.channel,
177
- uid: params.uid,
178
- deviceId: params.deviceId,
179
- previewToken: params.previewToken
180
- }
181
- });
1939
+ async queryDataBatch(requestParameters, initOverrides) {
1940
+ const response = await this.queryDataBatchRaw(requestParameters, initOverrides);
1941
+ return await response.value();
182
1942
  }
183
- // ==================== Action Gateway ====================
1943
+ };
1944
+
1945
+ // src/gen/apis/HealthApi.ts
1946
+ var HealthApi = class extends BaseAPI {
184
1947
  /**
185
- * 执行动作
186
- * POST /api/actions/execute
1948
+ * 检查服务健康状态
1949
+ * 健康检查
187
1950
  */
188
- async executeAction(request) {
189
- return this.request("POST", "/api/actions/execute", {
190
- body: request
191
- });
1951
+ async healthRaw(initOverrides) {
1952
+ const queryParameters = {};
1953
+ const headerParameters = {};
1954
+ let urlPath = `/api/health`;
1955
+ const response = await this.request({
1956
+ path: urlPath,
1957
+ method: "GET",
1958
+ headers: headerParameters,
1959
+ query: queryParameters
1960
+ }, initOverrides);
1961
+ return new JSONApiResponse(response, (jsonValue) => HealthResponseFromJSON(jsonValue));
192
1962
  }
193
1963
  /**
194
- * 快捷方法:领取
1964
+ * 检查服务健康状态
1965
+ * 健康检查
195
1966
  */
196
- async claim(activityId, params) {
197
- return this.executeAction({
198
- actionType: "claim",
199
- params: { activityId, ...params },
200
- context: {
201
- deviceId: this.config.deviceId,
202
- channel: this.config.channel
203
- }
204
- });
1967
+ async health(initOverrides) {
1968
+ const response = await this.healthRaw(initOverrides);
1969
+ return await response.value();
205
1970
  }
206
1971
  /**
207
- * 快捷方法:签到
1972
+ * 检查服务是否存活
1973
+ * 存活检查
208
1974
  */
209
- async signin(activityId) {
210
- return this.executeAction({
211
- actionType: "signin",
212
- params: { activityId },
213
- context: {
214
- deviceId: this.config.deviceId,
215
- channel: this.config.channel
216
- }
217
- });
1975
+ async livenessRaw(initOverrides) {
1976
+ const queryParameters = {};
1977
+ const headerParameters = {};
1978
+ let urlPath = `/api/health/live`;
1979
+ const response = await this.request({
1980
+ path: urlPath,
1981
+ method: "GET",
1982
+ headers: headerParameters,
1983
+ query: queryParameters
1984
+ }, initOverrides);
1985
+ return new JSONApiResponse(response, (jsonValue) => HealthResponseFromJSON(jsonValue));
218
1986
  }
219
1987
  /**
220
- * 快捷方法:抽奖
1988
+ * 检查服务是否存活
1989
+ * 存活检查
221
1990
  */
222
- async lottery(activityId, params) {
223
- return this.executeAction({
224
- actionType: "lottery",
225
- params: { activityId, ...params },
226
- context: {
227
- deviceId: this.config.deviceId,
228
- channel: this.config.channel
229
- }
230
- });
1991
+ async liveness(initOverrides) {
1992
+ const response = await this.livenessRaw(initOverrides);
1993
+ return await response.value();
231
1994
  }
232
- // ==================== Data Proxy ====================
233
1995
  /**
234
- * 查询数据
235
- * POST /api/data/query
1996
+ * 检查服务是否就绪(可接受流量)
1997
+ * 就绪检查
236
1998
  */
237
- async queryData(request) {
238
- return this.request("POST", "/api/data/query", {
239
- body: request
240
- });
1999
+ async readinessRaw(initOverrides) {
2000
+ const queryParameters = {};
2001
+ const headerParameters = {};
2002
+ let urlPath = `/api/health/ready`;
2003
+ const response = await this.request({
2004
+ path: urlPath,
2005
+ method: "GET",
2006
+ headers: headerParameters,
2007
+ query: queryParameters
2008
+ }, initOverrides);
2009
+ return new JSONApiResponse(response, (jsonValue) => HealthResponseFromJSON(jsonValue));
241
2010
  }
242
2011
  /**
243
- * 快捷方法:查询数据
2012
+ * 检查服务是否就绪(可接受流量)
2013
+ * 就绪检查
244
2014
  */
245
- async query(queryVersionId, params) {
246
- const response = await this.queryData({
247
- queryVersionId,
248
- params: params || {}
249
- });
250
- return response.data;
251
- }
252
- // ==================== 埋点 ====================
2015
+ async readiness(initOverrides) {
2016
+ const response = await this.readinessRaw(initOverrides);
2017
+ return await response.value();
2018
+ }
2019
+ };
2020
+
2021
+ // src/gen/apis/PageApi.ts
2022
+ var PageApi = class extends BaseAPI {
253
2023
  /**
254
- * 上报埋点
255
- * POST /api/track
2024
+ * 根据页面 UID 解析页面配置,返回: - 页面 JSON Schema - 组件 Manifest(锁定的组件版本清单) - 运行时配置(Kill Switch、Blocked Components 等)
2025
+ * 解析页面
256
2026
  */
257
- async track(events) {
258
- await this.request("POST", "/api/track", {
259
- body: { events }
260
- });
2027
+ async resolvePageRaw(requestParameters, initOverrides) {
2028
+ if (requestParameters["pageUid"] == null) {
2029
+ throw new RequiredError(
2030
+ "pageUid",
2031
+ 'Required parameter "pageUid" was null or undefined when calling resolvePage().'
2032
+ );
2033
+ }
2034
+ const queryParameters = {};
2035
+ if (requestParameters["pageUid"] != null) {
2036
+ queryParameters["pageUid"] = requestParameters["pageUid"];
2037
+ }
2038
+ if (requestParameters["channel"] != null) {
2039
+ queryParameters["channel"] = requestParameters["channel"];
2040
+ }
2041
+ if (requestParameters["uid"] != null) {
2042
+ queryParameters["uid"] = requestParameters["uid"];
2043
+ }
2044
+ if (requestParameters["deviceId"] != null) {
2045
+ queryParameters["deviceId"] = requestParameters["deviceId"];
2046
+ }
2047
+ if (requestParameters["previewToken"] != null) {
2048
+ queryParameters["previewToken"] = requestParameters["previewToken"];
2049
+ }
2050
+ const headerParameters = {};
2051
+ let urlPath = `/api/page/resolve`;
2052
+ const response = await this.request({
2053
+ path: urlPath,
2054
+ method: "GET",
2055
+ headers: headerParameters,
2056
+ query: queryParameters
2057
+ }, initOverrides);
2058
+ return new JSONApiResponse(response, (jsonValue) => PageResolveResponseFromJSON(jsonValue));
261
2059
  }
262
2060
  /**
263
- * 快捷方法:上报单个事件
2061
+ * 根据页面 UID 解析页面配置,返回: - 页面 JSON Schema - 组件 Manifest(锁定的组件版本清单) - 运行时配置(Kill Switch、Blocked Components 等)
2062
+ * 解析页面
264
2063
  */
265
- async trackEvent(eventName, params) {
266
- await this.track([
267
- {
268
- eventName,
269
- params,
270
- timestamp: Date.now()
271
- }
272
- ]);
2064
+ async resolvePage(requestParameters, initOverrides) {
2065
+ const response = await this.resolvePageRaw(requestParameters, initOverrides);
2066
+ return await response.value();
273
2067
  }
274
- // ==================== 活动状态 ====================
275
2068
  /**
276
- * 获取活动状态
277
- * GET /api/activity/state
2069
+ * 批量获取多个页面的解析结果
2070
+ * 批量解析页面
278
2071
  */
279
- async getActivityState(params) {
280
- return this.request("GET", "/api/activity/state", {
281
- params: {
282
- activityId: params.activityId,
283
- uid: params.uid,
284
- deviceId: params.deviceId
285
- }
286
- });
2072
+ async resolvePageBatchRaw(requestParameters, initOverrides) {
2073
+ if (requestParameters["resolvePageBatchRequest"] == null) {
2074
+ throw new RequiredError(
2075
+ "resolvePageBatchRequest",
2076
+ 'Required parameter "resolvePageBatchRequest" was null or undefined when calling resolvePageBatch().'
2077
+ );
2078
+ }
2079
+ const queryParameters = {};
2080
+ const headerParameters = {};
2081
+ headerParameters["Content-Type"] = "application/json";
2082
+ let urlPath = `/api/page/resolve/batch`;
2083
+ const response = await this.request({
2084
+ path: urlPath,
2085
+ method: "POST",
2086
+ headers: headerParameters,
2087
+ query: queryParameters,
2088
+ body: ResolvePageBatchRequestToJSON(requestParameters["resolvePageBatchRequest"])
2089
+ }, initOverrides);
2090
+ return new JSONApiResponse(response, (jsonValue) => ResolvePageBatch200ResponseFromJSON(jsonValue));
287
2091
  }
288
- // ==================== 健康检查 ====================
289
2092
  /**
290
- * 健康检查
291
- * GET /api/health
2093
+ * 批量获取多个页面的解析结果
2094
+ * 批量解析页面
292
2095
  */
293
- async health() {
294
- return this.request("GET", "/api/health");
2096
+ async resolvePageBatch(requestParameters, initOverrides) {
2097
+ const response = await this.resolvePageBatchRaw(requestParameters, initOverrides);
2098
+ return await response.value();
295
2099
  }
296
2100
  };
297
- function createUserClient(config) {
298
- return new UserApiClient(config);
2101
+ var ResolvePageChannelEnum = {
2102
+ preview: "preview",
2103
+ prod: "prod",
2104
+ gray: "gray"
2105
+ };
2106
+
2107
+ // src/gen/apis/TrackApi.ts
2108
+ var TrackApi = class extends BaseAPI {
2109
+ /**
2110
+ * 批量上报埋点事件
2111
+ * 上报埋点
2112
+ */
2113
+ async trackRaw(requestParameters, initOverrides) {
2114
+ if (requestParameters["trackRequest"] == null) {
2115
+ throw new RequiredError(
2116
+ "trackRequest",
2117
+ 'Required parameter "trackRequest" was null or undefined when calling track().'
2118
+ );
2119
+ }
2120
+ const queryParameters = {};
2121
+ const headerParameters = {};
2122
+ headerParameters["Content-Type"] = "application/json";
2123
+ let urlPath = `/api/track`;
2124
+ const response = await this.request({
2125
+ path: urlPath,
2126
+ method: "POST",
2127
+ headers: headerParameters,
2128
+ query: queryParameters,
2129
+ body: TrackRequestToJSON(requestParameters["trackRequest"])
2130
+ }, initOverrides);
2131
+ return new VoidApiResponse(response);
2132
+ }
2133
+ /**
2134
+ * 批量上报埋点事件
2135
+ * 上报埋点
2136
+ */
2137
+ async track(requestParameters, initOverrides) {
2138
+ await this.trackRaw(requestParameters, initOverrides);
2139
+ }
2140
+ };
2141
+
2142
+ // src/index.ts
2143
+ var import_openapi_client_core2 = require("@djvlc/openapi-client-core");
2144
+ var SDK_INFO = {
2145
+ name: true ? "@djvlc/openapi-user-client" : "@djvlc/openapi-user-client",
2146
+ version: true ? "1.0.0" : "0.0.0-dev"
2147
+ };
2148
+ function createUserClient(opts) {
2149
+ const defaultOpts = {
2150
+ timeoutMs: 15e3,
2151
+ // User API 追求快失败
2152
+ credentials: "omit"
2153
+ // 通常不走 Cookie
2154
+ };
2155
+ const mergedOpts = {
2156
+ ...defaultOpts,
2157
+ ...opts
2158
+ };
2159
+ return (0, import_openapi_client_core.createClient)(apis_exports, mergedOpts, SDK_INFO);
299
2160
  }
300
- var index_default = UserApiClient;
301
2161
  // Annotate the CommonJS export names for ESM import in node:
302
2162
  0 && (module.exports = {
303
- UserApiClient,
304
- createUserClient
2163
+ AbortError,
2164
+ ActionApi,
2165
+ ActionContextFromJSON,
2166
+ ActionContextFromJSONTyped,
2167
+ ActionContextToJSON,
2168
+ ActionContextToJSONTyped,
2169
+ ActionExecuteRequestFromJSON,
2170
+ ActionExecuteRequestFromJSONTyped,
2171
+ ActionExecuteRequestToJSON,
2172
+ ActionExecuteRequestToJSONTyped,
2173
+ ActionExecuteResponseFromJSON,
2174
+ ActionExecuteResponseFromJSONTyped,
2175
+ ActionExecuteResponseToJSON,
2176
+ ActionExecuteResponseToJSONTyped,
2177
+ ActivityApi,
2178
+ ActivityStateActivityInfoFromJSON,
2179
+ ActivityStateActivityInfoFromJSONTyped,
2180
+ ActivityStateActivityInfoToJSON,
2181
+ ActivityStateActivityInfoToJSONTyped,
2182
+ ActivityStateFromJSON,
2183
+ ActivityStateFromJSONTyped,
2184
+ ActivityStateResponseFromJSON,
2185
+ ActivityStateResponseFromJSONTyped,
2186
+ ActivityStateResponseToJSON,
2187
+ ActivityStateResponseToJSONTyped,
2188
+ ActivityStateStatusEnum,
2189
+ ActivityStateToJSON,
2190
+ ActivityStateToJSONTyped,
2191
+ BaseResponseVoFromJSON,
2192
+ BaseResponseVoFromJSONTyped,
2193
+ BaseResponseVoToJSON,
2194
+ BaseResponseVoToJSONTyped,
2195
+ BlockedComponentFromJSON,
2196
+ BlockedComponentFromJSONTyped,
2197
+ BlockedComponentToJSON,
2198
+ BlockedComponentToJSONTyped,
2199
+ Configuration,
2200
+ DataApi,
2201
+ DataQueryContextFromJSON,
2202
+ DataQueryContextFromJSONTyped,
2203
+ DataQueryContextToJSON,
2204
+ DataQueryContextToJSONTyped,
2205
+ DataQueryRequestFromJSON,
2206
+ DataQueryRequestFromJSONTyped,
2207
+ DataQueryRequestToJSON,
2208
+ DataQueryRequestToJSONTyped,
2209
+ DataQueryResponseFromJSON,
2210
+ DataQueryResponseFromJSONTyped,
2211
+ DataQueryResponseToJSON,
2212
+ DataQueryResponseToJSONTyped,
2213
+ DjvApiError,
2214
+ ErrorDetailFromJSON,
2215
+ ErrorDetailFromJSONTyped,
2216
+ ErrorDetailToJSON,
2217
+ ErrorDetailToJSONTyped,
2218
+ ErrorResponseVoFromJSON,
2219
+ ErrorResponseVoFromJSONTyped,
2220
+ ErrorResponseVoToJSON,
2221
+ ErrorResponseVoToJSONTyped,
2222
+ ExecuteActionBatch200ResponseFromJSON,
2223
+ ExecuteActionBatch200ResponseFromJSONTyped,
2224
+ ExecuteActionBatch200ResponseToJSON,
2225
+ ExecuteActionBatch200ResponseToJSONTyped,
2226
+ ExecuteActionBatchRequestFromJSON,
2227
+ ExecuteActionBatchRequestFromJSONTyped,
2228
+ ExecuteActionBatchRequestToJSON,
2229
+ ExecuteActionBatchRequestToJSONTyped,
2230
+ GetActivityStateBatch200ResponseFromJSON,
2231
+ GetActivityStateBatch200ResponseFromJSONTyped,
2232
+ GetActivityStateBatch200ResponseToJSON,
2233
+ GetActivityStateBatch200ResponseToJSONTyped,
2234
+ GetActivityStateBatchRequestFromJSON,
2235
+ GetActivityStateBatchRequestFromJSONTyped,
2236
+ GetActivityStateBatchRequestToJSON,
2237
+ GetActivityStateBatchRequestToJSONTyped,
2238
+ HealthApi,
2239
+ HealthResponseChecksValueFromJSON,
2240
+ HealthResponseChecksValueFromJSONTyped,
2241
+ HealthResponseChecksValueToJSON,
2242
+ HealthResponseChecksValueToJSONTyped,
2243
+ HealthResponseFromJSON,
2244
+ HealthResponseFromJSONTyped,
2245
+ HealthResponseStatusEnum,
2246
+ HealthResponseToJSON,
2247
+ HealthResponseToJSONTyped,
2248
+ ManifestItemFromJSON,
2249
+ ManifestItemFromJSONTyped,
2250
+ ManifestItemToJSON,
2251
+ ManifestItemToJSONTyped,
2252
+ NetworkError,
2253
+ PageApi,
2254
+ PageManifestFromJSON,
2255
+ PageManifestFromJSONTyped,
2256
+ PageManifestToJSON,
2257
+ PageManifestToJSONTyped,
2258
+ PageResolveResponseFromJSON,
2259
+ PageResolveResponseFromJSONTyped,
2260
+ PageResolveResponseToJSON,
2261
+ PageResolveResponseToJSONTyped,
2262
+ PageResolveResultFromJSON,
2263
+ PageResolveResultFromJSONTyped,
2264
+ PageResolveResultToJSON,
2265
+ PageResolveResultToJSONTyped,
2266
+ QueryDataBatch200ResponseFromJSON,
2267
+ QueryDataBatch200ResponseFromJSONTyped,
2268
+ QueryDataBatch200ResponseToJSON,
2269
+ QueryDataBatch200ResponseToJSONTyped,
2270
+ QueryDataBatchRequestFromJSON,
2271
+ QueryDataBatchRequestFromJSONTyped,
2272
+ QueryDataBatchRequestToJSON,
2273
+ QueryDataBatchRequestToJSONTyped,
2274
+ ResolvePageBatch200ResponseFromJSON,
2275
+ ResolvePageBatch200ResponseFromJSONTyped,
2276
+ ResolvePageBatch200ResponseToJSON,
2277
+ ResolvePageBatch200ResponseToJSONTyped,
2278
+ ResolvePageBatchRequestChannelEnum,
2279
+ ResolvePageBatchRequestFromJSON,
2280
+ ResolvePageBatchRequestFromJSONTyped,
2281
+ ResolvePageBatchRequestToJSON,
2282
+ ResolvePageBatchRequestToJSONTyped,
2283
+ ResolvePageChannelEnum,
2284
+ RuntimeConfigFromJSON,
2285
+ RuntimeConfigFromJSONTyped,
2286
+ RuntimeConfigReportConfigFromJSON,
2287
+ RuntimeConfigReportConfigFromJSONTyped,
2288
+ RuntimeConfigReportConfigToJSON,
2289
+ RuntimeConfigReportConfigToJSONTyped,
2290
+ RuntimeConfigToJSON,
2291
+ RuntimeConfigToJSONTyped,
2292
+ TimeoutError,
2293
+ TraceContextFromJSON,
2294
+ TraceContextFromJSONTyped,
2295
+ TraceContextToJSON,
2296
+ TraceContextToJSONTyped,
2297
+ TrackApi,
2298
+ TrackContextFromJSON,
2299
+ TrackContextFromJSONTyped,
2300
+ TrackContextToJSON,
2301
+ TrackContextToJSONTyped,
2302
+ TrackEventEventTypeEnum,
2303
+ TrackEventFromJSON,
2304
+ TrackEventFromJSONTyped,
2305
+ TrackEventToJSON,
2306
+ TrackEventToJSONTyped,
2307
+ TrackRequestFromJSON,
2308
+ TrackRequestFromJSONTyped,
2309
+ TrackRequestToJSON,
2310
+ TrackRequestToJSONTyped,
2311
+ UserActivityStateFromJSON,
2312
+ UserActivityStateFromJSONTyped,
2313
+ UserActivityStateProgressFromJSON,
2314
+ UserActivityStateProgressFromJSONTyped,
2315
+ UserActivityStateProgressToJSON,
2316
+ UserActivityStateProgressToJSONTyped,
2317
+ UserActivityStateToJSON,
2318
+ UserActivityStateToJSONTyped,
2319
+ createConsoleLogger,
2320
+ createSilentLogger,
2321
+ createUserClient,
2322
+ instanceOfActionContext,
2323
+ instanceOfActionExecuteRequest,
2324
+ instanceOfActionExecuteResponse,
2325
+ instanceOfActivityState,
2326
+ instanceOfActivityStateActivityInfo,
2327
+ instanceOfActivityStateResponse,
2328
+ instanceOfBaseResponseVo,
2329
+ instanceOfBlockedComponent,
2330
+ instanceOfDataQueryContext,
2331
+ instanceOfDataQueryRequest,
2332
+ instanceOfDataQueryResponse,
2333
+ instanceOfErrorDetail,
2334
+ instanceOfErrorResponseVo,
2335
+ instanceOfExecuteActionBatch200Response,
2336
+ instanceOfExecuteActionBatchRequest,
2337
+ instanceOfGetActivityStateBatch200Response,
2338
+ instanceOfGetActivityStateBatchRequest,
2339
+ instanceOfHealthResponse,
2340
+ instanceOfHealthResponseChecksValue,
2341
+ instanceOfManifestItem,
2342
+ instanceOfPageManifest,
2343
+ instanceOfPageResolveResponse,
2344
+ instanceOfPageResolveResult,
2345
+ instanceOfQueryDataBatch200Response,
2346
+ instanceOfQueryDataBatchRequest,
2347
+ instanceOfResolvePageBatch200Response,
2348
+ instanceOfResolvePageBatchRequest,
2349
+ instanceOfRuntimeConfig,
2350
+ instanceOfRuntimeConfigReportConfig,
2351
+ instanceOfTraceContext,
2352
+ instanceOfTrackContext,
2353
+ instanceOfTrackEvent,
2354
+ instanceOfTrackRequest,
2355
+ instanceOfUserActivityState,
2356
+ instanceOfUserActivityStateProgress,
2357
+ isRetryableError
305
2358
  });