@memberjunction/server 1.6.1 → 1.7.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/CHANGELOG.json +144 -1
- package/CHANGELOG.md +34 -2
- package/dist/generated/generated.d.ts +38 -0
- package/dist/generated/generated.d.ts.map +1 -1
- package/dist/generated/generated.js +196 -20
- package/dist/generated/generated.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +21 -20
- package/src/generated/generated.ts +144 -11
- package/src/index.ts +12 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,kBAAkB,CAAC;AAqB1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,0CAA0C,CAAC;AACzD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,8BAA8B,CAAC;AAE7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAE3C,cAAc,uBAAuB,CAAA;AAMrC,eAAO,MAAM,KAAK,kBAAyB,MAAM,MAAM,CAAC,kBAoFvD,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -57,6 +57,7 @@ const actions_1 = require("@memberjunction/actions");
|
|
|
57
57
|
(0, actions_1.LoadActionEntityServer)();
|
|
58
58
|
const core_actions_1 = require("@memberjunction/core-actions");
|
|
59
59
|
(0, core_actions_1.LoadGeneratedActions)();
|
|
60
|
+
const external_change_detection_1 = require("@memberjunction/external-change-detection");
|
|
60
61
|
const cacheRefreshInterval = config_1.configInfo.databaseSettings.metadataCacheRefreshInterval;
|
|
61
62
|
var class_validator_1 = require("class-validator");
|
|
62
63
|
Object.defineProperty(exports, "MaxLength", { enumerable: true, get: function () { return class_validator_1.MaxLength; } });
|
|
@@ -107,6 +108,9 @@ const serve = async (resolverPaths) => {
|
|
|
107
108
|
const config = new sqlserver_dataprovider_1.SQLServerProviderConfigData(dataSource, '', config_1.mj_core_schema, cacheRefreshInterval);
|
|
108
109
|
await (0, sqlserver_dataprovider_1.setupSQLServerClient)(config);
|
|
109
110
|
const md = new core_1.Metadata();
|
|
111
|
+
const cd = external_change_detection_1.ExternalChangeDetectorEngine.Instance;
|
|
112
|
+
await cd.Config(false, sqlserver_dataprovider_1.UserCache.Users[0]);
|
|
113
|
+
cd.DetectChangesForAllEligibleEntities().then(result => console.log(result));
|
|
110
114
|
console.log(`Data Source has been initialized. ${md?.Entities ? md.Entities.length : 0} entities loaded.`);
|
|
111
115
|
setupComplete$.next(true);
|
|
112
116
|
const dynamicModules = await Promise.all(paths.map((modulePath) => Promise.resolve(`${modulePath.replace(/\.[jt]s$/, '')}`).then(s => __importStar(require(s)))));
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,sDAA4D;AAC5D,kDAAqD;AACrD,+CAAgD;AAChD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAE5B,gBAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,sDAA4D;AAC5D,kDAAqD;AACrD,+CAAgD;AAChD,mFAAsH;AACtH,6CAAmC;AACnC,gDAAwB;AACxB,sDAA8B;AAC9B,yCAAqC;AACrC,8CAAkD;AAClD,yCAAyC;AACzC,yCAAgC;AAChC,4BAA0B;AAC1B,+BAAqC;AACrC,+CAAqF;AACrF,qCAAqC;AACrC,2BAAqC;AACrC,kEAA+C;AAC/C,qCAA2G;AAC3G,uCAA4D;AAC5D,6CAA+C;AAC/C,gDAAwB;AAExB,qDAAiE;AACjE,IAAA,gCAAsB,GAAE,CAAC;AAEzB,+DAAoE;AACpE,IAAA,mCAAoB,GAAE,CAAC;AAEvB,yFAAyF;AAEzF,MAAM,oBAAoB,GAAG,mBAAU,CAAC,gBAAgB,CAAC,4BAA4B,CAAC;AAEtF,mDAA4C;AAAnC,4GAAA,SAAS,OAAA;AAClB,+CAA6B;AAC7B,4CAA8C;AAArC,uGAAA,WAAW,OAAA;AACpB,mCAAsC;AAA7B,oGAAA,UAAU,OAAA;AACnB,+CAA6B;AAC7B,2EAAyD;AACzD,8EAA4D;AAC5D,+EAA6D;AAC7D,2EAAyD;AACzD,0CAAwB;AACxB,+BAA2C;AAAlC,yGAAA,iBAAiB,OAAA;AAE1B,+DAA6C;AAC7C,yDAAuC;AACvC,4DAA0C;AAC1C,8DAA4C;AAC5C,gEAA6C;AAC7C,+DAA6C;AAE7C,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AW,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IACxF,OAAO,CAAC,GAAG,CAAC,uCAAuC,oBAAW,GAAG,CAAC,CAAC;AACrE,CAAC,CAAC;AApFW,QAAA,KAAK,SAoFhB;AAEF,kBAAe,aAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "MemberJunction: This project provides API access via GraphQL to the common data store.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -21,26 +21,27 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@apollo/server": "^4.9.1",
|
|
23
23
|
"@graphql-tools/utils": "^10.0.1",
|
|
24
|
-
"@memberjunction/actions": "1.
|
|
25
|
-
"@memberjunction/ai": "1.
|
|
26
|
-
"@memberjunction/ai-mistral": "1.
|
|
27
|
-
"@memberjunction/ai-openai": "1.
|
|
28
|
-
"@memberjunction/ai-vectors-pinecone": "1.
|
|
29
|
-
"@memberjunction/aiengine": "1.
|
|
24
|
+
"@memberjunction/actions": "1.7.0",
|
|
25
|
+
"@memberjunction/ai": "1.7.0",
|
|
26
|
+
"@memberjunction/ai-mistral": "1.7.0",
|
|
27
|
+
"@memberjunction/ai-openai": "1.7.0",
|
|
28
|
+
"@memberjunction/ai-vectors-pinecone": "1.7.0",
|
|
29
|
+
"@memberjunction/aiengine": "1.7.0",
|
|
30
30
|
"@memberjunction/communication-core": "1.5.2",
|
|
31
|
-
"@memberjunction/core": "1.
|
|
32
|
-
"@memberjunction/core-actions": "1.
|
|
33
|
-
"@memberjunction/core-entities": "1.
|
|
34
|
-
"@memberjunction/data-context": "1.
|
|
35
|
-
"@memberjunction/data-context-server": "1.
|
|
36
|
-
"@memberjunction/doc-utils": "1.
|
|
37
|
-
"@memberjunction/global": "1.
|
|
38
|
-
"@memberjunction/queue": "1.
|
|
39
|
-
"@memberjunction/skip-types": "1.
|
|
40
|
-
"@memberjunction/sqlserver-dataprovider": "1.6.
|
|
41
|
-
"@memberjunction/storage": "1.
|
|
42
|
-
"@memberjunction/templates": "1.
|
|
43
|
-
"@memberjunction/
|
|
31
|
+
"@memberjunction/core": "1.7.0",
|
|
32
|
+
"@memberjunction/core-actions": "1.7.0",
|
|
33
|
+
"@memberjunction/core-entities": "1.7.0",
|
|
34
|
+
"@memberjunction/data-context": "1.7.0",
|
|
35
|
+
"@memberjunction/data-context-server": "1.7.0",
|
|
36
|
+
"@memberjunction/doc-utils": "1.7.0",
|
|
37
|
+
"@memberjunction/global": "1.7.0",
|
|
38
|
+
"@memberjunction/queue": "1.7.0",
|
|
39
|
+
"@memberjunction/skip-types": "1.7.0",
|
|
40
|
+
"@memberjunction/sqlserver-dataprovider": "1.6.2",
|
|
41
|
+
"@memberjunction/storage": "1.7.0",
|
|
42
|
+
"@memberjunction/templates": "1.7.0",
|
|
43
|
+
"@memberjunction/external-change-detection": "1.7.0",
|
|
44
|
+
"@memberjunction/entity-communications-server": "1.7.0",
|
|
44
45
|
"@types/cors": "^2.8.13",
|
|
45
46
|
"@types/jsonwebtoken": "9.0.6",
|
|
46
47
|
"@types/node": "20.14.2",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ALL ENTITIES - TypeGraphQL Type Class Definition - AUTO GENERATED FILE
|
|
3
3
|
* Generated Entities and Resolvers for Server
|
|
4
4
|
*
|
|
5
|
-
* GENERATED: 6/
|
|
5
|
+
* GENERATED: 6/12/2024, 12:19:28 AM
|
|
6
6
|
*
|
|
7
7
|
* >>> DO NOT MODIFY THIS FILE!!!!!!!!!!!!
|
|
8
8
|
* >>> YOUR CHANGES WILL BE OVERWRITTEN
|
|
@@ -1504,6 +1504,9 @@ export class Integration_ {
|
|
|
1504
1504
|
@Field(() => [mj_core_schema_server_object_types.CompanyIntegration_])
|
|
1505
1505
|
CompanyIntegrationsArray: mj_core_schema_server_object_types.CompanyIntegration_[]; // Link to CompanyIntegrations
|
|
1506
1506
|
|
|
1507
|
+
@Field(() => [mj_core_schema_server_object_types.RecordChange_])
|
|
1508
|
+
RecordChangesArray: mj_core_schema_server_object_types.RecordChange_[]; // Link to RecordChanges
|
|
1509
|
+
|
|
1507
1510
|
}
|
|
1508
1511
|
|
|
1509
1512
|
//****************************************************************************
|
|
@@ -1614,6 +1617,14 @@ export class IntegrationResolver extends ResolverBase {
|
|
|
1614
1617
|
const result = this.ArrayMapFieldNamesToCodeNames('Company Integrations', await dataSource.query(sSQL));
|
|
1615
1618
|
return result;
|
|
1616
1619
|
}
|
|
1620
|
+
|
|
1621
|
+
@FieldResolver(() => [mj_core_schema_server_object_types.RecordChange_])
|
|
1622
|
+
async RecordChangesArray(@Root() integration_: Integration_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
1623
|
+
this.CheckUserReadPermissions('Record Changes', userPayload);
|
|
1624
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwRecordChanges] WHERE [IntegrationID]=${integration_.ID} ` + this.getRowLevelSecurityWhereClause('Record Changes', userPayload, EntityPermissionType.Read, 'AND');
|
|
1625
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Record Changes', await dataSource.query(sSQL));
|
|
1626
|
+
return result;
|
|
1627
|
+
}
|
|
1617
1628
|
|
|
1618
1629
|
@Mutation(() => Integration_)
|
|
1619
1630
|
async UpdateIntegration(
|
|
@@ -2468,6 +2479,10 @@ export class Entity_ {
|
|
|
2468
2479
|
@MaxLength(510)
|
|
2469
2480
|
PreferredCommunicationField?: string;
|
|
2470
2481
|
|
|
2482
|
+
@Field({nullable: true, description: 'Optional, specify an icon (CSS Class) for each entity for display in the UI'})
|
|
2483
|
+
@MaxLength(1000)
|
|
2484
|
+
Icon?: string;
|
|
2485
|
+
|
|
2471
2486
|
@Field({nullable: true})
|
|
2472
2487
|
CodeName?: string;
|
|
2473
2488
|
|
|
@@ -2720,6 +2735,9 @@ export class CreateEntityInput {
|
|
|
2720
2735
|
|
|
2721
2736
|
@Field({ nullable: true })
|
|
2722
2737
|
PreferredCommunicationField?: string;
|
|
2738
|
+
|
|
2739
|
+
@Field({ nullable: true })
|
|
2740
|
+
Icon?: string;
|
|
2723
2741
|
}
|
|
2724
2742
|
|
|
2725
2743
|
|
|
@@ -2845,6 +2863,9 @@ export class UpdateEntityInput {
|
|
|
2845
2863
|
@Field({ nullable: true })
|
|
2846
2864
|
PreferredCommunicationField?: string;
|
|
2847
2865
|
|
|
2866
|
+
@Field({ nullable: true })
|
|
2867
|
+
Icon?: string;
|
|
2868
|
+
|
|
2848
2869
|
@Field(() => [KeyValuePairInput], { nullable: true })
|
|
2849
2870
|
OldValues___?: KeyValuePairInput[];
|
|
2850
2871
|
}
|
|
@@ -5035,6 +5056,13 @@ export class Application_ {
|
|
|
5035
5056
|
@Field({nullable: true})
|
|
5036
5057
|
Description?: string;
|
|
5037
5058
|
|
|
5059
|
+
@Field({nullable: true, description: 'Specify the CSS class information for the display icon for each application.'})
|
|
5060
|
+
@MaxLength(1000)
|
|
5061
|
+
Icon?: string;
|
|
5062
|
+
|
|
5063
|
+
@Field(() => Boolean, {description: 'If turned on, when a new user first uses the MJ Explorer app, the application records with this turned on will have this application included in their selected application list.'})
|
|
5064
|
+
DefaultForNewUser: boolean;
|
|
5065
|
+
|
|
5038
5066
|
@Field()
|
|
5039
5067
|
@MaxLength(8)
|
|
5040
5068
|
CreatedAt: Date;
|
|
@@ -5064,6 +5092,12 @@ export class CreateApplicationInput {
|
|
|
5064
5092
|
|
|
5065
5093
|
@Field({ nullable: true })
|
|
5066
5094
|
Description?: string;
|
|
5095
|
+
|
|
5096
|
+
@Field({ nullable: true })
|
|
5097
|
+
Icon?: string;
|
|
5098
|
+
|
|
5099
|
+
@Field(() => Boolean)
|
|
5100
|
+
DefaultForNewUser: boolean;
|
|
5067
5101
|
}
|
|
5068
5102
|
|
|
5069
5103
|
|
|
@@ -5081,6 +5115,12 @@ export class UpdateApplicationInput {
|
|
|
5081
5115
|
@Field({ nullable: true })
|
|
5082
5116
|
Description?: string;
|
|
5083
5117
|
|
|
5118
|
+
@Field({ nullable: true })
|
|
5119
|
+
Icon?: string;
|
|
5120
|
+
|
|
5121
|
+
@Field(() => Boolean)
|
|
5122
|
+
DefaultForNewUser: boolean;
|
|
5123
|
+
|
|
5084
5124
|
@Field(() => [KeyValuePairInput], { nullable: true })
|
|
5085
5125
|
OldValues___?: KeyValuePairInput[];
|
|
5086
5126
|
}
|
|
@@ -5213,7 +5253,7 @@ export class ApplicationEntity_ {
|
|
|
5213
5253
|
@Field(() => Int)
|
|
5214
5254
|
Sequence: number;
|
|
5215
5255
|
|
|
5216
|
-
@Field(() => Boolean)
|
|
5256
|
+
@Field(() => Boolean, {description: 'When set to 1, the entity will be included by default for a new user when they first access the application in question'})
|
|
5217
5257
|
DefaultForNewUser: boolean;
|
|
5218
5258
|
|
|
5219
5259
|
@Field()
|
|
@@ -5785,6 +5825,25 @@ export class UserApplication_ {
|
|
|
5785
5825
|
|
|
5786
5826
|
}
|
|
5787
5827
|
|
|
5828
|
+
//****************************************************************************
|
|
5829
|
+
// INPUT TYPE for User Applications
|
|
5830
|
+
//****************************************************************************
|
|
5831
|
+
@InputType()
|
|
5832
|
+
export class CreateUserApplicationInput {
|
|
5833
|
+
@Field(() => Int)
|
|
5834
|
+
UserID: number;
|
|
5835
|
+
|
|
5836
|
+
@Field(() => Int)
|
|
5837
|
+
ApplicationID: number;
|
|
5838
|
+
|
|
5839
|
+
@Field(() => Int)
|
|
5840
|
+
Sequence: number;
|
|
5841
|
+
|
|
5842
|
+
@Field(() => Boolean)
|
|
5843
|
+
IsActive: boolean;
|
|
5844
|
+
}
|
|
5845
|
+
|
|
5846
|
+
|
|
5788
5847
|
//****************************************************************************
|
|
5789
5848
|
// INPUT TYPE for User Applications
|
|
5790
5849
|
//****************************************************************************
|
|
@@ -5869,6 +5928,15 @@ export class UserApplicationResolver extends ResolverBase {
|
|
|
5869
5928
|
return result;
|
|
5870
5929
|
}
|
|
5871
5930
|
|
|
5931
|
+
@Mutation(() => UserApplication_)
|
|
5932
|
+
async CreateUserApplication(
|
|
5933
|
+
@Arg('input', () => CreateUserApplicationInput) input: CreateUserApplicationInput,
|
|
5934
|
+
@Ctx() { dataSource, userPayload }: AppContext,
|
|
5935
|
+
@PubSub() pubSub: PubSubEngine
|
|
5936
|
+
) {
|
|
5937
|
+
return this.CreateRecord('User Applications', input, dataSource, userPayload, pubSub)
|
|
5938
|
+
}
|
|
5939
|
+
|
|
5872
5940
|
@Mutation(() => UserApplication_)
|
|
5873
5941
|
async UpdateUserApplication(
|
|
5874
5942
|
@Arg('input', () => UpdateUserApplicationInput) input: UpdateUserApplicationInput,
|
|
@@ -7087,32 +7155,54 @@ export class RecordChange_ {
|
|
|
7087
7155
|
EntityID: number;
|
|
7088
7156
|
|
|
7089
7157
|
@Field()
|
|
7090
|
-
@MaxLength(
|
|
7158
|
+
@MaxLength(1500)
|
|
7091
7159
|
RecordID: string;
|
|
7092
7160
|
|
|
7093
|
-
@Field(() => Int)
|
|
7161
|
+
@Field(() => Int, {description: 'The user that made the change'})
|
|
7094
7162
|
UserID: number;
|
|
7095
7163
|
|
|
7096
|
-
@Field()
|
|
7164
|
+
@Field({description: 'Create, Update, or Delete'})
|
|
7165
|
+
@MaxLength(40)
|
|
7166
|
+
Type: string;
|
|
7167
|
+
|
|
7168
|
+
@Field({nullable: true, description: 'Internal or External'})
|
|
7169
|
+
@MaxLength(40)
|
|
7170
|
+
Source?: string;
|
|
7171
|
+
|
|
7172
|
+
@Field(() => Int, {nullable: true, description: 'If Source=External, this field can optionally specify which integration created the change, if known'})
|
|
7173
|
+
IntegrationID?: number;
|
|
7174
|
+
|
|
7175
|
+
@Field({description: 'The date/time that the change occured.'})
|
|
7097
7176
|
@MaxLength(8)
|
|
7098
7177
|
ChangedAt: Date;
|
|
7099
7178
|
|
|
7100
|
-
@Field()
|
|
7179
|
+
@Field({description: 'JSON structure that describes what was changed in a structured format.'})
|
|
7101
7180
|
ChangesJSON: string;
|
|
7102
7181
|
|
|
7103
|
-
@Field()
|
|
7182
|
+
@Field({description: 'A generated, human-readable description of what was changed.'})
|
|
7104
7183
|
ChangesDescription: string;
|
|
7105
7184
|
|
|
7106
|
-
@Field()
|
|
7185
|
+
@Field({description: 'A complete snapshot of the record AFTER the change was applied in a JSON format that can be parsed.'})
|
|
7107
7186
|
FullRecordJSON: string;
|
|
7108
7187
|
|
|
7109
|
-
@Field()
|
|
7110
|
-
@MaxLength(
|
|
7188
|
+
@Field({description: 'For internal record changes generated within MJ, the status is immediately Complete. For external changes that are detected, the workflow starts off as Pending, then In Progress and finally either Complete or Error'})
|
|
7189
|
+
@MaxLength(100)
|
|
7111
7190
|
Status: string;
|
|
7112
7191
|
|
|
7192
|
+
@Field({nullable: true})
|
|
7193
|
+
ErrorLog?: string;
|
|
7194
|
+
|
|
7113
7195
|
@Field({nullable: true})
|
|
7114
7196
|
Comments?: string;
|
|
7115
7197
|
|
|
7198
|
+
@Field()
|
|
7199
|
+
@MaxLength(8)
|
|
7200
|
+
CreatedAt: Date;
|
|
7201
|
+
|
|
7202
|
+
@Field()
|
|
7203
|
+
@MaxLength(8)
|
|
7204
|
+
UpdatedAt: Date;
|
|
7205
|
+
|
|
7116
7206
|
@Field()
|
|
7117
7207
|
@MaxLength(510)
|
|
7118
7208
|
Entity: string;
|
|
@@ -7120,6 +7210,10 @@ export class RecordChange_ {
|
|
|
7120
7210
|
@Field()
|
|
7121
7211
|
@MaxLength(200)
|
|
7122
7212
|
User: string;
|
|
7213
|
+
|
|
7214
|
+
@Field({nullable: true})
|
|
7215
|
+
@MaxLength(200)
|
|
7216
|
+
Integration?: string;
|
|
7123
7217
|
|
|
7124
7218
|
}
|
|
7125
7219
|
|
|
@@ -7137,6 +7231,15 @@ export class CreateRecordChangeInput {
|
|
|
7137
7231
|
@Field(() => Int)
|
|
7138
7232
|
UserID: number;
|
|
7139
7233
|
|
|
7234
|
+
@Field()
|
|
7235
|
+
Type: string;
|
|
7236
|
+
|
|
7237
|
+
@Field({ nullable: true })
|
|
7238
|
+
Source?: string;
|
|
7239
|
+
|
|
7240
|
+
@Field(() => Int, { nullable: true })
|
|
7241
|
+
IntegrationID?: number;
|
|
7242
|
+
|
|
7140
7243
|
@Field()
|
|
7141
7244
|
ChangedAt: Date;
|
|
7142
7245
|
|
|
@@ -7152,6 +7255,9 @@ export class CreateRecordChangeInput {
|
|
|
7152
7255
|
@Field()
|
|
7153
7256
|
Status: string;
|
|
7154
7257
|
|
|
7258
|
+
@Field({ nullable: true })
|
|
7259
|
+
ErrorLog?: string;
|
|
7260
|
+
|
|
7155
7261
|
@Field({ nullable: true })
|
|
7156
7262
|
Comments?: string;
|
|
7157
7263
|
}
|
|
@@ -13067,6 +13173,9 @@ export class Query_ {
|
|
|
13067
13173
|
@MaxLength(510)
|
|
13068
13174
|
Name: string;
|
|
13069
13175
|
|
|
13176
|
+
@Field({nullable: true})
|
|
13177
|
+
UserQuestion?: string;
|
|
13178
|
+
|
|
13070
13179
|
@Field({nullable: true})
|
|
13071
13180
|
Description?: string;
|
|
13072
13181
|
|
|
@@ -13076,6 +13185,9 @@ export class Query_ {
|
|
|
13076
13185
|
@Field({nullable: true})
|
|
13077
13186
|
SQL?: string;
|
|
13078
13187
|
|
|
13188
|
+
@Field({nullable: true})
|
|
13189
|
+
TechnicalDescription?: string;
|
|
13190
|
+
|
|
13079
13191
|
@Field({nullable: true})
|
|
13080
13192
|
OriginalSQL?: string;
|
|
13081
13193
|
|
|
@@ -13086,9 +13198,12 @@ export class Query_ {
|
|
|
13086
13198
|
@MaxLength(30)
|
|
13087
13199
|
Status: string;
|
|
13088
13200
|
|
|
13089
|
-
@Field(() => Int, {nullable: true})
|
|
13201
|
+
@Field(() => Int, {nullable: true, description: 'Value indicating the quality of the query, higher values mean a better quality'})
|
|
13090
13202
|
QualityRank?: number;
|
|
13091
13203
|
|
|
13204
|
+
@Field(() => Int, {nullable: true, description: 'Higher numbers indicate more execution overhead/time required. Useful for planning which queries to use in various scenarios.'})
|
|
13205
|
+
ExecutionCostRank?: number;
|
|
13206
|
+
|
|
13092
13207
|
@Field()
|
|
13093
13208
|
@MaxLength(8)
|
|
13094
13209
|
CreatedAt: Date;
|
|
@@ -13120,6 +13235,9 @@ export class CreateQueryInput {
|
|
|
13120
13235
|
@Field()
|
|
13121
13236
|
Name: string;
|
|
13122
13237
|
|
|
13238
|
+
@Field({ nullable: true })
|
|
13239
|
+
UserQuestion?: string;
|
|
13240
|
+
|
|
13123
13241
|
@Field({ nullable: true })
|
|
13124
13242
|
Description?: string;
|
|
13125
13243
|
|
|
@@ -13129,6 +13247,9 @@ export class CreateQueryInput {
|
|
|
13129
13247
|
@Field({ nullable: true })
|
|
13130
13248
|
SQL?: string;
|
|
13131
13249
|
|
|
13250
|
+
@Field({ nullable: true })
|
|
13251
|
+
TechnicalDescription?: string;
|
|
13252
|
+
|
|
13132
13253
|
@Field({ nullable: true })
|
|
13133
13254
|
OriginalSQL?: string;
|
|
13134
13255
|
|
|
@@ -13140,6 +13261,9 @@ export class CreateQueryInput {
|
|
|
13140
13261
|
|
|
13141
13262
|
@Field(() => Int, { nullable: true })
|
|
13142
13263
|
QualityRank?: number;
|
|
13264
|
+
|
|
13265
|
+
@Field(() => Int, { nullable: true })
|
|
13266
|
+
ExecutionCostRank?: number;
|
|
13143
13267
|
}
|
|
13144
13268
|
|
|
13145
13269
|
|
|
@@ -13154,6 +13278,9 @@ export class UpdateQueryInput {
|
|
|
13154
13278
|
@Field()
|
|
13155
13279
|
Name: string;
|
|
13156
13280
|
|
|
13281
|
+
@Field({ nullable: true })
|
|
13282
|
+
UserQuestion?: string;
|
|
13283
|
+
|
|
13157
13284
|
@Field({ nullable: true })
|
|
13158
13285
|
Description?: string;
|
|
13159
13286
|
|
|
@@ -13163,6 +13290,9 @@ export class UpdateQueryInput {
|
|
|
13163
13290
|
@Field({ nullable: true })
|
|
13164
13291
|
SQL?: string;
|
|
13165
13292
|
|
|
13293
|
+
@Field({ nullable: true })
|
|
13294
|
+
TechnicalDescription?: string;
|
|
13295
|
+
|
|
13166
13296
|
@Field({ nullable: true })
|
|
13167
13297
|
OriginalSQL?: string;
|
|
13168
13298
|
|
|
@@ -13175,6 +13305,9 @@ export class UpdateQueryInput {
|
|
|
13175
13305
|
@Field(() => Int, { nullable: true })
|
|
13176
13306
|
QualityRank?: number;
|
|
13177
13307
|
|
|
13308
|
+
@Field(() => Int, { nullable: true })
|
|
13309
|
+
ExecutionCostRank?: number;
|
|
13310
|
+
|
|
13178
13311
|
@Field(() => [KeyValuePairInput], { nullable: true })
|
|
13179
13312
|
OldValues___?: KeyValuePairInput[];
|
|
13180
13313
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ dotenv.config();
|
|
|
5
5
|
import { expressMiddleware } from '@apollo/server/express4';
|
|
6
6
|
import { mergeSchemas } from '@graphql-tools/schema';
|
|
7
7
|
import { Metadata } from '@memberjunction/core';
|
|
8
|
-
import { setupSQLServerClient, SQLServerProviderConfigData } from '@memberjunction/sqlserver-dataprovider';
|
|
8
|
+
import { setupSQLServerClient, SQLServerProviderConfigData, UserCache } from '@memberjunction/sqlserver-dataprovider';
|
|
9
9
|
import { json } from 'body-parser';
|
|
10
10
|
import cors from 'cors';
|
|
11
11
|
import express from 'express';
|
|
@@ -30,6 +30,8 @@ LoadActionEntityServer(); // prevent tree shaking for this dynamic module
|
|
|
30
30
|
import { LoadGeneratedActions } from '@memberjunction/core-actions';
|
|
31
31
|
LoadGeneratedActions(); // prevent tree shaking for this dynamic module
|
|
32
32
|
|
|
33
|
+
import { ExternalChangeDetectorEngine } from '@memberjunction/external-change-detection';
|
|
34
|
+
|
|
33
35
|
const cacheRefreshInterval = configInfo.databaseSettings.metadataCacheRefreshInterval;
|
|
34
36
|
|
|
35
37
|
export { MaxLength } from 'class-validator';
|
|
@@ -87,6 +89,15 @@ export const serve = async (resolverPaths: Array<string>) => {
|
|
|
87
89
|
const config = new SQLServerProviderConfigData(dataSource, '', mj_core_schema, cacheRefreshInterval);
|
|
88
90
|
await setupSQLServerClient(config); // datasource is already initialized, so we can setup the client right away
|
|
89
91
|
const md = new Metadata();
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
/******TEST HARNESS FOR CHANGE DETECTION */
|
|
95
|
+
const cd = ExternalChangeDetectorEngine.Instance;
|
|
96
|
+
await cd.Config(false, UserCache.Users[0]);
|
|
97
|
+
|
|
98
|
+
// don't wait for this, just run it and show in console whenever done.
|
|
99
|
+
cd.DetectChangesForAllEligibleEntities().then(result => console.log(result));
|
|
100
|
+
|
|
90
101
|
console.log(`Data Source has been initialized. ${md?.Entities ? md.Entities.length : 0} entities loaded.`);
|
|
91
102
|
|
|
92
103
|
setupComplete$.next(true);
|