altair-graphql-core 4.3.1 → 4.4.2

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.
Files changed (53) hide show
  1. package/build/config.js +9 -16
  2. package/build/index.js +1 -4
  3. package/build/plugin/base.js +1 -5
  4. package/build/plugin/context/context.interface.d.ts +2 -2
  5. package/build/plugin/context/context.interface.js +1 -2
  6. package/build/plugin/event/event.interfaces.js +1 -2
  7. package/build/plugin/panel.js +5 -9
  8. package/build/plugin/plugin.interfaces.js +5 -8
  9. package/build/plugin/ui-action.js +5 -9
  10. package/build/subscriptions/index.js +9 -12
  11. package/build/subscriptions/providers/action-cable.js +6 -13
  12. package/build/subscriptions/providers/app-sync.js +14 -18
  13. package/build/subscriptions/providers/graphql-ws.d.ts +1 -0
  14. package/build/subscriptions/providers/graphql-ws.js +9 -11
  15. package/build/subscriptions/providers/ws.d.ts +1 -0
  16. package/build/subscriptions/providers/ws.js +10 -11
  17. package/build/subscriptions/subscription-provider.js +1 -5
  18. package/build/theme/defaults/dark.js +16 -18
  19. package/build/theme/defaults/dracula.js +1 -3
  20. package/build/theme/defaults/light.js +1 -3
  21. package/build/theme/index.js +7 -23
  22. package/build/theme/theme.js +31 -37
  23. package/build/types/shared.js +1 -2
  24. package/build/types/state/account.interfaces.d.ts +8 -0
  25. package/build/types/state/account.interfaces.js +1 -0
  26. package/build/types/state/collection.interfaces.d.ts +5 -3
  27. package/build/types/state/collection.interfaces.js +1 -2
  28. package/build/types/state/dialog.interfaces.js +1 -2
  29. package/build/types/state/docs.interfaces.js +1 -2
  30. package/build/types/state/donation.interfaces.js +1 -2
  31. package/build/types/state/environments.interfaces.js +1 -2
  32. package/build/types/state/gql-schema.interfaces.js +1 -2
  33. package/build/types/state/header.interfaces.js +1 -2
  34. package/build/types/state/history.interfaces.js +1 -2
  35. package/build/types/state/layout.interfaces.js +1 -2
  36. package/build/types/state/local.interfaces.js +1 -2
  37. package/build/types/state/per-window.interfaces.js +1 -2
  38. package/build/types/state/postrequest.interfaces.js +1 -2
  39. package/build/types/state/prerequest.interfaces.js +1 -2
  40. package/build/types/state/query.interfaces.js +1 -4
  41. package/build/types/state/settings.interfaces.js +2 -4
  42. package/build/types/state/state.interfaces.d.ts +2 -0
  43. package/build/types/state/state.interfaces.js +1 -2
  44. package/build/types/state/stream.interfaces.js +1 -2
  45. package/build/types/state/variable.interfaces.js +1 -2
  46. package/build/types/state/window.interfaces.d.ts +1 -1
  47. package/build/types/state/window.interfaces.js +1 -2
  48. package/build/types/state/windows-meta.interfaces.d.ts +1 -0
  49. package/build/types/state/windows-meta.interfaces.js +1 -2
  50. package/build/utils/is_electron.js +1 -3
  51. package/build/utils/logger.js +7 -13
  52. package/package.json +3 -3
  53. package/tsconfig.json +2 -1
package/build/config.js CHANGED
@@ -1,14 +1,8 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getAltairConfig = exports.setAltairConfig = exports.AltairConfig = void 0;
7
- const subscriptions_1 = require("./subscriptions");
8
- const is_electron_1 = __importDefault(require("./utils/is_electron"));
1
+ import { WEBSOCKET_PROVIDER_ID } from './subscriptions';
2
+ import isElectron from './utils/is_electron';
9
3
  const isTranslateMode = window.__ALTAIR_TRANSLATE__;
