@memberjunction/data-context-server 3.4.0 → 4.0.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/dist/index.d.ts CHANGED
@@ -8,8 +8,4 @@ export declare class DataContextItemServer extends DataContextItem {
8
8
  */
9
9
  protected LoadFromSQL(dataSource: any, contextUser?: UserInfo): Promise<boolean>;
10
10
  }
11
- /**
12
- * Call this function after you import this package to ensure that the DataContextItemServer class is not tree shaken out of the final build
13
- */
14
- export declare function LoadDataContextItemsServer(): void;
15
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,qBACa,qBAAsB,SAAQ,eAAe;IACtD;;;;OAIG;cACsB,WAAW,CAAC,UAAU,EAAE,GAAG,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAclG;AAED;;GAEG;AACH,wBAAgB,0BAA0B,SAGzC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,qBACa,qBAAsB,SAAQ,eAAe;IACtD;;;;OAIG;cACsB,WAAW,CAAC,UAAU,EAAE,GAAG,EAAE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAclG"}
package/dist/index.js CHANGED
@@ -1,40 +1,14 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
1
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
2
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
3
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
22
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
23
6
  };
24
- var __importStar = (this && this.__importStar) || function (mod) {
25
- if (mod && mod.__esModule) return mod;
26
- var result = {};
27
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
- __setModuleDefault(result, mod);
29
- return result;
30
- };
31
- Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.LoadDataContextItemsServer = exports.DataContextItemServer = void 0;
33
- const global_1 = require("@memberjunction/global");
34
- const core_1 = require("@memberjunction/core");
35
- const data_context_1 = require("@memberjunction/data-context");
36
- const sql = __importStar(require("mssql"));
37
- let DataContextItemServer = class DataContextItemServer extends data_context_1.DataContextItem {
7
+ import { RegisterClass } from "@memberjunction/global";
8
+ import { LogError } from "@memberjunction/core";
9
+ import { DataContextItem } from "@memberjunction/data-context";
10
+ import * as sql from "mssql";
11
+ let DataContextItemServer = class DataContextItemServer extends DataContextItem {
38
12
  /**
39
13
  * Server-Side only method to load the data context item from a SQL statement
40
14
  * @param dataSource - The data source to load the data context item from (this implementation uses mssql ConnectionPool object)
@@ -50,21 +24,13 @@ let DataContextItemServer = class DataContextItemServer extends data_context_1.D
50
24
  }
51
25
  catch (e) {
52
26
  this.DataLoadingError = `Error loading data context item from SQL: ${e && e.message ? e.message : e}`;
53
- (0, core_1.LogError)(this.DataLoadingError);
27
+ LogError(this.DataLoadingError);
54
28
  return false;
55
29
  }
56
30
  }
57
31
  };
58
- exports.DataContextItemServer = DataContextItemServer;
59
- exports.DataContextItemServer = DataContextItemServer = __decorate([
60
- (0, global_1.RegisterClass)(data_context_1.DataContextItem, undefined, undefined, true)
32
+ DataContextItemServer = __decorate([
33
+ RegisterClass(DataContextItem, undefined, undefined, true)
61
34
  ], DataContextItemServer);
62
- /**
63
- * Call this function after you import this package to ensure that the DataContextItemServer class is not tree shaken out of the final build
64
- */
65
- function LoadDataContextItemsServer() {
66
- // nothing to do here - this is called from packages that import this package in order to prevent tree shaking from removing the DataContextItemServer class
67
- // that can happen since there is no static code path to instantiate the class
68
- }
69
- exports.LoadDataContextItemsServer = LoadDataContextItemsServer;
35
+ export { DataContextItemServer };
70
36
  //# 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,mDAAuD;AACvD,+CAA0D;AAC1D,+DAA+D;AAC/D,2CAA6B;AAGtB,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,8BAAe;IACtD;;;;OAIG;IACgB,KAAK,CAAC,WAAW,CAAC,UAAe,EAAE,WAAsB;QACxE,IAAI,CAAC;YACD,MAAM,IAAI,GAAG,UAAgC,CAAC;YAC9C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACtC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAA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GAAG,CAAC,CAAC;YAC7C,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC;YAC7B,OAAO,IAAI,CAAC,CAAC,mGAAmG;QACpH,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACP,IAAI,CAAC,gBAAgB,GAAG,6CAA6C,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;YACrG,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAChC,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ,CAAA;AApBY,qBAAqB;IADjC,aAAa,CAAC,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC;GAC9C,qBAAqB,CAoBjC"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@memberjunction/data-context-server",
3
- "version": "3.4.0",
3
+ "type": "module",
4
+ "version": "4.0.0",
4
5
  "description": "This library provides a server-side implementation of the DataContextItem class from @memberjunction/data-context that can handle the server-side only use case of loading data into a context using raw SQL statements.",
5
6
  "main": "dist/index.js",
6
7
  "types": "dist/index.d.ts",
@@ -9,20 +10,20 @@
9
10
  ],
10
11
  "scripts": {
11
12
  "start": "ts-node-dev src/index.ts",
12
- "build": "tsc",
13
+ "build": "tsc && tsc-alias -f",
13
14
  "test": "echo \"Error: no test specified\" && exit 1"
14
15
  },
15
16
  "author": "MemberJunction.com",
16
17
  "license": "ISC",
17
18
  "devDependencies": {
18
19
  "ts-node-dev": "^2.0.0",
19
- "typescript": "^5.4.5"
20
+ "typescript": "^5.9.3"
20
21
  },
21
22
  "dependencies": {
22
- "@memberjunction/core": "3.4.0",
23
- "@memberjunction/data-context": "3.4.0",
24
- "@memberjunction/global": "3.4.0",
25
- "mssql": "^11.0.1"
23
+ "@memberjunction/core": "4.0.0",
24
+ "@memberjunction/data-context": "4.0.0",
25
+ "@memberjunction/global": "4.0.0",
26
+ "mssql": "^12.2.0"
26
27
  },
27
28
  "repository": {
28
29
  "type": "git",