better-supabase 0.37.0 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-sdk/agents/index.d.ts +2 -2
- package/dist/{app-tables-BlhdqqHf.d.ts → app-tables-BeLFmp0l.d.ts} +1 -1
- package/dist/{authorization-C7yjZttV.d.ts → authorization-DQZ8Lrp5.d.ts} +46 -6
- package/dist/{bind-BspFMDdW.d.ts → bind-DsDKjuQn.d.ts} +1 -1
- package/dist/{block-env-CLco8YUl.d.ts → block-env-mNi2rPSF.d.ts} +3 -3
- package/dist/block-subjects-CINiJW1R.js +253 -0
- package/dist/{block-tables-DfomofFv.d.ts → block-tables-DYFRvRWW.d.ts} +1 -1
- package/dist/blocks/ai-chat/index.d.ts +3 -3
- package/dist/blocks/announcements/index.d.ts +3 -3
- package/dist/blocks/api-keys/index.d.ts +1 -1
- package/dist/blocks/attachments/index.d.ts +1 -1
- package/dist/blocks/audit/index.d.ts +2 -2
- package/dist/blocks/automations/index.d.ts +1 -1
- package/dist/blocks/billing/index.d.ts +1 -1
- package/dist/blocks/bookings/index.d.ts +1 -1
- package/dist/blocks/calendar/index.d.ts +1 -1
- package/dist/blocks/catalog/index.d.ts +29 -5
- package/dist/blocks/catalog/index.js +42 -9
- package/dist/blocks/comments/index.d.ts +4 -4
- package/dist/blocks/entitlements/index.d.ts +2 -2
- package/dist/blocks/expenses/index.d.ts +2 -0
- package/dist/blocks/expenses/index.js +10 -3
- package/dist/blocks/forms/index.d.ts +1 -1
- package/dist/blocks/inbox/index.d.ts +4 -4
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/invoices/index.d.ts +15 -1
- package/dist/blocks/invoices/index.js +14 -1
- package/dist/blocks/leave/index.d.ts +35 -1
- package/dist/blocks/leave/index.js +18 -3
- package/dist/blocks/messaging/index.d.ts +4 -4
- package/dist/blocks/mfa/index.d.ts +1 -1
- package/dist/blocks/notifications/index.d.ts +3 -3
- package/dist/blocks/onboarding/index.d.ts +1 -1
- package/dist/blocks/organizations/index.d.ts +2 -2
- package/dist/blocks/permissions/index.d.ts +1 -1
- package/dist/blocks/push/index.d.ts +1 -1
- package/dist/blocks/reactions/index.d.ts +3 -3
- package/dist/blocks/saved-views/index.d.ts +1 -1
- package/dist/blocks/search/index.d.ts +2 -2
- package/dist/blocks/sessions/index.d.ts +1 -1
- package/dist/blocks/settings/index.d.ts +1 -1
- package/dist/blocks/subjects/index.d.ts +1 -1
- package/dist/blocks/tags/index.d.ts +1 -1
- package/dist/blocks/undo/index.d.ts +1 -1
- package/dist/blocks/usage/index.d.ts +1 -1
- package/dist/blocks/workflow-editor/index.d.ts +3 -3
- package/dist/blocks/workflows/index.d.ts +3 -3
- package/dist/claims/index.d.ts +3 -3
- package/dist/cli/add-BCkaPIvM.js +1 -0
- package/dist/cli/{add-DqfJVb1F.js → add-Ba8xoX4q.js} +10 -10
- package/dist/cli/{add-Buuy7BSU.js → add-DKlk-VV9.js} +2 -2
- package/dist/cli/{app-table-files-Ku-4tPUu.js → app-table-files-Dw02ao0W.js} +2 -2
- package/dist/cli/{app-tables-Dg0sh4dH.js → app-tables-iSQ0c7G3.js} +2 -2
- package/dist/cli/{backfill-Dspz6kVJ.js → backfill-sYQgRuGd.js} +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-CqVBlc4L.js → blocks-BAj3U18j.js} +1 -1
- package/dist/cli/{blocks-B8LAph-w.js → blocks-YKQzZhPK.js} +1 -1
- package/dist/cli/{cache-BbuuCIRU.js → cache-BFSbb4is.js} +1 -1
- package/dist/cli/{codemod-DIAy8uXt.js → codemod-vbToOtFK.js} +1 -1
- package/dist/cli/{content-mapper-NXfJ5VkP.js → content-mapper-COnyl3V7.js} +2 -2
- package/dist/cli/{doctor-CUOyLE0c.js → doctor-BTGesU_-.js} +15 -15
- package/dist/cli/{gen-s9canfdC.js → gen-h1Ncsh1X.js} +11 -11
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/{init-Zs0Ca5on.js → init-DCy-FlB2.js} +8 -8
- package/dist/cli/{live-BaLsNove.js → live-BUOVB-DV.js} +2 -2
- package/dist/cli/{mcp-ST7bVpJD.js → mcp-CLAjfETj.js} +2 -2
- package/dist/cli/{metadata-aOvlCOOg.js → metadata-DqcJb3p5.js} +3 -3
- package/dist/cli/{migrate-ClBx3Ggx.js → migrate-dI1IaRan.js} +1 -1
- package/dist/cli/{migration-safety-mjm1pghO.js → migration-safety-Cj2AZdIH.js} +1 -1
- package/dist/cli/{migrations-tzItvwxT.js → migrations-CFIlnOmr.js} +2 -2
- package/dist/cli/{module-migration-D0Rjdvdx.js → module-migration-DteyIWzV.js} +2 -2
- package/dist/cli/powersync-D-1aQ3C6.js +1 -0
- package/dist/cli/{powersync-DryX_DMG.js → powersync-DWFvtUuZ.js} +3 -3
- package/dist/cli/{print-fOUnKwA9.js → print-DUUGo-bA.js} +2 -2
- package/dist/cli/{providers-BR1d_5jA.js → providers-B4q4yMUv.js} +1 -1
- package/dist/cli/{prune-workflows-CCjzNrxl.js → prune-workflows-DhJX2wAQ.js} +1 -1
- package/dist/cli/{remove-B_0OIusa.js → remove-BsAhvYpx.js} +5 -5
- package/dist/cli/{render-BCJKDX3c.js → render-CvRXYRSy.js} +3 -3
- package/dist/cli/{run-BctvQX_g.js → run-BY0fbQxQ.js} +27 -27
- package/dist/cli/{run-4VUQTR-R.js → run-DxWZi4IJ.js} +9 -9
- package/dist/cli/{shared-oY7PGamd.js → shared-C_9DBYw-.js} +1 -1
- package/dist/cli/{snapshot-CWtER9-4.js → snapshot-BAFwCE0l.js} +2 -2
- package/dist/cli/{source-D4uav_v9.js → source-CpnSlB6J.js} +1 -1
- package/dist/cli/{spec-BPsyEzqH.js → spec-BMBYao_7.js} +1 -1
- package/dist/cli/{spec-DTnBeaCD.js → spec-SNEhNUFc.js} +2 -2
- package/dist/cli/{sql-layout-DbhEQqq0.js → sql-layout-CKFIMA8Y.js} +2 -2
- package/dist/cli/{sync-CazH5FX4.js → sync-DMMrYcyr.js} +4 -4
- package/dist/cli/{upgrade-Dyb4-f0Q.js → upgrade-C1sSWUgx.js} +2 -2
- package/dist/cli/{upgrade-Cyx6ESpc.js → upgrade-D9tsBxs0.js} +5 -5
- package/dist/cli/{version-D1ZKUFng.js → version-DnpEuhUA.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/native/index.d.ts +4 -4
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +4 -4
- package/dist/{config-Dx3bEPlX.js → config-1-UmQczM.js} +1 -1
- package/dist/{config-uSliwPS6.js → config-AEB5iNEO.js} +4 -123
- package/dist/{context-D6OZQdcT.d.ts → context-Cln1eg7-.d.ts} +1 -1
- package/dist/contract/index.d.ts +3 -3
- package/dist/{controller-DhcSXkAC.d.ts → controller-BQHh7VG5.d.ts} +1 -1
- package/dist/create/index.d.ts +3 -3
- package/dist/create/index.js +3 -3
- package/dist/create/lite/index.d.ts +3 -3
- package/dist/create/lite/index.js +2 -2
- package/dist/{entitlements-Bi4y8w8e.d.ts → entitlements-aN3jHcYL.d.ts} +1 -1
- package/dist/{field-errors-CJ_i6HFg.d.ts → field-errors-0V7t1-pz.d.ts} +4 -4
- package/dist/{index-Bm1ftdBA.d.ts → index-3JE4ptwV.d.ts} +2 -2
- package/dist/{index-DrDCN45q.d.ts → index-C0jB70wR.d.ts} +1 -1
- package/dist/{index-Bc5t2QRU.d.ts → index-CCb0JjiX.d.ts} +6 -6
- package/dist/{index-ChvuVimY.d.ts → index-D1harGe_.d.ts} +2 -2
- package/dist/{index-CRwpDGxd.d.ts → index-DWCo9ZUL.d.ts} +1 -1
- package/dist/{index-C71uHfVj.d.ts → index-DoDmA-sQ.d.ts} +2 -2
- package/dist/{index-Cbwvf4yE.d.ts → index-hmnB81h6.d.ts} +1 -1
- package/dist/{instances-DKULdpWB.js → instances-Bycf_aus.js} +13 -1
- package/dist/mapper/bin.js +5 -5
- package/dist/mcp/index.d.ts +1 -1
- package/dist/next/index.d.ts +4 -4
- package/dist/{operations-BDjgCmT9.d.ts → operations-TlhX7IZX.d.ts} +1 -1
- package/dist/{options-X61tvckX.js → options-BXbixNrP.js} +3 -1
- package/dist/{options-RYbyaVhv.js → options-CYZH9uxU.js} +3 -1
- package/dist/{options-CEwoGUk_.js → options-DiEoDCtf.js} +4 -1
- package/dist/{options-ScQ6Hnxo.js → options-zsLpIqBA.js} +2 -1
- package/dist/otel/index.js +4 -4
- package/dist/{permissions-BGx22GP3.d.ts → permissions-CwlRRwvr.d.ts} +1 -1
- package/dist/{ports-D63bA3p4.d.ts → ports-rJDkwtOQ.d.ts} +1 -1
- package/dist/powersync/index.d.ts +2 -2
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.js +3 -3
- package/dist/{preset-oc_liUHz.js → preset-DkeXFh7e.js} +2 -2
- package/dist/{project-Cs0kz5OP.js → project-Bcs-4Pfw.js} +5 -5
- package/dist/{push-token-BsyX0KlT.d.ts → push-token-BLQ09NeA.d.ts} +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/server.d.ts +5 -5
- package/dist/realtime/index.d.ts +3 -3
- package/dist/records/index.d.ts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/solid/index.d.ts +5 -5
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +3 -3
- package/dist/{sql-CWYbu_6y.js → sql-D-_Egz0E.js} +552 -108
- package/dist/ssr/index.d.ts +1 -1
- package/dist/svelte/index.d.ts +5 -5
- package/dist/{tenant-DqnE50Ju.d.ts → tenant-BkW_auBX.d.ts} +1 -1
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +1 -1
- package/dist/{topic-Dp7VGPd-.d.ts → topic-L_8Qs5qs.d.ts} +1 -1
- package/dist/{types-DLXTmZtm.d.ts → types--PUNrvz8.d.ts} +2 -2
- package/dist/vue/index.d.ts +5 -5
- package/dist/{watch-topic-CtJAkWT4.d.ts → watch-topic-B9aKuw5v.d.ts} +1 -1
- package/dist/workflow-sdk/world/index.js +1 -1
- package/dist/{workflow-sdk-pB1jCLIL.js → workflow-sdk-6psRpDIo.js} +1 -69
- package/dist/yjs/index.d.ts +1 -1
- package/package.json +1 -1
- package/schemas/config-v1.json +19 -0
- package/dist/cli/add-8zKWiO0X.js +0 -1
- package/dist/cli/powersync-vvu2-72V.js +0 -1
- package/dist/resolved-names-sd6RuTju.js +0 -130
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as dbError } from "../../errors-B7tCfCvX.js";
|
|
2
2
|
import { n as isRecord } from "../../guards-CsRa6v57.js";
|
|
3
|
-
import { t as AsyncResult } from "../../result-8xza7w5W.js";
|
|
4
|
-
import { t as catalogSqlOptions } from "../../options-
|
|
3
|
+
import { a as ok, r as err, t as AsyncResult } from "../../result-8xza7w5W.js";
|
|
4
|
+
import { t as catalogSqlOptions } from "../../options-DiEoDCtf.js";
|
|
5
5
|
import { n as event, t as defineEvents } from "../../event-map-DxfsFgQT.js";
|
|
6
6
|
import { A as recordsOf, I as stringsOf, L as textOf, O as recordOf, T as pageOf, U as rpcTransport, V as dbTransport, W as sqlTransport, d as enumOrThrow, h as instantOf, m as instantArg, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
|
|
7
7
|
import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-CadxQ9-_.js";
|
|
@@ -11,6 +11,28 @@ import { n as defineBlock } from "../../define-block-22Jv4U_-.js";
|
|
|
11
11
|
import { t as rankBetweenResult } from "../../rank-result-DzaTKKhH.js";
|
|
12
12
|
import { d as money } from "../../money-DH--bbYr.js";
|
|
13
13
|
import { a as optionalAmountText, o as optionalMoneyOf, t as amountText } from "../../money-codec-SKPm8FPw.js";
|
|
14
|
+
// src/blocks/catalog/rank.ts
|
|
15
|
+
const WHOLE_RANK = /^-?[0-9]{1,9}$/u;
|
|
16
|
+
const MAX_POSITION = 999999999;
|
|
17
|
+
const rankInvalid = (message) => err(dbError("invalid_request", message, { hint: "RANK_KEY_INVALID" }));
|
|
18
|
+
const isPosition = (value) => Number.isSafeInteger(value) && Math.abs(value) <= MAX_POSITION;
|
|
19
|
+
/**
|
|
20
|
+
* The rank key a rank method writes: a base-62 key between the neighbors, or
|
|
21
|
+
* with integer ranks the position, or a whole number between the neighbors.
|
|
22
|
+
*/
|
|
23
|
+
function catalogRankKey(rank, type) {
|
|
24
|
+
if ("position" in rank) {
|
|
25
|
+
if (type !== "integer") return rankInvalid("a position needs blocks.catalog.options.rankType: \"integer\"; pass previous and next rank keys");
|
|
26
|
+
return isPosition(rank.position) ? ok(String(rank.position)) : rankInvalid("a position is a whole number of up to nine digits");
|
|
27
|
+
}
|
|
28
|
+
if (type === "text") return rankBetweenResult(rank);
|
|
29
|
+
const bound = (value) => value === null || value === void 0 ? null : WHOLE_RANK.test(value) ? Number(value) : void 0;
|
|
30
|
+
const previous = bound(rank.previous);
|
|
31
|
+
const next = bound(rank.next);
|
|
32
|
+
if (previous === void 0 || next === void 0) return rankInvalid("integer rank keys are whole numbers of up to nine digits");
|
|
33
|
+
const key = previous === null ? next === null ? 1 : next - 1 : next === null ? previous + 1 : next - previous >= 2 ? Math.floor((previous + next) / 2) : void 0;
|
|
34
|
+
return key === void 0 ? rankInvalid(`no whole number lies between ${String(previous)} and ${String(next)}; pass a position`) : isPosition(key) ? ok(String(key)) : rankInvalid("a position is a whole number of up to nine digits");
|
|
35
|
+
}
|
|
14
36
|
// src/blocks/catalog/catalog.ts
|
|
15
37
|
const PRODUCT_KINDS = [
|
|
16
38
|
"physical",
|
|
@@ -157,6 +179,7 @@ function createCatalog(options) {
|
|
|
157
179
|
applyTemporal(options);
|
|
158
180
|
const call = blockCall(options.transport, options.schema, options.mappers);
|
|
159
181
|
const fields = blockFields(options.fields, "product fields");
|
|
182
|
+
const rankOf = (rank) => catalogRankKey(rank, options.rankType ?? "text");
|
|
160
183
|
const saveProduct = (organizationId, productId, { title, slug, description, kind, price, trackInventory, ...extra }) => {
|
|
161
184
|
const clear = [
|
|
162
185
|
["price", price],
|
|
@@ -190,6 +213,16 @@ function createCatalog(options) {
|
|
|
190
213
|
from: enumOrThrow(row["from"], PRODUCT_STATUSES, "status")
|
|
191
214
|
};
|
|
192
215
|
}),
|
|
216
|
+
setVariantStatus: (variantId, status) => call("set_variant_status", {
|
|
217
|
+
variant: variantId,
|
|
218
|
+
status
|
|
219
|
+
}, (value) => {
|
|
220
|
+
const row = recordOf(value, "set_variant_status");
|
|
221
|
+
return {
|
|
222
|
+
status: textOf(row["status"]),
|
|
223
|
+
from: textOf(row["from"])
|
|
224
|
+
};
|
|
225
|
+
}),
|
|
193
226
|
deleteProduct: (productId) => call("delete_product", { product: productId }, (value) => value === true),
|
|
194
227
|
saveOption: (productId, input) => call("save_product_option", {
|
|
195
228
|
product: productId,
|
|
@@ -221,8 +254,8 @@ function createCatalog(options) {
|
|
|
221
254
|
}, matrixOf),
|
|
222
255
|
createVariant: (productId, input) => call("save_variant", variantArgs(productId, null, input), variantOf),
|
|
223
256
|
updateVariant: (productId, variantId, input) => call("save_variant", variantArgs(productId, variantId, input), variantOf),
|
|
224
|
-
reorderVariant: (variantId,
|
|
225
|
-
const key =
|
|
257
|
+
reorderVariant: (variantId, rank) => {
|
|
258
|
+
const key = rankOf(rank);
|
|
226
259
|
if (!key.ok) return AsyncResult.err(key.error);
|
|
227
260
|
return call("rank_variant", {
|
|
228
261
|
variant: variantId,
|
|
@@ -282,8 +315,8 @@ function createCatalog(options) {
|
|
|
282
315
|
...isRecord(row["fields"]) ? { fields: row["fields"] } : {}
|
|
283
316
|
};
|
|
284
317
|
}),
|
|
285
|
-
moveCategory: (categoryId, parentId,
|
|
286
|
-
const key =
|
|
318
|
+
moveCategory: (categoryId, parentId, rank) => {
|
|
319
|
+
const key = rankOf(rank);
|
|
287
320
|
if (!key.ok) return AsyncResult.err(key.error);
|
|
288
321
|
return call("move_category", {
|
|
289
322
|
category: categoryId,
|
|
@@ -312,14 +345,14 @@ function createCatalog(options) {
|
|
|
312
345
|
};
|
|
313
346
|
}),
|
|
314
347
|
deleteCollection: (collectionId) => call("delete_collection", { collection: collectionId }, (value) => value === true),
|
|
315
|
-
addToCollection: (collectionId, productId,
|
|
348
|
+
addToCollection: (collectionId, productId, rank) => {
|
|
316
349
|
const add = (rank) => call("add_to_collection", {
|
|
317
350
|
collection: collectionId,
|
|
318
351
|
product: productId,
|
|
319
352
|
rank
|
|
320
353
|
}, textOf);
|
|
321
|
-
if (
|
|
322
|
-
const key =
|
|
354
|
+
if (rank === void 0) return add(null);
|
|
355
|
+
const key = rankOf(rank);
|
|
323
356
|
return key.ok ? add(key.data) : AsyncResult.err(key.error);
|
|
324
357
|
},
|
|
325
358
|
removeFromCollection: (collectionId, productId) => call("remove_from_collection", {
|
|
@@ -7,14 +7,14 @@ import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
|
7
7
|
import { a as BlockTenantOptions, i as CursorPageOptions, r as BlockTemporalOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
8
8
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
9
9
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
10
|
-
import { F as CommentsSqlOptions } from "../../authorization-
|
|
10
|
+
import { F as CommentsSqlOptions } from "../../authorization-DQZ8Lrp5.js";
|
|
11
11
|
import { t as Author } from "../../block-authors-C5z3tGVu.js";
|
|
12
12
|
import { a as isFileAnchor, i as fileAnchor, n as FileAnchor, o as conversationTopic, r as FileAnchorAt, t as AnchorRegion } from "../../anchors-sCLvYj-8.js";
|
|
13
13
|
import { c as MessageEdit, l as MessageEdition, o as Message } from "../../messaging-Bfe4p9Pm.js";
|
|
14
14
|
import { Sn as EntitySchema, c as BlockOf, ln as RecordBindingWrite, mn as RecordRowInput, rn as RecordBinding } from "../../define-block-CDw9YGVh.js";
|
|
15
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
16
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
17
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
15
|
+
import { p as SubscriptionStatus } from "../../topic-L_8Qs5qs.js";
|
|
16
|
+
import { n as TopicPort } from "../../watch-topic-B9aKuw5v.js";
|
|
17
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
18
18
|
interface CommentsOptions<S extends StandardSchemaV1 | undefined = undefined> extends BlockTemporalOptions, BlockTenantOptions {
|
|
19
19
|
/**
|
|
20
20
|
* A Standard Schema for the message extra columns
|
|
@@ -4,8 +4,8 @@ import { n as SqlClient } from "../../executor-DoSNec_H.js";
|
|
|
4
4
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
5
5
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
6
6
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
7
|
-
import { a as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-
|
|
8
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
7
|
+
import { a as hasEntitlement, n as EntitlementKey, t as EntitlementClaimOptions } from "../../entitlements-aN3jHcYL.js";
|
|
8
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
9
9
|
/** The Stripe event sent when a customer's active entitlements change. */
|
|
10
10
|
export declare const ENTITLEMENTS_UPDATED = "entitlements.active_entitlement_summary.updated";
|
|
11
11
|
/**
|
|
@@ -42,6 +42,7 @@ interface ExpenseCategory {
|
|
|
42
42
|
readonly archivedAt?: Temporal.Instant;
|
|
43
43
|
readonly createdAt: Temporal.Instant;
|
|
44
44
|
readonly updatedAt: Temporal.Instant;
|
|
45
|
+
readonly fields?: Readonly<Record<string, unknown>>;
|
|
45
46
|
}
|
|
46
47
|
interface ExpenseCategoryInput {
|
|
47
48
|
readonly key: string;
|
|
@@ -49,6 +50,7 @@ interface ExpenseCategoryInput {
|
|
|
49
50
|
readonly limit?: Money;
|
|
50
51
|
/** Needs the attachments block, where receipts live. */
|
|
51
52
|
readonly receiptOver?: Money;
|
|
53
|
+
readonly fields?: Readonly<Record<string, unknown>>;
|
|
52
54
|
}
|
|
53
55
|
interface ExpenseLine {
|
|
54
56
|
readonly id: string;
|
|
@@ -2,7 +2,7 @@ import { n as dbError } from "../../errors-B7tCfCvX.js";
|
|
|
2
2
|
import { n as isRecord } from "../../guards-CsRa6v57.js";
|
|
3
3
|
import { t as temporal } from "../../temporal-required-w_2u4EDp.js";
|
|
4
4
|
import { t as AsyncResult } from "../../result-8xza7w5W.js";
|
|
5
|
-
import { t as expensesSqlOptions } from "../../options-
|
|
5
|
+
import { t as expensesSqlOptions } from "../../options-CYZH9uxU.js";
|
|
6
6
|
import { n as event, t as defineEvents } from "../../event-map-DxfsFgQT.js";
|
|
7
7
|
import { A as recordsOf, L as textOf, O as recordOf, U as rpcTransport, V as dbTransport, W as sqlTransport, d as enumOrThrow, j as requiredInstant, m as instantArg, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
|
|
8
8
|
import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-CadxQ9-_.js";
|
|
@@ -33,7 +33,8 @@ function categoryOf(value, fn) {
|
|
|
33
33
|
updatedAt: requiredInstant(row["updatedAt"], "updatedAt"),
|
|
34
34
|
...optional("limit", optionalMoney(row["limitAmount"], currency, "limit")),
|
|
35
35
|
...optional("receiptOver", optionalMoney(row["receiptOver"], currency, "receiptOver")),
|
|
36
|
-
...optional("archivedAt", optionalInstant(row["archivedAt"], "archivedAt"))
|
|
36
|
+
...optional("archivedAt", optionalInstant(row["archivedAt"], "archivedAt")),
|
|
37
|
+
...optional("fields", isRecord(row["fields"]) ? row["fields"] : void 0)
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
function lineOf(value, fn) {
|
|
@@ -153,7 +154,8 @@ function createExpenses(options) {
|
|
|
153
154
|
name: input.name,
|
|
154
155
|
currency: currency ?? null,
|
|
155
156
|
limit_amount: input.limit ? amountText(input.limit) : null,
|
|
156
|
-
receipt_over: input.receiptOver ? amountText(input.receiptOver) : null
|
|
157
|
+
receipt_over: input.receiptOver ? amountText(input.receiptOver) : null,
|
|
158
|
+
...input.fields === void 0 ? {} : { fields: input.fields }
|
|
157
159
|
}, category("save_expense_category")));
|
|
158
160
|
},
|
|
159
161
|
archiveCategory: (categoryId) => call("archive_expense_category", { category_id: categoryId }, category("archive_expense_category")),
|
|
@@ -351,6 +353,11 @@ const expenseCategoryInputSchema = entitySchema({
|
|
|
351
353
|
receiptOver: {
|
|
352
354
|
...moneyField,
|
|
353
355
|
optional: true
|
|
356
|
+
},
|
|
357
|
+
fields: {
|
|
358
|
+
kind: "json",
|
|
359
|
+
optional: true,
|
|
360
|
+
description: "The extra columns to set."
|
|
354
361
|
}
|
|
355
362
|
}
|
|
356
363
|
});
|
|
@@ -8,7 +8,7 @@ import { r as BlockTemporalOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
|
8
8
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
9
9
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
10
10
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
11
|
-
import { n as Controller } from "../../controller-
|
|
11
|
+
import { n as Controller } from "../../controller-BQHh7VG5.js";
|
|
12
12
|
import { _ as isFormDefinition, a as FormDefinition, c as FormJson, d as FormScoring, f as FormStep, g as formSchema, h as formDefinitionProblems, i as FormCondition, l as FormJsonSchema, m as UNSCORED_FIELD_TYPES, n as FORM_FIELD_TYPES, o as FormField, p as NPS_MAX, r as FORM_SCHEMA_DIALECT, s as FormFieldType, t as FORM_DEFINITION_SCHEMA, u as FormOption } from "../../form-definition-BN8shngm.js";
|
|
13
13
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
14
14
|
/** A submission's answers, by field key. */
|
|
@@ -2,10 +2,10 @@ import { Ct as Events, H as InboxEventData } from "../../events-DddDlibJ.js";
|
|
|
2
2
|
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
3
3
|
import { d as MessageKind, p as MessageReaction, u as MessageFile } from "../../messaging-Bfe4p9Pm.js";
|
|
4
4
|
import { Zt as DefaultAutomation, c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
5
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
6
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
7
|
-
import { l as StoragePort } from "../../ports-
|
|
8
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
5
|
+
import { p as SubscriptionStatus } from "../../topic-L_8Qs5qs.js";
|
|
6
|
+
import { n as TopicPort } from "../../watch-topic-B9aKuw5v.js";
|
|
7
|
+
import { l as StoragePort } from "../../ports-rJDkwtOQ.js";
|
|
8
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
9
9
|
import { S as StoredInboundEvent, _ as MessageDirection, a as ConversationEvent, b as PurgedContact, c as DeliveryStatus, d as InboxCounts, f as InboxFileSource, g as MessageDelivery, h as InboxUpload, i as Conversation, l as InboundResult, m as InboxRow, n as BotMode, o as ConversationPriority, p as InboxMessage, r as Contact, s as ConversationStatus, t as AuthorType, u as InboxChannel, v as MessageTemplate, x as ScheduledInboxMessage, y as PendingInboxFile } from "../../types-D5uf0l4_.js";
|
|
10
10
|
import { _ as InboxDraftSource, a as Inbox, c as InboxPatch, d as ScheduledMessageInput, f as StartConversationInput, g as InboxDraftInput, h as InboxDraft, i as InboundInput, l as MessageInput, m as createInbox, n as ConversationFilter, o as InboxHooks, p as TemplateInput, r as CreateInboxInput, s as InboxOptions, t as ContactInput, u as MessagePageOptions, v as InboxDraftStatus, y as InboxDrafts } from "../../inbox-yGfUVQr2.js";
|
|
11
11
|
export declare const INBOX_CHANNELS: readonly InboxChannel[];
|
package/dist/blocks/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { a as OptionInput, c as OptionSpecs, d as optionsJsonSchema, i as Option
|
|
|
12
12
|
import { A as CreateBlocksOptions, An as BlockNaming, C as BlockContext, Cn as EntitySchemaSpec, D as Blocks, Dn as GeneratedBlocks, E as BlockSinks, En as GeneratedBlock, F as BlockPorts, Fn as entityNames, I as Notifier, L as NotifierInput, M as createBlockClient, Mn as EntityNames, N as createBlocks, Nn as EntityNoun, O as BlocksEventMap, On as fillTopic, P as defineBlocks, Pn as EntityRename, R as PortName, S as BlockClientSource, Sn as EntitySchema, T as BlockSet, Tn as entitySchema, _ as BlockProvider, a as BlockConsumes, b as BLOCK_EVENT_SOURCE, bn as BlockSchemas, c as BlockOf, d as ClientOf, f as ConsumedPorts, g as BlockEnvKey, h as defineBlock, i as BlockCategory, j as UniquePort, jn as blockNames, k as BlocksHooks, kn as generatedOptions, l as BlockOptionSchemas, m as UsingOptions, n as BLOCK_CATEGORIES, o as BlockDefinition, p as ProvidedPorts, r as Block, s as BlockInvalidates, t as AnyBlock, tn as AnyRecordBinding, u as BlockProvides, v as BlockWiring, w as BlockMap, wn as EntitySchemas, x as BlockClientOptions, xn as EntityFieldSpecs, y as BlockWorker } from "../define-block-CDw9YGVh.js";
|
|
13
13
|
import { t as VisibleRange } from "../range-BN3kpJAE.js";
|
|
14
14
|
import { t as subjectKey } from "../block-subjects-Bkieh2Xk.js";
|
|
15
|
-
import { t as BlockEnv } from "../block-env-
|
|
15
|
+
import { t as BlockEnv } from "../block-env-mNi2rPSF.js";
|
|
16
16
|
/** What a hook passes a block creator from the env. */
|
|
17
17
|
interface EnvBlockOptions {
|
|
18
18
|
readonly transport: BlockTransport;
|
|
@@ -90,6 +90,16 @@ interface InvoiceInput<F extends object = Record<never, never>> {
|
|
|
90
90
|
/** Values for the extra columns, by column name. */
|
|
91
91
|
readonly fields?: Partial<F> & Readonly<Record<string, unknown>>;
|
|
92
92
|
}
|
|
93
|
+
interface InvoicePatch<F extends object = Record<never, never>> {
|
|
94
|
+
readonly title?: string;
|
|
95
|
+
readonly company?: RecordRef | null;
|
|
96
|
+
readonly contact?: RecordRef | null;
|
|
97
|
+
readonly termsDays?: number | null;
|
|
98
|
+
readonly note?: string | null;
|
|
99
|
+
readonly depositBps?: number | null;
|
|
100
|
+
readonly pricesIncludeTax?: boolean;
|
|
101
|
+
readonly fields?: Partial<F> & Readonly<Record<string, unknown>>;
|
|
102
|
+
}
|
|
93
103
|
/** What is owed in one currency, by days past due. */
|
|
94
104
|
interface InvoiceAging {
|
|
95
105
|
readonly currency: string;
|
|
@@ -104,6 +114,8 @@ interface InvoiceAging {
|
|
|
104
114
|
/** `F` types the invoices' extra columns, from the `fields` schema. */
|
|
105
115
|
interface Invoices<F extends object = Record<never, never>> {
|
|
106
116
|
create(organizationId: string, input: InvoiceInput<F>, lines?: readonly LineInput[]): AsyncResult<Invoice<F>>;
|
|
117
|
+
update(invoiceId: string, patch: InvoicePatch<F>): AsyncResult<Invoice<F>>;
|
|
118
|
+
delete(invoiceId: string): AsyncResult<boolean>;
|
|
107
119
|
setLines(invoiceId: string, lines: readonly LineInput[]): AsyncResult<Totals>;
|
|
108
120
|
/** Issues a draft: the next number, issue and due dates, frozen lines. */
|
|
109
121
|
issue(invoiceId: string, issuedOn?: Temporal.PlainDate, options?: {
|
|
@@ -170,6 +182,8 @@ export declare function createInvoices<S extends StandardSchemaV1 | undefined =
|
|
|
170
182
|
/** The events of the `invoices` block: type to data. */
|
|
171
183
|
type InvoicesEvents = {
|
|
172
184
|
readonly "invoice.created": InvoiceEventData;
|
|
185
|
+
readonly "invoice.updated": InvoiceEventData;
|
|
186
|
+
readonly "invoice.deleted": InvoiceEventData;
|
|
173
187
|
readonly "invoice.issued": InvoiceEventData;
|
|
174
188
|
readonly "invoice.payment_recorded": InvoiceEventData;
|
|
175
189
|
readonly "invoice.paid": InvoiceEventData;
|
|
@@ -184,4 +198,4 @@ type InvoicesEvents = {
|
|
|
184
198
|
export declare const invoicesEvents: Events<InvoicesEvents>;
|
|
185
199
|
/** The `invoices` block's manifest (ADR 0029). */
|
|
186
200
|
export declare const invoicesBlock: BlockOf<"invoices", typeof createInvoices, InvoicesEvents>;
|
|
187
|
-
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type Invoice, type InvoiceAging, type InvoiceCharge, type InvoiceInput, type InvoicePayment, type InvoiceStatus, type Invoices, type InvoicesEvents, type InvoicesOptions, type Line, type LineInput, type RecordRef, type RpcClient, type Totals, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|
|
201
|
+
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type Invoice, type InvoiceAging, type InvoiceCharge, type InvoiceInput, type InvoicePatch, type InvoicePayment, type InvoiceStatus, type Invoices, type InvoicesEvents, type InvoicesOptions, type Line, type LineInput, type RecordRef, type RpcClient, type Totals, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as isRecord } from "../../guards-CsRa6v57.js";
|
|
2
2
|
import { t as AsyncResult } from "../../result-8xza7w5W.js";
|
|
3
|
-
import { t as invoicesSqlOptions } from "../../options-
|
|
3
|
+
import { t as invoicesSqlOptions } from "../../options-BXbixNrP.js";
|
|
4
4
|
import { n as event, t as defineEvents } from "../../event-map-DxfsFgQT.js";
|
|
5
5
|
import { A as recordsOf, C as optionalInstant, L as textOf, O as recordOf, U as rpcTransport, V as dbTransport, W as sqlTransport, a as bigintOf, d as enumOrThrow, j as requiredInstant, m as instantArg, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
|
|
6
6
|
import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-CadxQ9-_.js";
|
|
@@ -142,6 +142,17 @@ function createInvoices(options) {
|
|
|
142
142
|
lines: lines === void 0 ? null : lines.map(lineArg)
|
|
143
143
|
}));
|
|
144
144
|
},
|
|
145
|
+
update: (invoiceId, patch) => {
|
|
146
|
+
const { fields: extra, ...rest } = patch;
|
|
147
|
+
return AsyncResult.from(() => fields.write({ ...extra })).andThen((valid) => invoice("update_invoice", {
|
|
148
|
+
invoice: invoiceId,
|
|
149
|
+
attrs: attrsArg({
|
|
150
|
+
...rest,
|
|
151
|
+
...valid
|
|
152
|
+
})
|
|
153
|
+
}));
|
|
154
|
+
},
|
|
155
|
+
delete: (invoiceId) => call("delete_invoice", { invoice: invoiceId }, (value) => value === true),
|
|
145
156
|
setLines: (invoiceId, lines) => {
|
|
146
157
|
const invalid = amountsError(void 0, lines.map((line) => line.unitAmount));
|
|
147
158
|
return invalid === void 0 ? call("set_invoice_lines", {
|
|
@@ -223,6 +234,8 @@ function createInvoices(options) {
|
|
|
223
234
|
/** The `invoices` block's event types, for its manifest and `onBlockEvent`. */
|
|
224
235
|
const invoicesEvents = defineEvents({
|
|
225
236
|
"invoice.created": event(),
|
|
237
|
+
"invoice.updated": event(),
|
|
238
|
+
"invoice.deleted": event(),
|
|
226
239
|
"invoice.issued": event(),
|
|
227
240
|
"invoice.payment_recorded": event(),
|
|
228
241
|
"invoice.paid": event(),
|
|
@@ -93,12 +93,36 @@ interface LeaveFeedEntry {
|
|
|
93
93
|
/** The request's extra columns, with `options.feed.fields`. */
|
|
94
94
|
readonly fields?: Readonly<Record<string, unknown>>;
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Confidential leave in a feed with `options.feed.confidential: "busy"`: who
|
|
98
|
+
* and when, without the type, amount or fields.
|
|
99
|
+
*/
|
|
100
|
+
interface LeaveFeedBusy {
|
|
101
|
+
readonly id: string;
|
|
102
|
+
readonly userId?: string;
|
|
103
|
+
readonly employeeId?: string;
|
|
104
|
+
/** The employee's name, with `options.feed.names`. */
|
|
105
|
+
readonly name?: string;
|
|
106
|
+
readonly startsOn: Temporal.PlainDate;
|
|
107
|
+
/** Inclusive. */
|
|
108
|
+
readonly endsOn: Temporal.PlainDate;
|
|
109
|
+
readonly partial: LeavePartial;
|
|
110
|
+
readonly startPart?: LeavePartial;
|
|
111
|
+
readonly endPart?: LeavePartial;
|
|
112
|
+
readonly updatedAt: Temporal.Instant;
|
|
113
|
+
}
|
|
96
114
|
/** What a leave feed share link reads. */
|
|
97
115
|
interface LeaveFeed {
|
|
98
116
|
readonly organizationId: string;
|
|
117
|
+
/** With `options.feed.organizationName`. */
|
|
118
|
+
readonly organizationName?: string;
|
|
99
119
|
/** The team of a `leave_team_feed` link. */
|
|
100
120
|
readonly teamId?: string;
|
|
121
|
+
/** The team's name, with `options.feed.teamName`. */
|
|
122
|
+
readonly teamName?: string;
|
|
101
123
|
readonly requests: readonly LeaveFeedEntry[];
|
|
124
|
+
/** With `options.feed.confidential: "busy"`. */
|
|
125
|
+
readonly busy?: readonly LeaveFeedBusy[];
|
|
102
126
|
}
|
|
103
127
|
/** A leave request. `F` types the extra columns the `fields` schema describes. */
|
|
104
128
|
interface LeaveRequest<F extends object = Record<never, never>> {
|
|
@@ -214,6 +238,11 @@ interface LeaveAdjustment {
|
|
|
214
238
|
readonly kind?: "grant" | "adjustment";
|
|
215
239
|
readonly note?: string;
|
|
216
240
|
readonly expiresOn?: Temporal.PlainDate;
|
|
241
|
+
/**
|
|
242
|
+
* The day the entry counts from, such as a backdated correction. Default: the
|
|
243
|
+
* first day of the period. Needs `columns.balances.effectiveOn`.
|
|
244
|
+
*/
|
|
245
|
+
readonly effectiveOn?: Temporal.PlainDate;
|
|
217
246
|
}
|
|
218
247
|
interface LeaveAccrual {
|
|
219
248
|
readonly typeId: string;
|
|
@@ -227,6 +256,11 @@ interface LeaveAccrual {
|
|
|
227
256
|
/** A member gets an accrual with the same key once. */
|
|
228
257
|
readonly idempotencyKey?: string;
|
|
229
258
|
readonly note?: string;
|
|
259
|
+
/**
|
|
260
|
+
* The day the accrual counts from, such as the first of the month. Default:
|
|
261
|
+
* the first day of the period. Needs `columns.balances.effectiveOn`.
|
|
262
|
+
*/
|
|
263
|
+
readonly effectiveOn?: Temporal.PlainDate;
|
|
230
264
|
}
|
|
231
265
|
interface Leave<F extends object = Record<never, never>> {
|
|
232
266
|
/** Needs `leave.manage`; updates the type with the same key. */
|
|
@@ -359,4 +393,4 @@ type LeaveEvents = {
|
|
|
359
393
|
export declare const leaveEvents: Events<LeaveEvents>;
|
|
360
394
|
/** The `leave` block's manifest (ADR 0029). */
|
|
361
395
|
export declare const leaveBlock: BlockOf<"leave", typeof createLeave, LeaveEvents>;
|
|
362
|
-
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type Leave, type LeaveAccrual, type LeaveAdjustedEventData, type LeaveAdjustment, type LeaveBalance, type LeaveEvents, type LeaveFeed, type LeaveFeedEntry, type LeaveLedgerEntry, type LeaveLedgerKind, type LeaveOptions, type LeavePartial, type LeaveRequest, type LeaveRequestEventData, type LeaveRequestInput, type LeaveRequestListOptions, type LeaveRequestUpdate, type LeaveStatus, type LeaveType, type LeaveTypeInput, type LeaveUnit, type RpcClient, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|
|
396
|
+
export { type BlockHooks, type BlockTransport, type BlockTransportMiddleware, type Leave, type LeaveAccrual, type LeaveAdjustedEventData, type LeaveAdjustment, type LeaveBalance, type LeaveEvents, type LeaveFeed, type LeaveFeedBusy, type LeaveFeedEntry, type LeaveLedgerEntry, type LeaveLedgerKind, type LeaveOptions, type LeavePartial, type LeaveRequest, type LeaveRequestEventData, type LeaveRequestInput, type LeaveRequestListOptions, type LeaveRequestUpdate, type LeaveStatus, type LeaveType, type LeaveTypeInput, type LeaveUnit, type RpcClient, dbTransport, extendBlock, rpcTransport, sqlTransport, withBlockHooks, wrapTransport };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as isRecord } from "../../guards-CsRa6v57.js";
|
|
2
2
|
import { t as temporal } from "../../temporal-required-w_2u4EDp.js";
|
|
3
|
-
import { t as leaveSqlOptions } from "../../options-
|
|
3
|
+
import { t as leaveSqlOptions } from "../../options-zsLpIqBA.js";
|
|
4
4
|
import { n as event, t as defineEvents } from "../../event-map-DxfsFgQT.js";
|
|
5
5
|
import { A as recordsOf, C as optionalInstant, L as textOf, O as recordOf, U as rpcTransport, V as dbTransport, W as sqlTransport, d as enumOrThrow, j as requiredInstant, n as applyTemporal, o as blockCall, w as optionalText } from "../../block-helpers-I7UzjNEf.js";
|
|
6
6
|
import { i as wrapTransport, n as extendBlock, r as withBlockHooks } from "../../block-hooks-CadxQ9-_.js";
|
|
@@ -185,7 +185,20 @@ function createLeave(options) {
|
|
|
185
185
|
const row = recordOf(value, "leave_feed");
|
|
186
186
|
return {
|
|
187
187
|
organizationId: textOf(row["organizationId"]),
|
|
188
|
+
...optional("organizationName", optionalText(row["organizationName"])),
|
|
188
189
|
...optional("teamId", optionalText(row["teamId"])),
|
|
190
|
+
...optional("teamName", optionalText(row["teamName"])),
|
|
191
|
+
...row["busy"] === void 0 ? {} : { busy: recordsOf(row["busy"], "leave_feed").map((entry) => ({
|
|
192
|
+
id: textOf(entry["id"]),
|
|
193
|
+
...owners(entry),
|
|
194
|
+
...optional("name", optionalText(entry["name"])),
|
|
195
|
+
startsOn: dateOf(entry["startsOn"]),
|
|
196
|
+
endsOn: dateOf(entry["endsOn"]),
|
|
197
|
+
partial: enumOrThrow(entry["partial"], PARTIALS, "leave partial"),
|
|
198
|
+
...optional("startPart", optionalPart(entry["startPart"])),
|
|
199
|
+
...optional("endPart", optionalPart(entry["endPart"])),
|
|
200
|
+
updatedAt: requiredInstant(entry["updatedAt"], "updatedAt")
|
|
201
|
+
})) },
|
|
189
202
|
requests: recordsOf(row["requests"], "leave_feed").map((entry) => ({
|
|
190
203
|
id: textOf(entry["id"]),
|
|
191
204
|
...owners(entry),
|
|
@@ -235,7 +248,8 @@ function createLeave(options) {
|
|
|
235
248
|
kind: adjustment.kind ?? "adjustment",
|
|
236
249
|
note: adjustment.note ?? null,
|
|
237
250
|
...optional("employee_id", adjustment.employeeId),
|
|
238
|
-
...optional("expires_on", adjustment.expiresOn?.toString())
|
|
251
|
+
...optional("expires_on", adjustment.expiresOn?.toString()),
|
|
252
|
+
...optional("effective_on", adjustment.effectiveOn?.toString())
|
|
239
253
|
}, (value) => entryOf(value, "adjust_leave_balance")),
|
|
240
254
|
accrue: (organizationId, accrual) => call("accrue_leave", {
|
|
241
255
|
tenant: organizationId,
|
|
@@ -245,7 +259,8 @@ function createLeave(options) {
|
|
|
245
259
|
user_ids: accrual.userIds ?? null,
|
|
246
260
|
idempotency_key: accrual.idempotencyKey ?? null,
|
|
247
261
|
note: accrual.note ?? null,
|
|
248
|
-
...optional("employee_ids", accrual.employeeIds)
|
|
262
|
+
...optional("employee_ids", accrual.employeeIds),
|
|
263
|
+
...optional("effective_on", accrual.effectiveOn?.toString())
|
|
249
264
|
}, numberOf),
|
|
250
265
|
closePeriod: (organizationId, period) => call("close_leave_year", {
|
|
251
266
|
tenant: organizationId,
|
|
@@ -4,14 +4,14 @@ import { Ct as Events } from "../../events-DddDlibJ.js";
|
|
|
4
4
|
import { _ as ConversationEventData, k as MessageEventData } from "../../index-DjJUamhw.js";
|
|
5
5
|
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
6
6
|
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-CtMsgLQr.js";
|
|
7
|
-
import { P as MessagingSqlOptions } from "../../authorization-
|
|
7
|
+
import { P as MessagingSqlOptions } from "../../authorization-DQZ8Lrp5.js";
|
|
8
8
|
import { a as isFileAnchor, i as fileAnchor, n as FileAnchor, o as conversationTopic, r as FileAnchorAt, t as AnchorRegion } from "../../anchors-sCLvYj-8.js";
|
|
9
9
|
import { _ as NotifyLevel, a as FollowTarget, b as UnreadCount, c as MessageEdit, d as MessageKind, f as MessageListOptions, g as NewMessage, h as MessagingOptions, i as ConversationSummary, l as MessageEdition, m as Messaging, n as ConversationAccess, o as Message, p as MessageReaction, r as ConversationKind, s as MessageCursor, t as Conversation, u as MessageFile, v as OpenConversation, x as createMessaging, y as RecordMention } from "../../messaging-Bfe4p9Pm.js";
|
|
10
10
|
import { a as ThreadSummary, i as ThreadSummarizer, n as SummaryMessage, o as ThreadSummaryInput, r as SummaryTarget, s as ThreadSummaryOutput, t as SummarizeOptions } from "../../summaries-CUemsYwV.js";
|
|
11
11
|
import { Sn as EntitySchema, c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
12
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
13
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
14
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
12
|
+
import { p as SubscriptionStatus } from "../../topic-L_8Qs5qs.js";
|
|
13
|
+
import { n as TopicPort } from "../../watch-topic-B9aKuw5v.js";
|
|
14
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
15
15
|
type MentionScope = "channel" | "here";
|
|
16
16
|
interface ParsedMentions {
|
|
17
17
|
/** Mentioned user ids, lowercase, in order and without repeats. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { b as DbError, f as Result } from "../../result-DTOQRyGY.js";
|
|
2
2
|
import { t as Aal } from "../../mfa-CM5r904M.js";
|
|
3
3
|
import { r as Block } from "../../define-block-CDw9YGVh.js";
|
|
4
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
4
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
5
5
|
import { t as AuthReply } from "../../auth-reply-BMPJQssh.js";
|
|
6
6
|
/** A factor as `auth.mfa.listFactors()` returns it. */
|
|
7
7
|
interface RawMfaFactor {
|
|
@@ -10,9 +10,9 @@ import { t as BlockProblemOptions } from "../../problem-NGBjN-TO.js";
|
|
|
10
10
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
11
11
|
import { i as EventSink, t as CloudEvent } from "../../cloud-event-BjgxkfJJ.js";
|
|
12
12
|
import { g as SubscriberPolicy, i as AuthorizationHooks } from "../../authorization-hooks-CR8TVvqo.js";
|
|
13
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
14
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
15
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
13
|
+
import { p as SubscriptionStatus } from "../../topic-L_8Qs5qs.js";
|
|
14
|
+
import { n as TopicPort } from "../../watch-topic-B9aKuw5v.js";
|
|
15
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
16
16
|
import { n as VerifyOptions } from "../../signatures-jPr9JXyw.js";
|
|
17
17
|
import { a as NotificationItem, i as NotificationAction, n as NotificationMessage, o as NotificationSubject, r as NotificationSendResult, s as RenderedText, t as NotificationChannel } from "../../channel-B_kufDZy.js";
|
|
18
18
|
import { a as DeliveryTransport, c as UnsubscribeTarget, i as DeliverySendOptions, l as mailHeaders, n as DeliveryMessages, o as EmailMessage, r as DeliveryReceipt, s as MailCategory, t as DeliveryChannel } from "../../delivery-CWcbh87x.js";
|
|
@@ -5,7 +5,7 @@ import { n as BlockOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
|
5
5
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
6
6
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
7
7
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
8
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
8
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
9
9
|
type ChecklistScope = "user" | "organization";
|
|
10
10
|
/** One step. `events` completes it when the outbox records one of those types. */
|
|
11
11
|
interface ChecklistStep<Id extends string = string> {
|
|
@@ -7,9 +7,9 @@ import { Ct as Events, W as InvitationEventData, Z as OrganizationEventData, o a
|
|
|
7
7
|
import { r as BlockTemporalOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
8
8
|
import { a as dbTransport, i as RpcClient, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
9
9
|
import { a as BlockTransportMiddleware, d as extendBlock, f as withBlockHooks, n as BlockHooks, p as wrapTransport } from "../../block-hooks-CtMsgLQr.js";
|
|
10
|
-
import { N as PlatformRolesOption } from "../../authorization-
|
|
10
|
+
import { N as PlatformRolesOption } from "../../authorization-DQZ8Lrp5.js";
|
|
11
11
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
12
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
12
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
13
13
|
declare const INVITATION_ERRORS: {
|
|
14
14
|
readonly INVITATION_FORBIDDEN: "42501";
|
|
15
15
|
readonly INVITATION_ROLE_FORBIDDEN: "42501";
|
|
@@ -6,7 +6,7 @@ import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTrans
|
|
|
6
6
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
7
7
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
8
8
|
import { B as PermissionFlags, H as can, U as permissionFlags, V as PermissionSet, W as permissionMatches } from "../../index-DAS_5OfK.js";
|
|
9
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
9
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
10
10
|
interface PermissionsOptions extends BlockOptions {
|
|
11
11
|
/** `withBlockHooks` hooks around the client's methods. */
|
|
12
12
|
readonly hooks?: BlockHooks<Permissions>;
|
|
@@ -10,7 +10,7 @@ import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTrans
|
|
|
10
10
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
11
11
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
12
12
|
import { n as NotificationMessage, t as NotificationChannel } from "../../channel-B_kufDZy.js";
|
|
13
|
-
import { t as ExpoNotificationsLike } from "../../push-token-
|
|
13
|
+
import { t as ExpoNotificationsLike } from "../../push-token-BLQ09NeA.js";
|
|
14
14
|
type PushPlatform = "ios" | "android" | "web";
|
|
15
15
|
type PushProvider = "expo" | "fcm" | "apns" | "webpush";
|
|
16
16
|
/**
|
|
@@ -7,9 +7,9 @@ import { a as BlockTenantOptions, r as BlockTemporalOptions } from "../../block-
|
|
|
7
7
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
8
8
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
9
9
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
10
|
-
import { p as SubscriptionStatus } from "../../topic-
|
|
11
|
-
import { n as TopicPort } from "../../watch-topic-
|
|
12
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
10
|
+
import { p as SubscriptionStatus } from "../../topic-L_8Qs5qs.js";
|
|
11
|
+
import { n as TopicPort } from "../../watch-topic-B9aKuw5v.js";
|
|
12
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
13
13
|
interface ReactionsOptions extends BlockTemporalOptions, BlockTenantOptions {
|
|
14
14
|
readonly transport: BlockTransport;
|
|
15
15
|
/**
|
|
@@ -7,7 +7,7 @@ import { t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
|
7
7
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
8
8
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
9
9
|
import { p as ListQueryInput } from "../../list-query-BkbLV-Yc.js";
|
|
10
|
-
import { n as Controller } from "../../controller-
|
|
10
|
+
import { n as Controller } from "../../controller-BQHh7VG5.js";
|
|
11
11
|
import { t as RankNeighbors } from "../../rank-result-B_xLQCBV.js";
|
|
12
12
|
export declare const SAVED_VIEW_KINDS: readonly ["table", "board", "calendar", "timeline", "gantt"];
|
|
13
13
|
type SavedViewKind = (typeof SAVED_VIEW_KINDS)[number];
|
|
@@ -6,8 +6,8 @@ import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTrans
|
|
|
6
6
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
7
7
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
8
8
|
import { i as EventSink } from "../../cloud-event-BjgxkfJJ.js";
|
|
9
|
-
import { i as KeyboardPort } from "../../ports-
|
|
10
|
-
import { n as Controller } from "../../controller-
|
|
9
|
+
import { i as KeyboardPort } from "../../ports-rJDkwtOQ.js";
|
|
10
|
+
import { n as Controller } from "../../controller-BQHh7VG5.js";
|
|
11
11
|
interface SearchOptions extends Pick<BlockOptions, "transport" | "service" | "schema" | "mappers"> {
|
|
12
12
|
/** `withBlockHooks` hooks around the methods. */
|
|
13
13
|
readonly hooks?: BlockHooks<Search>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { b as DbError, f as Result } from "../../result-DTOQRyGY.js";
|
|
3
3
|
import { r as Block } from "../../define-block-CDw9YGVh.js";
|
|
4
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
4
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
5
5
|
import { t as AuthReply } from "../../auth-reply-BMPJQssh.js";
|
|
6
6
|
/** An OAuth client as the Auth OAuth server describes it. */
|
|
7
7
|
interface RawOAuthClient {
|
|
@@ -5,7 +5,7 @@ import { n as BlockOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
|
5
5
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
6
6
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
7
7
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
8
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
8
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
9
9
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
10
10
|
/**
|
|
11
11
|
* One setting: its Standard Schema and the value `get` returns when none is
|
|
@@ -2,7 +2,7 @@ import { b as DbError } from "../../result-DTOQRyGY.js";
|
|
|
2
2
|
import { et as RecordRef } from "../../types-BzIYSSWK.js";
|
|
3
3
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
4
4
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
5
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
5
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
6
6
|
import { t as subjectKey } from "../../block-subjects-Bkieh2Xk.js";
|
|
7
7
|
import { c as Subjects, d as MY_WORK_KINDS, f as MyWorkKind, l as SubjectsOptions, n as MyWorkItem, o as ResolvedSubject, r as MyWorkOptions, s as SUBJECT_TITLES_LIMIT, t as MY_WORK_LIMIT, u as createSubjects } from "../../subjects-CVjAE7nz.js";
|
|
8
8
|
/** The `subjects` block's manifest (ADR 0029). */
|
|
@@ -7,7 +7,7 @@ import { n as Logger } from "../../logger-0LfhvwE4.js";
|
|
|
7
7
|
import { n as BlockOptions } from "../../block-helpers-BNtM1tqy.js";
|
|
8
8
|
import { n as BlockHooks } from "../../block-hooks-CtMsgLQr.js";
|
|
9
9
|
import { Sn as EntitySchema, c as BlockOf, ln as RecordBindingWrite, rn as RecordBinding } from "../../define-block-CDw9YGVh.js";
|
|
10
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
10
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
11
11
|
import { t as RankNeighbors } from "../../rank-result-B_xLQCBV.js";
|
|
12
12
|
interface TagsOptions<S extends StandardSchemaV1 | undefined = undefined> extends BlockOptions {
|
|
13
13
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTransport } from "../../block-transport-CDmOUuLZ.js";
|
|
2
2
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
3
|
-
import { n as Controller } from "../../controller-
|
|
3
|
+
import { n as Controller } from "../../controller-BQHh7VG5.js";
|
|
4
4
|
import { a as UndoToken, c as undoToken, i as UndoOptions, n as Undo, o as createUndo, r as UndoCall, s as isUndoToken, t as UNDO_FUNCTIONS } from "../../undo-CdKp5_2X.js";
|
|
5
5
|
interface UndoEntry {
|
|
6
6
|
readonly id: number;
|
|
@@ -3,7 +3,7 @@ import { a as dbTransport, o as rpcTransport, s as sqlTransport, t as BlockTrans
|
|
|
3
3
|
import { n as StripeSource, t as StripeClient } from "../../stripe-Bl-sjnl6.js";
|
|
4
4
|
import { _ as reportUsageToStripe, a as Usage, c as UsageEntry, d as UsageMeterInfo, f as UsageOptions, g as createUsage, h as UsageStatus, i as ReportUsageResult, l as UsageHistoryEntry, m as UsageRecorded, n as RecordUsageOptions, o as UsageBatchRecorded, p as UsagePeriod, r as ReportUsageOptions, s as UsageBreakdownEntry, t as PurgeUsageOptions, u as UsageHistoryOptions } from "../../usage-DZ8j5Tm_.js";
|
|
5
5
|
import { c as BlockOf } from "../../define-block-CDw9YGVh.js";
|
|
6
|
-
import { n as Controller, t as AuthPort } from "../../controller-
|
|
6
|
+
import { n as Controller, t as AuthPort } from "../../controller-BQHh7VG5.js";
|
|
7
7
|
/** The `usage` block's manifest (ADR 0029). */
|
|
8
8
|
export declare const usageBlock: BlockOf<"usage", typeof createUsage>;
|
|
9
9
|
interface UsageMeterControllerOptions {
|