@memberjunction/core-entities 6.2.0 → 6.3.0-edge.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 (81) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/custom/MJUserViewEntityExtended.d.ts +4 -7
  3. package/dist/custom/MJUserViewEntityExtended.d.ts.map +1 -1
  4. package/dist/custom/MJUserViewEntityExtended.js +15 -97
  5. package/dist/custom/MJUserViewEntityExtended.js.map +1 -1
  6. package/dist/engines/CanonGraphEngine.d.ts +122 -0
  7. package/dist/engines/CanonGraphEngine.d.ts.map +1 -0
  8. package/dist/engines/CanonGraphEngine.js +495 -0
  9. package/dist/engines/CanonGraphEngine.js.map +1 -0
  10. package/dist/engines/UserInfoEngine.d.ts.map +1 -1
  11. package/dist/engines/UserInfoEngine.js +12 -7
  12. package/dist/engines/UserInfoEngine.js.map +1 -1
  13. package/dist/engines/conversations.d.ts +159 -10
  14. package/dist/engines/conversations.d.ts.map +1 -1
  15. package/dist/engines/conversations.js +434 -18
  16. package/dist/engines/conversations.js.map +1 -1
  17. package/dist/generated/entities/__mj.d.ts +4237 -899
  18. package/dist/generated/entities/__mj.d.ts.map +1 -1
  19. package/dist/generated/entities/__mj.js +4605 -448
  20. package/dist/generated/entities/__mj.js.map +1 -1
  21. package/dist/generated/queries/__mj.d.ts +269 -0
  22. package/dist/generated/queries/__mj.d.ts.map +1 -0
  23. package/dist/generated/queries/__mj.js +100 -0
  24. package/dist/generated/queries/__mj.js.map +1 -0
  25. package/dist/generated/queries/index.d.ts +2 -0
  26. package/dist/generated/queries/index.d.ts.map +1 -0
  27. package/dist/generated/queries/index.js +4 -0
  28. package/dist/generated/queries/index.js.map +1 -0
  29. package/dist/generated/remote_operations.d.ts +50 -22
  30. package/dist/generated/remote_operations.d.ts.map +1 -1
  31. package/dist/generated/remote_operations.js +3 -3
  32. package/dist/generated/remote_operations.js.map +1 -1
  33. package/dist/graph/BaseGraphEdgeProvider.d.ts +158 -0
  34. package/dist/graph/BaseGraphEdgeProvider.d.ts.map +1 -0
  35. package/dist/graph/BaseGraphEdgeProvider.js +70 -0
  36. package/dist/graph/BaseGraphEdgeProvider.js.map +1 -0
  37. package/dist/graph/GraphEngine.d.ts +255 -0
  38. package/dist/graph/GraphEngine.d.ts.map +1 -0
  39. package/dist/graph/GraphEngine.js +1066 -0
  40. package/dist/graph/GraphEngine.js.map +1 -0
  41. package/dist/graph/GraphExpansion.d.ts +142 -0
  42. package/dist/graph/GraphExpansion.d.ts.map +1 -0
  43. package/dist/graph/GraphExpansion.js +87 -0
  44. package/dist/graph/GraphExpansion.js.map +1 -0
  45. package/dist/graph/index.d.ts +15 -0
  46. package/dist/graph/index.d.ts.map +1 -0
  47. package/dist/graph/index.js +30 -0
  48. package/dist/graph/index.js.map +1 -0
  49. package/dist/graph/providers/AlternateBaseViewEdgeProvider.d.ts +16 -0
  50. package/dist/graph/providers/AlternateBaseViewEdgeProvider.d.ts.map +1 -0
  51. package/dist/graph/providers/AlternateBaseViewEdgeProvider.js +115 -0
  52. package/dist/graph/providers/AlternateBaseViewEdgeProvider.js.map +1 -0
  53. package/dist/graph/providers/EntityMetadataEdgeProvider.d.ts +17 -0
  54. package/dist/graph/providers/EntityMetadataEdgeProvider.d.ts.map +1 -0
  55. package/dist/graph/providers/EntityMetadataEdgeProvider.js +145 -0
  56. package/dist/graph/providers/EntityMetadataEdgeProvider.js.map +1 -0
  57. package/dist/graph/providers/ForeignKeyEdgeProvider.d.ts +25 -0
  58. package/dist/graph/providers/ForeignKeyEdgeProvider.d.ts.map +1 -0
  59. package/dist/graph/providers/ForeignKeyEdgeProvider.js +131 -0
  60. package/dist/graph/providers/ForeignKeyEdgeProvider.js.map +1 -0
  61. package/dist/graph/providers/JoinEntityEdgeProvider.d.ts +37 -0
  62. package/dist/graph/providers/JoinEntityEdgeProvider.d.ts.map +1 -0
  63. package/dist/graph/providers/JoinEntityEdgeProvider.js +170 -0
  64. package/dist/graph/providers/JoinEntityEdgeProvider.js.map +1 -0
  65. package/dist/graph/providers/QueryEdgeProvider.d.ts +33 -0
  66. package/dist/graph/providers/QueryEdgeProvider.d.ts.map +1 -0
  67. package/dist/graph/providers/QueryEdgeProvider.js +120 -0
  68. package/dist/graph/providers/QueryEdgeProvider.js.map +1 -0
  69. package/dist/graph/providers/QueryMetadataEdgeProvider.d.ts +18 -0
  70. package/dist/graph/providers/QueryMetadataEdgeProvider.d.ts.map +1 -0
  71. package/dist/graph/providers/QueryMetadataEdgeProvider.js +163 -0
  72. package/dist/graph/providers/QueryMetadataEdgeProvider.js.map +1 -0
  73. package/dist/graph/providers/RecordLinkEdgeProvider.d.ts +20 -0
  74. package/dist/graph/providers/RecordLinkEdgeProvider.d.ts.map +1 -0
  75. package/dist/graph/providers/RecordLinkEdgeProvider.js +172 -0
  76. package/dist/graph/providers/RecordLinkEdgeProvider.js.map +1 -0
  77. package/dist/index.d.ts +3 -0
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +5 -0
  80. package/dist/index.js.map +1 -1
  81. package/package.json +6 -6
