altair-graphql-core 4.2.1 → 4.3.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.
Files changed (45) hide show
  1. package/build/config.d.ts +42 -30
  2. package/build/config.js +3 -1
  3. package/build/index.d.ts +1 -0
  4. package/build/plugin/base.d.ts +1 -0
  5. package/build/plugin/context/context.interface.d.ts +1 -0
  6. package/build/plugin/event/event.interfaces.d.ts +1 -0
  7. package/build/plugin/panel.d.ts +1 -0
  8. package/build/plugin/plugin.interfaces.d.ts +1 -0
  9. package/build/plugin/ui-action.d.ts +1 -0
  10. package/build/subscriptions/index.d.ts +1 -0
  11. package/build/subscriptions/providers/action-cable.d.ts +1 -0
  12. package/build/subscriptions/providers/app-sync.d.ts +1 -0
  13. package/build/subscriptions/providers/graphql-ws.d.ts +1 -0
  14. package/build/subscriptions/providers/ws.d.ts +1 -0
  15. package/build/subscriptions/subscription-provider.d.ts +1 -0
  16. package/build/theme/defaults/dark.d.ts +1 -0
  17. package/build/theme/defaults/dracula.d.ts +1 -0
  18. package/build/theme/defaults/light.d.ts +1 -0
  19. package/build/theme/index.d.ts +1 -0
  20. package/build/theme/theme.d.ts +1 -0
  21. package/build/types/shared.d.ts +1 -0
  22. package/build/types/state/collection.interfaces.d.ts +12 -3
  23. package/build/types/state/dialog.interfaces.d.ts +1 -0
  24. package/build/types/state/docs.interfaces.d.ts +1 -0
  25. package/build/types/state/donation.interfaces.d.ts +1 -0
  26. package/build/types/state/environments.interfaces.d.ts +1 -0
  27. package/build/types/state/gql-schema.interfaces.d.ts +1 -0
  28. package/build/types/state/header.interfaces.d.ts +1 -0
  29. package/build/types/state/history.interfaces.d.ts +1 -0
  30. package/build/types/state/layout.interfaces.d.ts +1 -0
  31. package/build/types/state/local.interfaces.d.ts +1 -0
  32. package/build/types/state/per-window.interfaces.d.ts +1 -0
  33. package/build/types/state/postrequest.interfaces.d.ts +1 -0
  34. package/build/types/state/prerequest.interfaces.d.ts +1 -0
  35. package/build/types/state/query.interfaces.d.ts +1 -0
  36. package/build/types/state/settings.interfaces.d.ts +5 -0
  37. package/build/types/state/state.interfaces.d.ts +1 -0
  38. package/build/types/state/stream.interfaces.d.ts +1 -0
  39. package/build/types/state/variable.interfaces.d.ts +1 -0
  40. package/build/types/state/window.interfaces.d.ts +3 -0
  41. package/build/types/state/windows-meta.interfaces.d.ts +1 -0
  42. package/build/utils/is_electron.d.ts +1 -0
  43. package/build/utils/logger.d.ts +1 -0
  44. package/package.json +2 -2
  45. package/tsconfig.json +1 -0
package/build/config.d.ts CHANGED
@@ -3,39 +3,59 @@ import { IDictionary } from './types/shared';
3
3
  import { IInitialEnvironments } from './types/state/environments.interfaces';
4
4
  import { HttpVerb } from './types/state/query.interfaces';
5
5
  import { SettingsState } from './types/state/settings.interfaces';
