@ganju/utils 0.0.16 → 0.0.18

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 (68) hide show
  1. package/dist/constants.d.ts +9 -0
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.js +26 -2
  4. package/dist/customCodeToken.d.ts +15 -0
  5. package/dist/customCodeToken.d.ts.map +1 -1
  6. package/dist/customCodeToken.js +49 -1
  7. package/dist/data.d.ts +6 -0
  8. package/dist/data.d.ts.map +1 -1
  9. package/dist/data.js +53 -1
  10. package/dist/dataApi.d.ts +200 -1
  11. package/dist/dataApi.d.ts.map +1 -1
  12. package/dist/dataApi.js +106 -1
  13. package/dist/dataCompiler.d.ts.map +1 -1
  14. package/dist/dataCompiler.js +5 -1
  15. package/dist/dataCsv.d.ts +20 -0
  16. package/dist/dataCsv.d.ts.map +1 -0
  17. package/dist/dataCsv.js +102 -0
  18. package/dist/dataDdl.d.ts.map +1 -1
  19. package/dist/dataDdl.js +3 -1
  20. package/dist/dataEngine.d.ts.map +1 -1
  21. package/dist/dataEngine.js +86 -4
  22. package/dist/dataImport.d.ts +2 -0
  23. package/dist/dataImport.d.ts.map +1 -1
  24. package/dist/dataImport.js +4 -1
  25. package/dist/dataQueries.d.ts +73 -0
  26. package/dist/dataQueries.d.ts.map +1 -0
  27. package/dist/dataQueries.js +513 -0
  28. package/dist/dataRpc.d.ts +44 -0
  29. package/dist/dataRpc.d.ts.map +1 -1
  30. package/dist/dataTools.d.ts +40 -0
  31. package/dist/dataTools.d.ts.map +1 -0
  32. package/dist/dataTools.js +280 -0
  33. package/dist/dataTriggers.d.ts +203 -0
  34. package/dist/dataTriggers.d.ts.map +1 -0
  35. package/dist/dataTriggers.js +760 -0
  36. package/dist/dataTypes.d.ts +3 -0
  37. package/dist/dataTypes.d.ts.map +1 -1
  38. package/dist/index.d.ts +201 -2
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +4 -0
  41. package/dist/localizeDataError.d.ts +18 -0
  42. package/dist/localizeDataError.d.ts.map +1 -0
  43. package/dist/localizeDataError.js +359 -0
  44. package/dist/schema.d.ts +201 -0
  45. package/dist/schema.d.ts.map +1 -1
  46. package/dist/schema.js +149 -1
  47. package/dist/sdkConstants.d.ts +3 -0
  48. package/dist/sdkConstants.d.ts.map +1 -1
  49. package/dist/sdkConstants.js +4 -1
  50. package/package.json +1 -1
  51. package/src/constants.ts +30 -2
  52. package/src/customCodeToken.ts +87 -0
  53. package/src/data.ts +74 -0
  54. package/src/dataApi.ts +129 -2
  55. package/src/dataCompiler.ts +5 -1
  56. package/src/dataCsv.ts +99 -0
  57. package/src/dataDdl.ts +3 -1
  58. package/src/dataEngine.ts +94 -4
  59. package/src/dataImport.ts +3 -0
  60. package/src/dataQueries.ts +730 -0
  61. package/src/dataRpc.ts +26 -0
  62. package/src/dataTools.ts +338 -0
  63. package/src/dataTriggers.ts +1134 -0
  64. package/src/dataTypes.ts +9 -0
  65. package/src/index.ts +11 -1
  66. package/src/localizeDataError.ts +593 -0
  67. package/src/schema.ts +158 -1
  68. package/src/sdkConstants.ts +3 -0
