@malloydata/db-publisher 0.0.342 → 0.0.344

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/dist/index.js CHANGED
@@ -9,4 +9,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.PublisherConnection = void 0;
10
10
  var publisher_connection_1 = require("./publisher_connection");
11
11
  Object.defineProperty(exports, "PublisherConnection", { enumerable: true, get: function () { return publisher_connection_1.PublisherConnection; } });
12
+ const malloy_1 = require("@malloydata/malloy");
13
+ const publisher_connection_2 = require("./publisher_connection");
14
+ (0, malloy_1.registerConnectionType)('publisher', {
15
+ displayName: 'Malloy Publisher',
16
+ factory: async (config) => {
17
+ const connectionUri = config['connectionUri'];
18
+ if (typeof connectionUri !== 'string') {
19
+ throw new Error(`Publisher connection "${config.name}" requires a connectionUri`);
20
+ }
21
+ return publisher_connection_2.PublisherConnection.create(config.name, {
22
+ connectionUri,
23
+ accessToken: typeof config['accessToken'] === 'string'
24
+ ? config['accessToken']
25
+ : undefined,
26
+ });
27
+ },
28
+ properties: [
29
+ {
30
+ name: 'connectionUri',
31
+ displayName: 'Connection URI',
32
+ type: 'string',
33
+ },
34
+ {
35
+ name: 'accessToken',
36
+ displayName: 'Access Token',
37
+ type: 'secret',
38
+ optional: true,
39
+ },
40
+ ],
41
+ });
12
42
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+DAA2D;AAAnD,2HAAA,mBAAmB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,+DAA2D;AAAnD,2HAAA,mBAAmB,OAAA;AAE3B,+CAA0D;AAE1D,iEAA2D;AAE3D,IAAA,+BAAsB,EAAC,WAAW,EAAE;IAClC,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,EAAE;QAC1C,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;QAC9C,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CACb,yBAAyB,MAAM,CAAC,IAAI,4BAA4B,CACjE,CAAC;QACJ,CAAC;QACD,OAAO,0CAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE;YAC7C,aAAa;YACb,WAAW,EACT,OAAO,MAAM,CAAC,aAAa,CAAC,KAAK,QAAQ;gBACvC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;gBACvB,CAAC,CAAC,SAAS;SAChB,CAAC,CAAC;IACL,CAAC;IACD,UAAU,EAAE;QACV;YACE,IAAI,EAAE,eAAe;YACrB,WAAW,EAAE,gBAAgB;YAC7B,IAAI,EAAE,QAAQ;SACf;QACD;YACE,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/db-publisher",
3
- "version": "0.0.342",
3
+ "version": "0.0.344",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "generate-api-types": "openapi-generator-cli generate -i publisher-api-doc.yaml -g typescript-axios -o src/client/ && node scripts/patch-common.js"
24
24
  },
25
25
  "dependencies": {
26
- "@malloydata/malloy": "0.0.342",
26
+ "@malloydata/malloy": "0.0.344",
27
27
  "axios": "^1.6.7"
28
28
  },
29
29
  "devDependencies": {
package/src/index.ts CHANGED
@@ -6,3 +6,39 @@
6
6
  */
7
7
 
8
8
  export {PublisherConnection} from './publisher_connection';
9
+
10
+ import {registerConnectionType} from '@malloydata/malloy';
11
+ import type {ConnectionConfig} from '@malloydata/malloy';
12
+ import {PublisherConnection} from './publisher_connection';
13
+
14
+ registerConnectionType('publisher', {
15
+ displayName: 'Malloy Publisher',
16
+ factory: async (config: ConnectionConfig) => {
17
+ const connectionUri = config['connectionUri'];
18
+ if (typeof connectionUri !== 'string') {
19
+ throw new Error(
20
+ `Publisher connection "${config.name}" requires a connectionUri`
21
+ );
22
+ }
23
+ return PublisherConnection.create(config.name, {
24
+ connectionUri,
25
+ accessToken:
26
+ typeof config['accessToken'] === 'string'
27
+ ? config['accessToken']
28
+ : undefined,
29
+ });
30
+ },
31
+ properties: [
32
+ {
33
+ name: 'connectionUri',
34
+ displayName: 'Connection URI',
35
+ type: 'string',
36
+ },
37
+ {
38
+ name: 'accessToken',
39
+ displayName: 'Access Token',
40
+ type: 'secret',
41
+ optional: true,
42
+ },
43
+ ],
44
+ });