@@ -0,0 +1,269 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Returns all active users with basic profile info. Designed as a reusable building block for composed queries.
4
+ * Query: MJ/Demos/Active Users (ID D972EBBA-AEB3-46F2-9ED1-B8986173039C)
5
+ */
6
+ export type ActiveUsersParams = Record<string, never>;
7
+ export interface ActiveUsersRow {
8
+ /** Unique identifier for the user */
9
+ ID: string | null;
10
+ /** Full name of the user */
11
+ Name: string | null;
12
+ /** Email address of the user */
13
+ Email: string | null;
14
+ /** Type or role of the user */
15
+ Type: string | null;
16
+ /** Timestamp when the user record was created */
17
+ CreatedAt: Date | null;
18
+ }
19
+ export declare const ActiveUsersRowSchema: z.ZodObject<{
20
+ ID: z.ZodNullable<z.ZodString>;
21
+ Name: z.ZodNullable<z.ZodString>;
22
+ Email: z.ZodNullable<z.ZodString>;
23
+ Type: z.ZodNullable<z.ZodString>;
24
+ CreatedAt: z.ZodNullable<z.ZodDate>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ ID?: string;
27
+ Name?: string;
28
+ Type?: string;
29
+ Email?: string;
30
+ CreatedAt?: Date;
31
+ }, {
32
+ ID?: string;
33
+ Name?: string;
34
+ Type?: string;
35
+ Email?: string;
36
+ CreatedAt?: Date;
37
+ }>;
38
+ export declare const ActiveUsers: import("@memberjunction/core").TypedQuery<ActiveUsersParams, ActiveUsersRow>;
39
+ /**
40
+ * Returns recent record changes grouped by entity name. Accepts a lookbackDays parameter to control the time window.
41
+ * Query: MJ/Demos/Recent Entity Changes (ID C3F7F066-789A-42A2-ACFD-2C113B5D2E30)
42
+ */
43
+ export interface RecentEntityChangesParams {
44
+ /** Number of days to look back for record changes */
45
+ lookbackDays: number;
46
+ }
47
+ export interface RecentEntityChangesRow {
48
+ /** Name of the entity that had record changes */
49
+ EntityName: string;
50
+ /** Total number of changes for the entity */
51
+ ChangeCount: number | null;
52
+ /** Most recent change timestamp for the entity */
53
+ LatestChange: Date | null;
54
+ /** Earliest change timestamp for the entity */
55
+ EarliestChange: Date | null;
56
+ }
57
+ export declare const RecentEntityChangesRowSchema: z.ZodObject<{
58
+ EntityName: z.ZodString;
59
+ ChangeCount: z.ZodNullable<z.ZodNumber>;
60
+ LatestChange: z.ZodNullable<z.ZodDate>;
61
+ EarliestChange: z.ZodNullable<z.ZodDate>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ EntityName?: string;
64
+ ChangeCount?: number;
65
+ LatestChange?: Date;
66
+ EarliestChange?: Date;
67
+ }, {
68
+ EntityName?: string;
69
+ ChangeCount?: number;
70
+ LatestChange?: Date;
71
+ EarliestChange?: Date;
72
+ }>;
73
+ export declare const RecentEntityChanges: import("@memberjunction/core").TypedQuery<RecentEntityChangesParams, RecentEntityChangesRow>;
74
+ /**
75
+ * Returns record IDs for a given entity that have a specific tag assigned, with relevance weight. Composable — join on RecordID to the target entity's primary key to enrich with full record data for tag-based filtering and drill-downs.
76
+ * Query: MJ/Tags/Entity Records By Tag (ID 52E5C84F-6B00-45AA-BCB4-9429B1CE5BA7)
77
+ */
78
+ export interface EntityRecordsByTagParams {
79
+ /** The display name of the entity to filter tagged items for (e.g., 'Accounts', 'Contacts'). */
80
+ entityName: string;
81
+ /** The display name of the specific tag to match against records. */
82
+ tagName: string;
83
+ }
84
+ export interface EntityRecordsByTagRow {
85
+ /** The identifier of the record in the target entity that has the tag applied. */
86
+ RecordID: string;
87
+ /** The numeric weight or importance assigned to this specific tag association. */
88
+ Weight: number;
89
+ /** The timestamp indicating when the tag was associated with the record. */
90
+ TaggedAt: Date;
91
+ }
92
+ export declare const EntityRecordsByTagRowSchema: z.ZodObject<{
93
+ RecordID: z.ZodString;
94
+ Weight: z.ZodNumber;
95
+ TaggedAt: z.ZodDate;
96
+ }, "strip", z.ZodTypeAny, {
97
+ Weight?: number;
98
+ RecordID?: string;
99
+ TaggedAt?: Date;
100
+ }, {
101
+ Weight?: number;
102
+ RecordID?: string;
103
+ TaggedAt?: Date;
104
+ }>;
105
+ export declare const EntityRecordsByTag: import("@memberjunction/core").TypedQuery<EntityRecordsByTagParams, EntityRecordsByTagRow>;
106
+ /**
107
+ * Returns per-tag item count and average relevance weight across all tagged items. Used by the Classify dashboard for taxonomy health metrics without loading individual records.
108
+ * Query: MJ/Tags/Tag Aggregates (ID A95E20FE-E0E9-4BDD-A61F-24447252C4E2)
109
+ */
110
+ export type TagAggregatesParams = Record<string, never>;
111
+ export interface TagAggregatesRow {
112
+ /** The unique identifier for the tag being aggregated */
113
+ TagID: string;
114
+ /** Total number of items associated with this tag */
115
+ ItemCount: number | null;
116
+ /** The average relevance weight of the items for this tag, formatted to two decimal places */
117
+ AvgWeight: number | null;
118
+ }
119
+ export declare const TagAggregatesRowSchema: z.ZodObject<{
120
+ TagID: z.ZodString;
121
+ ItemCount: z.ZodNullable<z.ZodNumber>;
122
+ AvgWeight: z.ZodNullable<z.ZodNumber>;
123
+ }, "strip", z.ZodTypeAny, {
124
+ TagID?: string;
125
+ ItemCount?: number;
126
+ AvgWeight?: number;
127
+ }, {
128
+ TagID?: string;
129
+ ItemCount?: number;
130
+ AvgWeight?: number;
131
+ }>;
132
+ export declare const TagAggregates: import("@memberjunction/core").TypedQuery<TagAggregatesParams, TagAggregatesRow>;
133
+ /**
134
+ * Aggregates tag counts across all records of a given entity, showing how many records have each tag along with average relevance weight and date range. Composable — use as a subquery or join to analyze topic distribution, category breakdowns, and tag popularity.
135
+ * Query: MJ/Tags/Tag Distribution For Entity (ID FEEC35FC-384F-40A1-B49E-2133A6930202)
136
+ */
137
+ export interface TagDistributionForEntityParams {
138
+ /** The display name of the entity to filter tagged items by (e.g., 'Inquiry', 'Customer'). */
139
+ entityName: string;
140
+ }
141
+ export interface TagDistributionForEntityRow {
142
+ /** Unique identifier for the tag */
143
+ TagID: string;
144
+ /** Display name of the tag */
145
+ TagDisplayName: string;
146
+ /** Description of the tag's purpose or meaning */
147
+ TagDescription: string | null;
148
+ /** Identifier for the parent tag, if this is a sub-tag */
149
+ TagParentID: string | null;
150
+ /** Display name of the parent tag */
151
+ ParentTagDisplayName: string;
152
+ /** Total number of records associated with this tag for the specified entity */
153
+ RecordCount: number | null;
154
+ /** The average weight assigned to this tag across all items */
155
+ AvgWeight: number | null;
156
+ /** The timestamp of the first time this tag was applied to a record */
157
+ EarliestTaggedAt: Date | null;
158
+ /** The timestamp of the most recent time this tag was applied to a record */
159
+ LatestTaggedAt: Date | null;
160
+ }
161
+ export declare const TagDistributionForEntityRowSchema: z.ZodObject<{
162
+ TagID: z.ZodString;
163
+ TagDisplayName: z.ZodString;
164
+ TagDescription: z.ZodNullable<z.ZodString>;
165
+ TagParentID: z.ZodNullable<z.ZodString>;
166
+ ParentTagDisplayName: z.ZodString;
167
+ RecordCount: z.ZodNullable<z.ZodNumber>;
168
+ AvgWeight: z.ZodNullable<z.ZodNumber>;
169
+ EarliestTaggedAt: z.ZodNullable<z.ZodDate>;
170
+ LatestTaggedAt: z.ZodNullable<z.ZodDate>;
171
+ }, "strip", z.ZodTypeAny, {
172
+ TagID?: string;
173
+ AvgWeight?: number;
174
+ TagDisplayName?: string;
175
+ TagDescription?: string;
176
+ TagParentID?: string;
177
+ ParentTagDisplayName?: string;
178
+ RecordCount?: number;
179
+ EarliestTaggedAt?: Date;
180
+ LatestTaggedAt?: Date;
181
+ }, {
182
+ TagID?: string;
183
+ AvgWeight?: number;
184
+ TagDisplayName?: string;
185
+ TagDescription?: string;
186
+ TagParentID?: string;
187
+ ParentTagDisplayName?: string;
188
+ RecordCount?: number;
189
+ EarliestTaggedAt?: Date;
190
+ LatestTaggedAt?: Date;
191
+ }>;
192
+ export declare const TagDistributionForEntity: import("@memberjunction/core").TypedQuery<TagDistributionForEntityParams, TagDistributionForEntityRow>;
193
+ /**
194
+ * Returns all active tags assigned to a specific entity record, including tag hierarchy (parent tag) and relevance weight. Composable — join via RecordID to enrich any entity with its tag metadata.
195
+ * Query: MJ/Tags/Tags For Entity Record (ID A9EB7B0C-20D6-46BF-8215-49FF6863841D)
196
+ */
197
+ export interface TagsForEntityRecordParams {
198
+ /** The display name of the entity to filter tags for (e.g., 'Accounts', 'Contacts'). */
199
+ entityName: string;
200
+ /** The primary key identifier of the specific record for which to retrieve tags. */
201
+ recordID: string;
202
+ }
203
+ export interface TagsForEntityRecordRow {
204
+ /** Unique identifier for the tag */
205
+ TagID: string;
206
+ /** Internal name of the tag */
207
+ TagName: string;
208
+ /** User-friendly display name of the tag */
209
+ TagDisplayName: string;
210
+ /** Description of the tag's purpose */
211
+ TagDescription: string | null;
212
+ /** ID of the parent tag if this is part of a hierarchy */
213
+ TagParentID: string | null;
214
+ /** Display name of the parent tag */
215
+ ParentTagDisplayName: string;
216
+ /** Numerical weight or priority assigned to this tag instance */
217
+ Weight: number;
218
+ /** The ID of the record that was tagged */
219
+ RecordID: string;
220
+ /** Timestamp when the tag was applied to the record */
221
+ TaggedAt: Date;
222
+ }
223
+ export declare const TagsForEntityRecordRowSchema: z.ZodObject<{
224
+ TagID: z.ZodString;
225
+ TagName: z.ZodString;
226
+ TagDisplayName: z.ZodString;
227
+ TagDescription: z.ZodNullable<z.ZodString>;
228
+ TagParentID: z.ZodNullable<z.ZodString>;
229
+ ParentTagDisplayName: z.ZodString;
230
+ Weight: z.ZodNumber;
231
+ RecordID: z.ZodString;
232
+ TaggedAt: z.ZodDate;
233
+ }, "strip", z.ZodTypeAny, {
234
+ Weight?: number;
235
+ RecordID?: string;
236
+ TagID?: string;
237
+ TaggedAt?: Date;
238
+ TagDisplayName?: string;
239
+ TagDescription?: string;
240
+ TagParentID?: string;
241
+ ParentTagDisplayName?: string;
242
+ TagName?: string;
243
+ }, {
244
+ Weight?: number;
245
+ RecordID?: string;
246
+ TagID?: string;
247
+ TaggedAt?: Date;
248
+ TagDisplayName?: string;
249
+ TagDescription?: string;
250
+ TagParentID?: string;
251
+ ParentTagDisplayName?: string;
252
+ TagName?: string;
253
+ }>;
254
+ export declare const TagsForEntityRecord: import("@memberjunction/core").TypedQuery<TagsForEntityRecordParams, TagsForEntityRecordRow>;
255
+ export declare const Queries: {
256
+ readonly MJ: {
257
+ readonly Demos: {
258
+ readonly ActiveUsers: import("@memberjunction/core").TypedQuery<ActiveUsersParams, ActiveUsersRow>;
259
+ readonly RecentEntityChanges: import("@memberjunction/core").TypedQuery<RecentEntityChangesParams, RecentEntityChangesRow>;
260
+ };
261
+ readonly Tags: {
262
+ readonly EntityRecordsByTag: import("@memberjunction/core").TypedQuery<EntityRecordsByTagParams, EntityRecordsByTagRow>;
263
+ readonly TagAggregates: import("@memberjunction/core").TypedQuery<TagAggregatesParams, TagAggregatesRow>;
264
+ readonly TagDistributionForEntity: import("@memberjunction/core").TypedQuery<TagDistributionForEntityParams, TagDistributionForEntityRow>;
265
+ readonly TagsForEntityRecord: import("@memberjunction/core").TypedQuery<TagsForEntityRecordParams, TagsForEntityRecordRow>;
266
+ };
267
+ };
268
+ };
269
+ //# sourceMappingURL=__mj.d.ts.map
@@ -0,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M,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU5C,CAAC;AACH,eAAO,MAAM,wBAAwB,wGAKnC,CAAC;AAEH;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC,wFAAwF;IACxF,UAAU,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,sBAAsB;IACnC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,uCAAuC;IACvC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,0DAA0D;IAC1D,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,qCAAqC;IACrC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,QAAQ,EAAE,IAAI,CAAC;CAClB;AACD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUvC,CAAC;AACH,eAAO,MAAM,mBAAmB,8FAK9B,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;CAaV,CAAC"}
@@ -0,0 +1,100 @@
1
+ // AUTO-GENERATED FILE - DO NOT EDIT
2
+ // Generated by MemberJunction CodeGen (typed_query_codegen)
3
+ import { DefineTypedQuery } from '@memberjunction/core';
4
+ import { z } from 'zod';
5
+ export const ActiveUsersRowSchema = z.object({
6
+ ID: z.string().nullable(),
7
+ Name: z.string().nullable(),
8
+ Email: z.string().nullable(),
9
+ Type: z.string().nullable(),
10
+ CreatedAt: z.coerce.date().nullable(),
11
+ });
12
+ export const ActiveUsers = DefineTypedQuery({
13
+ QueryID: "D972EBBA-AEB3-46F2-9ED1-B8986173039C",
14
+ Path: "MJ/Demos/Active Users",
15
+ Signature: "sha256:45a0467f06374fce8dd4076d613b2f7db0e79fd41de075ba337aa1808c45e316",
16
+ RowSchema: ActiveUsersRowSchema,
17
+ });
18
+ export const RecentEntityChangesRowSchema = z.object({
19
+ EntityName: z.string(),
20
+ ChangeCount: z.number().nullable(),
21
+ LatestChange: z.coerce.date().nullable(),
22
+ EarliestChange: z.coerce.date().nullable(),
23
+ });
24
+ export const RecentEntityChanges = DefineTypedQuery({
25
+ QueryID: "C3F7F066-789A-42A2-ACFD-2C113B5D2E30",
26
+ Path: "MJ/Demos/Recent Entity Changes",
27
+ Signature: "sha256:1fffe82387d83db3c4cc1550d05e9a344f5a3dd1384e9bd64e529e86c3edd3a5",
28
+ RowSchema: RecentEntityChangesRowSchema,
29
+ });
30
+ export const EntityRecordsByTagRowSchema = z.object({
31
+ RecordID: z.string(),
32
+ Weight: z.number(),
33
+ TaggedAt: z.coerce.date(),
34
+ });
35
+ export const EntityRecordsByTag = DefineTypedQuery({
36
+ QueryID: "52E5C84F-6B00-45AA-BCB4-9429B1CE5BA7",
37
+ Path: "MJ/Tags/Entity Records By Tag",
38
+ Signature: "sha256:a9a497e188cc50d3d8fecd75edd1836b2e60a49479c0be36cfbe0e9ca8cf736d",
39
+ RowSchema: EntityRecordsByTagRowSchema,
40
+ });
41
+ export const TagAggregatesRowSchema = z.object({
42
+ TagID: z.string(),
43
+ ItemCount: z.number().nullable(),
44
+ AvgWeight: z.number().nullable(),
45
+ });
46
+ export const TagAggregates = DefineTypedQuery({
47
+ QueryID: "A95E20FE-E0E9-4BDD-A61F-24447252C4E2",
48
+ Path: "MJ/Tags/Tag Aggregates",
49
+ Signature: "sha256:cd67a4519a83e1cf5513b185cbf6f3d6981e3af67c496272b575871349c24b42",
50
+ RowSchema: TagAggregatesRowSchema,
51
+ });
52
+ export const TagDistributionForEntityRowSchema = z.object({
53
+ TagID: z.string(),
54
+ TagDisplayName: z.string(),
55
+ TagDescription: z.string().nullable(),
56
+ TagParentID: z.string().nullable(),
57
+ ParentTagDisplayName: z.string(),
58
+ RecordCount: z.number().nullable(),
59
+ AvgWeight: z.number().nullable(),
60
+ EarliestTaggedAt: z.coerce.date().nullable(),
61
+ LatestTaggedAt: z.coerce.date().nullable(),
62
+ });
63
+ export const TagDistributionForEntity = DefineTypedQuery({
64
+ QueryID: "FEEC35FC-384F-40A1-B49E-2133A6930202",
65
+ Path: "MJ/Tags/Tag Distribution For Entity",
66
+ Signature: "sha256:d3cace46578408b380ed4799038aea9b1026cbfd703f319c725a0b92eaffe9e1",
67
+ RowSchema: TagDistributionForEntityRowSchema,
68
+ });
69
+ export const TagsForEntityRecordRowSchema = z.object({
70
+ TagID: z.string(),
71
+ TagName: z.string(),
72
+ TagDisplayName: z.string(),
73
+ TagDescription: z.string().nullable(),
74
+ TagParentID: z.string().nullable(),
75
+ ParentTagDisplayName: z.string(),
76
+ Weight: z.number(),
77
+ RecordID: z.string(),
78
+ TaggedAt: z.coerce.date(),
79
+ });
80
+ export const TagsForEntityRecord = DefineTypedQuery({
81
+ QueryID: "A9EB7B0C-20D6-46BF-8215-49FF6863841D",
82
+ Path: "MJ/Tags/Tags For Entity Record",
83
+ Signature: "sha256:4b223183e38825ca5b7bd452861e1e02550e05755024c9e3a134ad4b6409fbdb",
84
+ RowSchema: TagsForEntityRecordRowSchema,
85
+ });
86
+ export const Queries = {
87
+ MJ: {
88
+ Demos: {
89
+ ActiveUsers,
90
+ RecentEntityChanges,
91
+ },
92
+ Tags: {
93
+ EntityRecordsByTag,
94
+ TagAggregates,
95
+ TagDistributionForEntity,
96
+ TagsForEntityRecord,
97
+ },
98
+ },
99
+ };
100
+ //# sourceMappingURL=__mj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__mj.js","sourceRoot":"","sources":["../../../src/generated/queries/__mj.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,4DAA4D;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAA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 //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/queries/index.ts"],"names":[],"mappings":"AAGA,cAAc,WAAW,CAAC"}
@@ -0,0 +1,4 @@
1
+ // AUTO-GENERATED FILE - DO NOT EDIT
2
+ // Generated by MemberJunction CodeGen (typed_query_codegen)
3
+ export * from './__mj.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generated/queries/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,4DAA4D;AAE5D,cAAc,WAAW,CAAC"}
@@ -502,7 +502,7 @@ export interface PredictiveStudioModelingPlanSpec {
502
502
  Strategy: 'train_test_split' | 'kfold' | 'holdout';
503
503
  TestSize?: number;
504
504
  K?: number;
505
- LockedHoldoutFraction: number;
505
+ LockedHoldoutFraction?: number;
506
506
  };
