@lightsparkdev/core 0.1.7 → 0.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @lightsparkdev/core
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Update how the user agent string is passed by the requester
8
+
9
+ ## 0.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Update the schema to include new wallet balances, etc.
14
+
3
15
  ## 0.1.7
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -380,9 +380,10 @@ var LIGHTSPARK_BETA_HEADER_KEY = "X-Lightspark-Beta";
380
380
  var LIGHTSPARK_BETA_HEADER_VALUE = "z2h0BBYxTA83cjW7fi8QwWtBPCzkQKiemcuhKY08LOo";
381
381
  import_dayjs.default.extend(import_utc.default);
382
382
  var Requester = class {
383
- constructor(nodeKeyCache, schemaEndpoint, authProvider = new StubAuthProvider(), baseUrl = DEFAULT_BASE_URL) {
383
+ constructor(nodeKeyCache, schemaEndpoint, sdkUserAgent, authProvider = new StubAuthProvider(), baseUrl = DEFAULT_BASE_URL) {
384
384
  this.nodeKeyCache = nodeKeyCache;
385
385
  this.schemaEndpoint = schemaEndpoint;
386
+ this.sdkUserAgent = sdkUserAgent;
386
387
  this.authProvider = authProvider;
387
388
  this.baseUrl = baseUrl;
388
389
  let websocketImpl;
@@ -501,8 +502,7 @@ var Requester = class {
501
502
  getSdkUserAgent() {
502
503
  const platform = isNode ? "NodeJS" : "Browser";
503
504
  const platformVersion = isNode ? process.version : "";
504
- const sdkVersion = "1.0.4";
505
- return `lightspark-js-sdk/${sdkVersion} ${platform}/${platformVersion}`;
505
+ return `${this.sdkUserAgent} ${platform}/${platformVersion}`;
506
506
  }
507
507
  async addSigningDataIfNeeded(queryPayload, headers, signingNodeId) {
508
508
  if (!signingNodeId) {
package/dist/index.d.ts CHANGED
@@ -65,10 +65,11 @@ type Query<T> = {
65
65
  declare class Requester {
66
66
  private readonly nodeKeyCache;
67
67
  private readonly schemaEndpoint;
68
+ private readonly sdkUserAgent;
68
69
  private readonly authProvider;
69
70
  private readonly baseUrl;
70
71
  private readonly wsClient;
71
- constructor(nodeKeyCache: NodeKeyCache, schemaEndpoint: string, authProvider?: AuthProvider, baseUrl?: string);
72
+ constructor(nodeKeyCache: NodeKeyCache, schemaEndpoint: string, sdkUserAgent: string, authProvider?: AuthProvider, baseUrl?: string);
72
73
  executeQuery<T>(query: Query<T>): Promise<T | null>;
73
74
  subscribe(queryPayload: string, variables?: {
74
75
  [key: string]: any;
package/dist/index.js CHANGED
@@ -320,9 +320,10 @@ var LIGHTSPARK_BETA_HEADER_KEY = "X-Lightspark-Beta";
320
320
  var LIGHTSPARK_BETA_HEADER_VALUE = "z2h0BBYxTA83cjW7fi8QwWtBPCzkQKiemcuhKY08LOo";
321
321
  dayjs.extend(utc);
322
322
  var Requester = class {
323
- constructor(nodeKeyCache, schemaEndpoint, authProvider = new StubAuthProvider(), baseUrl = DEFAULT_BASE_URL) {
323
+ constructor(nodeKeyCache, schemaEndpoint, sdkUserAgent, authProvider = new StubAuthProvider(), baseUrl = DEFAULT_BASE_URL) {
324
324
  this.nodeKeyCache = nodeKeyCache;
325
325
  this.schemaEndpoint = schemaEndpoint;
326
+ this.sdkUserAgent = sdkUserAgent;
326
327
  this.authProvider = authProvider;
327
328
  this.baseUrl = baseUrl;
328
329
  let websocketImpl;
@@ -441,8 +442,7 @@ var Requester = class {
441
442
  getSdkUserAgent() {
442
443
  const platform = isNode ? "NodeJS" : "Browser";
443
444
  const platformVersion = isNode ? process.version : "";
444
- const sdkVersion = "1.0.4";
445
- return `lightspark-js-sdk/${sdkVersion} ${platform}/${platformVersion}`;
445
+ return `${this.sdkUserAgent} ${platform}/${platformVersion}`;
446
446
  }
447
447
  async addSigningDataIfNeeded(queryPayload, headers, signingNodeId) {
448
448
  if (!signingNodeId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightsparkdev/core",
3
- "version": "0.1.7",
3
+ "version": "0.2.1",
4
4
  "description": "Lightspark JS SDK",
5
5
  "author": "Lightspark Inc.",
6
6
  "keywords": [
@@ -32,6 +32,7 @@ class Requester {
32
32
  constructor(
33
33
  private readonly nodeKeyCache: NodeKeyCache,
34
34
  private readonly schemaEndpoint: string,
35
+ private readonly sdkUserAgent: string,
35
36
  private readonly authProvider: AuthProvider = new StubAuthProvider(),
36
37
  private readonly baseUrl: string = DEFAULT_BASE_URL
37
38
  ) {
@@ -166,10 +167,7 @@ class Requester {
166
167
  private getSdkUserAgent(): string {
167
168
  const platform = isNode ? "NodeJS" : "Browser";
168
169
  const platformVersion = isNode ? process.version : "";
169
- // TODO(Jeremy): Figure out how to properly load this from the package.json. Using an import
170
- // is breaking the streaming sats extension.
171
- const sdkVersion = "1.0.4";
172
- return `lightspark-js-sdk/${sdkVersion} ${platform}/${platformVersion}`;
170
+ return `${this.sdkUserAgent} ${platform}/${platformVersion}`;
173
171
  }
174
172
 
175
173
  private async addSigningDataIfNeeded(