@prostgles/app 2.3.6-dev.1791804762 → 2.3.6-dev.1791820085

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 (116) hide show
  1. package/client/build/js/main.bundle.js +2 -2
  2. package/dist/common/DBGeneratedSchema.d.ts +15 -6
  3. package/dist/common/DBGeneratedSchema.d.ts.map +1 -1
  4. package/dist/common/actionColumn.d.ts +51 -14
  5. package/dist/common/actionColumn.d.ts.map +1 -1
  6. package/dist/common/actionColumn.js +12 -3
  7. package/dist/common/actionColumn.js.map +1 -1
  8. package/dist/common/columnDisplayFormat.schema.d.ts +48 -4
  9. package/dist/common/columnDisplayFormat.schema.d.ts.map +1 -1
  10. package/dist/common/createActionColumn.d.ts +11 -4
  11. package/dist/common/createActionColumn.d.ts.map +1 -1
  12. package/dist/common/createActionColumn.js +12 -8
  13. package/dist/common/createActionColumn.js.map +1 -1
  14. package/dist/common/functionOptions.d.ts +217 -0
  15. package/dist/common/functionOptions.d.ts.map +1 -0
  16. package/dist/common/functionOptions.js +39 -0
  17. package/dist/common/functionOptions.js.map +1 -0
  18. package/dist/common/llmUtils.d.ts.map +1 -1
  19. package/dist/common/mcp/tableOptionsJsonbSchema.d.ts +48 -4
  20. package/dist/common/mcp/tableOptionsJsonbSchema.d.ts.map +1 -1
  21. package/dist/common/mcp/ui.mcp.schema.d.ts +48 -4
  22. package/dist/common/mcp/ui.mcp.schema.d.ts.map +1 -1
  23. package/dist/common/prostglesMcp.d.ts +48 -4
  24. package/dist/common/prostglesMcp.d.ts.map +1 -1
  25. package/dist/common/resolveActionFunction.d.ts +13 -0
  26. package/dist/common/resolveActionFunction.d.ts.map +1 -0
  27. package/dist/common/resolveActionFunction.js +23 -0
  28. package/dist/common/resolveActionFunction.js.map +1 -0
  29. package/dist/server/package.json +3 -3
  30. package/dist/server/src/BackupManager/BackupManager.d.ts +15 -6
  31. package/dist/server/src/BackupManager/BackupManager.d.ts.map +1 -1
  32. package/dist/server/src/ConnectionManager/ConnectionManager.d.ts +15 -6
  33. package/dist/server/src/ConnectionManager/ConnectionManager.d.ts.map +1 -1
  34. package/dist/server/src/ConnectionManager/ConnectionManager.js +11 -2
  35. package/dist/server/src/ConnectionManager/ConnectionManager.js.map +1 -1
  36. package/dist/server/src/ConnectionManager/getConnectionServerFunctions.d.ts +11 -1
  37. package/dist/server/src/ConnectionManager/getConnectionServerFunctions.d.ts.map +1 -1
  38. package/dist/server/src/ConnectionManager/getConnectionServerFunctions.js +12 -3
  39. package/dist/server/src/ConnectionManager/getConnectionServerFunctions.js.map +1 -1
  40. package/dist/server/src/ConnectionManager/getHotReloadConfigs.d.ts +2 -1
  41. package/dist/server/src/ConnectionManager/getHotReloadConfigs.d.ts.map +1 -1
  42. package/dist/server/src/ConnectionManager/getHotReloadConfigs.js +3 -1
  43. package/dist/server/src/ConnectionManager/getHotReloadConfigs.js.map +1 -1
  44. package/dist/server/src/ConnectionManager/initConnectionManager.d.ts +1 -1
  45. package/dist/server/src/ConnectionManager/initConnectionManager.d.ts.map +1 -1
  46. package/dist/server/src/ConnectionManager/initConnectionManager.js +1 -0
  47. package/dist/server/src/ConnectionManager/initConnectionManager.js.map +1 -1
  48. package/dist/server/src/ConnectionManager/modifyClientFunctionSchema.d.ts +4 -0
  49. package/dist/server/src/ConnectionManager/modifyClientFunctionSchema.d.ts.map +1 -0
  50. package/dist/server/src/ConnectionManager/modifyClientFunctionSchema.js +13 -0
  51. package/dist/server/src/ConnectionManager/modifyClientFunctionSchema.js.map +1 -0
  52. package/dist/server/src/ConnectionManager/startConnection.d.ts.map +1 -1
  53. package/dist/server/src/ConnectionManager/startConnection.js +5 -1
  54. package/dist/server/src/ConnectionManager/startConnection.js.map +1 -1
  55. package/dist/server/src/ConnectionManager/validateSchemaConfigActions.d.ts +9 -0
  56. package/dist/server/src/ConnectionManager/validateSchemaConfigActions.d.ts.map +1 -0
  57. package/dist/server/src/ConnectionManager/validateSchemaConfigActions.js +123 -0
  58. package/dist/server/src/ConnectionManager/validateSchemaConfigActions.js.map +1 -0
  59. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/agenticWorkflow/definitionValidation/validateAgenticWorkflowDefinitions.d.ts.map +1 -1
  60. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/agenticWorkflow/proxyHandlers/createWorkflowExecutionHandlers.d.ts.map +1 -1
  61. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/agenticWorkflow/proxyHandlers/getAgentConfigWithDefaults.d.ts.map +1 -1
  62. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Prostgles/agenticWorkflow/proxyHandlers/setupOrchestrationToolPermissions.d.ts.map +1 -1
  63. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Ui.mcp.d.ts +48 -4
  64. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/Ui.mcp.d.ts.map +1 -1
  65. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/WebDev/tools/getWebDevChatAndConnection.d.ts +15 -6
  66. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers/WebDev/tools/getWebDevChatAndConnection.d.ts.map +1 -1
  67. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers.d.ts +96 -8
  68. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMCPServers.d.ts.map +1 -1
  69. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMcpHub.d.ts +96 -8
  70. package/dist/server/src/McpHub/ProstglesMcpHub/ProstglesMcpHub.d.ts.map +1 -1
  71. package/dist/server/src/authConfig/getAuth.d.ts.map +1 -1
  72. package/dist/server/src/authConfig/sessionUtils.d.ts.map +1 -1
  73. package/dist/server/src/authConfig/subscribeToAuthSetupChanges.d.ts.map +1 -1
  74. package/dist/server/src/cli/cliTemplateFiles.js +7 -5
  75. package/dist/server/src/cli/cliTemplateFiles.js.map +1 -1
  76. package/dist/server/src/init/initUsers.d.ts.map +1 -1
  77. package/dist/server/src/publish/getPublishLLM.d.ts.map +1 -1
  78. package/dist/server/src/publish/getPublishLlmChats.d.ts.map +1 -1
  79. package/dist/server/src/publish/publish.d.ts.map +1 -1
  80. package/dist/server/src/publish/publish.js +1 -0
  81. package/dist/server/src/publish/publish.js.map +1 -1
  82. package/dist/server/src/schemaConfig.d.ts +2 -1
  83. package/dist/server/src/schemaConfig.d.ts.map +1 -1
  84. package/dist/server/src/schemaConfig.js.map +1 -1
  85. package/dist/server/src/serverFunctions/adminServerFunctions/stateServerAdminFunctions.d.ts +30 -12
  86. package/dist/server/src/serverFunctions/adminServerFunctions/stateServerAdminFunctions.d.ts.map +1 -1
  87. package/dist/server/src/serverFunctions/adminServerFunctions/webApp/getTemplatedWebAppConnection.d.ts +15 -6
  88. package/dist/server/src/serverFunctions/adminServerFunctions/webApp/getTemplatedWebAppConnection.d.ts.map +1 -1
  89. package/dist/server/src/serverFunctions/applySampleSchema.d.ts +15 -6
  90. package/dist/server/src/serverFunctions/applySampleSchema.d.ts.map +1 -1
  91. package/dist/server/src/serverFunctions/askLLM/agentConstants.d.ts +1 -1
  92. package/dist/server/src/serverFunctions/askLLM/askLLM.d.ts.map +1 -1
  93. package/dist/server/src/serverFunctions/askLLM/getPastMessages.d.ts.map +1 -1
  94. package/dist/server/src/serverFunctions/askLLM/getValidatedAskLLMChatOptions.d.ts.map +1 -1
  95. package/dist/server/src/serverFunctions/askLLM/handleToolUseResultConfirmation.d.ts.map +1 -1
  96. package/dist/server/src/serverFunctions/askLLM/prostglesLLMTools/getMCPServerTools.d.ts.map +1 -1
  97. package/dist/server/src/serverFunctions/askLLM/prostglesLLMTools/getMcpToolsWithDynamicDescription.d.ts.map +1 -1
  98. package/dist/server/src/serverFunctions/deleteConnection.d.ts +15 -6
  99. package/dist/server/src/serverFunctions/deleteConnection.d.ts.map +1 -1
  100. package/dist/server/src/serverFunctions/getConnectionAndDatabaseConfig.d.ts +15 -6
  101. package/dist/server/src/serverFunctions/getConnectionAndDatabaseConfig.d.ts.map +1 -1
  102. package/dist/server/src/serverFunctions/loadGeneratedWorkspaces/loadGeneratedWorkspaces.d.ts.map +1 -1
  103. package/dist/server/src/serverFunctions/loadGeneratedWorkspaces/loadGeneratedWorkspacesFunction.d.ts.map +1 -1
  104. package/dist/server/src/serverFunctions/stateServerFunctions.d.ts +30 -12
  105. package/dist/server/src/serverFunctions/stateServerFunctions.d.ts.map +1 -1
  106. package/dist/server/src/tableConfig/tableConfigConnections.d.ts.map +1 -1
  107. package/dist/server/src/tableConfig/tableConfigConnections.js +5 -0
  108. package/dist/server/src/tableConfig/tableConfigConnections.js.map +1 -1
  109. package/dist/server/src/tableHooks/llm_credentials.tableHooks.d.ts.map +1 -1
  110. package/dist/server/src/tableHooks/tableHooks.d.ts +47 -20
  111. package/dist/server/src/tableHooks/tableHooks.d.ts.map +1 -1
  112. package/dist/server/src/tableHooks/users.tableHooks.d.ts +17 -8
  113. package/dist/server/src/tableHooks/users.tableHooks.d.ts.map +1 -1
  114. package/dist/server/src/upsertConnection.d.ts +15 -6
  115. package/dist/server/src/upsertConnection.d.ts.map +1 -1
  116. package/package.json +3 -3