507
507
  /** Proposed resource budget for the experiment session. */
508
508
  ProposedBudget: PredictiveStudioBudget;
@@ -529,7 +529,7 @@ export interface PredictiveStudioStartExperimentSessionOutput {
529
529
  /** The session's status after starting (`Running`, or `Completed`/`Paused` if it ran to a bound synchronously). */
530
530
  status: string;
531
531
  }
532
- /** Optional point-in-time assembly strategy for the train (mirrors the pipeline's stored AsOfStrategy). */
532
+ /** A point-in-time assembly strategy, as `PredictiveStudio.TrainModel` accepted it before Prediction Units (see {@link RetiredTrainModelInputs}). */
533
533
  export interface PredictiveStudioTrainAsOf {
534
534
  /** How to anchor feature assembly in time: no anchoring, a column on the row, or an offset before the label event. */
535
535
  Mode: 'none' | 'column' | 'offset';
@@ -538,37 +538,65 @@ export interface PredictiveStudioTrainAsOf {
538
538
  /** Days before the label event to assemble features (when `Mode` is `offset`). */
539
539
  OffsetDays?: number;
540
540
  }
541
- /** Input for `PredictiveStudio.TrainModel`. */
541
+ /** Input for `PredictiveStudio.TrainModel`. The pipeline's Prediction Unit and Evaluation Protocol decide everything else. */
542
542
  export interface PredictiveStudioTrainModelInput {
543
543
  /** Id of the `MJ: ML Training Pipelines` row to train. */
544
544
  pipelineId: string;
545
545
  /** Optional `MJ: Experiment Session Iterations` id this run belongs to (NULL for a one-off standalone train). */
546
546
  experimentSessionIterationId?: string;
547
- /** Optional cap on the number of training rows pulled from the target entity. */
548
- maxRows?: number;
549
- /** Optional primary-key field on the target entity (defaults to `ID`). */
550
- primaryKeyField?: string;
551
- /** Optional per-record label-event dates (keyed by record primary key), required when `asOf.Mode` is `offset`. */
552
- labelEventDates?: Record<string, string>;
553
- /** Optional as-of strategy override; when omitted the pipeline's stored `AsOfStrategy` is used. */
554
- asOf?: PredictiveStudioTrainAsOf;
555
547
  /** Sidecar version string recorded in the model lineage for provenance. */
556
548
  sidecarVersion?: string;
557
549
  }
558
- /** Output of `PredictiveStudio.TrainModel` — the produced (Draft) model + its honest metrics. */
550
+ /**
551
+ * Inputs `PredictiveStudio.TrainModel` accepted before Prediction Units. They are refused by name when present, even
552
+ * when empty or `asOf.Mode` is `none`: the Prediction Unit declares the decision date and the row key, and every
553
+ * eligible row is read (a capped read is not a complete read). Kept only so a caller (or a test probe) can type a
554
+ * payload that still sends them.
555
+ */
556
+ export interface RetiredTrainModelInputs {
557
+ /** Refused: the Prediction Unit declares each row's decision date. */
558
+ asOf?: PredictiveStudioTrainAsOf;
559
+ /** Refused: the Prediction Unit declares each row's decision date. */
560
+ labelEventDates?: Record<string, string>;
561
+ /** Refused: every eligible row is read. */
562
+ maxRows?: number;
563
+ /** Refused: the Prediction Unit reads its rows keyed by the row entity's own primary key. */
564
+ primaryKeyField?: string;
565
+ }
566
+ /**
567
+ * Output of `PredictiveStudio.TrainModel`: the run's stored gate decision, its Training Snapshot and Evaluation
568
+ * Protocol, and the produced model when the decision ships one.
569
+ */
559
570
  export interface PredictiveStudioTrainModelOutput {
560
- /** Id of the produced (Draft) `MJ: ML Models` row. */
561
- modelId: string;
571
+ /** Id of the produced (Draft) `MJ: ML Models` row; absent when the gate decision ships no model (no-signal, or the existing rule kept). */
572
+ modelId?: string;
562
573
  /** Id of the `MJ: ML Training Runs` row recording this attempt. */
563
574
  trainingRunId: string;
564
- /** Monotonic model version under the pipeline (`max(Version)+1`). */
565
- version: number;
566
- /** JSON of the metrics scored exactly once on the locked holdout the search never saw (the honest performance number). */
575
+ /** Monotonic model version under the pipeline; absent when no model is produced. */
576
+ version?: number;
577
+ /**
578
+ * JSON of the test-set scores measured once on the locked holdout (`{ "<metric>": value, … }`): the produced
579
+ * model's stored scores when a model exists (the member the gate ships), otherwise the trainer's finalist scores.
580
+ */
567
581
  holdoutMetrics?: string;
568
- /** True when one feature dominates the model's predictions (possible target leakage). A flagged model stays Draft and needs human sign-off before promotion. */
582
+ /** True when one feature dominates the finalist's predictions (possible target leakage); a flagged model stays Draft and needs human sign-off. */
569
583
  leakageFlagged: boolean;
570
- /** Lifecycle status of the produced model (always `Draft` immediately after training). */
584
+ /** Lifecycle status of the produced model (`Draft`), `NoSignal` when the gate stored no-signal, or `KeptExistingRule` when it kept the existing rule. */
571
585
  status: string;
586
+ /** The `MJ: ML Training Snapshots` row the run trained on. */
587
+ trainingSnapshotId?: string;
588
+ /** The `MJ: ML Evaluation Protocols` row (exact version) the run was evaluated under. */
589
+ evaluationProtocolId?: string;
590
+ /** That protocol row's Version. */
591
+ evaluationProtocolVersion?: number;
592
+ /** The stored gate outcome. */
593
+ gateOutcome?: 'model' | 'keep-simple-baseline' | 'no-signal';
594
+ /** The decision-table branch the stored outcome came from (for example `b:keep-simple-baseline` or `c:no-signal`). */
595
+ gateBranch?: string;
596
+ /** The stored reason for the outcome, in words generated from the stored comparisons. */
597
+ gateReason?: string;
598
+ /** The member the gate ships (the model, a simple baseline or the existing rule); absent under no-signal. */
599
+ shipped?: string;
572
600
  }
573
601
  /** Input for `Query.RefreshExtraction`. Selectors combine as a union; give at least one. */
574
602
  export interface QueryRefreshExtractionInput {
@@ -2093,11 +2121,11 @@ export declare class PredictiveStudioStartExperimentSessionOperation extends Bas
2093
2121
  readonly ExecutionMode: "LongRunning";
2094
2122
  readonly RequiredScope = "predictive:execute";
2095
2123
  readonly RequiresSystemUser = false;
2096
- readonly ContractFingerprint = "ro_fp_6a24af7901f8dd8b";
2124
+ readonly ContractFingerprint = "ro_fp_869cb01adf6b0bbd";
2097
2125
  }
2098
2126
  /**
2099
2127
  * Train ML Model
2100
- * Train a predictive model from an MJ: ML Training Pipelines definition. Carves a locked holdout (point-in-time/as-of aware), trains via the sidecar, persists an immutable Draft MJ: ML Models row, and flags single-feature dominance (possible target leakage). Returns the new model id, its honest holdout metrics, the leakage flag, and the model version. Delegates to TrainingEngine.trainModel in @memberjunction/predictive-studio-engine.
2128
+ * Trains a predictive model from an ML Training Pipeline under the pipeline's Prediction Unit and Evaluation Protocol: freezes a Training Snapshot, carves the locked holdout by date, selects on inner folds, fits the baselines and stores the three-outcome gate decision with its reason on the training run. Outputs the run's gate outcome and reason, the snapshot and protocol, the model id (none under no-signal), the test-set scores and whether one feature dominates the predictions (possible target leakage).
2101
2129
  * GenerationType=Manual — the server body is supplied by a hand-authored subclass registered
2102
2130
  * under 'PredictiveStudio.TrainModel'. This generated base provides the typed contract only (client-safe).
2103
2131
  */
@@ -2106,7 +2134,7 @@ export declare class PredictiveStudioTrainModelOperation extends BaseRemotableOp
2106
2134
  readonly ExecutionMode: "LongRunning";
2107
2135
  readonly RequiredScope = "predictive:execute";
2108
2136
  readonly RequiresSystemUser = false;
2109
- readonly ContractFingerprint = "ro_fp_470d23334fcd4964";
2137
+ readonly ContractFingerprint = "ro_fp_2b7f9d9a95e772b6";
2110
2138
  }
2111
2139
  /**
2112
2140
  * Refresh Query Extraction