@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.
- package/dist/constants.d.ts +9 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +26 -2
- package/dist/customCodeToken.d.ts +15 -0
- package/dist/customCodeToken.d.ts.map +1 -1
- package/dist/customCodeToken.js +49 -1
- package/dist/data.d.ts +6 -0
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +53 -1
- package/dist/dataApi.d.ts +200 -1
- package/dist/dataApi.d.ts.map +1 -1
- package/dist/dataApi.js +106 -1
- package/dist/dataCompiler.d.ts.map +1 -1
- package/dist/dataCompiler.js +5 -1
- package/dist/dataCsv.d.ts +20 -0
- package/dist/dataCsv.d.ts.map +1 -0
- package/dist/dataCsv.js +102 -0
- package/dist/dataDdl.d.ts.map +1 -1
- package/dist/dataDdl.js +3 -1
- package/dist/dataEngine.d.ts.map +1 -1
- package/dist/dataEngine.js +86 -4
- package/dist/dataImport.d.ts +2 -0
- package/dist/dataImport.d.ts.map +1 -1
- package/dist/dataImport.js +4 -1
- package/dist/dataQueries.d.ts +73 -0
- package/dist/dataQueries.d.ts.map +1 -0
- package/dist/dataQueries.js +513 -0
- package/dist/dataRpc.d.ts +44 -0
- package/dist/dataRpc.d.ts.map +1 -1
- package/dist/dataTools.d.ts +40 -0
- package/dist/dataTools.d.ts.map +1 -0
- package/dist/dataTools.js +280 -0
- package/dist/dataTriggers.d.ts +203 -0
- package/dist/dataTriggers.d.ts.map +1 -0
- package/dist/dataTriggers.js +760 -0
- package/dist/dataTypes.d.ts +3 -0
- package/dist/dataTypes.d.ts.map +1 -1
- package/dist/index.d.ts +201 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/localizeDataError.d.ts +18 -0
- package/dist/localizeDataError.d.ts.map +1 -0
- package/dist/localizeDataError.js +359 -0
- package/dist/schema.d.ts +201 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +149 -1
- package/dist/sdkConstants.d.ts +3 -0
- package/dist/sdkConstants.d.ts.map +1 -1
- package/dist/sdkConstants.js +4 -1
- package/package.json +1 -1
- package/src/constants.ts +30 -2
- package/src/customCodeToken.ts +87 -0
- package/src/data.ts +74 -0
- package/src/dataApi.ts +129 -2
- package/src/dataCompiler.ts +5 -1
- package/src/dataCsv.ts +99 -0
- package/src/dataDdl.ts +3 -1
- package/src/dataEngine.ts +94 -4
- package/src/dataImport.ts +3 -0
- package/src/dataQueries.ts +730 -0
- package/src/dataRpc.ts +26 -0
- package/src/dataTools.ts +338 -0
- package/src/dataTriggers.ts +1134 -0
- package/src/dataTypes.ts +9 -0
- package/src/index.ts +11 -1
- package/src/localizeDataError.ts +593 -0
- package/src/schema.ts +158 -1
- package/src/sdkConstants.ts +3 -0
package/src/dataTypes.ts
CHANGED
|
@@ -104,6 +104,9 @@ export interface DataTable {
|
|
|
104
104
|
|
|
105
105
|
export interface DataSchema {
|
|
106
106
|
tables: DataTable[];
|
|
107
|
+
// The zone the owner set for the database: datetimes come back in it for
|
|
108
|
+
// callers that send none. Null when unset (UTC).
|
|
109
|
+
timeZone?: string | null;
|
|
107
110
|
}
|
|
108
111
|
|
|
109
112
|
// Who is calling and under which rules. `actor` is recorded on every row a
|
|
@@ -116,8 +119,14 @@ export interface DataCaller {
|
|
|
116
119
|
restricted?: boolean;
|
|
117
120
|
// Customer-scoped tables: fill and filter `participant_id` with this.
|
|
118
121
|
participantId?: string;
|
|
122
|
+
// Only these tables exist for the caller (a function's `data.tables`):
|
|
123
|
+
// every other one is hidden, through relations and filters too.
|
|
124
|
+
tables?: string[];
|
|
119
125
|
// Datetimes come back in this zone, with the offset.
|
|
120
126
|
timeZone?: string;
|
|
127
|
+
// A function a trigger ran: how deep in a chain of triggers its writes
|
|
128
|
+
// are (its actor is `trigger:<id>`).
|
|
129
|
+
triggerDepth?: number;
|
|
121
130
|
limits?: DataCallerLimits;
|
|
122
131
|
}
|
|
123
132
|
|
package/src/index.ts
CHANGED
|
@@ -109,12 +109,17 @@ import {
|
|
|
109
109
|
import {
|
|
110
110
|
mintCustomCodeToken,
|
|
111
111
|
verifyCustomCodeToken,
|
|
112
|
+
mintCustomCodeCallToken,
|
|
113
|
+
verifyCustomCodeCallToken,
|
|
112
114
|
customCodeScriptName,
|
|
113
115
|
customCodePreviewScriptName,
|
|
114
116
|
customCodeUploadName,
|
|
115
117
|
customCodePreviewUploadName
|
|
116
118
|
} from './customCodeToken';
|
|
117
|
-
import type {
|
|
119
|
+
import type {
|
|
120
|
+
CustomCodeCallPayload,
|
|
121
|
+
CustomCodeTokenPayload
|
|
122
|
+
} from './customCodeToken';
|
|
118
123
|
import {
|
|
119
124
|
mintContainmentToken,
|
|
120
125
|
verifyContainmentToken
|
|
@@ -160,6 +165,7 @@ import { formatRelative } from './formatRelative';
|
|
|
160
165
|
import { formatRelativeTime } from './formatRelativeTime';
|
|
161
166
|
import { languageCookieDomain } from './languageCookieDomain';
|
|
162
167
|
import { localizeZodIssue, languageFromHeader } from './localizeZodIssue';
|
|
168
|
+
import { localizeDataError } from './localizeDataError';
|
|
163
169
|
import { slugifyTitle } from './slugifyTitle';
|
|
164
170
|
import { resourceUriFromTitle } from './resourceUri';
|
|
165
171
|
import {
|
|
@@ -411,6 +417,8 @@ export const utils = {
|
|
|
411
417
|
listResourcesPage,
|
|
412
418
|
mintCustomCodeToken,
|
|
413
419
|
verifyCustomCodeToken,
|
|
420
|
+
mintCustomCodeCallToken,
|
|
421
|
+
verifyCustomCodeCallToken,
|
|
414
422
|
customCodeScriptName,
|
|
415
423
|
customCodePreviewScriptName,
|
|
416
424
|
customCodeUploadName,
|
|
@@ -444,6 +452,7 @@ export const utils = {
|
|
|
444
452
|
languageCookieDomain,
|
|
445
453
|
localizeZodIssue,
|
|
446
454
|
languageFromHeader,
|
|
455
|
+
localizeDataError,
|
|
447
456
|
slugifyTitle,
|
|
448
457
|
resourceUriFromTitle,
|
|
449
458
|
accessTokenHint,
|
|
@@ -657,6 +666,7 @@ export type {
|
|
|
657
666
|
CustomCodeManifest,
|
|
658
667
|
CustomCodeSendFile,
|
|
659
668
|
CustomCodeCreateResource,
|
|
669
|
+
CustomCodeCallPayload,
|
|
660
670
|
CustomCodeTokenPayload,
|
|
661
671
|
ContainmentTokenPayload,
|
|
662
672
|
OAuthProviderConfig,
|