@lightsparkdev/core 1.0.14 → 1.0.15

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,11 @@
1
1
  # @lightsparkdev/core
2
2
 
3
+ ## 1.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 66e76d3: - Remove beta headers in Requester
8
+
3
9
  ## 1.0.14
4
10
 
5
11
  ### Patch Changes
@@ -161,6 +161,7 @@ type JSONType = JSONLiteral | JSONType[] | {
161
161
  type JSONObject = {
162
162
  [key: string]: JSONType;
163
163
  };
164
+ type NN<T> = NonNullable<T>;
164
165
 
165
166
  declare const isError: (e: unknown) => e is Error;
166
167
  type ErrorWithMessage = {
@@ -268,4 +269,4 @@ declare function pollUntil<D extends () => Promise<unknown>, T>(asyncFn: D, getV
268
269
 
269
270
  declare function sleep(ms: number): Promise<unknown>;
270
271
 
271
- export { JSONType as $, isErrorMsg as A, errorToJSON as B, ConfigKeys as C, bytesToHex as D, hexToBytes as E, getLocalStorageConfigItem as F, getLocalStorageBoolean as G, setLocalStorageBoolean as H, deleteLocalStorageItem as I, getCurrentLocale as J, countryCodesToCurrencyCodes as K, CurrencyLocales as L, CurrencyCodes as M, localeToCurrencyCode as N, clamp as O, linearInterpolate as P, round as Q, isNumber as R, pollUntil as S, sleep as T, Maybe as U, ExpandRecursively as V, ById as W, OmitTypename as X, isType as Y, DeepPartial as Z, JSONLiteral as _, b64encode as a, JSONObject as a0, b64decode as b, createSha256Hash as c, defaultCurrencyCode as d, CurrencyUnit as e, CurrencyAmountType as f, convertCurrencyAmountValue as g, convertCurrencyAmount as h, CurrencyMap as i, CurrencyAmountObj as j, CurrencyAmountArg as k, isCurrencyAmountObj as l, isCurrencyAmount as m, mapCurrencyAmount as n, isCurrencyMap as o, abbrCurrencyUnit as p, formatCurrencyStr as q, localeToCurrencySymbol as r, separateCurrencyStrParts as s, isBrowser as t, urlsafe_b64decode as u, isNode as v, isTest as w, isError as x, isErrorWithMessage as y, getErrorMsg as z };
272
+ export { JSONType as $, isErrorMsg as A, errorToJSON as B, ConfigKeys as C, bytesToHex as D, hexToBytes as E, getLocalStorageConfigItem as F, getLocalStorageBoolean as G, setLocalStorageBoolean as H, deleteLocalStorageItem as I, getCurrentLocale as J, countryCodesToCurrencyCodes as K, CurrencyLocales as L, CurrencyCodes as M, localeToCurrencyCode as N, clamp as O, linearInterpolate as P, round as Q, isNumber as R, pollUntil as S, sleep as T, Maybe as U, ExpandRecursively as V, ById as W, OmitTypename as X, isType as Y, DeepPartial as Z, JSONLiteral as _, b64encode as a, JSONObject as a0, NN as a1, b64decode as b, createSha256Hash as c, defaultCurrencyCode as d, CurrencyUnit as e, CurrencyAmountType as f, convertCurrencyAmountValue as g, convertCurrencyAmount as h, CurrencyMap as i, CurrencyAmountObj as j, CurrencyAmountArg as k, isCurrencyAmountObj as l, isCurrencyAmount as m, mapCurrencyAmount as n, isCurrencyMap as o, abbrCurrencyUnit as p, formatCurrencyStr as q, localeToCurrencySymbol as r, separateCurrencyStrParts as s, isBrowser as t, urlsafe_b64decode as u, isNode as v, isTest as w, isError as x, isErrorWithMessage as y, getErrorMsg as z };
package/dist/index.cjs CHANGED
@@ -1396,8 +1396,6 @@ var import_graphql_ws = require("graphql-ws");
1396
1396
  var import_ws = __toESM(require("ws"), 1);
1397
1397
  var import_zen_observable_ts = require("zen-observable-ts");
1398
1398
  var DEFAULT_BASE_URL = "api.lightspark.com";
1399
- var LIGHTSPARK_BETA_HEADER_KEY = "X-Lightspark-Beta";
1400
- var LIGHTSPARK_BETA_HEADER_VALUE = "z2h0BBYxTA83cjW7fi8QwWtBPCzkQKiemcuhKY08LOo";
1401
1399
  import_dayjs.default.extend(import_utc.default);
1402
1400
  var Requester = class {
1403
1401
  constructor(nodeKeyCache, schemaEndpoint, sdkUserAgent, authProvider = new StubAuthProvider(), baseUrl = DEFAULT_BASE_URL, cryptoImpl = DefaultCrypto) {
@@ -1495,7 +1493,6 @@ var Requester = class {
1495
1493
  const sdkUserAgent = this.getSdkUserAgent();
1496
1494
  const baseHeaders = {
1497
1495
  "Content-Type": "application/json",
1498
- [LIGHTSPARK_BETA_HEADER_KEY]: LIGHTSPARK_BETA_HEADER_VALUE,
1499
1496
  "X-Lightspark-SDK": sdkUserAgent,
1500
1497
  "User-Agent": browserUserAgent || sdkUserAgent
1501
1498
  };
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { W as ById, C as ConfigKeys, k as CurrencyAmountArg, j as CurrencyAmountObj, f as CurrencyAmountType, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, Z as DeepPartial, V as ExpandRecursively, _ as JSONLiteral, a0 as JSONObject, $ as JSONType, U as Maybe, X as OmitTypename, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, m as isCurrencyAmount, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, w as isTest, Y as isType, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, n as mapCurrencyAmount, S as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, T as sleep, u as urlsafe_b64decode } from './index-d0c72658.js';
1
+ export { W as ById, C as ConfigKeys, k as CurrencyAmountArg, j as CurrencyAmountObj, f as CurrencyAmountType, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, Z as DeepPartial, V as ExpandRecursively, _ as JSONLiteral, a0 as JSONObject, $ as JSONType, U as Maybe, a1 as NN, X as OmitTypename, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, m as isCurrencyAmount, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, w as isTest, Y as isType, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, n as mapCurrencyAmount, S as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, T as sleep, u as urlsafe_b64decode } from './index-2708d41b.js';
2
2
  import { Observable } from 'zen-observable-ts';
3
3
 
4
4
  declare class LightsparkException extends Error {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { W as ById, C as ConfigKeys, k as CurrencyAmountArg, j as CurrencyAmountObj, f as CurrencyAmountType, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, Z as DeepPartial, V as ExpandRecursively, _ as JSONLiteral, a0 as JSONObject, $ as JSONType, U as Maybe, X as OmitTypename, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, m as isCurrencyAmount, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, w as isTest, Y as isType, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, n as mapCurrencyAmount, S as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, T as sleep, u as urlsafe_b64decode } from './index-d0c72658.js';
1
+ export { W as ById, C as ConfigKeys, k as CurrencyAmountArg, j as CurrencyAmountObj, f as CurrencyAmountType, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, Z as DeepPartial, V as ExpandRecursively, _ as JSONLiteral, a0 as JSONObject, $ as JSONType, U as Maybe, a1 as NN, X as OmitTypename, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, m as isCurrencyAmount, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, w as isTest, Y as isType, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, n as mapCurrencyAmount, S as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, T as sleep, u as urlsafe_b64decode } from './index-2708d41b.js';
2
2
  import { Observable } from 'zen-observable-ts';
3
3
 
4
4
  declare class LightsparkException extends Error {
package/dist/index.js CHANGED
@@ -455,8 +455,6 @@ import { createClient } from "graphql-ws";
455
455
  import NodeWebSocket from "ws";
456
456
  import { Observable } from "zen-observable-ts";
457
457
  var DEFAULT_BASE_URL = "api.lightspark.com";
458
- var LIGHTSPARK_BETA_HEADER_KEY = "X-Lightspark-Beta";
459
- var LIGHTSPARK_BETA_HEADER_VALUE = "z2h0BBYxTA83cjW7fi8QwWtBPCzkQKiemcuhKY08LOo";
460
458
  dayjs.extend(utc);
461
459
  var Requester = class {
462
460
  constructor(nodeKeyCache, schemaEndpoint, sdkUserAgent, authProvider = new StubAuthProvider(), baseUrl = DEFAULT_BASE_URL, cryptoImpl = DefaultCrypto) {
@@ -554,7 +552,6 @@ var Requester = class {
554
552
  const sdkUserAgent = this.getSdkUserAgent();
555
553
  const baseHeaders = {
556
554
  "Content-Type": "application/json",
557
- [LIGHTSPARK_BETA_HEADER_KEY]: LIGHTSPARK_BETA_HEADER_VALUE,
558
555
  "X-Lightspark-SDK": sdkUserAgent,
559
556
  "User-Agent": browserUserAgent || sdkUserAgent
560
557
  };
@@ -1 +1 @@
1
- export { W as ById, k as CurrencyAmountArg, j as CurrencyAmountObj, f as CurrencyAmountType, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, Z as DeepPartial, V as ExpandRecursively, _ as JSONLiteral, a0 as JSONObject, $ as JSONType, U as Maybe, X as OmitTypename, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, m as isCurrencyAmount, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, w as isTest, Y as isType, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, n as mapCurrencyAmount, S as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, T as sleep, u as urlsafe_b64decode } from '../index-d0c72658.js';
1
+ export { W as ById, k as CurrencyAmountArg, j as CurrencyAmountObj, f as CurrencyAmountType, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, Z as DeepPartial, V as ExpandRecursively, _ as JSONLiteral, a0 as JSONObject, $ as JSONType, U as Maybe, a1 as NN, X as OmitTypename, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, m as isCurrencyAmount, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, w as isTest, Y as isType, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, n as mapCurrencyAmount, S as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, T as sleep, u as urlsafe_b64decode } from '../index-2708d41b.js';
@@ -1 +1 @@
1
- export { W as ById, k as CurrencyAmountArg, j as CurrencyAmountObj, f as CurrencyAmountType, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, Z as DeepPartial, V as ExpandRecursively, _ as JSONLiteral, a0 as JSONObject, $ as JSONType, U as Maybe, X as OmitTypename, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, m as isCurrencyAmount, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, w as isTest, Y as isType, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, n as mapCurrencyAmount, S as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, T as sleep, u as urlsafe_b64decode } from '../index-d0c72658.js';
1
+ export { W as ById, k as CurrencyAmountArg, j as CurrencyAmountObj, f as CurrencyAmountType, M as CurrencyCodes, L as CurrencyLocales, i as CurrencyMap, e as CurrencyUnit, Z as DeepPartial, V as ExpandRecursively, _ as JSONLiteral, a0 as JSONObject, $ as JSONType, U as Maybe, a1 as NN, X as OmitTypename, p as abbrCurrencyUnit, b as b64decode, a as b64encode, D as bytesToHex, O as clamp, h as convertCurrencyAmount, g as convertCurrencyAmountValue, K as countryCodesToCurrencyCodes, c as createSha256Hash, d as defaultCurrencyCode, I as deleteLocalStorageItem, B as errorToJSON, q as formatCurrencyStr, J as getCurrentLocale, z as getErrorMsg, G as getLocalStorageBoolean, F as getLocalStorageConfigItem, E as hexToBytes, t as isBrowser, m as isCurrencyAmount, l as isCurrencyAmountObj, o as isCurrencyMap, x as isError, A as isErrorMsg, y as isErrorWithMessage, v as isNode, R as isNumber, w as isTest, Y as isType, P as linearInterpolate, N as localeToCurrencyCode, r as localeToCurrencySymbol, n as mapCurrencyAmount, S as pollUntil, Q as round, s as separateCurrencyStrParts, H as setLocalStorageBoolean, T as sleep, u as urlsafe_b64decode } from '../index-2708d41b.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightsparkdev/core",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "Lightspark JS SDK",
5
5
  "author": "Lightspark Inc.",
6
6
  "keywords": [
@@ -21,9 +21,6 @@ import { b64encode } from "../utils/base64.js";
21
21
  import { isNode } from "../utils/environment.js";
22
22
 
23
23
  const DEFAULT_BASE_URL = "api.lightspark.com";
24
- export const LIGHTSPARK_BETA_HEADER_KEY = "X-Lightspark-Beta";
25
- export const LIGHTSPARK_BETA_HEADER_VALUE =
26
- "z2h0BBYxTA83cjW7fi8QwWtBPCzkQKiemcuhKY08LOo";
27
24
  dayjs.extend(utc);
28
25
 
29
26
  type BodyData = {
@@ -150,7 +147,6 @@ class Requester {
150
147
  const sdkUserAgent = this.getSdkUserAgent();
151
148
  const baseHeaders = {
152
149
  "Content-Type": "application/json",
153
- [LIGHTSPARK_BETA_HEADER_KEY]: LIGHTSPARK_BETA_HEADER_VALUE,
154
150
  "X-Lightspark-SDK": sdkUserAgent,
155
151
  "User-Agent": browserUserAgent || sdkUserAgent,
156
152
  };
@@ -31,3 +31,5 @@ export type DeepPartial<T> = T extends object
31
31
  export type JSONLiteral = string | number | boolean | null;
32
32
  export type JSONType = JSONLiteral | JSONType[] | { [key: string]: JSONType };
33
33
  export type JSONObject = { [key: string]: JSONType };
34
+
35
+ export type NN<T> = NonNullable<T>;