10
- class AltairConfig {
11
- constructor({ endpointURL, subscriptionsEndpoint, initialQuery, initialHeaders, initialEnvironments, initialVariables, initialPreRequestScript, initialPostRequestScript = '', instanceStorageNamespace, initialSettings, initialSubscriptionsProvider = subscriptions_1.WEBSOCKET_PROVIDER_ID, initialSubscriptionsPayload = {}, initialHttpMethod = 'POST', preserveState = true, initialWindows = [], } = {}) {
4
+ export class AltairConfig {
5
+ constructor({ endpointURL, subscriptionsEndpoint, initialQuery, initialHeaders, initialEnvironments, initialVariables, initialPreRequestScript, initialPostRequestScript = '', instanceStorageNamespace, initialSettings, initialSubscriptionsProvider = WEBSOCKET_PROVIDER_ID, initialSubscriptionsPayload = {}, initialHttpMethod = 'POST', preserveState = true, initialWindows = [], } = {}) {
12
6
  this.donation = {
13
7
  url: 'https://opencollective.com/altair/donate',
14
8
  action_count_threshold: 50
@@ -16,7 +10,7 @@ class AltairConfig {
16
10
  this.ga = 'UA-41432833-6';
17
11
  this.add_query_depth_limit = 3;
18
12
  this.tab_size = 2;
19
- this.max_windows = is_electron_1.default ? 50 : 15;
13
+ this.max_windows = isElectron ? 50 : 15;
20
14
  this.default_language = isTranslateMode ? 'ach-UG' : 'en-US';
21
15
  this.languages = {
22
16
  'en-US': 'English',
@@ -36,7 +30,7 @@ class AltairConfig {
36
30
  'ro-RO': 'Romanian',
37
31
  'vi-VN': 'Vietnamese',
38
32
  };
39
- this.query_history_depth = is_electron_1.default ? 100 : 15;
33
+ this.query_history_depth = isElectron ? 100 : 15;
40
34
  this.defaultTheme = 'system';
41
35
  this.themes = ['light', 'dark', 'dracula', 'system'];
42
36
  this.isTranslateMode = isTranslateMode;
@@ -76,12 +70,11 @@ class AltairConfig {
76
70
  this.initialData.windows = initialWindows;
77
71
  }
78
72
  }
79
- exports.AltairConfig = AltairConfig;
80
73
  let config = new AltairConfig();
81
- exports.setAltairConfig = (_config) => {
74
+ export const setAltairConfig = (_config) => {
82
75
  config = _config;
83
76
  };
84
- exports.getAltairConfig = () => {
77
+ export const getAltairConfig = () => {
85
78
  return config;
86
79
  };
87
- window.getAltairConfig = exports.getAltairConfig;
80
+ window.getAltairConfig = getAltairConfig;
package/build/index.js CHANGED
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerPluginClass = void 0;
4
- exports.registerPluginClass = (pluginClassName, pluginClass) => {
1
+ export const registerPluginClass = (pluginClassName, pluginClass) => {
5
2
  window['AltairGraphQL'].plugins[pluginClassName] = pluginClass;
6
3
  };
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PluginBase = void 0;
4
- class PluginBase {
1
+ export class PluginBase {
5
2
  constructor(ctx) {
6
3
  this.ctx = ctx;
7
4
  }
8
5
  }
9
- exports.PluginBase = PluginBase;
@@ -31,8 +31,8 @@ export interface PluginContext {
31
31
  * Since it is a method, the state can be generated when called.
32
32
  * So we can ensure uniqueness of the state, as well as avoid passing values by references.
33
33
  */
34
- getWindowState(windowId: string): Promise<PluginWindowState>;
35
- getCurrentWindowState(): Promise<PluginWindowState>;
34
+ getWindowState(windowId: string): Promise<PluginWindowState | undefined>;
35
+ getCurrentWindowState(): Promise<PluginWindowState | undefined>;
36
36
  /**
37
37
  * panel has two locations: sidebar, header
38
38
  *
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  ;
2
+ export {};
@@ -1,26 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AltairPanel = exports.AltairPanelLocation = void 0;
4
- const uuid_1 = require("uuid");
5
- var AltairPanelLocation;
1
+ import { v4 as uuid } from 'uuid';
2
+ export var AltairPanelLocation;
6
3
  (function (AltairPanelLocation) {
7
4
  AltairPanelLocation["HEADER"] = "header";
8
5
  AltairPanelLocation["SIDEBAR"] = "sidebar";
9
6
  AltairPanelLocation["RESULT_PANE_BOTTOM"] = "result_pane_bottom";
10
- })(AltairPanelLocation = exports.AltairPanelLocation || (exports.AltairPanelLocation = {}));
7
+ })(AltairPanelLocation || (AltairPanelLocation = {}));
11
8
  /**
12
9
  * Used for dynamic panel elements. Can also be used for angular components in the future.
13
10
  */
14
- class AltairPanel {
11
+ export class AltairPanel {
15
12
  constructor(title, element, location) {
16
13
  this.title = title;
17
14
  this.element = element;
18
15
  this.location = location;
19
- this.id = uuid_1.v4();
16
+ this.id = uuid();
20
17
  this.isActive = false;
21
18
  }
22
19
  destroy() {
23
20
  this.element = null;
24
21
  }
25
22
  }
26
- exports.AltairPanel = AltairPanel;
@@ -1,27 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createPlugin = exports.PluginType = exports.PluginSource = void 0;
4
1
  /**
5
2
  * Defines the repository of the plugin.
6
3
  * Used to know where to get the plugin from.
7
4
  */
8
- var PluginSource;
5
+ export var PluginSource;
9
6
  (function (PluginSource) {
10
7
  PluginSource["NPM"] = "npm";
11
8
  PluginSource["GITHUB"] = "github";
12
9
  PluginSource["URL"] = "url";
13
- })(PluginSource = exports.PluginSource || (exports.PluginSource = {}));
10
+ })(PluginSource || (PluginSource = {}));
14
11
  /**
15
12
  * Specifies the type of the plugin.
16
13
  * Determines how the plugin would interact with Altair.
17
14
  */
18
- var PluginType;
15
+ export var PluginType;
19
16
  (function (PluginType) {
20
17
  PluginType["HEADER"] = "header";
21
18
  PluginType["SIDEBAR"] = "sidebar";
22
19
  PluginType["ACTION_BUTTON"] = "action_button";
23
- })(PluginType = exports.PluginType || (exports.PluginType = {}));
24
- exports.createPlugin = (name, manifest) => {
20
+ })(PluginType || (PluginType = {}));
21
+ export const createPlugin = (name, manifest) => {
25
22
  return {
26
23
  name,
27
24
  manifest,
@@ -1,20 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AltairUiAction = exports.AltairUiActionLocation = void 0;
4
- const uuid_1 = require("uuid");
5
- var AltairUiActionLocation;
1
+ import { v4 as uuid } from 'uuid';
2
+ export var AltairUiActionLocation;
6
3
  (function (AltairUiActionLocation) {
7
4
  AltairUiActionLocation["RESULT_PANE"] = "result_pane";
8
- })(AltairUiActionLocation = exports.AltairUiActionLocation || (exports.AltairUiActionLocation = {}));
9
- class AltairUiAction {
5
+ })(AltairUiActionLocation || (AltairUiActionLocation = {}));
6
+ export class AltairUiAction {
10
7
  constructor(title, location, callback) {
11
8
  this.title = title;
12
9
  this.location = location;
13
10
  this.callback = callback;
14
- this.id = uuid_1.v4();
11
+ this.id = uuid();
15
12
  }
16
13
  execute() {
17
14
  this.callback();
18
15
  }
19
16
  }
20
- exports.AltairUiAction = AltairUiAction;
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SUBSCRIPTION_PROVIDER_IDS = exports.ACTION_CABLE_PROVIDER_ID = exports.APP_SYNC_PROVIDER_ID = exports.GRAPHQL_WS_PROVIDER_ID = exports.WEBSOCKET_PROVIDER_ID = void 0;
4
- exports.WEBSOCKET_PROVIDER_ID = 'websocket';
5
- exports.GRAPHQL_WS_PROVIDER_ID = 'graphql-ws';
6
- exports.APP_SYNC_PROVIDER_ID = 'app-sync';
7
- exports.ACTION_CABLE_PROVIDER_ID = 'action-cable';
8
- exports.SUBSCRIPTION_PROVIDER_IDS = {
9
- WEBSOCKET: exports.WEBSOCKET_PROVIDER_ID,
10
- GRAPHQL_WS: exports.GRAPHQL_WS_PROVIDER_ID,
11
- APP_SYNC: exports.APP_SYNC_PROVIDER_ID,
12
- ACTION_CABLE: exports.ACTION_CABLE_PROVIDER_ID
1
+ export const WEBSOCKET_PROVIDER_ID = 'websocket';
2
+ export const GRAPHQL_WS_PROVIDER_ID = 'graphql-ws';
3
+ export const APP_SYNC_PROVIDER_ID = 'app-sync';
4
+ export const ACTION_CABLE_PROVIDER_ID = 'action-cable';
5
+ export const SUBSCRIPTION_PROVIDER_IDS = {
6
+ WEBSOCKET: WEBSOCKET_PROVIDER_ID,
7
+ GRAPHQL_WS: GRAPHQL_WS_PROVIDER_ID,
8
+ APP_SYNC: APP_SYNC_PROVIDER_ID,
9
+ ACTION_CABLE: ACTION_CABLE_PROVIDER_ID
13
10
  };
@@ -1,16 +1,10 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ActionCableSubscriptionProvider = void 0;
7
- const subscription_provider_1 = require("../subscription-provider");
8
- const rxjs_1 = require("rxjs");
9
- const actioncable_1 = __importDefault(require("actioncable"));
10
- class ActionCableSubscriptionProvider extends subscription_provider_1.SubscriptionProvider {
1
+ import { SubscriptionProvider } from '../subscription-provider';
2
+ import { Observable } from 'rxjs';
3
+ import ActionCable from 'actioncable';
4
+ export class ActionCableSubscriptionProvider extends SubscriptionProvider {
11
5
  execute(options) {
12
- const cable = actioncable_1.default.createConsumer(this.subscriptionUrl);
13
- return new rxjs_1.Observable((subscriber) => {
6
+ const cable = ActionCable.createConsumer(this.subscriptionUrl);
7
+ return new Observable((subscriber) => {
14
8
  this.subscription = cable.subscriptions.create(Object.assign({}, {
15
9
  channel: this.connectionParams.channel || 'GraphqlChannel',
16
10
  channelId: Math.round(Date.now() + Math.random() * 100000).toString(16),
@@ -33,4 +27,3 @@ class ActionCableSubscriptionProvider extends subscription_provider_1.Subscripti
33
27
  this.subscription?.unsubscribe();
34
28
  }
35
29
  }
36
- exports.ActionCableSubscriptionProvider = ActionCableSubscriptionProvider;
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AppSyncSubscriptionProvider = void 0;
4
- const subscription_provider_1 = require("../subscription-provider");
5
- const rxjs_1 = require("rxjs");
6
- const aws_appsync_auth_link_1 = require("aws-appsync-auth-link");
7
- const aws_appsync_subscription_link_1 = require("aws-appsync-subscription-link");
8
- const core_1 = require("@apollo/client/core");
9
- const graphql_1 = require("graphql");
10
- class AppSyncSubscriptionProvider extends subscription_provider_1.SubscriptionProvider {
1
+ import { SubscriptionProvider } from '../subscription-provider';
2
+ import { Observable } from 'rxjs';
3
+ import { createAuthLink } from 'aws-appsync-auth-link';
4
+ import { createSubscriptionHandshakeLink } from 'aws-appsync-subscription-link';
5
+ import { ApolloClient, ApolloLink, InMemoryCache } from '@apollo/client/core';
6
+ import { parse } from 'graphql';
7
+ export class AppSyncSubscriptionProvider extends SubscriptionProvider {
11
8
  /**
12
9
  {
13
10
  "aws_project_region": "us-west-2",
@@ -26,19 +23,19 @@ class AppSyncSubscriptionProvider extends subscription_provider_1.SubscriptionPr
26
23
  apiKey: this.connectionParams.aws_appsync_apiKey,
27
24
  jwtToken: this.connectionParams.aws_appsync_jwtToken,
28
25
  };
29
- const link = core_1.ApolloLink.from([
30
- aws_appsync_auth_link_1.createAuthLink({ url, region, auth }),
31
- aws_appsync_subscription_link_1.createSubscriptionHandshakeLink({ url, region, auth }),
26
+ const link = ApolloLink.from([
27
+ createAuthLink({ url, region, auth }),
28
+ createSubscriptionHandshakeLink({ url, region, auth }),
32
29
  ]);
33
- const client = new core_1.ApolloClient({
30
+ const client = new ApolloClient({
34
31
  link,
35
- cache: new core_1.InMemoryCache()
32
+ cache: new InMemoryCache()
36
33
  });
37
34
  const subscription = client.subscribe({
38
- query: graphql_1.parse(options.query),
35
+ query: parse(options.query),
39
36
  variables: options.variables
40
37
  });
41
- return new rxjs_1.Observable((subscriber) => {
38
+ return new Observable((subscriber) => {
42
39
  this.subscription = subscription.subscribe({
43
40
  next: (...args) => subscriber.next(...args),
44
41
  error: (...args) => subscriber.error(...args),
@@ -52,4 +49,3 @@ class AppSyncSubscriptionProvider extends subscription_provider_1.SubscriptionPr
52
49
  }
53
50
  }
54
51
  }
55
- exports.AppSyncSubscriptionProvider = AppSyncSubscriptionProvider;
@@ -3,6 +3,7 @@ import { Observable } from 'rxjs';
3
3
  import { Client } from 'graphql-ws';
4
4
  export declare class GraphQLWsSubscriptionProvider extends SubscriptionProvider {
5
5
  client?: Client;
6
+ cleanup?: () => void;
6
7
  createClient(): void;
7
8
  execute(options: SubscriptionProviderExecuteOptions): Observable<unknown>;
8
9
  close(): void;
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GraphQLWsSubscriptionProvider = void 0;
4
- const subscription_provider_1 = require("../subscription-provider");
5
- const rxjs_1 = require("rxjs");
6
- const graphql_ws_1 = require("graphql-ws");
7
- class GraphQLWsSubscriptionProvider extends subscription_provider_1.SubscriptionProvider {
1
+ import { SubscriptionProvider } from '../subscription-provider';
2
+ import { Observable } from 'rxjs';
3
+ import { createClient } from 'graphql-ws';
4
+ export class GraphQLWsSubscriptionProvider extends SubscriptionProvider {
8
5
  createClient() {
9
- this.client = graphql_ws_1.createClient({
6
+ this.client = createClient({
10
7
  url: this.subscriptionUrl,
11
8
  connectionParams: this.connectionParams,
12
9
  on: {
@@ -24,8 +21,8 @@ class GraphQLWsSubscriptionProvider extends subscription_provider_1.Subscription
24
21
  if (!this.client) {
25
22
  throw new Error('Could not create subscription client!');
26
23
  }
27
- return new rxjs_1.Observable((subscriber) => {
28
- return this.client.subscribe({
24
+ return new Observable((subscriber) => {
25
+ this.cleanup = this.client.subscribe({
29
26
  query: options.query,
30
27
  variables: options.variables,
31
28
  operationName: options.operationName,
@@ -37,8 +34,9 @@ class GraphQLWsSubscriptionProvider extends subscription_provider_1.Subscription
37
34
  });
38
35
  }
39
36
  close() {
37
+ this.cleanup?.();
38
+ this.cleanup = undefined;
40
39
  this.client?.dispose();
41
40
  this.client = undefined;
42
41
  }
43
42
  }
44
- exports.GraphQLWsSubscriptionProvider = GraphQLWsSubscriptionProvider;
@@ -3,6 +3,7 @@ import { SubscriptionClient } from 'subscriptions-transport-ws';
3
3
  import { Observable } from 'rxjs';
4
4
  export declare class WebsocketSubscriptionProvider extends SubscriptionProvider {
5
5
  client?: SubscriptionClient;
6
+ cleanup?: () => void;
6
7
  createClient(): void;
7
8
  execute(options: SubscriptionProviderExecuteOptions): Observable<unknown>;
8
9
  close(): void;
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebsocketSubscriptionProvider = void 0;
4
- const subscription_provider_1 = require("../subscription-provider");
5
- const subscriptions_transport_ws_1 = require("subscriptions-transport-ws");
6
- const rxjs_1 = require("rxjs");
7
- class WebsocketSubscriptionProvider extends subscription_provider_1.SubscriptionProvider {
1
+ import { SubscriptionProvider } from '../subscription-provider';
2
+ import { SubscriptionClient } from 'subscriptions-transport-ws';
3
+ import { Observable } from 'rxjs';
4
+ export class WebsocketSubscriptionProvider extends SubscriptionProvider {
8
5
  createClient() {
9
- this.client = new subscriptions_transport_ws_1.SubscriptionClient(this.subscriptionUrl, {
6
+ this.client = new SubscriptionClient(this.subscriptionUrl, {
10
7
  reconnect: true,
11
8
  connectionParams: this.connectionParams,
12
9
  connectionCallback: this.extraOptions?.onConnected
@@ -17,8 +14,8 @@ class WebsocketSubscriptionProvider extends subscription_provider_1.Subscription
17
14
  if (!this.client) {
18
15
  throw new Error('Could not create subscription client!');
19
16
  }
20
- return new rxjs_1.Observable((subscriber) => {
21
- return this.client.request({
17
+ return new Observable((subscriber) => {
18
+ const res = this.client.request({
22
19
  query: options.query,
23
20
  variables: options.variables,
24
21
  operationName: options.operationName,
@@ -27,12 +24,14 @@ class WebsocketSubscriptionProvider extends subscription_provider_1.Subscription
27
24
  error: (...args) => subscriber.error(...args),
28
25
  complete: () => subscriber.complete(),
29
26
  });
27
+ this.cleanup = res.unsubscribe;
30
28
  });
31
29
  }
32
30
  close() {
31
+ this.cleanup?.();
32
+ this.cleanup = undefined;
33
33
  this.client?.unsubscribeAll();
34
34
  this.client?.close();
35
35
  this.client = undefined;
36
36
  }
37
37
  }
38
- exports.WebsocketSubscriptionProvider = WebsocketSubscriptionProvider;
@@ -1,11 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SubscriptionProvider = void 0;
4
- class SubscriptionProvider {
1
+ export class SubscriptionProvider {
5
2
  constructor(subscriptionUrl, connectionParams, extraOptions) {
6
3
  this.subscriptionUrl = subscriptionUrl;
7
4
  this.connectionParams = connectionParams;
8
5
  this.extraOptions = extraOptions;
9
6
  }
10
7
  }
11
- exports.SubscriptionProvider = SubscriptionProvider;
@@ -1,12 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const theme_1 = require("../theme");
1
+ import { foundations } from '../theme';
4
2
  const theme = {
5
3
  colors: {
6
- bg: theme_1.foundations.colors.black,
4
+ bg: foundations.colors.black,
7
5
  offBg: '#3f4349',
8
- font: theme_1.foundations.colors.white,
9
- offFont: theme_1.foundations.colors.lightGray,
6
+ font: foundations.colors.white,
7
+ offFont: foundations.colors.lightGray,
10
8
  border: '#565c64',
11
9
  offBorder: '#565656',
12
10
  headerBg: '#3f4349',
@@ -16,18 +14,18 @@ const theme = {
16
14
  },
17
15
  editor: {
18
16
  colors: {
19
- comment: theme_1.foundations.colors.darkGray,
20
- string: theme_1.foundations.colors.orange,
21
- number: theme_1.foundations.colors.orange,
22
- variable: theme_1.foundations.colors.white,
23
- attribute: theme_1.foundations.colors.green,
24
- keyword: theme_1.foundations.colors.blue,
25
- atom: theme_1.foundations.colors.white,
26
- property: theme_1.foundations.colors.blue,
27
- definition: theme_1.foundations.colors.orange,
28
- punctuation: theme_1.foundations.colors.blue,
29
- cursor: theme_1.foundations.colors.blue,
17
+ comment: foundations.colors.darkGray,
18
+ string: foundations.colors.orange,
19
+ number: foundations.colors.orange,
20
+ variable: foundations.colors.white,
21
+ attribute: foundations.colors.green,
22
+ keyword: foundations.colors.blue,
23
+ atom: foundations.colors.white,
24
+ property: foundations.colors.blue,
25
+ definition: foundations.colors.orange,
26
+ punctuation: foundations.colors.blue,
27
+ cursor: foundations.colors.blue,
30
28
  }
31
29
  },
32
30
  };
33
- exports.default = theme;
31
+ export default theme;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const theme = {
4
2
  colors: {
5
3
  bg: '#282a36',
@@ -25,4 +23,4 @@ const theme = {
25
23
  }
26
24
  }
27
25
  };
28
- exports.default = theme;
26
+ export default theme;
@@ -1,4 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const theme = {};
4
- exports.default = theme;
2
+ export default theme;
@@ -1,23 +1,7 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- var __importDefault = (this && this.__importDefault) || function (mod) {
13
- return (mod && mod.__esModule) ? mod : { "default": mod };
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.dracula = exports.dark = exports.light = void 0;
17
- const light_1 = __importDefault(require("./defaults/light"));
18
- const dark_1 = __importDefault(require("./defaults/dark"));
19
- const dracula_1 = __importDefault(require("./defaults/dracula"));
20
- __exportStar(require("./theme"), exports);
21
- exports.light = light_1.default;
22
- exports.dark = dark_1.default;
23
- exports.dracula = dracula_1.default;
1
+ import lightTheme from './defaults/light';
2
+ import darkTheme from './defaults/dark';
3
+ import draculaTheme from './defaults/dracula';
4
+ export * from './theme';
5
+ export const light = lightTheme;
6
+ export const dark = darkTheme;
7
+ export const dracula = draculaTheme;
@@ -1,12 +1,6 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createTheme = exports.mergeThemes = exports.hexToRgbStr = exports.foundations = void 0;
7
- const deepmerge_1 = __importDefault(require("deepmerge"));
1
+ import deepmerge from 'deepmerge';
8
2
  const convertCssColorNameToHex = require('convert-css-color-name-to-hex');
9
- exports.foundations = {
3
+ export const foundations = {
10
4
  easing: 'ease',
11
5
  colors: {
12
6
  black: '#33363b',
@@ -35,41 +29,41 @@ exports.foundations = {
35
29
  },
36
30
  },
37
31
  };
38
- const theme = deepmerge_1.default(exports.foundations, {
32
+ const theme = deepmerge(foundations, {
39
33
  isSystem: false,
40
34
  colors: {
41
- primary: exports.foundations.colors.green,
42
- secondary: exports.foundations.colors.blue,
43
- bg: exports.foundations.colors.white,
44
- offBg: exports.foundations.colors.lightGray,
45
- font: exports.foundations.colors.black,
46
- offFont: exports.foundations.colors.darkGray,
47
- border: exports.foundations.colors.gray,
48
- offBorder: exports.foundations.colors.lightGray,
49
- headerBg: exports.foundations.colors.white,
35
+ primary: foundations.colors.green,
36
+ secondary: foundations.colors.blue,
37
+ bg: foundations.colors.white,
38
+ offBg: foundations.colors.lightGray,
39
+ font: foundations.colors.black,
40
+ offFont: foundations.colors.darkGray,
41
+ border: foundations.colors.gray,
42
+ offBorder: foundations.colors.lightGray,
43
+ headerBg: foundations.colors.white,
50
44
  },
51
45
  shadow: {
52
- color: exports.foundations.colors.black,
46
+ color: foundations.colors.black,
53
47
  opacity: .1,
54
48
  },
55
49
  editor: {
56
50
  fontFamily: {
57
51
  default: 'JetBrains Mono',
58
52
  },
59
- fontSize: exports.foundations.type.fontSize.bodySmaller,
53
+ fontSize: foundations.type.fontSize.bodySmaller,
60
54
  colors: {
61
- comment: exports.foundations.colors.darkGray,
62
- string: exports.foundations.colors.orange,
63
- number: exports.foundations.colors.orange,
64
- variable: exports.foundations.colors.black,
65
- keyword: exports.foundations.colors.blue,
66
- atom: exports.foundations.colors.black,
67
- attribute: exports.foundations.colors.green,
68
- property: exports.foundations.colors.blue,
69
- punctuation: exports.foundations.colors.blue,
70
- definition: exports.foundations.colors.orange,
71
- builtin: exports.foundations.colors.orange,
72
- cursor: exports.foundations.colors.blue,
55
+ comment: foundations.colors.darkGray,
56
+ string: foundations.colors.orange,
57
+ number: foundations.colors.orange,
58
+ variable: foundations.colors.black,
59
+ keyword: foundations.colors.blue,
60
+ atom: foundations.colors.black,
61
+ attribute: foundations.colors.green,
62
+ property: foundations.colors.blue,
63
+ punctuation: foundations.colors.blue,
64
+ definition: foundations.colors.orange,
65
+ builtin: foundations.colors.orange,
66
+ cursor: foundations.colors.blue,
73
67
  },
74
68
  }
75
69
  });
@@ -101,7 +95,7 @@ const hexToRgb = (hex) => {
101
95
  b: parseInt(result[3], 16)
102
96
  } : undefined;
103
97
  };
104
- exports.hexToRgbStr = (hex) => {
98
+ export const hexToRgbStr = (hex) => {
105
99
  if (!hex) {
106
100
  return '';
107
101
  }
@@ -130,9 +124,9 @@ const rgbTint = (rgb, i) => {
130
124
  b: rgb.b + (255 - rgb.b) * i * 0.1
131
125
  };
132
126
  };
133
- exports.mergeThemes = (...customThemes) => {
134
- return deepmerge_1.default.all(customThemes);
127
+ export const mergeThemes = (...customThemes) => {
128
+ return deepmerge.all(customThemes);
135
129
  };
136
- exports.createTheme = (customTheme, extraTheme = {}) => {
137
- return deepmerge_1.default.all([theme, customTheme, extraTheme]);
130
+ export const createTheme = (customTheme, extraTheme = {}) => {
131
+ return deepmerge.all([theme, customTheme, extraTheme]);
138
132
  };
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export interface AccountState {
2
+ loggedIn: boolean;
3
+ accessToken: string;
4
+ firstName: string;
5
+ lastName: string;
6
+ email: string;
7
+ }
8
+ //# sourceMappingURL=account.interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ export {};
@@ -6,14 +6,16 @@ export interface CollectionState {
6
6
  sortBy: SortByOptions;
7
7
  }
8
8
  export interface IQuery extends ExportWindowState {
9
- id?: number;
9
+ id?: string;
10
+ serverId?: number;
10
11
  created_at?: number;
11
12
  updated_at?: number;
12
13
  }
13
14
  export interface IQueryCollection {
14
15
  id?: number;
16
+ serverId?: number;
15
17
  title: string;
16
- queries: any[];
18
+ queries: IQuery[];
17
19
  description?: string;
18
20
  /**
19
21
  * path of the collection in the collection tree
@@ -25,7 +27,7 @@ export interface IQueryCollection {
25
27
  }
26
28
  export interface IQueryCollectionTree extends IQueryCollection {
27
29
  id: number;
28
- collections: IQueryCollectionTree[];
30
+ collections?: IQueryCollectionTree[];
29
31
  }
30
32
  export interface ExportCollectionState extends IQueryCollectionTree {
31
33
  version: 1;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  ;
2
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HTTP_VERBS = void 0;
4
- exports.HTTP_VERBS = ['POST', 'GET', 'PUT', 'DELETE'];
1
+ export const HTTP_VERBS = ['POST', 'GET', 'PUT', 'DELETE'];
@@ -1,4 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const config_1 = require("../../config");
4
- const config = config_1.getAltairConfig();
1
+ import { getAltairConfig } from '../../config';
2
+ const config = getAltairConfig();
@@ -1,3 +1,4 @@
1
+ import { AccountState } from './account.interfaces';
1
2
  import { CollectionState } from './collection.interfaces';
2
3
  import { DonationState } from './donation.interfaces';
3
4
  import { EnvironmentsState } from './environments.interfaces';
@@ -13,5 +14,6 @@ export interface RootState {
13
14
  collection: CollectionState;
14
15
  environments: EnvironmentsState;
15
16
  local: LocalState;
17
+ account: AccountState;
16
18
  }
17
19
  //# sourceMappingURL=state.interfaces.d.ts.map
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -2,7 +2,7 @@ import { GraphQLSchema } from 'graphql';
2
2
  import { SubscriptionProviderIds } from '../../subscriptions';
3
3
  import { PerWindowState } from './per-window.interfaces';
4
4
  export interface WindowState {
5
- [id: string]: PerWindowState;
5
+ [id: string]: PerWindowState | undefined;
6
6
  }
7
7
  /**
8
8
  * Data structure for exported windows
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -6,5 +6,6 @@ export interface WindowsMetaState {
6
6
  showSettingsDialog: boolean;
7
7
  showEnvironmentManager: boolean;
8
8
  showPluginManager: boolean;
9
+ showAccountDialog: boolean;
9
10
  }
10
11
  //# sourceMappingURL=windows-meta.interfaces.d.ts.map
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,3 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = !!((window && window.process && window.process.versions.electron) || window.ipc);
1
+ export default !!((window && window.process && window.process.versions.electron) || window.ipc);
@@ -1,15 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createLogger = void 0;
7
- const loglevel_1 = __importDefault(require("loglevel"));
8
- const loglevel_plugin_prefix_1 = __importDefault(require("loglevel-plugin-prefix"));
9
- loglevel_plugin_prefix_1.default.reg(loglevel_1.default);
10
- exports.createLogger = (environment) => {
1
+ import loglevel from 'loglevel';
2
+ import prefix from 'loglevel-plugin-prefix';
3
+ prefix.reg(loglevel);
4
+ export const createLogger = (environment) => {
11
5
  if (!environment.production) {
12
- loglevel_1.default.setLevel('TRACE');
6
+ loglevel.setLevel('TRACE');
13
7
  }
14
8
  const PREVIOUS_VERSION_KEY = 'altair__debug_previous_version';
15
9
  const CURRENT_VERSION_KEY = 'altair__debug_current_version';
@@ -36,10 +30,10 @@ exports.createLogger = (environment) => {
36
30
  console.log('Previous version:', previousVersion());
37
31
  console.log('Current version:', currentVersion());
38
32
  console.groupEnd();
39
- loglevel_1.default.setLevel('TRACE');
33
+ loglevel.setLevel('TRACE');
40
34
  }
41
35
  window._ALTAIR__ENABLE_DEBUG_MODE__ = value;
42
36
  }
43
37
  });
44
- return loglevel_1.default;
38
+ return loglevel;
45
39
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "altair-graphql-core",
3
- "version": "4.3.1",
3
+ "version": "4.4.2",
4
4
  "description": "Several of the core logic for altair graphql client",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "@types/actioncable": "^5.2.5",
31
31
  "@types/node": "^14.14.41",
32
32
  "@types/uuid": "^8.3.0",
33
- "ajv": "^8.6.0",
33
+ "ajv": "^6.12.3",
34
34
  "ajv-cli": "^5.0.0",
35
35
  "react": "^17.0.2",
36
36
  "ts-node": "^8.5.4",
@@ -61,5 +61,5 @@
61
61
  "util": "^0.12.4",
62
62
  "uuid": "^8.3.2"
63
63
  },
64
- "gitHead": "a3015132ac38bd025ef6a7ba46f1ed36f1508a57"
64
+ "gitHead": "44bf6dbb486b9afb51be1cb56228903346f515d4"
65
65
  }
package/tsconfig.json CHANGED
@@ -5,7 +5,8 @@
5
5
  "declaration": true,
6
6
  "declarationMap": true,
7
7
  "target": "es2020",
8
- "module": "commonjs",
8
+ "module": "ES2020",
9
+ "moduleResolution": "node",
9
10
  "lib": [
10
11
  "dom",
11
12
  "esnext"