@@ -132,6 +132,10 @@ export declare const constants: {
132
132
  BILLING_METER_SHARED_MESSAGES: string;
133
133
  BILLING_METER_EMBEDDED: string;
134
134
  BILLING_METER_TOOL_CALLS: string;
135
+ BILLING_METER_DATA_STORAGE: string;
136
+ BILLING_METER_DATA_ROWS_WRITTEN: string;
137
+ BILLING_METER_DATA_ROWS_READ: string;
138
+ BILLING_METER_DATA_TRIGGER_RUNS: string;
135
139
  BILLING_METER_UNITS_KEY: string;
136
140
  POLAR_API_BASE: string;
137
141
  POLAR_SANDBOX_API_BASE: string;
@@ -650,6 +654,9 @@ export declare const constants: {
650
654
  CUSTOM_CODE_BROKER_PATH_RESOURCES_CREATE: string;
651
655
  CUSTOM_CODE_BROKER_PATH_RESOURCES_DELETE: string;
652
656
  CUSTOM_CODE_BROKER_PATH_SEND_FILE: string;
657
+ CUSTOM_CODE_BROKER_PATH_DATA: string;
658
+ CUSTOM_CODE_BROKER_PATH_CHANNELS_SEND: string;
659
+ CUSTOM_CODE_BROKER_PATH_CHANNELS_POST: string;
653
660
  CUSTOM_CODE_OUTBOUND_PARAM_ARTIFACT_ID: "artifactId";
654
661
  CUSTOM_CODE_OUTBOUND_PARAM_ALLOWED_HOSTS: "allowedHosts";
655
662
  CUSTOM_CODE_PLATFORM_HOSTS: string[];
@@ -692,6 +699,8 @@ export declare const constants: {
692
699
  MCP_CHANNEL_PLATFORM_HEADER: string;
693
700
  MCP_CHANNEL_CONVERSATION_HEADER: string;
694
701
  MCP_CHANNEL_CLIENT_USER_AGENT: string;
702
+ MCP_CHANNEL_PARTICIPANT_HEADER: string;
703
+ MCP_CHANNEL_TIME_ZONE_HEADER: string;
695
704
  MCP_SESSION_HEADER: string;
696
705
  MCP_REQUEST_METHOD_INITIALIZE: "initialize";
697
706
  MCP_REQUEST_METHOD_PING: "ping";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAkKA,QAAA,MAAM,yBAAyB,EAAiB,UAAU,CAAC;AAC3D,QAAA,MAAM,+BAA+B,EAAuB,gBAAgB,CAAC;AAC7E,QAAA,MAAM,8BAA8B,EAAsB,eAAe,CAAC;AAC1E,QAAA,MAAM,wBAAwB,EAAgB,SAAS,CAAC;AAuCxD,QAAA,MAAM,sBAAsB,EAAiB,UAAU,CAAC;AACxD,QAAA,MAAM,4BAA4B,EAAuB,gBAAgB,CAAC;AAC1E,QAAA,MAAM,oBAAoB,EAAe,QAAQ,CAAC;AAClD,QAAA,MAAM,oBAAoB,EAAe,QAAQ,CAAC;AA+FlD,QAAA,MAAM,4BAA4B,EAAc,OAAO,CAAC;AACxD,QAAA,MAAM,6BAA6B,EAAe,QAAQ,CAAC;AA2V3D,QAAA,MAAM,sBAAsB,EAAkB,WAAW,CAAC;AAC1D,QAAA,MAAM,mBAAmB,EAAe,Q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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAqcT,OAAO,mBAAmB,GAC1B,OAAO,mBAAmB,GAC1B,OAAO,sBAAsB;eAC1B,MAAM;eACN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAyWwB,MAAM,GAAG,MAAM;cAAQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsnEnE,CAAC"}
package/dist/constants.js CHANGED
@@ -1344,7 +1344,10 @@ const RESERVED_TOOL_NAME_PREFIXES = [
1344
1344
  'slack-',
1345
1345
  CALENDAR_TOOL_KEY_PREFIX,
1346
1346
  CALCOM_TOOL_KEY_PREFIX,
1347
- WEB_TOOL_KEY_PREFIX
1347
+ WEB_TOOL_KEY_PREFIX,
1348
+ // data-describe, data-query, data-write and data-admin, registered for a
1349
+ // project with a database.
1350
+ 'data-'
1348
1351
  ];
1349
1352
  // The keys that don't belong to a prefixed group: the RAG core the channel
1350
1353
  // runner intercepts by name, the smoke-test tool, the three proxied definition
@@ -1597,6 +1600,11 @@ const MCP_CHANNEL_PLATFORM_HEADER = 'x-ganju-channel-platform';
1597
1600
  // the chat it ran in.
1598
1601
  const MCP_CHANNEL_CONVERSATION_HEADER = 'x-ganju-channel-conversation-id';
1599
1602
  const MCP_CHANNEL_CLIENT_USER_AGENT = 'ganju-channel/0.0.1';
1603
+ // The participant a channel turn is for: customer-scoped tables fill and
1604
+ // filter their rows with it. Trusted only on the channel's own auth paths.
1605
+ const MCP_CHANNEL_PARTICIPANT_HEADER = 'x-ganju-channel-participant-id';
1606
+ // The zone the channel resolves dates in; the data tools answer in it.
1607
+ const MCP_CHANNEL_TIME_ZONE_HEADER = 'x-ganju-channel-time-zone';
1600
1608
  const JWKS_KV_KEY = 'jwks:v1';
1601
1609
  const JWKS_TTL_SECONDS = 600;
1602
1610
  // Standard OIDC scopes the better-auth oauthProvider honors for user OAuth
@@ -2035,9 +2043,16 @@ const BILLING_METER_EMBEDDED = 'ganju_embedded_storage';
2035
2043
  // customer 2.5 million past the allowance owes $12.50, which is what every page
2036
2044
  // of ours quotes.
2037
2045
  const BILLING_METER_TOOL_CALLS = 'ganju_custom_tool_calls';
2046
+ // Project data, reported in full (not past an allowance) and attached at $0:
2047
+ // measured before they are priced. Storage is the period's peak in whole MB,
2048
+ // rows and trigger runs are counts.
2049
+ const BILLING_METER_DATA_STORAGE = 'ganju_data_storage';
2050
+ const BILLING_METER_DATA_ROWS_WRITTEN = 'ganju_data_rows_written';
2051
+ const BILLING_METER_DATA_ROWS_READ = 'ganju_data_rows_read';
2052
+ const BILLING_METER_DATA_TRIGGER_RUNS = 'ganju_data_trigger_runs';
2038
2053
  // The metadata property every meter aggregates (`sum` over it). Ingested events
2039
2054
  // carry the increment under this key, so it has to agree with the aggregation
2040
- // configured on all four meters — which is why it lives beside their names
2055
+ // configured on every meter — which is why it lives beside their names
2041
2056
  // rather than at the call site.
2042
2057
  const BILLING_METER_UNITS_KEY = 'units';
2043
2058
  // Polar API hosts. Sandbox is a separate host rather than a mode flag, so the
@@ -2200,6 +2215,10 @@ exports.constants = {
2200
2215
  BILLING_METER_SHARED_MESSAGES,
2201
2216
  BILLING_METER_EMBEDDED,
2202
2217
  BILLING_METER_TOOL_CALLS,
2218
+ BILLING_METER_DATA_STORAGE,
2219
+ BILLING_METER_DATA_ROWS_WRITTEN,
2220
+ BILLING_METER_DATA_ROWS_READ,
2221
+ BILLING_METER_DATA_TRIGGER_RUNS,
2203
2222
  BILLING_METER_UNITS_KEY,
2204
2223
  POLAR_API_BASE,
2205
2224
  POLAR_SANDBOX_API_BASE,
@@ -2697,6 +2716,9 @@ exports.constants = {
2697
2716
  CUSTOM_CODE_BROKER_PATH_RESOURCES_CREATE: sdkConstants_1.CUSTOM_CODE_BROKER_PATH_RESOURCES_CREATE,
2698
2717
  CUSTOM_CODE_BROKER_PATH_RESOURCES_DELETE: sdkConstants_1.CUSTOM_CODE_BROKER_PATH_RESOURCES_DELETE,
2699
2718
  CUSTOM_CODE_BROKER_PATH_SEND_FILE: sdkConstants_1.CUSTOM_CODE_BROKER_PATH_SEND_FILE,
2719
+ CUSTOM_CODE_BROKER_PATH_DATA: sdkConstants_1.CUSTOM_CODE_BROKER_PATH_DATA,
2720
+ CUSTOM_CODE_BROKER_PATH_CHANNELS_SEND: sdkConstants_1.CUSTOM_CODE_BROKER_PATH_CHANNELS_SEND,
2721
+ CUSTOM_CODE_BROKER_PATH_CHANNELS_POST: sdkConstants_1.CUSTOM_CODE_BROKER_PATH_CHANNELS_POST,
2700
2722
  CUSTOM_CODE_OUTBOUND_PARAM_ARTIFACT_ID,
2701
2723
  CUSTOM_CODE_OUTBOUND_PARAM_ALLOWED_HOSTS,
2702
2724
  CUSTOM_CODE_PLATFORM_HOSTS,
@@ -2739,6 +2761,8 @@ exports.constants = {
2739
2761
  MCP_CHANNEL_PLATFORM_HEADER,
2740
2762
  MCP_CHANNEL_CONVERSATION_HEADER,
2741
2763
  MCP_CHANNEL_CLIENT_USER_AGENT,
2764
+ MCP_CHANNEL_PARTICIPANT_HEADER,
2765
+ MCP_CHANNEL_TIME_ZONE_HEADER,
2742
2766
  MCP_SESSION_HEADER,
2743
2767
  MCP_REQUEST_METHOD_INITIALIZE,
2744
2768
  MCP_REQUEST_METHOD_PING,
@@ -23,6 +23,21 @@ export declare const mintCustomCodeToken: (payload: Omit<CustomCodeTokenPayload,
23
23
  * failed.
24
24
  */
25
25
  export declare const verifyCustomCodeToken: (token: string, secret: string, now?: number) => Promise<CustomCodeTokenPayload | null>;
26
+ export interface CustomCodeCallPayload {
27
+ v: string;
28
+ artifactId: string;
29
+ versionId: string;
30
+ tool: string;
31
+ exp: number;
32
+ trigger?: {
33
+ id: string;
34
+ depth: number;
35
+ };
36
+ }
37
+ export declare const mintCustomCodeCallToken: (payload: Omit<CustomCodeCallPayload, "v" | "exp"> & {
38
+ ttlMs: number;
39
+ }, secret: string, issuedAt?: number) => Promise<string>;
40
+ export declare const verifyCustomCodeCallToken: (token: string, secret: string, now?: number) => Promise<CustomCodeCallPayload | null>;
26
41
  /**
27
42
  * The legacy dispatch-namespace script name for an artifact: `artifact_<id>`.
28
43
  *
@@ -1 +1 @@
1
- {"version":3,"file":"customCodeToken.d.ts","sourceRoot":"","sources":["../src/customCodeToken.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,sBAAsB;IAGrC,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;IAGnB,SAAS,EAAE,MAAM,CAAC;IAIlB,GAAG,EAAE,MAAM,CAAC;IAOZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAGlB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AA0BD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,IAAI,CAAC,sBAAsB,EAAE,GAAG,GAAG,KAAK,GAAG,KAAK,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,EACD,QAAQ,MAAM,EACd,WAAU,MAAmB,KAC5B,OAAO,CAAC,MAAM,CAmBhB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,MAAM,MAAM,KACX,OAAO,CAAC,sBAAsB,GAAG,IAAI,CA+DvC,CAAC;AAEF;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AE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACzC;AAID,eAAO,MAAM,uBAAuB,GAClC,SAAS,IAAI,CAAC,qBAAqB,EAAE,GAAG,GAAG,KAAK,CAAC,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,EACrE,QAAQ,MAAM,EACd,WAAU,MAAmB,KAC5B,OAAO,CAAC,MAAM,CAchB,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,MAAK,MAAmB,KACvB,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAuCtC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,GAAI,YAAY,MAAM,KAAG,MACE,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GAAI,YAAY,MAAM,KAAG,MACoB,CAAC;AAEtF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,oBAAoB,GAAI,YAAY,MAAM,KAAG,MACR,CAAC;AAEnD;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GAAI,YAAY,MAAM,KAAG,MACR,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.customCodePreviewUploadName = exports.customCodeUploadName = exports.customCodePreviewScriptName = exports.customCodeScriptName = exports.verifyCustomCodeToken = exports.mintCustomCodeToken = void 0;
3
+ exports.customCodePreviewUploadName = exports.customCodeUploadName = exports.customCodePreviewScriptName = exports.customCodeScriptName = exports.verifyCustomCodeCallToken = exports.mintCustomCodeCallToken = exports.verifyCustomCodeToken = exports.mintCustomCodeToken = void 0;
4
4
  const base64_1 = require("./base64");
5
5
  const constants_1 = require("./constants");
6
6
  const encoder = new TextEncoder();
@@ -96,6 +96,54 @@ const verifyCustomCodeToken = async (token, secret, now) => {
96
96
  };
97
97
  };
98
98
  exports.verifyCustomCodeToken = verifyCustomCodeToken;
99
+ const callSecret = (secret) => `${secret}:call`;
100
+ const mintCustomCodeCallToken = async (payload, secret, issuedAt = Date.now()) => {
101
+ const body = {
102
+ v: constants_1.constants.CUSTOM_CODE_TOKEN_VERSION,
103
+ artifactId: payload.artifactId,
104
+ versionId: payload.versionId,
105
+ tool: payload.tool,
106
+ exp: Math.ceil((issuedAt + payload.ttlMs) / 1000),
107
+ ...(payload.trigger ? { trigger: payload.trigger } : {})
108
+ };
109
+ const encodedPayload = (0, base64_1.toBase64Url)((0, base64_1.bytesToBase64)(encoder.encode(JSON.stringify(body))));
110
+ const signature = await signPayload(encodedPayload, callSecret(secret));
111
+ return `${encodedPayload}.${signature}`;
112
+ };
113
+ exports.mintCustomCodeCallToken = mintCustomCodeCallToken;
114
+ const verifyCustomCodeCallToken = async (token, secret, now = Date.now()) => {
115
+ const separator = token.lastIndexOf('.');
116
+ if (separator <= 0)
117
+ return null;
118
+ const encodedPayload = token.slice(0, separator);
119
+ try {
120
+ const key = await importKey(callSecret(secret));
121
+ const valid = await crypto.subtle.verify('HMAC', key, new Uint8Array((0, base64_1.base64ToBytes)((0, base64_1.fromBase64Url)(token.slice(separator + 1)))), encoder.encode(encodedPayload));
122
+ if (!valid)
123
+ return null;
124
+ const candidate = JSON.parse(new TextDecoder().decode((0, base64_1.base64ToBytes)((0, base64_1.fromBase64Url)(encodedPayload))));
125
+ if (candidate.v !== constants_1.constants.CUSTOM_CODE_TOKEN_VERSION ||
126
+ typeof candidate.artifactId !== 'string' ||
127
+ typeof candidate.versionId !== 'string' ||
128
+ typeof candidate.tool !== 'string' ||
129
+ typeof candidate.exp !== 'number' ||
130
+ candidate.exp * 1000 <= now) {
131
+ return null;
132
+ }
133
+ const trigger = candidate.trigger;
134
+ if (trigger !== undefined &&
135
+ (typeof trigger?.id !== 'string' ||
136
+ !Number.isInteger(trigger.depth) ||
137
+ trigger.depth < 1)) {
138
+ return null;
139
+ }
140
+ return candidate;
141
+ }
142
+ catch {
143
+ return null;
144
+ }
145
+ };
146
+ exports.verifyCustomCodeCallToken = verifyCustomCodeCallToken;
99
147
  /**
100
148
  * The legacy dispatch-namespace script name for an artifact: `artifact_<id>`.
101
149
  *
package/dist/data.d.ts CHANGED
@@ -5,5 +5,11 @@ export { chunkRows, rowsPerInsert, ftsMatch, keysetCondition, encodeCursor, deco
5
5
  export type { SqlValue, KeysetCursor, SortKey } from './dataCompiler';
6
6
  export { INTERNAL_MIGRATIONS, INTERNAL_SCHEMA_VERSION, hasInternalTables, getMeta, setMeta, migrateInternal, loadSchema, toTableInput, normaliseColumn, translateSqliteError, describe, query, write, rowHistory, pruneHistory, deleteImpact, createTable, updateTable, dropTable, addColumn, updateColumn, dropColumn, columnChangeNeedsRebuild, dropColumnNeedsRebuild, readTableCopy, clearFailedTableCopy, copyTableStep, writeReachesCopy, assertActor, assertWritable, exportRows } from './dataEngine';
7
7
  export type { SqlRow, SqlRunner } from './dataEngine';
8
+ export { DATA_QUERY_PARAM_TYPES, DATA_MAX_QUERIES, DATA_MAX_QUERY_SQL, DATA_MAX_QUERY_PARAMS, DATA_DEFAULT_QUERY_ROWS, compileQuerySql, checkQueryPlan, listQueries, queriesFor, saveQuery, dropQuery, runQuery } from './dataQueries';
9
+ export type { DataQuery, DataQueryInput, DataQueryParam, DataQueryParamType } from './dataQueries';
8
10
  export type { ProjectDatabaseRpc, DatabaseInfo, ExportFile, ExportFormat, ExportState, RestoreResult } from './dataRpc';
11
+ export { DATA_TOOL_DESCRIBE, DATA_TOOL_QUERY, DATA_TOOL_WRITE, DATA_TOOL_ADMIN, DATA_TOOL_NAMES, DATA_TOOL_TITLES, DATA_TOOL_MAX_LIMIT, DATA_ADMIN_ACTIONS, hasDataToolTables, dataToolDefinitions, dataAdminToolDefinition } from './dataTools';
12
+ export type { DataToolDefinition, DataAdminAction } from './dataTools';
13
+ export { DATA_TRIGGER_EVENTS, DATA_TRIGGER_ACTIONS, DATA_MAX_TRIGGERS, DATA_TRIGGER_MAX_DEPTH, DATA_TRIGGER_DEFAULT_RATE, DATA_TRIGGER_MAX_RATE, DATA_OUTBOX_BATCH, DATA_TRIGGER_MAX_MESSAGE_BYTES, utf8Bytes, conditionMatches, renderTriggerText, normaliseTrigger, listTriggers, getTrigger, saveTrigger, dropTrigger, setTriggerEnabled, replaceManagedTriggers, collectTriggerEvents, readOutbox, deleteOutbox, outboxSize, clearOutbox, triggersUsingColumn, renameColumnInTriggers } from './dataTriggers';
14
+ export type { DataTrigger, DataTriggerAction, DataTriggerActionType, DataTriggerCondition, DataTriggerEvent, DataTriggerEventMessage, DataTriggerInput, DataTriggerTemplate, DataTriggerTest, DataTriggerWithSecret, SavedTrigger } from './dataTriggers';
9
15
  //# sourceMappingURL=data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACX,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,SAAS,EACT,aAAa,EACb,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,KAAK,EACN,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,eAAe,EACf,UAAU,EACV,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,QAAQ,EACR,KAAK,EACL,KAAK,EACL,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,UAAU,EACV,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,UAAU,EACX,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtD,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,aAAa,EACd,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACX,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,SAAS,EACT,aAAa,EACb,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,KAAK,EACN,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,eAAe,EACf,UAAU,EACV,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,QAAQ,EACR,KAAK,EACL,KAAK,EACL,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,UAAU,EACV,wBAAwB,EACxB,sBAAsB,EACtB,aA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uB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,YAAY,EACb,MAAM,gBAAgB,CAAC"}
package/dist/data.js CHANGED
@@ -15,7 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.writeReachesCopy = exports.copyTableStep = exports.clearFailedTableCopy = exports.readTableCopy = exports.dropColumnNeedsRebuild = exports.columnChangeNeedsRebuild = exports.dropColumn = exports.updateColumn = exports.addColumn = exports.dropTable = exports.updateTable = exports.createTable = exports.deleteImpact = exports.pruneHistory = exports.rowHistory = exports.write = exports.query = exports.describe = exports.translateSqliteError = exports.normaliseColumn = exports.toTableInput = exports.loadSchema = exports.migrateInternal = exports.setMeta = exports.getMeta = exports.hasInternalTables = exports.INTERNAL_SCHEMA_VERSION = exports.INTERNAL_MIGRATIONS = exports.zoned = exports.tidyArgs = exports.isSensitiveWrite = exports.decodeCursor = exports.encodeCursor = exports.keysetCondition = exports.ftsMatch = exports.rowsPerInsert = exports.chunkRows = exports.sqlLiteral = exports.searchableColumns = exports.ftsTableName = exports.ftsCreateSql = exports.desiredTriggers = exports.desiredIndexes = exports.columnDefinitionSql = exports.createTableSql = exports.isValidIdentifier = exports.identifierIssue = exports.DATA_HIDDEN_COLUMNS = exports.DATA_SYSTEM_COLUMNS = exports.DATA_IDENTIFIER_PATTERN = void 0;
18
- exports.exportRows = exports.assertWritable = exports.assertActor = void 0;
18
+ exports.triggersUsingColumn = exports.clearOutbox = exports.outboxSize = exports.deleteOutbox = exports.readOutbox = exports.collectTriggerEvents = exports.replaceManagedTriggers = exports.setTriggerEnabled = exports.dropTrigger = exports.saveTrigger = exports.getTrigger = exports.listTriggers = exports.normaliseTrigger = exports.renderTriggerText = exports.conditionMatches = exports.utf8Bytes = exports.DATA_TRIGGER_MAX_MESSAGE_BYTES = exports.DATA_OUTBOX_BATCH = exports.DATA_TRIGGER_MAX_RATE = exports.DATA_TRIGGER_DEFAULT_RATE = exports.DATA_TRIGGER_MAX_DEPTH = exports.DATA_MAX_TRIGGERS = exports.DATA_TRIGGER_ACTIONS = exports.DATA_TRIGGER_EVENTS = exports.dataAdminToolDefinition = exports.dataToolDefinitions = exports.hasDataToolTables = exports.DATA_ADMIN_ACTIONS = exports.DATA_TOOL_MAX_LIMIT = exports.DATA_TOOL_TITLES = exports.DATA_TOOL_NAMES = exports.DATA_TOOL_ADMIN = exports.DATA_TOOL_WRITE = exports.DATA_TOOL_QUERY = exports.DATA_TOOL_DESCRIBE = exports.runQuery = exports.dropQuery = exports.saveQuery = exports.queriesFor = exports.listQueries = exports.checkQueryPlan = exports.compileQuerySql = exports.DATA_DEFAULT_QUERY_ROWS = exports.DATA_MAX_QUERY_PARAMS = exports.DATA_MAX_QUERY_SQL = exports.DATA_MAX_QUERIES = exports.DATA_QUERY_PARAM_TYPES = exports.exportRows = exports.assertWritable = exports.assertActor = void 0;
19
+ exports.renameColumnInTriggers = void 0;
19
20
  // Entry point for `@ganju/utils/data`: everything a project's database and
20
21
  // its callers share, without pulling in the rest of the package.
21
22
  __exportStar(require("./dataTypes"), exports);
@@ -76,3 +77,54 @@ Object.defineProperty(exports, "writeReachesCopy", { enumerable: true, get: func
76
77
  Object.defineProperty(exports, "assertActor", { enumerable: true, get: function () { return dataEngine_1.assertActor; } });
77
78
  Object.defineProperty(exports, "assertWritable", { enumerable: true, get: function () { return dataEngine_1.assertWritable; } });
78
79
  Object.defineProperty(exports, "exportRows", { enumerable: true, get: function () { return dataEngine_1.exportRows; } });
80
+ var dataQueries_1 = require("./dataQueries");
81
+ Object.defineProperty(exports, "DATA_QUERY_PARAM_TYPES", { enumerable: true, get: function () { return dataQueries_1.DATA_QUERY_PARAM_TYPES; } });
82
+ Object.defineProperty(exports, "DATA_MAX_QUERIES", { enumerable: true, get: function () { return dataQueries_1.DATA_MAX_QUERIES; } });
83
+ Object.defineProperty(exports, "DATA_MAX_QUERY_SQL", { enumerable: true, get: function () { return dataQueries_1.DATA_MAX_QUERY_SQL; } });
84
+ Object.defineProperty(exports, "DATA_MAX_QUERY_PARAMS", { enumerable: true, get: function () { return dataQueries_1.DATA_MAX_QUERY_PARAMS; } });
85
+ Object.defineProperty(exports, "DATA_DEFAULT_QUERY_ROWS", { enumerable: true, get: function () { return dataQueries_1.DATA_DEFAULT_QUERY_ROWS; } });
86
+ Object.defineProperty(exports, "compileQuerySql", { enumerable: true, get: function () { return dataQueries_1.compileQuerySql; } });
87
+ Object.defineProperty(exports, "checkQueryPlan", { enumerable: true, get: function () { return dataQueries_1.checkQueryPlan; } });
88
+ Object.defineProperty(exports, "listQueries", { enumerable: true, get: function () { return dataQueries_1.listQueries; } });
89
+ Object.defineProperty(exports, "queriesFor", { enumerable: true, get: function () { return dataQueries_1.queriesFor; } });
90
+ Object.defineProperty(exports, "saveQuery", { enumerable: true, get: function () { return dataQueries_1.saveQuery; } });
91
+ Object.defineProperty(exports, "dropQuery", { enumerable: true, get: function () { return dataQueries_1.dropQuery; } });
92
+ Object.defineProperty(exports, "runQuery", { enumerable: true, get: function () { return dataQueries_1.runQuery; } });
93
+ var dataTools_1 = require("./dataTools");
94
+ Object.defineProperty(exports, "DATA_TOOL_DESCRIBE", { enumerable: true, get: function () { return dataTools_1.DATA_TOOL_DESCRIBE; } });
95
+ Object.defineProperty(exports, "DATA_TOOL_QUERY", { enumerable: true, get: function () { return dataTools_1.DATA_TOOL_QUERY; } });
96
+ Object.defineProperty(exports, "DATA_TOOL_WRITE", { enumerable: true, get: function () { return dataTools_1.DATA_TOOL_WRITE; } });
97
+ Object.defineProperty(exports, "DATA_TOOL_ADMIN", { enumerable: true, get: function () { return dataTools_1.DATA_TOOL_ADMIN; } });
98
+ Object.defineProperty(exports, "DATA_TOOL_NAMES", { enumerable: true, get: function () { return dataTools_1.DATA_TOOL_NAMES; } });
99
+ Object.defineProperty(exports, "DATA_TOOL_TITLES", { enumerable: true, get: function () { return dataTools_1.DATA_TOOL_TITLES; } });
100
+ Object.defineProperty(exports, "DATA_TOOL_MAX_LIMIT", { enumerable: true, get: function () { return dataTools_1.DATA_TOOL_MAX_LIMIT; } });
101
+ Object.defineProperty(exports, "DATA_ADMIN_ACTIONS", { enumerable: true, get: function () { return dataTools_1.DATA_ADMIN_ACTIONS; } });
102
+ Object.defineProperty(exports, "hasDataToolTables", { enumerable: true, get: function () { return dataTools_1.hasDataToolTables; } });
103
+ Object.defineProperty(exports, "dataToolDefinitions", { enumerable: true, get: function () { return dataTools_1.dataToolDefinitions; } });
104
+ Object.defineProperty(exports, "dataAdminToolDefinition", { enumerable: true, get: function () { return dataTools_1.dataAdminToolDefinition; } });
105
+ var dataTriggers_1 = require("./dataTriggers");
106
+ Object.defineProperty(exports, "DATA_TRIGGER_EVENTS", { enumerable: true, get: function () { return dataTriggers_1.DATA_TRIGGER_EVENTS; } });
107
+ Object.defineProperty(exports, "DATA_TRIGGER_ACTIONS", { enumerable: true, get: function () { return dataTriggers_1.DATA_TRIGGER_ACTIONS; } });
108
+ Object.defineProperty(exports, "DATA_MAX_TRIGGERS", { enumerable: true, get: function () { return dataTriggers_1.DATA_MAX_TRIGGERS; } });
109
+ Object.defineProperty(exports, "DATA_TRIGGER_MAX_DEPTH", { enumerable: true, get: function () { return dataTriggers_1.DATA_TRIGGER_MAX_DEPTH; } });
110
+ Object.defineProperty(exports, "DATA_TRIGGER_DEFAULT_RATE", { enumerable: true, get: function () { return dataTriggers_1.DATA_TRIGGER_DEFAULT_RATE; } });
111
+ Object.defineProperty(exports, "DATA_TRIGGER_MAX_RATE", { enumerable: true, get: function () { return dataTriggers_1.DATA_TRIGGER_MAX_RATE; } });
112
+ Object.defineProperty(exports, "DATA_OUTBOX_BATCH", { enumerable: true, get: function () { return dataTriggers_1.DATA_OUTBOX_BATCH; } });
113
+ Object.defineProperty(exports, "DATA_TRIGGER_MAX_MESSAGE_BYTES", { enumerable: true, get: function () { return dataTriggers_1.DATA_TRIGGER_MAX_MESSAGE_BYTES; } });
114
+ Object.defineProperty(exports, "utf8Bytes", { enumerable: true, get: function () { return dataTriggers_1.utf8Bytes; } });
115
+ Object.defineProperty(exports, "conditionMatches", { enumerable: true, get: function () { return dataTriggers_1.conditionMatches; } });
116
+ Object.defineProperty(exports, "renderTriggerText", { enumerable: true, get: function () { return dataTriggers_1.renderTriggerText; } });
117
+ Object.defineProperty(exports, "normaliseTrigger", { enumerable: true, get: function () { return dataTriggers_1.normaliseTrigger; } });
118
+ Object.defineProperty(exports, "listTriggers", { enumerable: true, get: function () { return dataTriggers_1.listTriggers; } });
119
+ Object.defineProperty(exports, "getTrigger", { enumerable: true, get: function () { return dataTriggers_1.getTrigger; } });
120
+ Object.defineProperty(exports, "saveTrigger", { enumerable: true, get: function () { return dataTriggers_1.saveTrigger; } });
121
+ Object.defineProperty(exports, "dropTrigger", { enumerable: true, get: function () { return dataTriggers_1.dropTrigger; } });
122
+ Object.defineProperty(exports, "setTriggerEnabled", { enumerable: true, get: function () { return dataTriggers_1.setTriggerEnabled; } });
123
+ Object.defineProperty(exports, "replaceManagedTriggers", { enumerable: true, get: function () { return dataTriggers_1.replaceManagedTriggers; } });
124
+ Object.defineProperty(exports, "collectTriggerEvents", { enumerable: true, get: function () { return dataTriggers_1.collectTriggerEvents; } });
125
+ Object.defineProperty(exports, "readOutbox", { enumerable: true, get: function () { return dataTriggers_1.readOutbox; } });
126
+ Object.defineProperty(exports, "deleteOutbox", { enumerable: true, get: function () { return dataTriggers_1.deleteOutbox; } });
127
+ Object.defineProperty(exports, "outboxSize", { enumerable: true, get: function () { return dataTriggers_1.outboxSize; } });
128
+ Object.defineProperty(exports, "clearOutbox", { enumerable: true, get: function () { return dataTriggers_1.clearOutbox; } });
129
+ Object.defineProperty(exports, "triggersUsingColumn", { enumerable: true, get: function () { return dataTriggers_1.triggersUsingColumn; } });
130
+ Object.defineProperty(exports, "renameColumnInTriggers", { enumerable: true, get: function () { return dataTriggers_1.renameColumnInTriggers; } });
package/dist/dataApi.d.ts CHANGED
@@ -6,7 +6,7 @@ export interface DataApiRoute {
6
6
  path: string;
7
7
  summary: string;
8
8
  description?: string;
9
- tag: 'Database' | 'Tables' | 'Rows' | 'History and export';
9
+ tag: 'Database' | 'Tables' | 'Rows' | 'Queries' | 'Triggers' | 'History and export';
10
10
  body?: z.ZodType;
11
11
  query?: z.ZodObject;
12
12
  returns: string;
@@ -35,6 +35,17 @@ export declare const DATA_API_ROUTES: {
35
35
  readonly returns: "{ database }";
36
36
  readonly status: 201;
37
37
  };
38
+ readonly updateDatabase: {
39
+ readonly method: "patch";
40
+ readonly path: "";
41
+ readonly tag: "Database";
42
+ readonly summary: "Change the database's settings";
43
+ readonly description: "`timeZone`, an IANA zone such as `America/Bogota`, or null for UTC. Datetimes come back in it for callers that send no `timeZone` of their own: the assistant, functions and scripts. Datetimes without an offset are read in it too.";
44
+ readonly body: z.ZodObject<{
45
+ timeZone: z.ZodNullable<z.ZodString>;
46
+ }, z.core.$strict>;
47
+ readonly returns: "{ database }";
48
+ };
38
49
  readonly remove: {
39
50
  readonly method: "delete";
40
51
  readonly path: "";
@@ -396,6 +407,194 @@ export declare const DATA_API_ROUTES: {
396
407
  }, z.core.$strict>;
397
408
  readonly returns: "{ results }";
398
409
  };
410
+ readonly listQueries: {
411
+ readonly method: "get";
412
+ readonly path: "/query";
413
+ readonly tag: "Queries";
414
+ readonly summary: "Named queries";
415
+ readonly description: "Each with its SQL, parameters, the tables it reads and its plan (`SCAN orders` means it reads the whole table).";
416
+ readonly returns: "{ queries }";
417
+ };
418
+ readonly saveQuery: {
419
+ readonly method: "post";
420
+ readonly path: "/query";
421
+ readonly tag: "Queries";
422
+ readonly summary: "Save a named query";
423
+ readonly description: "One `SELECT` (or `WITH … SELECT`) with named parameters such as `:from`, each declared in `params` with its type. It is compiled, never run, and refused unless it only reads this database's tables. Saving under an existing name replaces it. `assistant: true` lets channel bots run it from data-query.";
424
+ readonly body: z.ZodObject<{
425
+ name: z.ZodString;
426
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
427
+ sql: z.ZodString;
428
+ params: z.ZodOptional<z.ZodArray<z.ZodObject<{
429
+ name: z.ZodString;
430
+ type: z.ZodEnum<{
431
+ boolean: "boolean";
432
+ text: "text";
433
+ integer: "integer";
434
+ decimal: "decimal";
435
+ date: "date";
436
+ datetime: "datetime";
437
+ }>;
438
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
439
+ required: z.ZodOptional<z.ZodBoolean>;
440
+ }, z.core.$strict>>>;
441
+ assistant: z.ZodOptional<z.ZodBoolean>;
442
+ }, z.core.$strict>;
443
+ readonly returns: "{ query }";
444
+ readonly status: 201;
445
+ };
446
+ readonly dropQuery: {
447
+ readonly method: "delete";
448
+ readonly path: "/query/:name";
449
+ readonly tag: "Queries";
450
+ readonly summary: "Delete a named query";
451
+ readonly returns: "{ dropped }";
452
+ };
453
+ readonly runQuery: {
454
+ readonly method: "post";
455
+ readonly path: "/query/:name/run";
456
+ readonly tag: "Queries";
457
+ readonly summary: "Run a named query";
458
+ readonly description: "With its `params`, up to `limit` rows (100 by default, 500 at most) and 1 MB; `truncated` says it stopped early. A query that would scan a table over 200,000 rows is refused.";
459
+ readonly body: z.ZodObject<{
460
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
461
+ limit: z.ZodOptional<z.ZodNumber>;
462
+ timeZone: z.ZodOptional<z.ZodString>;
463
+ }, z.core.$strict>;
464
+ readonly returns: "{ query, rows, truncated? }";
465
+ };
466
+ readonly listTriggers: {
467
+ readonly method: "get";
468
+ readonly path: "/trigger";
469
+ readonly tag: "Triggers";
470
+ readonly summary: "Triggers";
471
+ readonly description: "Each with its table, event, condition and action. `pending` counts events not yet handed to the queue. Webhook secrets are never listed.";
472
+ readonly returns: "{ triggers, pending }";
473
+ };
474
+ readonly saveTrigger: {
475
+ readonly method: "post";
476
+ readonly path: "/trigger";
477
+ readonly tag: "Triggers";
478
+ readonly summary: "Save a trigger";
479
+ readonly description: "Runs one action when rows of `table` are inserted, updated or deleted, and `when` holds: `{ \"status\": { \"changedTo\": \"READY\" } }` fires on the transition only; `changedFrom`, `changed: true` and `equals` test a column too, and `all` / `any` combine them. The action is one of `function` (a function of this project, given `{ event, table, row, previous, actor, eventId, triggerId }`), `webhook` (an https URL, sent a POST signed in `x-ganju-signature`), `chat` (`{ channelId, chatId, text }`), `email` (`{ to, subject, text }`) or `customer` (`{ text, template? }`, to the row's customer on a customer-scoped table). Texts take `{{field}}` from the row, inserted as plain text. Saving under an existing name replaces it, unless `replace` is false; with no `name`, it always creates a new trigger, named from the table, event and action and numbered past those taken. Left out, `enabled` keeps a saved trigger on or off as it was. A new webhook answers with its signing `secret`, shown this once. Delivery is at least once: every event carries an `eventId`.";
480
+ readonly body: z.ZodObject<{
481
+ name: z.ZodOptional<z.ZodString>;
482
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
483
+ table: z.ZodString;
484
+ on: z.ZodEnum<{
485
+ insert: "insert";
486
+ update: "update";
487
+ delete: "delete";
488
+ }>;
489
+ when: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
490
+ enabled: z.ZodOptional<z.ZodBoolean>;
491
+ replace: z.ZodOptional<z.ZodBoolean>;
492
+ rateLimit: z.ZodOptional<z.ZodNumber>;
493
+ function: z.ZodOptional<z.ZodString>;
494
+ webhook: z.ZodOptional<z.ZodURL>;
495
+ chat: z.ZodOptional<z.ZodObject<{
496
+ channelId: z.ZodString;
497
+ chatId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
498
+ text: z.ZodString;
499
+ }, z.core.$strict>>;
500
+ email: z.ZodOptional<z.ZodObject<{
501
+ to: z.ZodUnion<readonly [z.ZodEmail, z.ZodArray<z.ZodEmail>]>;
502
+ subject: z.ZodOptional<z.ZodString>;
503
+ text: z.ZodString;
504
+ }, z.core.$strict>>;
505
+ customer: z.ZodOptional<z.ZodObject<{
506
+ text: z.ZodString;
507
+ template: z.ZodOptional<z.ZodObject<{
508
+ name: z.ZodString;
509
+ language: z.ZodString;
510
+ params: z.ZodOptional<z.ZodArray<z.ZodString>>;
511
+ }, z.core.$strict>>;
512
+ }, z.core.$strict>>;
513
+ }, z.core.$strict>;
514
+ readonly returns: "{ trigger, secret? }";
515
+ readonly status: 201;
516
+ };
517
+ readonly updateTrigger: {
518
+ readonly method: "patch";
519
+ readonly path: "/trigger/:name";
520
+ readonly tag: "Triggers";
521
+ readonly summary: "Turn a trigger on or off";
522
+ readonly description: "Turning one back on clears why Ganju turned it off (20 failed runs in a row).";
523
+ readonly body: z.ZodObject<{
524
+ enabled: z.ZodBoolean;
525
+ }, z.core.$strict>;
526
+ readonly returns: "{ trigger }";
527
+ };
528
+ readonly dropTrigger: {
529
+ readonly method: "delete";
530
+ readonly path: "/trigger/:name";
531
+ readonly tag: "Triggers";
532
+ readonly summary: "Delete a trigger";
533
+ readonly returns: "{ dropped }";
534
+ };
535
+ readonly deployTriggers: {
536
+ readonly method: "post";
537
+ readonly path: "/trigger/deploy";
538
+ readonly tag: "Triggers";
539
+ readonly summary: "Deploy the triggers of ganju.json";
540
+ readonly description: "What `ganju deploy` sends: every trigger listed is saved as managed by the CLI, and the CLI's earlier ones not listed are deleted. Triggers made in the dashboard are left alone. All or nothing. New webhooks' secrets come back once, by name.";
541
+ readonly body: z.ZodObject<{
542
+ triggers: z.ZodArray<z.ZodObject<{
543
+ name: z.ZodOptional<z.ZodString>;
544
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
545
+ table: z.ZodString;
546
+ on: z.ZodEnum<{
547
+ insert: "insert";
548
+ update: "update";
549
+ delete: "delete";
550
+ }>;
551
+ when: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
552
+ enabled: z.ZodOptional<z.ZodBoolean>;
553
+ replace: z.ZodOptional<z.ZodBoolean>;
554
+ rateLimit: z.ZodOptional<z.ZodNumber>;
555
+ function: z.ZodOptional<z.ZodString>;
556
+ webhook: z.ZodOptional<z.ZodURL>;
557
+ chat: z.ZodOptional<z.ZodObject<{
558
+ channelId: z.ZodString;
559
+ chatId: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
560
+ text: z.ZodString;
561
+ }, z.core.$strict>>;
562
+ email: z.ZodOptional<z.ZodObject<{
563
+ to: z.ZodUnion<readonly [z.ZodEmail, z.ZodArray<z.ZodEmail>]>;
564
+ subject: z.ZodOptional<z.ZodString>;
565
+ text: z.ZodString;
566
+ }, z.core.$strict>>;
567
+ customer: z.ZodOptional<z.ZodObject<{
568
+ text: z.ZodString;
569
+ template: z.ZodOptional<z.ZodObject<{
570
+ name: z.ZodString;
571
+ language: z.ZodString;
572
+ params: z.ZodOptional<z.ZodArray<z.ZodString>>;
573
+ }, z.core.$strict>>;
574
+ }, z.core.$strict>>;
575
+ }, z.core.$strict>>;
576
+ }, z.core.$strict>;
577
+ readonly returns: "{ triggers, removed, secrets }";
578
+ };
579
+ readonly listTriggerRuns: {
580
+ readonly method: "get";
581
+ readonly path: "/trigger/:name/run";
582
+ readonly tag: "Triggers";
583
+ readonly summary: "A trigger's recent runs";
584
+ readonly description: "Newest first, up to 50: `ok`, `failed` with its error, `skipped`, or `running`.";
585
+ readonly query: z.ZodObject<{
586
+ limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
587
+ }, z.core.$strip>;
588
+ readonly returns: "{ runs }";
589
+ };
590
+ readonly retryTriggerRun: {
591
+ readonly method: "post";
592
+ readonly path: "/trigger/:name/run/:runId/retry";
593
+ readonly tag: "Triggers";
594
+ readonly summary: "Run a failed event again";
595
+ readonly description: "The same event, with the same `eventId`.";
596
+ readonly returns: "{ run }";
597
+ };
399
598
  readonly startExport: {
400
599
  readonly method: "post";
401
600
  readonly path: "/export";
@@ -1 +1 @@
1
- {"version":3,"file":"dataApi.d.ts","sourceRoot":"","sources":["../src/dataApi.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MA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