@atomm-developer/generator-sdk 1.0.8 → 1.0.9

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.
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { t as toUtf8, f as fromUtf8 } from "./index-DP-Q2Dkh.js";
4
+ import { t as toUtf8, f as fromUtf8 } from "./index-T0kU38cY.js";
5
5
  class EventStreamSerde {
6
6
  constructor({ marshaller, serializer, deserializer, serdeContext, defaultContentType }) {
7
7
  __publicField(this, "marshaller");
@@ -10159,6 +10159,7 @@ class BillingModule {
10159
10159
  __publicField(this, "credits");
10160
10160
  __publicField(this, "emitter", new EventEmitter());
10161
10161
  /** 缓存的免费次数信息 */
10162
+ __publicField(this, "_isEnabled", false);
10162
10163
  __publicField(this, "_freeRemaining", 0);
10163
10164
  __publicField(this, "_freeTotal", 0);
10164
10165
  __publicField(this, "_creditsPerUse", 0);
@@ -10186,6 +10187,7 @@ class BillingModule {
10186
10187
  }),
10187
10188
  this.credits.getBalance()
10188
10189
  ]);
10190
+ this._isEnabled = freeData.is_enabled;
10189
10191
  this._freeRemaining = freeData.remaining_count;
10190
10192
  this._freeTotal = freeData.total_count;
10191
10193
  this._creditsPerUse = freeData.need_credits;
@@ -10277,6 +10279,7 @@ class BillingModule {
10277
10279
  const inFreePeriod = now < this._freePeriodEnd;
10278
10280
  const freePeriodRemaining = inFreePeriod ? Math.ceil((this._freePeriodEnd - now) / 1e3) : 0;
10279
10281
  return {
10282
+ isEnabled: this._isEnabled,
10280
10283
  freeRemaining: this._freeRemaining,
10281
10284
  freeTotal: this._freeTotal,
10282
10285
  creditsPerUse: this._creditsPerUse,
@@ -12284,7 +12287,7 @@ class HttpProtocol extends SerdeContext {
12284
12287
  });
12285
12288
  }
12286
12289
  async loadEventStreamCapability() {
12287
- const { EventStreamSerde } = await import("./index-6H3DQX8m.js");
12290
+ const { EventStreamSerde } = await import("./index-DyTtU447.js");
12288
12291
  return new EventStreamSerde({
12289
12292
  marshaller: this.getEventStreamMarshaller(),
12290
12293
  serializer: this.serializer,
package/dist/index.d.ts CHANGED
@@ -95,6 +95,7 @@ declare class BillingModule {
95
95
  private readonly credits;
96
96
  private readonly emitter;
97
97
  /** 缓存的免费次数信息 */
98
+ private _isEnabled;
98
99
  private _freeRemaining;
99
100
  private _freeTotal;
100
101
  private _creditsPerUse;
@@ -712,6 +713,8 @@ export declare interface TemplateRuntimeSnapshot {
712
713
 
713
714
  /** 使用额度信息(整合免费次数 + 积分余额 + 免费时段) */
714
715
  export declare interface UsageInfo {
716
+ /** 当前模块是否启用计费 */
717
+ isEnabled: boolean;
715
718
  /** 剩余免费次数 */
716
719
  freeRemaining: number;
717
720
  /** 免费总次数 */
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { G, S, T, w } from "./index-DP-Q2Dkh.js";
1
+ import { G, S, T, w } from "./index-T0kU38cY.js";
2
2
  export {
3
3
  G as GeneratorSDK,
4
4
  S as SdkError,