6
- export interface AltairConfigOptions {
6
+ export interface AltairWindowOptions {
7
+ /**
8
+ * Initial name of the window
9
+ */
10
+ initialName?: string;
7
11
  /**
8
12
  * URL to set as the server endpoint
9
13
  */
10
14
  endpointURL?: string;
11
15
  /**
12
- * URL to set as the subscription endpoint
13
- */
16
+ * URL to set as the subscription endpoint
17
+ */
14
18
  subscriptionsEndpoint?: string;
15
19
  /**
16
- * Initial query to be added
17
- */
20
+ * Initial query to be added
21
+ */
18
22
  initialQuery?: string;
19
23
  /**
20
- * Initial variables to be added
21
- */
24
+ * Initial variables to be added
25
+ */
22
26
  initialVariables?: string;
23
27
  /**
24
- * Initial pre-request script to be added
25
- */
28
+ * Initial pre-request script to be added
29
+ */
26
30
  initialPreRequestScript?: string;
27
31
  /**
28
- * Initial post-request script to be added
29
- */
32
+ * Initial post-request script to be added
33
+ */
30
34
  initialPostRequestScript?: string;
31
35
  /**
32
- * Initial headers object to be added
33
- * @example
34
- * {
35
- * 'X-GraphQL-Token': 'asd7-237s-2bdk-nsdk4'
36
- * }
37
- */
36
+ * Initial headers object to be added
37
+ * @example
38
+ * {
39
+ * 'X-GraphQL-Token': 'asd7-237s-2bdk-nsdk4'
40
+ * }
41
+ */
38
42
  initialHeaders?: IDictionary;
43
+ /**
44
+ * Initial subscriptions provider
45
+ *
46
+ * @default "websocket"
47
+ */
48
+ initialSubscriptionsProvider?: SubscriptionProviderIds;
49
+ /**
50
+ * Initial subscriptions connection params
51
+ */
52
+ initialSubscriptionsPayload?: IDictionary;
53
+ /**
54
+ * HTTP method to use for making requests
55
+ */
56
+ initialHttpMethod?: HttpVerb;
57
+ }
58
+ export interface AltairConfigOptions extends AltairWindowOptions {
39
59
  /**
40
60
  * Initial Environments to be added
41
61
  * @example
@@ -64,16 +84,6 @@ export interface AltairConfigOptions {
64
84
  * Initial app settings to use
65
85
  */
66
86
  initialSettings?: Partial<SettingsState>;
67
- /**
68
- * Initial subscriptions provider
69
- *
70
- * @default "websocket"
71
- */
72
- initialSubscriptionsProvider?: SubscriptionProviderIds;
73
- /**
74
- * Initial subscriptions connection params
75
- */
76
- initialSubscriptionsPayload?: IDictionary;
77
87
  /**
78
88
  * Indicates if the state should be preserved for subsequent app loads
79
89
  *
@@ -81,9 +91,9 @@ export interface AltairConfigOptions {
81
91
  */
82
92
  preserveState?: boolean;
83
93
  /**
84
- * HTTP method to use for making requests
94
+ * List of options for windows to be loaded
85
95
  */
86
- initialHttpMethod?: HttpVerb;
96
+ initialWindows?: AltairWindowOptions[];
87
97
  }
88
98
  export declare class AltairConfig {
89
99
  donation: {
@@ -133,8 +143,10 @@ export declare class AltairConfig {
133
143
  initialSubscriptionsPayload: IDictionary<any>;
134
144
  initialHttpMethod: "POST" | "GET" | "PUT" | "DELETE";
135
145
  preserveState: boolean;
146
+ windows: AltairWindowOptions[];
136
147
  };
137
- constructor({ endpointURL, subscriptionsEndpoint, initialQuery, initialHeaders, initialEnvironments, initialVariables, initialPreRequestScript, initialPostRequestScript, instanceStorageNamespace, initialSettings, initialSubscriptionsProvider, initialSubscriptionsPayload, initialHttpMethod, preserveState, }?: AltairConfigOptions);
148
+ constructor({ endpointURL, subscriptionsEndpoint, initialQuery, initialHeaders, initialEnvironments, initialVariables, initialPreRequestScript, initialPostRequestScript, instanceStorageNamespace, initialSettings, initialSubscriptionsProvider, initialSubscriptionsPayload, initialHttpMethod, preserveState, initialWindows, }?: AltairConfigOptions);
138
149
  }
139
150
  export declare const setAltairConfig: (_config: AltairConfig) => void;
140
151
  export declare const getAltairConfig: () => AltairConfig;
152
+ //# sourceMappingURL=config.d.ts.map
package/build/config.js CHANGED
@@ -8,7 +8,7 @@ const subscriptions_1 = require("./subscriptions");
8
8
  const is_electron_1 = __importDefault(require("./utils/is_electron"));
9
9
  const isTranslateMode = window.__ALTAIR_TRANSLATE__;
10
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, } = {}) {
11
+ constructor({ endpointURL, subscriptionsEndpoint, initialQuery, initialHeaders, initialEnvironments, initialVariables, initialPreRequestScript, initialPostRequestScript = '', instanceStorageNamespace, initialSettings, initialSubscriptionsProvider = subscriptions_1.WEBSOCKET_PROVIDER_ID, initialSubscriptionsPayload = {}, initialHttpMethod = 'POST', preserveState = true, initialWindows = [], } = {}) {
12
12
  this.donation = {
13
13
  url: 'https://opencollective.com/altair/donate',
14
14
  action_count_threshold: 50
@@ -57,6 +57,7 @@ class AltairConfig {
57
57
  initialSubscriptionsPayload: {},
58
58
  initialHttpMethod: 'POST',
59
59
  preserveState: true,
60
+ windows: [],
60
61
  };
61
62
  this.initialData.url = window.__ALTAIR_ENDPOINT_URL__ || endpointURL || '';
62
63
  this.initialData.subscriptionsEndpoint = window.__ALTAIR_SUBSCRIPTIONS_ENDPOINT__ || subscriptionsEndpoint || '';
@@ -72,6 +73,7 @@ class AltairConfig {
72
73
  this.initialData.initialSubscriptionsPayload = initialSubscriptionsPayload;
73
74
  this.initialData.initialHttpMethod = initialHttpMethod;
74
75
  this.initialData.preserveState = preserveState;
76
+ this.initialData.windows = initialWindows;
75
77
  }
76
78
  }
77
79
  exports.AltairConfig = AltairConfig;
package/build/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import { PluginBase, PluginConstructor } from './plugin/base';
2
2
  export declare const registerPluginClass: <T extends PluginBase>(pluginClassName: string, pluginClass: PluginConstructor<T>) => void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -8,3 +8,4 @@ export declare abstract class PluginBase {
8
8
  export interface PluginConstructor<T extends PluginBase = PluginBase> {
9
9
  new (): T;
10
10
  }
11
+ //# sourceMappingURL=base.d.ts.map
@@ -75,3 +75,4 @@ export interface PluginContext {
75
75
  export interface PluginContextGenerator {
76
76
  createContext(pluginName: string, plugin: AltairPlugin): PluginContext;
77
77
  }
78
+ //# sourceMappingURL=context.interface.d.ts.map
@@ -27,3 +27,4 @@ export interface PluginEventPayloadMap {
27
27
  }
28
28
  export declare type PluginEvent = keyof PluginEventPayloadMap;
29
29
  export declare type PluginEventCallback<T extends PluginEvent> = (payload: PluginEventPayloadMap[T]) => void;
30
+ //# sourceMappingURL=event.interfaces.d.ts.map
@@ -15,3 +15,4 @@ export declare class AltairPanel {
15
15
  constructor(title: string, element: HTMLElement, location: AltairPanelLocation);
16
16
  destroy(): void;
17
17
  }
18
+ //# sourceMappingURL=panel.d.ts.map
@@ -47,3 +47,4 @@ export interface AltairPlugin {
47
47
  manifest: PluginManifest;
48
48
  }
49
49
  export declare const createPlugin: (name: string, manifest: PluginManifest) => AltairPlugin;
50
+ //# sourceMappingURL=plugin.interfaces.d.ts.map
@@ -9,3 +9,4 @@ export declare class AltairUiAction {
9
9
  constructor(title: string, location: AltairUiActionLocation, callback: () => void);
10
10
  execute(): void;
11
11
  }
12
+ //# sourceMappingURL=ui-action.d.ts.map
@@ -15,3 +15,4 @@ export interface SubscriptionProviderData {
15
15
  getProviderClass: () => Promise<SubscriptionProviderConstructor>;
16
16
  copyTag?: string;
17
17
  }
18
+ //# sourceMappingURL=index.d.ts.map
@@ -6,3 +6,4 @@ export declare class ActionCableSubscriptionProvider extends SubscriptionProvide
6
6
  execute(options: SubscriptionProviderExecuteOptions): Observable<unknown>;
7
7
  close(): void;
8
8
  }
9
+ //# sourceMappingURL=action-cable.d.ts.map
@@ -16,3 +16,4 @@ export declare class AppSyncSubscriptionProvider extends SubscriptionProvider {
16
16
  execute(options: SubscriptionProviderExecuteOptions): Observable<unknown>;
17
17
  close(): void;
18
18
  }
19
+ //# sourceMappingURL=app-sync.d.ts.map
@@ -7,3 +7,4 @@ export declare class GraphQLWsSubscriptionProvider extends SubscriptionProvider
7
7
  execute(options: SubscriptionProviderExecuteOptions): Observable<unknown>;
8
8
  close(): void;
9
9
  }
10
+ //# sourceMappingURL=graphql-ws.d.ts.map
@@ -7,3 +7,4 @@ export declare class WebsocketSubscriptionProvider extends SubscriptionProvider
7
7
  execute(options: SubscriptionProviderExecuteOptions): Observable<unknown>;
8
8
  close(): void;
9
9
  }
10
+ //# sourceMappingURL=ws.d.ts.map
@@ -17,3 +17,4 @@ export declare abstract class SubscriptionProvider {
17
17
  abstract execute(options: SubscriptionProviderExecuteOptions): Observable<any>;
18
18
  abstract close(): void;
19
19
  }
20
+ //# sourceMappingURL=subscription-provider.d.ts.map
@@ -1,3 +1,4 @@
1
1
  import { ICustomTheme } from '../theme';
2
2
  declare const theme: ICustomTheme;
3
3
  export default theme;
4
+ //# sourceMappingURL=dark.d.ts.map
@@ -1,3 +1,4 @@
1
1
  import { ICustomTheme } from '../theme';
2
2
  declare const theme: ICustomTheme;
3
3
  export default theme;
4
+ //# sourceMappingURL=dracula.d.ts.map
@@ -1,3 +1,4 @@
1
1
  import { ICustomTheme } from '../theme';
2
2
  declare const theme: ICustomTheme;
3
3
  export default theme;
4
+ //# sourceMappingURL=light.d.ts.map
@@ -188,3 +188,4 @@ export declare const dracula: {
188
188
  };
189
189
  };
