cdeops 0.0.2-alpha.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.
package/LICENSE ADDED
@@ -0,0 +1,39 @@
1
+ The CDEBase Enterprise license (the “Enterprise License”)
2
+ Copyright (c) 2018 cdebase LLC.
3
+
4
+ With regard to the CDEBase Software:
5
+
6
+ This software and associated documentation files (the "Software") may only be
7
+ used in production, if you (and any entity that you represent) have agreed to,
8
+ and are in compliance with, the CDEBase Terms of Service, available
9
+ at https://about.cdebase.com/terms (the “Enterprise Terms”), or other
10
+ agreement governing the use of the Software, as agreed by you and CDEBase,
11
+ and otherwise have a valid CDEBase Enterprise subscription for the
12
+ correct number of user seats. Subject to the foregoing sentence, you are free to
13
+ modify this Software and publish patches to the Software. You agree that CDEBase
14
+ and/or its licensors (as applicable) retain all right, title and interest in and
15
+ to all such modifications and/or patches, and all such modifications and/or
16
+ patches may only be used, copied, modified, displayed, distributed, or otherwise
17
+ exploited with a valid CDEBase Enterprise subscription for the correct
18
+ number of user seats. Notwithstanding the foregoing, you may copy and modify
19
+ the Software for development and testing purposes, without requiring a
20
+ subscription. You agree that CDEBase and/or its licensors (as applicable) retain
21
+ all right, title and interest in and to all such modifications. You are not
22
+ granted any other rights beyond what is expressly stated herein. Subject to the
23
+ foregoing, it is forbidden to copy, merge, publish, distribute, sublicense,
24
+ and/or sell the Software.
25
+
26
+ The full text of this Enterprise License shall be included in all copies or
27
+ substantial portions of the Software.
28
+
29
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
+ SOFTWARE.
36
+
37
+ For all third party components incorporated into the CDEBase Software, those
38
+ components are licensed under the original license provided by the owner of the
39
+ applicable component.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+
2
+
3
+ ## To run tests
4
+
5
+ `npm link`
6
+ `npm link @xtermstack/xterm-core`
7
+ `npm install`
8
+ `tsc`
9
+ `npm run test`
package/client.d.ts ADDED
@@ -0,0 +1,321 @@
1
+ /// <reference path="./src/cdeops.d.ts"/>
2
+ /// <reference path="./src/cdeops.proposed.d.ts"/>
3
+
4
+ declare module 'cdeops/client' {
5
+
6
+ import {
7
+ OrganizationResource,
8
+ RelativePattern,
9
+ GlobPattern,
10
+ LogLevel,
11
+ Uri as URI,
12
+ Unsubscribable,
13
+ Subscribable,
14
+ Workspace,
15
+ ConfigurationTarget,
16
+ OrganizationConfiguration,
17
+ configuration,
18
+ organization
19
+ } from 'cdeops';
20
+
21
+ export {
22
+ OrganizationResource,
23
+ RelativePattern,
24
+ GlobPattern,
25
+ URI,
26
+ LogLevel,
27
+ Unsubscribable,
28
+ Subscribable,
29
+ Workspace,
30
+ ConfigurationTarget,
31
+ OrganizationConfiguration,
32
+ configuration,
33
+ organization,
34
+ }
35
+
36
+ export interface DocumentFilter {
37
+ /** A language id, such as `typescript` or `*`. */
38
+ language?: string;
39
+
40
+ /** A URI scheme, such as `file` or `untitled`. */
41
+ scheme?: string;
42
+
43
+ /** A glob pattern, such as `*.{ts,js}`. */
44
+ pattern?: string;
45
+
46
+ /** A base URI (e.g. root URI of a workspace folder) that the document must be within. */
47
+ baseUri?: URL | string;
48
+ }
49
+
50
+ /**
51
+ * A document selector is the combination of one or many document filters.
52
+ * A document matches the selector if any of the given filters matches.
53
+ * If the filter is a string and not a {@link DocumentFilter}, it will be treated as a language id.
54
+ *
55
+ * @example let sel: DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }];
56
+ */
57
+ export type DocumentSelector = (string | DocumentFilter)[]
58
+
59
+ /**
60
+ * A document selector is the combination of one or many document filters.
61
+ * A document matches the selector if any of the given filters matches.
62
+ * If the filter is a string and not a {@link DocumentFilter}, it will be treated as a language id.
63
+ *
64
+ * @example let sel: DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }];
65
+ */
66
+ export type DocumentSelector = (string | DocumentFilter)[]
67
+
68
+ /**
69
+ * A panel view created by {@link sourcegraph.app.createPanelView}.
70
+ */
71
+ export interface PanelView extends Unsubscribable {
72
+ /**
73
+ * The title of the panel view.
74
+ */
75
+ title: string
76
+
77
+ /**
78
+ * The content to show in the panel view. Markdown is supported.
79
+ */
80
+ content: string
81
+
82
+ /**
83
+ * The priority of this panel view. A higher value means that the item is shown near the beginning (usually
84
+ * the left side).
85
+ */
86
+ priority: number
87
+
88
+ /**
89
+ * Display the results of the location provider (with the given ID) in this panel below the
90
+ * {@link PanelView#contents}.
91
+ *
92
+ * Experimental. Subject to change or removal without notice.
93
+ *
94
+ * @internal
95
+ */
96
+ component: { locationProvider: string } | null
97
+ }
98
+
99
+ /**
100
+ * A style for a {@link TextDocumentDecoration}.
101
+ */
102
+ export interface ThemableDecorationStyle {
103
+ /** The CSS background-color property value for the line. */
104
+ backgroundColor?: string
105
+
106
+ /** The CSS border property value for the line. */
107
+ border?: string
108
+
109
+ /** The CSS border-color property value for the line. */
110
+ borderColor?: string
111
+
112
+ /** The CSS border-width property value for the line. */
113
+ borderWidth?: string
114
+ }
115
+ /**
116
+ * A text document decoration changes the appearance of a range in the document and/or adds other content to
117
+ * it.
118
+ */
119
+ export interface TextDocumentDecoration extends ThemableDecorationStyle {
120
+ /**
121
+ * The range that the decoration applies to. Currently, decorations are
122
+ * only applied only on the start line, and the entire line. Multiline
123
+ * and intra-line ranges are not supported.
124
+ */
125
+ range: Range
126
+
127
+ /**
128
+ * If true, the decoration applies to all lines in the range (inclusive), even if not all characters on the
129
+ * line are included.
130
+ */
131
+ isWholeLine?: boolean
132
+
133
+ /** Content to display after the range. */
134
+ after?: DecorationAttachmentRenderOptions
135
+
136
+ /** Overwrite style for light themes. */
137
+ light?: ThemableDecorationStyle
138
+
139
+ /** Overwrite style for dark themes. */
140
+ dark?: ThemableDecorationStyle
141
+ }
142
+
143
+
144
+ /**
145
+ * A style for {@link BadgeAttachmentRenderOptions}.
146
+ */
147
+ export interface ThemableBadgeAttachmentStyle {
148
+ /**
149
+ * The icon (a base64-encoded image icon) to display next to the wrapped value.
150
+ *
151
+ * @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
152
+ */
153
+ icon?: string
154
+
155
+ /**
156
+ * The CSS background-color property value for the attachment.
157
+ *
158
+ * @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
159
+ */
160
+ backgroundColor?: string
161
+
162
+ /**
163
+ * The CSS color property value for the attachment.
164
+ *
165
+ * @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
166
+ */
167
+ color?: string
168
+ }
169
+
170
+ /** An attachment adds content to a hover tooltip or result in a locations panel. */
171
+ export interface BadgeAttachmentRenderOptions extends ThemableBadgeAttachmentStyle {
172
+ /** Predefined icons for badge attachments */
173
+ kind: 'info' | 'error' | 'warning'
174
+
175
+ /** Tooltip text to display when hovering over the attachment. */
176
+ hoverMessage?: string
177
+
178
+ /** If set, the attachment becomes a link with this destination URL. */
179
+ linkURL?: string
180
+
181
+ /**
182
+ * Overwrite style for light themes.
183
+ *
184
+ * @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
185
+ */
186
+ light?: ThemableBadgeAttachmentStyle
187
+
188
+ /**
189
+ * Overwrite style for dark themes.
190
+ *
191
+ * @deprecated Use {@link BadgeAttachmentRenderOptions#kind} to pick a predefined icon
192
+ */
193
+ dark?: ThemableBadgeAttachmentStyle
194
+ }
195
+
196
+ /**
197
+ * A wrapper around a providable type (currently hover and locations) with additional
198
+ * context to enable displaying badges next to the wrapped result value in the UI.
199
+ */
200
+ export type Badged<T extends object> = T & {
201
+ badge?: BadgeAttachmentRenderOptions
202
+ }
203
+
204
+
205
+ /**
206
+ * A hover represents additional information for a symbol or word. Hovers are rendered in a tooltip-like
207
+ * widget.
208
+ */
209
+ export interface Hover {
210
+ /**
211
+ * The contents of this hover.
212
+ */
213
+ contents: MarkupContent
214
+
215
+ /**
216
+ * The range to which this hover applies. When missing, the editor will use the range at the current
217
+ * position or the current position itself.
218
+ */
219
+ range?: Range
220
+
221
+ /**
222
+ * Alerts that should be shown in this hover.
223
+ */
224
+ alerts?: Badged<HoverAlert>[]
225
+ }
226
+
227
+ export interface HoverAlert {
228
+ /**
229
+ * Text content to be shown on hovers. Since the alert is displayed inline,
230
+ * multiparagraph content will be rendered on one line. It's recommended to
231
+ * provide a brief message here, and place futher details in the badge or
232
+ * provide a link.
233
+ */
234
+ summary: MarkupContent
235
+
236
+ /**
237
+ * When an alert has a dismissal type, dismissing it will prevent all alerts
238
+ * of that type from being shown. If no type is provided, the alert is not
239
+ * dismissible.
240
+ */
241
+ type?: string
242
+ }
243
+
244
+ export interface ContextValues {
245
+ [key: string]: string | number | boolean | null
246
+ }
247
+
248
+ /**
249
+ * Internal API for Cdeops extensions. ost of those wil be removed for the beta release of Cdeops
250
+ * extensions. They are necessary now due to limitations in the extension API and its implementation tha will
251
+ * be addressed in the beta release.
252
+ *
253
+ * @internal
254
+ * @hidden
255
+ */
256
+ export namespace internal {
257
+ /**
258
+ * Returns a promise that resolve when all pending messages have been sent to the client.
259
+ * It helps enforce serialization of messages.
260
+ *
261
+ * @internal
262
+ */
263
+ export function sync(): Promise<void>;
264
+
265
+
266
+ /**
267
+ * Updates context values for use in context expressions and contribution labels.
268
+ *
269
+ * @param updates The updates to apply to the context. If a context property's value is null, it is deleted from the
270
+ * context.
271
+ */
272
+ export function updateContext(updates: ContextValues): void;
273
+
274
+
275
+ export const cdeopsURL: URI
276
+
277
+
278
+
279
+ export const clientApplication: 'cdeops' | 'other'
280
+
281
+ /**
282
+ * Server api
283
+ */
284
+ export const serverApi: any
285
+
286
+
287
+ /**
288
+ * gql
289
+ */
290
+ export const gql: any
291
+ }
292
+
293
+ /**
294
+ * The extension context is passed to the extension's activate function and contains utilities for
295
+ * extension lifecycle.
296
+ */
297
+ export interface ExtensionContext {
298
+ /**
299
+ * An object that maintains subscriptions to resources that should be freed when the extension is
300
+ * deactivated.
301
+ *
302
+ * When an extension is deactivated, first its exported `deactivate` function is called (if one exists).
303
+ * The `deactivate` function may be async, in which case deactivation blocks on it finishing. Next,
304
+ * regardless of whether the `deactivate` function finished successfully or rejected with an error, all
305
+ * unsubscribables passed to {@link ExtensionContext#subscriptions#add} are unsubscribed from.
306
+ *
307
+ * (An extension is deactivated when the user disables it, or after an arbitary time period if
308
+ * activationEvents no longer evaluated to true.)
309
+ */
310
+ subscriptions: {
311
+ /**
312
+ * Mark a resource's teardown function to be called when the extension is deactivated.
313
+ *
314
+ * @param unsubscribable An {@link Unsubscribable} that frees (unsubscribes from) a resource, or a
315
+ * plan function that deos the same. Async functions are not supported. (If deactivation requires
316
+ * async operations, make the `deactivate` function async; that is supported.)
317
+ */
318
+ add: (unsubscribe: Unsubscribable | (() => void)) => void;
319
+ }
320
+ }
321
+ }
package/client.js ADDED
@@ -0,0 +1,9 @@
1
+ // This is the module that is bundled with extensions when they use `import ... from 'cdeops/client'` or
2
+ // `require('cdeops/client')`. It delegates to the extension host's runtime implementation of this module by calling
3
+ // `global.require` (which ensures that the extension host's `require` is called at runtime).
4
+ //
5
+ // This dummy file is used when extension is bundled with a JavaScript bundler that lacks support for externals
6
+ // (or when `cdeops/client` is not configured as an external module). Parcel does not support extenals
7
+ // (https://github.com/parcel-bundler/parcel/issues/144). Webpack, Rollup, and Microbundle support externals.
8
+
9
+ module.exports = global.require('cdeops/client')
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "cdeops",
3
+ "version": "0.0.2-alpha.0",
4
+ "description": "Cdecode - Extension API: build extensions that enhance coding experience in your cdeops editor",
5
+ "license": "Apache-2.0",
6
+ "author": "CDMBase LLC",
7
+ "sideEffects": false,
8
+ "main": "src/index.js",
9
+ "module": "src/index.js",
10
+ "types": "./src/cdeops.d.ts",
11
+ "files": [
12
+ "server.d.ts",
13
+ "server.js",
14
+ "client.d.ts",
15
+ "client.js",
16
+ "src",
17
+ "dist/docs"
18
+ ],
19
+ "scripts": {
20
+ "build": "npm run build:clean && npm run build:lib",
21
+ "build:clean": "rimraf lib",
22
+ "build:lib": "webpack",
23
+ "build:lib:watch": "npm run build:lib -- --watch",
24
+ "docs": "typedoc",
25
+ "prepublishOnly": "npm run tslint && npm run docs",
26
+ "tslint": "tslint -c tslint.json -p tsconfig.json './src/**/*.{ts,js}'",
27
+ "watch": "npm run build:lib:watch"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "gitHead": "adc8a3c248d8d214e66489f332f758759fcdb7a5"
33
+ }
package/server.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /// <reference path="./src/cdeops.d.ts"/>
2
+ /// <reference path="./src/cdeops.proposed.d.ts"/>
3
+
4
+ import * as cdeops from 'cdeops';
5
+ export = cdeops;
package/server.js ADDED
@@ -0,0 +1,9 @@
1
+ // This is the module that is bundled with extensions when they use `import ... from 'cdeops/server'` or
2
+ // `require('cdeops/server')`. It delegates to the extension host's runtime implementation of this module by calling
3
+ // `global.require` (which ensures that the extension host's `require` is called at runtime).
4
+ //
5
+ // This dummy file is used when extension is bundled with a JavaScript bundler that lacks support for externals
6
+ // (or when `cdeops/server` is not configured as an external module). Parcel does not support extenals
7
+ // (https://github.com/parcel-bundler/parcel/issues/144). Webpack, Rollup, and Microbundle support externals.
8
+
9
+ module.exports = require('cdeops/server')