@@ -1,5 +1,4 @@
1
- import type { AnyObject, JSONB, ParsedJoinPath } from "prostgles-types";
2
- import { type GroupedDetailedFilter } from "./filterUtils";
1
+ import type { AnyObject, JSONB } from "prostgles-types";
3
2
  export declare const ACTION_VARIANTS: readonly ["text", "faded", "filled", "outline"];
4
3
  export declare const ACTION_COLORS: readonly ["default", "action", "danger", "warn", "green", "indigo", "inherit", "transparent", "white"];
5
4
  export declare const ACTION_PROPERTIES: readonly ["text", "icon", "variant", "color", "disabledInfo", "isLoading"];
@@ -33,7 +32,10 @@ export declare const actionButtonStateSchema: {
33
32
  export type ActionButtonState = JSONB.GetObjectType<typeof actionButtonStateSchema>;
34
33
  export declare const actionColumnParamsSchema: {
35
34
  readonly methodName: "string";
36
- readonly argName: "string";
35
+ readonly argName: {
36
+ readonly type: "string";
37
+ readonly optional: true;
38
+ };
37
39
  readonly joinPath: {
38
40
  readonly optional: true;
39
41
  readonly arrayOf: {
@@ -50,9 +52,28 @@ export declare const actionColumnParamsSchema: {
50
52
  };
51
53
  };
52
54
  readonly conditions: {
55
+ readonly optional: true;
53
56
  readonly arrayOf: {
54
57
  readonly type: {
55
- readonly filter: "any";
58
+ readonly filter: {
59
+ readonly oneOfType: readonly [{
60
+ readonly $and: {
61
+ readonly arrayOf: {
62
+ readonly record: {
63
+ readonly values: "any";
64
+ };
65
+ };
66
+ };
67
+ }, {
68
+ readonly $or: {
69
+ readonly arrayOf: {
70
+ readonly record: {
71
+ readonly values: "any";
72
+ };
73
+ };
74
+ };
75
+ }];
76
+ };
56
77
  readonly value: {
57
78
  readonly type: {
58
79
  readonly text: {
@@ -121,7 +142,10 @@ export declare const actionColumnsParamsSchema: {
121
142
  readonly columnName: "string";
122
143
  }, {
123
144
  readonly methodName: "string";
124
- readonly argName: "string";
145
+ readonly argName: {
146
+ readonly type: "string";
147
+ readonly optional: true;
148
+ };
125
149
  readonly joinPath: {
126
150
  readonly optional: true;
127
151
  readonly arrayOf: {
@@ -138,9 +162,28 @@ export declare const actionColumnsParamsSchema: {
138
162
  };
139
163
  };
140
164
  readonly conditions: {
165
+ readonly optional: true;
141
166
  readonly arrayOf: {
142
167
  readonly type: {
143
- readonly filter: "any";
168
+ readonly filter: {
169
+ readonly oneOfType: readonly [{
170
+ readonly $and: {
171
+ readonly arrayOf: {
172
+ readonly record: {
173
+ readonly values: "any";
174
+ };
175
+ };
176
+ };
177
+ }, {
178
+ readonly $or: {
179
+ readonly arrayOf: {
180
+ readonly record: {
181
+ readonly values: "any";
182
+ };
183
+ };
184
+ };
185
+ }];
186
+ };
144
187
  readonly value: {
145
188
  readonly type: {
146
189
  readonly text: {
@@ -206,14 +249,8 @@ export declare const actionColumnsParamsSchema: {
206
249
  };
207
250
  };
208
251
  export type ActionColumnsParams = JSONB.GetObjectType<typeof actionColumnsParamsSchema>;
209
- export type ActionCaseValue = {
210
- conditions: {
211
- filter: GroupedDetailedFilter;
212
- value: ActionButtonState;
213
- }[];
214
- defaultValue?: ActionButtonState;
215
- joinPath?: ParsedJoinPath[];
216
- };
252
+ export type ActionColumnParams = JSONB.GetObjectType<typeof actionColumnParamsSchema>;
253
+ export type ActionCaseValue = Pick<ActionColumnParams, "conditions" | "defaultValue" | "joinPath">;
217
254
  export declare const getActionValueKey: (columnName: string) => string;
218
255
  export declare const getActionCaseSelect: (value: ActionCaseValue) => AnyObject | undefined;
219
256
  //# sourceMappingURL=actionColumn.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actionColumn.d.ts","sourceRoot":"","sources":["../../../common/actionColumn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,eAAe,CAAC;AAEvB,eAAO,MAAM,eAAe,iDAAkD,CAAC;AAC/E,eAAO,MAAM,aAAa,wGAUhB,CAAC;AACX,eAAO,MAAM,iBAAiB,4EAOpB,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;CAO1B,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CACjD,OAAO,uBAAuB,CAC/B,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkB3B,CAAC;AAEX,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAM5B,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,aAAa,CACnD,OAAO,yBAAyB,CACjC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACtF,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,EAAE,YAAY,GAAG,cAAc,GAAG,UAAU,CAAC,CAAC;AAEnG,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,WAA2B,CAAC;AAEhF,eAAO,MAAM,mBAAmB,GAC9B,OAAO,eAAe,KACrB,SAAS,GAAG,SAgBd,CAAC"}
@@ -32,7 +32,7 @@ exports.actionButtonStateSchema = {
32
32
  };
33
33
  exports.actionColumnParamsSchema = {
34
34
  methodName: "string",
35
- argName: "string",
35
+ argName: { type: "string", optional: true },
36
36
  joinPath: {
37
37
  optional: true,
38
38
  arrayOf: {
@@ -43,8 +43,17 @@ exports.actionColumnParamsSchema = {
43
43
  },
44
44
  },
45
45
  conditions: {
46
+ optional: true,
46
47
  arrayOf: {
47
- type: { filter: "any", value: { type: exports.actionButtonStateSchema } },
48
+ type: {
49
+ filter: {
50
+ oneOfType: [
51
+ { $and: { arrayOf: { record: { values: "any" } } } },
52
+ { $or: { arrayOf: { record: { values: "any" } } } },
53
+ ],
54
+ },
55
+ value: { type: exports.actionButtonStateSchema },
56
+ },
48
57
  },
49
58
  },
50
59
  defaultValue: { type: exports.actionButtonStateSchema, optional: true },
@@ -59,7 +68,7 @@ exports.actionColumnsParamsSchema = {
59
68
  const getActionValueKey = (columnName) => `${columnName}__state`;
60
69
  exports.getActionValueKey = getActionValueKey;
61
70
  const getActionCaseSelect = (value) => {
62
- const branches = value.conditions.flatMap(({ filter, value: result }) => {
71
+ const branches = (value.conditions ?? []).flatMap(({ filter, value: result }) => {
63
72
  const condition = (0, filterUtils_1.getTableFilterFromDetailedGroupFilter)(filter);
64
73
  if (!Object.keys(condition).length)
65
74
  return [];
@@ -1 +1 @@
1
- {"version":3,"file":"actionColumn.js","sourceRoot":"","sources":["../../../common/actionColumn.ts"],"names":[],"mappings":";;;AACA,+CAGuB;AAEV,QAAA,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AAClE,QAAA,aAAa,GAAG;IAC3B,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IACP,QAAQ;IACR,SAAS;IACT,aAAa;IACb,OAAO;CACC,CAAC;AACE,QAAA,iBAAiB,GAAG;IAC/B,MAAM;IACN,MAAM;IACN,SAAS;IACT,OAAO;IACP,cAAc;IACd,WAAW;CACH,CAAC;AAGE,QAAA,uBAAuB,GAAG;IACrC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;IACxC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;IACxC,OAAO,EAAE,EAAE,IAAI,EAAE,uBAAe,EAAE,QAAQ,EAAE,IAAI,EAAE;IAClD,KAAK,EAAE,EAAE,IAAI,EAAE,qBAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC9C,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;IAChD,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;CACtC,CAAC;AAME,QAAA,wBAAwB,GAAG;IACtC,UAAU,EAAE,QAAQ;IACpB,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE;QACR,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACP,IAAI,EAAE;gBACJ,KAAK,EAAE,QAAQ;gBACf,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,EAA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,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM;YAAE,OAAO,EAAE,CAAC;QAC9C,OAAO;YACL;gBACE,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;oBACtB,EAAE,aAAa,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;oBAChE,CAAC,CAAC,SAAS;gBACX,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;aACvB;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,4DAA4D;IAC5D,IAAI,CAAC,QAAQ,CAAC,MAAM;QAAE,OAAO;IAC7B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE,CAAC;AAC9E,CAAC,CAAC;AAlBW,QAAA,mBAAmB,uBAkB9B"}
@@ -16,7 +16,10 @@ export declare const columnDisplayFormatSchema: {
16
16
  readonly columnName: "string";
17
17
  }, {
18
18
  readonly methodName: "string";
19
- readonly argName: "string";
19
+ readonly argName: {
20
+ readonly type: "string";
21
+ readonly optional: true;
22
+ };
20
23
  readonly joinPath: {
21
24
  readonly optional: true;
22
25
  readonly arrayOf: {
@@ -33,9 +36,28 @@ export declare const columnDisplayFormatSchema: {
33
36
  };
34
37
  };
35
38
  readonly conditions: {
39
+ readonly optional: true;
36
40
  readonly arrayOf: {
37
41
  readonly type: {
38
- readonly filter: "any";
42
+ readonly filter: {
43
+ readonly oneOfType: readonly [{
44
+ readonly $and: {
45
+ readonly arrayOf: {
46
+ readonly record: {
47
+ readonly values: "any";
48
+ };
49
+ };
50
+ };
51
+ }, {
52
+ readonly $or: {
53
+ readonly arrayOf: {
54
+ readonly record: {
55
+ readonly values: "any";
56
+ };
57
+ };
58
+ };
59
+ }];
60
+ };
39
61
  readonly value: {
40
62
  readonly type: {
41
63
  readonly text: {
@@ -109,7 +131,10 @@ export declare const columnDisplayFormatSchema: {
109
131
  readonly params: {
110
132
  readonly type: {
111
133
  readonly methodName: "string";
112
- readonly argName: "string";
134
+ readonly argName: {
135
+ readonly type: "string";
136
+ readonly optional: true;
137
+ };
113
138
  readonly joinPath: {
114
139
  readonly optional: true;
115
140
  readonly arrayOf: {
@@ -126,9 +151,28 @@ export declare const columnDisplayFormatSchema: {
126
151
  };
127
152
  };
128
153
  readonly conditions: {
154
+ readonly optional: true;
129
155
  readonly arrayOf: {
130
156
  readonly type: {
131
- readonly filter: "any";
157
+ readonly filter: {
158
+ readonly oneOfType: readonly [{
159
+ readonly $and: {
160
+ readonly arrayOf: {
161
+ readonly record: {
162
+ readonly values: "any";
163
+ };
164
+ };
165
+ };
166
+ }, {
167
+ readonly $or: {
168
+ readonly arrayOf: {
169
+ readonly record: {
170
+ readonly values: "any";
171
+ };
172
+ };
173
+ };
174
+ }];
175
+ };
132
176
  readonly value: {
133
177
  readonly type: {
134
178
  readonly text: {
@@ -1 +1 @@
1
- {"version":3,"file":"columnDisplayFormat.schema.d.ts","sourceRoot":"","sources":["../../../common/columnDisplayFormat.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG7C,eAAO,MAAM,YAAY,sCAAuC,CAAC;AA6FjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmJ5B,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAChD,OAAO,yBAAyB,CACjC,CAAC"}
1
+ {"version":3,"file":"columnDisplayFormat.schema.d.ts","sourceRoot":"","sources":["../../../common/columnDisplayFormat.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG7C,eAAO,MAAM,YAAY,sCAAuC,CAAC;AA6FjE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmJ5B,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAChD,OAAO,yBAAyB,CACjC,CAAC"}
@@ -44,8 +44,9 @@ export type ActionColumnValue = JSONB.GetObjectType<typeof actionColumnValueSche
44
44
  * Use in tableConfig.columns. The method receives primitive row fields through its sole
45
45
  * matching RowLookup/ValueLookup argument (or argName when explicitly set).
46
46
  * The optional methodName is the fallback for subsequent stored states.
47
+ * initialState supplies the initial button label, icon and other stored properties.
47
48
  */
48
- export declare const createActionColumn: (methodName?: string) => {
49
+ export declare const createActionColumn: (methodName?: string, initialState?: Omit<ActionColumnValue, "methodName">) => {
49
50
  readonly nullable: true;
50
51
  readonly defaultValue: string;
51
52
  readonly jsonbSchema: {
@@ -89,9 +90,15 @@ export declare const createActionColumn: (methodName?: string) => {
89
90
  };
90
91
  };
91
92
  readonly defaultValue: {
92
- methodName: string;
93
- } | {
94
- methodName?: undefined;
93
+ text?: string | undefined;
94
+ icon?: string | undefined;
95
+ variant?: "text" | "faded" | "filled" | "outline" | undefined;
96
+ color?: "default" | "action" | "danger" | "warn" | "green" | "indigo" | "inherit" | "transparent" | "white" | undefined;
97
+ disabledInfo?: string | undefined;
98
+ isLoading?: boolean | undefined;
99
+ argName?: string | undefined;
100
+ details?: string | undefined;
101
+ methodName?: string | undefined;
95
102
  };
96
103
  };
97
104
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createActionColumn.d.ts","sourceRoot":"","sources":["../../../common/createActionColumn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG7C,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS1B,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CACjD,OAAO,uBAAuB,CAC/B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,aAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQzC,CAAC"}
1
+ {"version":3,"file":"createActionColumn.d.ts","sourceRoot":"","sources":["../../../common/createActionColumn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG7C,6EAA6E;AAC7E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAS1B,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CACjD,OAAO,uBAAuB,CAC/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,aAAa,MAAM,EAAE,eAAc,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAU/G,CAAC"}
@@ -17,14 +17,18 @@ exports.actionColumnValueSchema = {
17
17
  * Use in tableConfig.columns. The method receives primitive row fields through its sole
18
18
  * matching RowLookup/ValueLookup argument (or argName when explicitly set).
19
19
  * The optional methodName is the fallback for subsequent stored states.
20
+ * initialState supplies the initial button label, icon and other stored properties.
20
21
  */
21
- const createActionColumn = (methodName) => ({
22
- nullable: true,
23
- defaultValue: JSON.stringify(methodName ? { methodName } : {}),
24
- jsonbSchema: {
25
- type: exports.actionColumnValueSchema,
26
- defaultValue: methodName ? { methodName } : {},
27
- },
28
- });
22
+ const createActionColumn = (methodName, initialState = {}) => {
23
+ const defaultValue = { ...(methodName && { methodName }), ...initialState };
24
+ return {
25
+ nullable: true,
26
+ defaultValue: JSON.stringify(defaultValue),
27
+ jsonbSchema: {
28
+ type: exports.actionColumnValueSchema,
29
+ defaultValue,
30
+ },
31
+ };
32
+ };
29
33
  exports.createActionColumn = createActionColumn;
30
34
  //# sourceMappingURL=createActionColumn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createActionColumn.js","sourceRoot":"","sources":["../../../common/createActionColumn.ts"],"names":[],"mappings":";;;AACA,iDAAyD;AAEzD,6EAA6E;AAChE,QAAA,uBAAuB,GAAG;IACrC,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC9C,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;IAC3C,GAAG,sCAAuB;IAC1B,OAAO,EAAE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uB;YAC7B,YAAY;SACb;KACO,CAAC;AACb,CAAC,CAAC;AAVW,QAAA,kBAAkB,sBAU7B"}
@@ -0,0 +1,217 @@
1
+ import { getActionFunctions, type AnyObject, type ClientServerFunction, type JSONB } from "prostgles-types";
2
+ import { type ActionButtonState } from "./actionColumn";
3
+ export declare const functionOptionsSchema: {
4
+ readonly action: {
5
+ readonly optional: true;
6
+ readonly type: {
7
+ readonly conditions: {
8
+ readonly optional: true;
9
+ readonly arrayOf: {
10
+ readonly type: {
11
+ readonly filter: {
12
+ readonly oneOfType: readonly [{
13
+ readonly $and: {
14
+ readonly arrayOf: {
15
+ readonly record: {
16
+ readonly values: "any";
17
+ };
18
+ };
19
+ };
20
+ }, {
21
+ readonly $or: {
22
+ readonly arrayOf: {
23
+ readonly record: {
24
+ readonly values: "any";
25
+ };
26
+ };
27
+ };
28
+ }];
29
+ };
30
+ readonly value: {
31
+ readonly type: {
32
+ readonly text: {
33
+ readonly type: "string";
34
+ readonly optional: true;
35
+ };
36
+ readonly icon: {
37
+ readonly type: "string";
38
+ readonly optional: true;
39
+ };
40
+ readonly variant: {
41
+ readonly enum: readonly ["text", "faded", "filled", "outline"];
42
+ readonly optional: true;
43
+ };
44
+ readonly color: {
45
+ readonly enum: readonly ["default", "action", "danger", "warn", "green", "indigo", "inherit", "transparent", "white"];
46
+ readonly optional: true;
47
+ };
48
+ readonly disabledInfo: {
49
+ readonly type: "string";
50
+ readonly optional: true;
51
+ };
52
+ readonly isLoading: {
53
+ readonly type: "boolean";
54
+ readonly optional: true;
55
+ };
56
+ };
57
+ };
58
+ };
59
+ };
60
+ };
61
+ readonly defaultValue: {
62
+ readonly type: {
63
+ readonly text: {
64
+ readonly type: "string";
65
+ readonly optional: true;
66
+ };
67
+ readonly icon: {
68
+ readonly type: "string";
69
+ readonly optional: true;
70
+ };
71
+ readonly variant: {
72
+ readonly enum: readonly ["text", "faded", "filled", "outline"];
73
+ readonly optional: true;
74
+ };
75
+ readonly color: {
76
+ readonly enum: readonly ["default", "action", "danger", "warn", "green", "indigo", "inherit", "transparent", "white"];
77
+ readonly optional: true;
78
+ };
79
+ readonly disabledInfo: {
80
+ readonly type: "string";
81
+ readonly optional: true;
82
+ };
83
+ readonly isLoading: {
84
+ readonly type: "boolean";
85
+ readonly optional: true;
86
+ };
87
+ };
88
+ readonly optional: true;
89
+ };
90
+ };
91
+ };
92
+ readonly defaultArgs: {
93
+ readonly record: {
94
+ readonly values: "any";
95
+ };
96
+ readonly optional: true;
97
+ };
98
+ readonly outputTable: {
99
+ readonly type: "string";
100
+ readonly optional: true;
101
+ };
102
+ };
103
+ export declare const functionOptionsJsonbSchema: {
104
+ readonly record: {
105
+ readonly partial: true;
106
+ readonly values: {
107
+ readonly type: {
108
+ readonly action: {
109
+ readonly optional: true;
110
+ readonly type: {
111
+ readonly conditions: {
112
+ readonly optional: true;
113
+ readonly arrayOf: {
114
+ readonly type: {
115
+ readonly filter: {
116
+ readonly oneOfType: readonly [{
117
+ readonly $and: {
118
+ readonly arrayOf: {
119
+ readonly record: {
120
+ readonly values: "any";
121
+ };
122
+ };
123
+ };
124
+ }, {
125
+ readonly $or: {
126
+ readonly arrayOf: {
127
+ readonly record: {
128
+ readonly values: "any";
129
+ };
130
+ };
131
+ };
132
+ }];
133
+ };
134
+ readonly value: {
135
+ readonly type: {
136
+ readonly text: {
137
+ readonly type: "string";
138
+ readonly optional: true;
139
+ };
140
+ readonly icon: {
141
+ readonly type: "string";
142
+ readonly optional: true;
143
+ };
144
+ readonly variant: {
145
+ readonly enum: readonly ["text", "faded", "filled", "outline"];
146
+ readonly optional: true;
147
+ };
148
+ readonly color: {
149
+ readonly enum: readonly ["default", "action", "danger", "warn", "green", "indigo", "inherit", "transparent", "white"];
150
+ readonly optional: true;
151
+ };
152
+ readonly disabledInfo: {
153
+ readonly type: "string";
154
+ readonly optional: true;
155
+ };
156
+ readonly isLoading: {
157
+ readonly type: "boolean";
158
+ readonly optional: true;
159
+ };
160
+ };
161
+ };
162
+ };
163
+ };
164
+ };
165
+ readonly defaultValue: {
166
+ readonly type: {
167
+ readonly text: {
168
+ readonly type: "string";
169
+ readonly optional: true;
170
+ };
171
+ readonly icon: {
172
+ readonly type: "string";
173
+ readonly optional: true;
174
+ };
175
+ readonly variant: {
176
+ readonly enum: readonly ["text", "faded", "filled", "outline"];
177
+ readonly optional: true;
178
+ };
179
+ readonly color: {
180
+ readonly enum: readonly ["default", "action", "danger", "warn", "green", "indigo", "inherit", "transparent", "white"];
181
+ readonly optional: true;
182
+ };
183
+ readonly disabledInfo: {
184
+ readonly type: "string";
185
+ readonly optional: true;
186
+ };
187
+ readonly isLoading: {
188
+ readonly type: "boolean";
189
+ readonly optional: true;
190
+ };
191
+ };
192
+ readonly optional: true;
193
+ };
194
+ };
195
+ };
196
+ readonly defaultArgs: {
197
+ readonly record: {
198
+ readonly values: "any";
199
+ };
200
+ readonly optional: true;
201
+ };
202
+ readonly outputTable: {
203
+ readonly type: "string";
204
+ readonly optional: true;
205
+ };
206
+ };
207
+ };
208
+ };
209
+ };
210
+ export type FunctionOptions = JSONB.GetObjectType<typeof functionOptionsSchema>;
211
+ export type FunctionOptionsMap = Partial<Record<string, FunctionOptions>>;
212
+ export declare const getFunctionOptions: (method: ClientServerFunction | undefined) => FunctionOptions | undefined;
213
+ export declare const getFunctionActionValueKey: (key: string) => string;
214
+ export declare const getFunctionActionSelect: (method: ClientServerFunction | undefined, key: string) => AnyObject;
215
+ export declare const getTableFunctionActionSelect: (methods: Record<string, ClientServerFunction>, table: Parameters<typeof getActionFunctions>[1]) => AnyObject;
216
+ export declare const getFunctionActionValue: (method: ClientServerFunction | undefined, row: AnyObject, key: string) => ActionButtonState;
217
+ //# sourceMappingURL=functionOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functionOptions.d.ts","sourceRoot":"","sources":["../../../common/functionOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,SAAS,EAAE,KAAK,oBAAoB,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ports.getFunctionActionSelect = exports.getFunctionActionValueKey = exports.getFunctionOptions = exports.functionOptionsJsonbSchema = exports.functionOptionsSchema = void 0;
4
+ const prostgles_types_1 = require("prostgles-types");
5
+ const actionColumn_1 = require("./actionColumn");
6
+ exports.functionOptionsSchema = {
7
+ action: {
8
+ optional: true,
9
+ type: {
10
+ conditions: actionColumn_1.actionColumnParamsSchema.conditions,
11
+ defaultValue: actionColumn_1.actionColumnParamsSchema.defaultValue,
12
+ },
13
+ },
14
+ defaultArgs: { record: { values: "any" }, optional: true },
15
+ outputTable: { type: "string", optional: true },
16
+ };
17
+ exports.functionOptionsJsonbSchema = {
18
+ record: { partial: true, values: { type: exports.functionOptionsSchema } },
19
+ };
20
+ const getFunctionOptions = (method) => method?.function_options;
21
+ exports.getFunctionOptions = getFunctionOptions;
22
+ const getFunctionActionValueKey = (key) => `${key}__function_state`;
23
+ exports.getFunctionActionValueKey = getFunctionActionValueKey;
24
+ const getFunctionActionSelect = (method, key) => {
25
+ const expression = (0, actionColumn_1.getActionCaseSelect)((0, exports.getFunctionOptions)(method)?.action ?? {});
26
+ return expression ? { [(0, exports.getFunctionActionValueKey)(key)]: expression } : {};
27
+ };
28
+ exports.getFunctionActionSelect = getFunctionActionSelect;
29
+ const getTableFunctionActionSelect = (methods, table) => Object.assign({}, ...(0, prostgles_types_1.getActionFunctions)(methods, table).map(({ methodName }) => (0, exports.getFunctionActionSelect)(methods[methodName], methodName)));
30
+ exports.getTableFunctionActionSelect = getTableFunctionActionSelect;
31
+ const getFunctionActionValue = (method, row, key) => {
32
+ const state = row[(0, exports.getFunctionActionValueKey)(key)];
33
+ return {
34
+ ...(0, exports.getFunctionOptions)(method)?.action?.defaultValue,
35
+ ...(state ? JSON.parse(state) : {}),
36
+ };
37
+ };
38
+ exports.getFunctionActionValue = getFunctionActionValue;
39
+ //# sourceMappingURL=functionOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functionOptions.js","sourceRoot":"","sources":["../../../common/functionOptions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