190
190
  };
191
+ //# sourceMappingURL=index.d.ts.map
@@ -102,3 +102,4 @@ export declare const hexToRgbStr: (hex: string) => string;
102
102
  export declare const mergeThemes: (...customThemes: ICustomTheme[]) => ICustomTheme;
103
103
  export declare const createTheme: (customTheme: ICustomTheme, extraTheme?: ICustomTheme) => ITheme;
104
104
  export {};
105
+ //# sourceMappingURL=theme.d.ts.map
@@ -3,3 +3,4 @@ export interface IDictionary<V = any> {
3
3
  }
4
4
  export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
5
5
  export declare type TODO = any;
6
+ //# sourceMappingURL=shared.d.ts.map
@@ -13,13 +13,22 @@ export interface IQuery extends ExportWindowState {
13
13
  export interface IQueryCollection {
14
14
  id?: number;
15
15
  title: string;
16
- description?: string;
17
16
  queries: any[];
18
- collections?: IQueryCollection[];
17
+ description?: string;
18
+ /**
19
+ * path of the collection in the collection tree
20
+ * e.g. '/123/456'
21
+ */
22
+ parentPath?: string;
19
23
  created_at?: number;
20
24
  updated_at?: number;
21
25
  }
22
- export interface ExportCollectionState extends IQueryCollection {
26
+ export interface IQueryCollectionTree extends IQueryCollection {
27
+ id: number;
28
+ collections: IQueryCollectionTree[];
29
+ }
30
+ export interface ExportCollectionState extends IQueryCollectionTree {
23
31
  version: 1;
24
32
  type: 'collection';
25
33
  }
34
+ //# sourceMappingURL=collection.interfaces.d.ts.map
@@ -6,3 +6,4 @@ export interface DialogState {
6
6
  showAddToCollectionDialog: boolean;
7
7
  showPreRequestDialog: boolean;
8
8
  }
9
+ //# sourceMappingURL=dialog.interfaces.d.ts.map
@@ -17,3 +17,4 @@ export interface DocsState {
17
17
  isLoading: boolean;
18
18
  docView: DocView;
19
19
  }
20
+ //# sourceMappingURL=docs.interfaces.d.ts.map
@@ -1,3 +1,4 @@
1
1
  export interface DonationState {
2
2
  showAlert: boolean;
3
3
  }
4
+ //# sourceMappingURL=donation.interfaces.d.ts.map
@@ -19,3 +19,4 @@ export interface EnvironmentsState {
19
19
  activeSubEnvironment?: string;
20
20
  }
21
21
  export {};
22
+ //# sourceMappingURL=environments.interfaces.d.ts.map
@@ -6,3 +6,4 @@ export interface GQLSchemaState {
6
6
  allowIntrospection: boolean;
7
7
  lastUpdatedAt?: number;
8
8
  }
9
+ //# sourceMappingURL=gql-schema.interfaces.d.ts.map
@@ -4,3 +4,4 @@ export interface Header {
4
4
  enabled?: boolean;
5
5
  }
6
6
  export declare type HeaderState = Header[];
7
+ //# sourceMappingURL=header.interfaces.d.ts.map
@@ -4,3 +4,4 @@ export interface History {
4
4
  export interface HistoryState {
5
5
  list: History[];
6
6
  }
7
+ //# sourceMappingURL=history.interfaces.d.ts.map
@@ -5,3 +5,4 @@ export interface LayoutState {
5
5
  windowIdInCollection?: string;
6
6
  hasDynamicTitle?: boolean;
7
7
  }
8
+ //# sourceMappingURL=layout.interfaces.d.ts.map
@@ -16,3 +16,4 @@ export interface LocalState {
16
16
  panels: AltairPanel[];
17
17
  uiActions: AltairUiAction[];
18
18
  }
19
+ //# sourceMappingURL=local.interfaces.d.ts.map
@@ -23,3 +23,4 @@ export interface PerWindowState {
23
23
  postRequest: PostrequestState;
24
24
  windowId: string;
25
25
  }
26
+ //# sourceMappingURL=per-window.interfaces.d.ts.map
@@ -2,3 +2,4 @@ export interface PostrequestState {
2
2
  enabled: boolean;
3
3
  script: string;
4
4
  }
5
+ //# sourceMappingURL=postrequest.interfaces.d.ts.map
@@ -2,3 +2,4 @@ export interface PrerequestState {
2
2
  enabled: boolean;
3
3
  script: string;
4
4
  }
5
+ //# sourceMappingURL=prerequest.interfaces.d.ts.map
@@ -40,3 +40,4 @@ export interface QueryState {
40
40
  }
41
41
  export declare const HTTP_VERBS: readonly ["POST", "GET", "PUT", "DELETE"];
42
42
  export declare type HttpVerb = typeof HTTP_VERBS[number];
43
+ //# sourceMappingURL=query.interfaces.d.ts.map
@@ -56,6 +56,10 @@ export interface SettingsState {
56
56
  * Reload schema on app start
57
57
  */
58
58
  'schema.reloadOnStart'?: boolean;
59
+ /**
60
+ * Disable update notification
61
+ */
62
+ 'alert.disableUpdateNotification'?: boolean;
59
63
  /**
60
64
  * Disable warning alerts
61
65
  */
@@ -82,3 +86,4 @@ export interface SettingsState {
82
86
  'editor.shortcuts'?: Record<string, string>;
83
87
  }
84
88
  export {};
89
+ //# sourceMappingURL=settings.interfaces.d.ts.map
@@ -14,3 +14,4 @@ export interface RootState {
14
14
  environments: EnvironmentsState;
15
15
  local: LocalState;
16
16
  }
17
+ //# sourceMappingURL=state.interfaces.d.ts.map
@@ -5,3 +5,4 @@ export interface StreamState {
5
5
  isConnected: boolean;
6
6
  failed: any;
7
7
  }
8
+ //# sourceMappingURL=stream.interfaces.d.ts.map
@@ -8,3 +8,4 @@ export interface VariableState {
8
8
  variables: string;
9
9
  files: FileVariable[];
10
10
  }
11
+ //# sourceMappingURL=variable.interfaces.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { GraphQLSchema } from 'graphql';
2
+ import { SubscriptionProviderIds } from '../../subscriptions';
2
3
  import { PerWindowState } from './per-window.interfaces';
3
4
  export interface WindowState {
4
5
  [id: string]: PerWindowState;
@@ -19,6 +20,7 @@ export interface ExportWindowState {
19
20
  variables: string;
20
21
  subscriptionUrl: string;
21
22
  subscriptionConnectionParams?: string;
23
+ subscriptionProvider?: SubscriptionProviderIds;
22
24
  preRequestScript?: string;
23
25
  preRequestScriptEnabled?: boolean;
24
26
  postRequestScript?: string;
@@ -33,3 +35,4 @@ export interface ExportWindowState {
33
35
  windowIdInCollection?: string;
34
36
  gqlSchema?: GraphQLSchema;
35
37
  }
38
+ //# sourceMappingURL=window.interfaces.d.ts.map
@@ -7,3 +7,4 @@ export interface WindowsMetaState {
7
7
  showEnvironmentManager: boolean;
8
8
  showPluginManager: boolean;
9
9
  }
10
+ //# sourceMappingURL=windows-meta.interfaces.d.ts.map
@@ -1,2 +1,3 @@
1
1
  declare const _default: boolean;
2
2
  export default _default;
3
+ //# sourceMappingURL=is_electron.d.ts.map
@@ -3,3 +3,4 @@ export declare const createLogger: (environment: {
3
3
  production: boolean;
4
4
  version: string;
5
5
  }) => loglevel.RootLogger;
6
+ //# sourceMappingURL=logger.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "altair-graphql-core",
3
- "version": "4.2.1",
3
+ "version": "4.3.0",
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",
@@ -61,5 +61,5 @@
61
61
  "util": "^0.12.4",
62
62
  "uuid": "^8.3.2"
63
63
  },
64
- "gitHead": "d1c9b6c9f6c9d2e3b0d9f0b99cd04573e9bf6439"
64
+ "gitHead": "b4858d081932d9c79f221a13d34bcc0dc858aa0f"
65
65
  }
package/tsconfig.json CHANGED
@@ -3,6 +3,7 @@
3
3
  "outDir": "build/",
4
4
  "rootDir": "./src",
5
5
  "declaration": true,
6
+ "declarationMap": true,
6
7
  "target": "es2020",
7
8
  "module": "commonjs",
8
9
  "lib": [