@ttt-productions/ttt-core 0.2.12 → 0.2.14
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/business.d.ts +85 -0
- package/dist/constants/business.d.ts.map +1 -1
- package/dist/constants/business.js +98 -0
- package/dist/constants/business.js.map +1 -1
- package/dist/constants/index.d.ts +5 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +5 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/options.d.ts +103 -0
- package/dist/constants/options.d.ts.map +1 -0
- package/dist/constants/options.js +161 -0
- package/dist/constants/options.js.map +1 -0
- package/dist/constants/pagination.d.ts +37 -0
- package/dist/constants/pagination.d.ts.map +1 -0
- package/dist/constants/pagination.js +40 -0
- package/dist/constants/pagination.js.map +1 -0
- package/dist/constants/retention.d.ts +25 -0
- package/dist/constants/retention.d.ts.map +1 -0
- package/dist/constants/retention.js +32 -0
- package/dist/constants/retention.js.map +1 -0
- package/dist/constants/scheduled-jobs.d.ts +9 -0
- package/dist/constants/scheduled-jobs.d.ts.map +1 -0
- package/dist/constants/scheduled-jobs.js +15 -0
- package/dist/constants/scheduled-jobs.js.map +1 -0
- package/dist/constants/storage-keys.d.ts +7 -0
- package/dist/constants/storage-keys.d.ts.map +1 -0
- package/dist/constants/storage-keys.js +8 -0
- package/dist/constants/storage-keys.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/atoms.d.ts +24 -0
- package/dist/schemas/atoms.d.ts.map +1 -0
- package/dist/schemas/atoms.js +29 -0
- package/dist/schemas/atoms.js.map +1 -0
- package/dist/schemas/index.d.ts +3 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +3 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/share-operation.d.ts +376 -0
- package/dist/schemas/share-operation.d.ts.map +1 -0
- package/dist/schemas/share-operation.js +61 -0
- package/dist/schemas/share-operation.js.map +1 -0
- package/dist/types/project.d.ts +1 -11
- package/dist/types/project.d.ts.map +1 -1
- package/dist/utils/format.d.ts +6 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +13 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +39 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Caching, retention, and cleanup TTLs / batch sizes.
|
|
2
|
+
// --- Profanity word list cache ---
|
|
3
|
+
/** TTL for the in-memory profanity word list cache (1 hour). */
|
|
4
|
+
export const WORD_LIST_CACHE_TTL_MS = 1000 * 60 * 60;
|
|
5
|
+
// --- Donations ---
|
|
6
|
+
/** Minimum number of recent donations always retained in the recentDonations collection. */
|
|
7
|
+
export const MIN_RECENT_DONATIONS = 50;
|
|
8
|
+
/** Days after which a donation is considered old enough to archive. */
|
|
9
|
+
export const DONATION_RETENTION_DAYS = 90;
|
|
10
|
+
// --- Pending media archive ---
|
|
11
|
+
/** Days after which a terminal pendingMedia doc is moved to pendingMediaArchive. */
|
|
12
|
+
export const PENDING_MEDIA_ARCHIVE_AFTER_DAYS = 7;
|
|
13
|
+
/** Per-run cap on docs archived by the archivePendingMedia scheduled job. */
|
|
14
|
+
export const PENDING_MEDIA_ARCHIVE_BATCH_SIZE = 500;
|
|
15
|
+
// --- Orphan upload cleanup ---
|
|
16
|
+
/** TTL in hours after which an orphan storage upload becomes eligible for deletion. */
|
|
17
|
+
export const ORPHAN_UPLOAD_TTL_HOURS = 24;
|
|
18
|
+
/** Per-run cap on orphan storage deletions. */
|
|
19
|
+
export const ORPHAN_UPLOAD_DELETE_CAP = 500;
|
|
20
|
+
/** Page size for listing orphan uploads. */
|
|
21
|
+
export const ORPHAN_UPLOAD_LIST_PAGE_SIZE = 1000;
|
|
22
|
+
// --- Frontend in-flight upload listeners ---
|
|
23
|
+
/** After this idle duration, an in-flight upload toast is considered stale. */
|
|
24
|
+
export const STALE_TOAST_THRESHOLD_MS = 5 * 60 * 1000;
|
|
25
|
+
/** Maximum lookback window for the in-flight upload listener (24 hours). */
|
|
26
|
+
export const LISTENER_WINDOW_MS = 24 * 60 * 60 * 1000;
|
|
27
|
+
// --- Public users React Query cache ---
|
|
28
|
+
/** Stale time for the publicUsers query cache (30 minutes). */
|
|
29
|
+
export const PUBLIC_USERS_STALE_TIME_MS = 30 * 60 * 1000;
|
|
30
|
+
/** GC time for the publicUsers query cache (1 hour). */
|
|
31
|
+
export const PUBLIC_USERS_GC_TIME_MS = 60 * 60 * 1000;
|
|
32
|
+
//# sourceMappingURL=retention.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retention.js","sourceRoot":"","sources":["../../src/constants/retention.ts"],"names":[],"mappings":"AAAA,sDAAsD;AAEtD,oCAAoC;AAEpC,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC;AAErD,oBAAoB;AAEpB,4FAA4F;AAC5F,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,uEAAuE;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C,gCAAgC;AAEhC,oFAAoF;AACpF,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,CAAC;AAElD,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,CAAC;AAEpD,gCAAgC;AAEhC,uFAAuF;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C,+CAA+C;AAC/C,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C,4CAA4C;AAC5C,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD,8CAA8C;AAE9C,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEtD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEtD,yCAAyC;AAEzC,+DAA+D;AAC/D,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEzD,wDAAwD;AACxD,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Interval in minutes for the admin-task cleanup scheduled job. */
|
|
2
|
+
export declare const ADMIN_TASK_CLEANUP_INTERVAL = 15;
|
|
3
|
+
/** Batch size of expired task checkouts processed per scheduled run. */
|
|
4
|
+
export declare const ADMIN_TASK_EXPIRED_BATCH_SIZE = 500;
|
|
5
|
+
/** Safety cap on iterations within a single admin-task cleanup run. */
|
|
6
|
+
export declare const ADMIN_TASK_CLEANUP_MAX_ITERATIONS = 10;
|
|
7
|
+
/** Source URLs the syncProfanityList job pulls word lists from. */
|
|
8
|
+
export declare const WORD_LIST_URLS: readonly ["https://raw.githubusercontent.com/zacanger/profane-words/master/words.json", "https://raw.githubusercontent.com/RobertJGabriel/Google-profanity-words/master/list.txt"];
|
|
9
|
+
//# sourceMappingURL=scheduled-jobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduled-jobs.d.ts","sourceRoot":"","sources":["../../src/constants/scheduled-jobs.ts"],"names":[],"mappings":"AAIA,oEAAoE;AACpE,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,wEAAwE;AACxE,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,uEAAuE;AACvE,eAAO,MAAM,iCAAiC,KAAK,CAAC;AAIpD,mEAAmE;AACnE,eAAO,MAAM,cAAc,oLAGjB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Scheduled-job intervals, batch sizes, and source URLs.
|
|
2
|
+
// --- Admin task cleanup ---
|
|
3
|
+
/** Interval in minutes for the admin-task cleanup scheduled job. */
|
|
4
|
+
export const ADMIN_TASK_CLEANUP_INTERVAL = 15;
|
|
5
|
+
/** Batch size of expired task checkouts processed per scheduled run. */
|
|
6
|
+
export const ADMIN_TASK_EXPIRED_BATCH_SIZE = 500;
|
|
7
|
+
/** Safety cap on iterations within a single admin-task cleanup run. */
|
|
8
|
+
export const ADMIN_TASK_CLEANUP_MAX_ITERATIONS = 10;
|
|
9
|
+
// --- Profanity list sync ---
|
|
10
|
+
/** Source URLs the syncProfanityList job pulls word lists from. */
|
|
11
|
+
export const WORD_LIST_URLS = [
|
|
12
|
+
'https://raw.githubusercontent.com/zacanger/profane-words/master/words.json',
|
|
13
|
+
'https://raw.githubusercontent.com/RobertJGabriel/Google-profanity-words/master/list.txt',
|
|
14
|
+
];
|
|
15
|
+
//# sourceMappingURL=scheduled-jobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduled-jobs.js","sourceRoot":"","sources":["../../src/constants/scheduled-jobs.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,6BAA6B;AAE7B,oEAAoE;AACpE,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C,wEAAwE;AACxE,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAEjD,uEAAuE;AACvE,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAEpD,8BAA8B;AAE9B,mEAAmE;AACnE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,4EAA4E;IAC5E,yFAAyF;CACjF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** sessionStorage key holding the path the user wanted before being redirected to login. */
|
|
2
|
+
export declare const REDIRECT_PATH_KEY = "redirectPath";
|
|
3
|
+
/** localStorage key holding the last-seen app version (used by version-gate component). */
|
|
4
|
+
export declare const LS_VERSION_KEY = "ttt-app-version";
|
|
5
|
+
/** sessionStorage key marking that a version-mismatch reload was already attempted. */
|
|
6
|
+
export declare const SS_RELOAD_ATTEMPTED_KEY = "ttt-version-reload-attempted";
|
|
7
|
+
//# sourceMappingURL=storage-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-keys.d.ts","sourceRoot":"","sources":["../../src/constants/storage-keys.ts"],"names":[],"mappings":"AAEA,4FAA4F;AAC5F,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,2FAA2F;AAC3F,eAAO,MAAM,cAAc,oBAAoB,CAAC;AAEhD,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Well-known keys used in browser sessionStorage / localStorage.
|
|
2
|
+
/** sessionStorage key holding the path the user wanted before being redirected to login. */
|
|
3
|
+
export const REDIRECT_PATH_KEY = 'redirectPath';
|
|
4
|
+
/** localStorage key holding the last-seen app version (used by version-gate component). */
|
|
5
|
+
export const LS_VERSION_KEY = 'ttt-app-version';
|
|
6
|
+
/** sessionStorage key marking that a version-mismatch reload was already attempted. */
|
|
7
|
+
export const SS_RELOAD_ATTEMPTED_KEY = 'ttt-version-reload-attempted';
|
|
8
|
+
//# sourceMappingURL=storage-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-keys.js","sourceRoot":"","sources":["../../src/constants/storage-keys.ts"],"names":[],"mappings":"AAAA,iEAAiE;AAEjE,4FAA4F;AAC5F,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEhD,2FAA2F;AAC3F,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAEhD,uFAAuF;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const projectIdSchema: z.ZodString;
|
|
3
|
+
export declare const userIdSchema: z.ZodString;
|
|
4
|
+
export declare const inviteIdSchema: z.ZodString;
|
|
5
|
+
export declare const violationIdSchema: z.ZodString;
|
|
6
|
+
export declare const opportunityIdSchema: z.ZodString;
|
|
7
|
+
export declare const jobIdSchema: z.ZodString;
|
|
8
|
+
export declare const replyIdSchema: z.ZodString;
|
|
9
|
+
export declare const channelIdSchema: z.ZodString;
|
|
10
|
+
export declare const taleIdSchema: z.ZodString;
|
|
11
|
+
export declare const tuneIdSchema: z.ZodString;
|
|
12
|
+
export declare const televisionIdSchema: z.ZodString;
|
|
13
|
+
export declare const chapterIdSchema: z.ZodString;
|
|
14
|
+
export declare const songIdSchema: z.ZodString;
|
|
15
|
+
export declare const showIdSchema: z.ZodString;
|
|
16
|
+
export declare const skillIdSchema: z.ZodString;
|
|
17
|
+
export declare const taskIdSchema: z.ZodString;
|
|
18
|
+
export declare const messageIdSchema: z.ZodString;
|
|
19
|
+
export declare const libraryIdSchema: z.ZodString;
|
|
20
|
+
export declare const itemIdSchema: z.ZodString;
|
|
21
|
+
export declare const addRemoveActionSchema: z.ZodEnum<["add", "remove"]>;
|
|
22
|
+
export declare const projectTypeSchema: z.ZodEnum<["Tales", "Tunes", "Television"]>;
|
|
23
|
+
export declare const titleSchema: z.ZodString;
|
|
24
|
+
//# sourceMappingURL=atoms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atoms.d.ts","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,eAAe,aAAoB,CAAC;AACjD,eAAO,MAAM,YAAY,aAAoB,CAAC;AAC9C,eAAO,MAAM,cAAc,aAAoB,CAAC;AAChD,eAAO,MAAM,iBAAiB,aAAoB,CAAC;AACnD,eAAO,MAAM,mBAAmB,aAAoB,CAAC;AACrD,eAAO,MAAM,WAAW,aAAoB,CAAC;AAC7C,eAAO,MAAM,aAAa,aAAoB,CAAC;AAC/C,eAAO,MAAM,eAAe,aAAoB,CAAC;AACjD,eAAO,MAAM,YAAY,aAAoB,CAAC;AAC9C,eAAO,MAAM,YAAY,aAAoB,CAAC;AAC9C,eAAO,MAAM,kBAAkB,aAAoB,CAAC;AACpD,eAAO,MAAM,eAAe,aAAoB,CAAC;AACjD,eAAO,MAAM,YAAY,aAAoB,CAAC;AAC9C,eAAO,MAAM,YAAY,aAAoB,CAAC;AAC9C,eAAO,MAAM,aAAa,aAAoB,CAAC;AAC/C,eAAO,MAAM,YAAY,aAAoB,CAAC;AAC9C,eAAO,MAAM,eAAe,aAAoB,CAAC;AACjD,eAAO,MAAM,eAAe,aAAoB,CAAC;AACjD,eAAO,MAAM,YAAY,aAAoB,CAAC;AAG9C,eAAO,MAAM,qBAAqB,8BAA4B,CAAC;AAC/D,eAAO,MAAM,iBAAiB,6CAA2C,CAAC;AAG1E,eAAO,MAAM,WAAW,aAA6B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// ID atoms — every callable input that includes an ID field uses one of these.
|
|
3
|
+
// Kept as separate constants (not aliases of a generic `idSchema`) so consumers
|
|
4
|
+
// reading a callable's schema can see exactly which entity the field refers to.
|
|
5
|
+
export const projectIdSchema = z.string().min(1);
|
|
6
|
+
export const userIdSchema = z.string().min(1);
|
|
7
|
+
export const inviteIdSchema = z.string().min(1);
|
|
8
|
+
export const violationIdSchema = z.string().min(1);
|
|
9
|
+
export const opportunityIdSchema = z.string().min(1);
|
|
10
|
+
export const jobIdSchema = z.string().min(1);
|
|
11
|
+
export const replyIdSchema = z.string().min(1);
|
|
12
|
+
export const channelIdSchema = z.string().min(1);
|
|
13
|
+
export const taleIdSchema = z.string().min(1);
|
|
14
|
+
export const tuneIdSchema = z.string().min(1);
|
|
15
|
+
export const televisionIdSchema = z.string().min(1);
|
|
16
|
+
export const chapterIdSchema = z.string().min(1);
|
|
17
|
+
export const songIdSchema = z.string().min(1);
|
|
18
|
+
export const showIdSchema = z.string().min(1);
|
|
19
|
+
export const skillIdSchema = z.string().min(1);
|
|
20
|
+
export const taskIdSchema = z.string().min(1);
|
|
21
|
+
export const messageIdSchema = z.string().min(1);
|
|
22
|
+
export const libraryIdSchema = z.string().min(1);
|
|
23
|
+
export const itemIdSchema = z.string().min(1);
|
|
24
|
+
// Action / enum atoms.
|
|
25
|
+
export const addRemoveActionSchema = z.enum(['add', 'remove']);
|
|
26
|
+
export const projectTypeSchema = z.enum(['Tales', 'Tunes', 'Television']);
|
|
27
|
+
// String shape atoms.
|
|
28
|
+
export const titleSchema = z.string().min(1).max(200);
|
|
29
|
+
//# sourceMappingURL=atoms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atoms.js","sourceRoot":"","sources":["../../src/schemas/atoms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+EAA+E;AAC/E,gFAAgF;AAChF,gFAAgF;AAChF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACjD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAChD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACjD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,YAAY,GAA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C,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ShareOperationSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"add-pending">;
|
|
4
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
uid: z.ZodString;
|
|
7
|
+
}, "strict", z.ZodTypeAny, {
|
|
8
|
+
uid: string;
|
|
9
|
+
}, {
|
|
10
|
+
uid: string;
|
|
11
|
+
}>>;
|
|
12
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
sourceType: z.ZodOptional<z.ZodEnum<["invite", "job"]>>;
|
|
14
|
+
}, "strict", z.ZodTypeAny, {
|
|
15
|
+
type: "add-pending";
|
|
16
|
+
amount?: number | undefined;
|
|
17
|
+
user?: {
|
|
18
|
+
uid: string;
|
|
19
|
+
} | undefined;
|
|
20
|
+
sourceId?: string | undefined;
|
|
21
|
+
sourceType?: "invite" | "job" | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
type: "add-pending";
|
|
24
|
+
amount?: number | undefined;
|
|
25
|
+
user?: {
|
|
26
|
+
uid: string;
|
|
27
|
+
} | undefined;
|
|
28
|
+
sourceId?: string | undefined;
|
|
29
|
+
sourceType?: "invite" | "job" | undefined;
|
|
30
|
+
}>, z.ZodObject<{
|
|
31
|
+
type: z.ZodLiteral<"remove-pending">;
|
|
32
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
34
|
+
uid: z.ZodString;
|
|
35
|
+
}, "strict", z.ZodTypeAny, {
|
|
36
|
+
uid: string;
|
|
37
|
+
}, {
|
|
38
|
+
uid: string;
|
|
39
|
+
}>>;
|
|
40
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
sourceType: z.ZodOptional<z.ZodEnum<["invite", "job"]>>;
|
|
42
|
+
}, "strict", z.ZodTypeAny, {
|
|
43
|
+
type: "remove-pending";
|
|
44
|
+
amount?: number | undefined;
|
|
45
|
+
user?: {
|
|
46
|
+
uid: string;
|
|
47
|
+
} | undefined;
|
|
48
|
+
sourceId?: string | undefined;
|
|
49
|
+
sourceType?: "invite" | "job" | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
type: "remove-pending";
|
|
52
|
+
amount?: number | undefined;
|
|
53
|
+
user?: {
|
|
54
|
+
uid: string;
|
|
55
|
+
} | undefined;
|
|
56
|
+
sourceId?: string | undefined;
|
|
57
|
+
sourceType?: "invite" | "job" | undefined;
|
|
58
|
+
}>, z.ZodObject<{
|
|
59
|
+
type: z.ZodLiteral<"add-active">;
|
|
60
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
uid: z.ZodString;
|
|
63
|
+
}, "strict", z.ZodTypeAny, {
|
|
64
|
+
uid: string;
|
|
65
|
+
}, {
|
|
66
|
+
uid: string;
|
|
67
|
+
}>>;
|
|
68
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
69
|
+
sourceType: z.ZodOptional<z.ZodEnum<["invite", "job"]>>;
|
|
70
|
+
}, "strict", z.ZodTypeAny, {
|
|
71
|
+
type: "add-active";
|
|
72
|
+
amount?: number | undefined;
|
|
73
|
+
user?: {
|
|
74
|
+
uid: string;
|
|
75
|
+
} | undefined;
|
|
76
|
+
sourceId?: string | undefined;
|
|
77
|
+
sourceType?: "invite" | "job" | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
type: "add-active";
|
|
80
|
+
amount?: number | undefined;
|
|
81
|
+
user?: {
|
|
82
|
+
uid: string;
|
|
83
|
+
} | undefined;
|
|
84
|
+
sourceId?: string | undefined;
|
|
85
|
+
sourceType?: "invite" | "job" | undefined;
|
|
86
|
+
}>, z.ZodObject<{
|
|
87
|
+
type: z.ZodLiteral<"create-project">;
|
|
88
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
90
|
+
uid: z.ZodString;
|
|
91
|
+
}, "strict", z.ZodTypeAny, {
|
|
92
|
+
uid: string;
|
|
93
|
+
}, {
|
|
94
|
+
uid: string;
|
|
95
|
+
}>>;
|
|
96
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
97
|
+
sourceType: z.ZodOptional<z.ZodEnum<["invite", "job"]>>;
|
|
98
|
+
}, "strict", z.ZodTypeAny, {
|
|
99
|
+
type: "create-project";
|
|
100
|
+
amount?: number | undefined;
|
|
101
|
+
user?: {
|
|
102
|
+
uid: string;
|
|
103
|
+
} | undefined;
|
|
104
|
+
sourceId?: string | undefined;
|
|
105
|
+
sourceType?: "invite" | "job" | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
type: "create-project";
|
|
108
|
+
amount?: number | undefined;
|
|
109
|
+
user?: {
|
|
110
|
+
uid: string;
|
|
111
|
+
} | undefined;
|
|
112
|
+
sourceId?: string | undefined;
|
|
113
|
+
sourceType?: "invite" | "job" | undefined;
|
|
114
|
+
}>, z.ZodObject<{
|
|
115
|
+
type: z.ZodLiteral<"convert-invite">;
|
|
116
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
118
|
+
uid: z.ZodString;
|
|
119
|
+
}, "strict", z.ZodTypeAny, {
|
|
120
|
+
uid: string;
|
|
121
|
+
}, {
|
|
122
|
+
uid: string;
|
|
123
|
+
}>>;
|
|
124
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
125
|
+
sourceType: z.ZodOptional<z.ZodEnum<["invite", "job"]>>;
|
|
126
|
+
}, "strict", z.ZodTypeAny, {
|
|
127
|
+
type: "convert-invite";
|
|
128
|
+
amount?: number | undefined;
|
|
129
|
+
user?: {
|
|
130
|
+
uid: string;
|
|
131
|
+
} | undefined;
|
|
132
|
+
sourceId?: string | undefined;
|
|
133
|
+
sourceType?: "invite" | "job" | undefined;
|
|
134
|
+
}, {
|
|
135
|
+
type: "convert-invite";
|
|
136
|
+
amount?: number | undefined;
|
|
137
|
+
user?: {
|
|
138
|
+
uid: string;
|
|
139
|
+
} | undefined;
|
|
140
|
+
sourceId?: string | undefined;
|
|
141
|
+
sourceType?: "invite" | "job" | undefined;
|
|
142
|
+
}>]>;
|
|
143
|
+
export type ShareOperation = z.infer<typeof ShareOperationSchema>;
|
|
144
|
+
export type ShareOperationType = ShareOperation['type'];
|
|
145
|
+
export declare const ManageProjectSharesInputSchema: z.ZodObject<{
|
|
146
|
+
projectId: z.ZodString;
|
|
147
|
+
operation: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
148
|
+
type: z.ZodLiteral<"add-pending">;
|
|
149
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
uid: z.ZodString;
|
|
152
|
+
}, "strict", z.ZodTypeAny, {
|
|
153
|
+
uid: string;
|
|
154
|
+
}, {
|
|
155
|
+
uid: string;
|
|
156
|
+
}>>;
|
|
157
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
158
|
+
sourceType: z.ZodOptional<z.ZodEnum<["invite", "job"]>>;
|
|
159
|
+
}, "strict", z.ZodTypeAny, {
|
|
160
|
+
type: "add-pending";
|
|
161
|
+
amount?: number | undefined;
|
|
162
|
+
user?: {
|
|
163
|
+
uid: string;
|
|
164
|
+
} | undefined;
|
|
165
|
+
sourceId?: string | undefined;
|
|
166
|
+
sourceType?: "invite" | "job" | undefined;
|
|
167
|
+
}, {
|
|
168
|
+
type: "add-pending";
|
|
169
|
+
amount?: number | undefined;
|
|
170
|
+
user?: {
|
|
171
|
+
uid: string;
|
|
172
|
+
} | undefined;
|
|
173
|
+
sourceId?: string | undefined;
|
|
174
|
+
sourceType?: "invite" | "job" | undefined;
|
|
175
|
+
}>, z.ZodObject<{
|
|
176
|
+
type: z.ZodLiteral<"remove-pending">;
|
|
177
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
179
|
+
uid: z.ZodString;
|
|
180
|
+
}, "strict", z.ZodTypeAny, {
|
|
181
|
+
uid: string;
|
|
182
|
+
}, {
|
|
183
|
+
uid: string;
|
|
184
|
+
}>>;
|
|
185
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
186
|
+
sourceType: z.ZodOptional<z.ZodEnum<["invite", "job"]>>;
|
|
187
|
+
}, "strict", z.ZodTypeAny, {
|
|
188
|
+
type: "remove-pending";
|
|
189
|
+
amount?: number | undefined;
|
|
190
|
+
user?: {
|
|
191
|
+
uid: string;
|
|
192
|
+
} | undefined;
|
|
193
|
+
sourceId?: string | undefined;
|
|
194
|
+
sourceType?: "invite" | "job" | undefined;
|
|
195
|
+
}, {
|
|
196
|
+
type: "remove-pending";
|
|
197
|
+
amount?: number | undefined;
|
|
198
|
+
user?: {
|
|
199
|
+
uid: string;
|
|
200
|
+
} | undefined;
|
|
201
|
+
sourceId?: string | undefined;
|
|
202
|
+
sourceType?: "invite" | "job" | undefined;
|
|
203
|
+
}>, z.ZodObject<{
|
|
204
|
+
type: z.ZodLiteral<"add-active">;
|
|
205
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
206
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
207
|
+
uid: z.ZodString;
|
|
208
|
+
}, "strict", z.ZodTypeAny, {
|
|
209
|
+
uid: string;
|
|
210
|
+
}, {
|
|
211
|
+
uid: string;
|
|
212
|
+
}>>;
|
|
213
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
214
|
+
sourceType: z.ZodOptional<z.ZodEnum<["invite", "job"]>>;
|
|
215
|
+
}, "strict", z.ZodTypeAny, {
|
|
216
|
+
type: "add-active";
|
|
217
|
+
amount?: number | undefined;
|
|
218
|
+
user?: {
|
|
219
|
+
uid: string;
|
|
220
|
+
} | undefined;
|
|
221
|
+
sourceId?: string | undefined;
|
|
222
|
+
sourceType?: "invite" | "job" | undefined;
|
|
223
|
+
}, {
|
|
224
|
+
type: "add-active";
|
|
225
|
+
amount?: number | undefined;
|
|
226
|
+
user?: {
|
|
227
|
+
uid: string;
|
|
228
|
+
} | undefined;
|
|
229
|
+
sourceId?: string | undefined;
|
|
230
|
+
sourceType?: "invite" | "job" | undefined;
|
|
231
|
+
}>, z.ZodObject<{
|
|
232
|
+
type: z.ZodLiteral<"create-project">;
|
|
233
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
234
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
235
|
+
uid: z.ZodString;
|
|
236
|
+
}, "strict", z.ZodTypeAny, {
|
|
237
|
+
uid: string;
|
|
238
|
+
}, {
|
|
239
|
+
uid: string;
|
|
240
|
+
}>>;
|
|
241
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
242
|
+
sourceType: z.ZodOptional<z.ZodEnum<["invite", "job"]>>;
|
|
243
|
+
}, "strict", z.ZodTypeAny, {
|
|
244
|
+
type: "create-project";
|
|
245
|
+
amount?: number | undefined;
|
|
246
|
+
user?: {
|
|
247
|
+
uid: string;
|
|
248
|
+
} | undefined;
|
|
249
|
+
sourceId?: string | undefined;
|
|
250
|
+
sourceType?: "invite" | "job" | undefined;
|
|
251
|
+
}, {
|
|
252
|
+
type: "create-project";
|
|
253
|
+
amount?: number | undefined;
|
|
254
|
+
user?: {
|
|
255
|
+
uid: string;
|
|
256
|
+
} | undefined;
|
|
257
|
+
sourceId?: string | undefined;
|
|
258
|
+
sourceType?: "invite" | "job" | undefined;
|
|
259
|
+
}>, z.ZodObject<{
|
|
260
|
+
type: z.ZodLiteral<"convert-invite">;
|
|
261
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
263
|
+
uid: z.ZodString;
|
|
264
|
+
}, "strict", z.ZodTypeAny, {
|
|
265
|
+
uid: string;
|
|
266
|
+
}, {
|
|
267
|
+
uid: string;
|
|
268
|
+
}>>;
|
|
269
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
270
|
+
sourceType: z.ZodOptional<z.ZodEnum<["invite", "job"]>>;
|
|
271
|
+
}, "strict", z.ZodTypeAny, {
|
|
272
|
+
type: "convert-invite";
|
|
273
|
+
amount?: number | undefined;
|
|
274
|
+
user?: {
|
|
275
|
+
uid: string;
|
|
276
|
+
} | undefined;
|
|
277
|
+
sourceId?: string | undefined;
|
|
278
|
+
sourceType?: "invite" | "job" | undefined;
|
|
279
|
+
}, {
|
|
280
|
+
type: "convert-invite";
|
|
281
|
+
amount?: number | undefined;
|
|
282
|
+
user?: {
|
|
283
|
+
uid: string;
|
|
284
|
+
} | undefined;
|
|
285
|
+
sourceId?: string | undefined;
|
|
286
|
+
sourceType?: "invite" | "job" | undefined;
|
|
287
|
+
}>]>;
|
|
288
|
+
}, "strict", z.ZodTypeAny, {
|
|
289
|
+
projectId: string;
|
|
290
|
+
operation: {
|
|
291
|
+
type: "add-pending";
|
|
292
|
+
amount?: number | undefined;
|
|
293
|
+
user?: {
|
|
294
|
+
uid: string;
|
|
295
|
+
} | undefined;
|
|
296
|
+
sourceId?: string | undefined;
|
|
297
|
+
sourceType?: "invite" | "job" | undefined;
|
|
298
|
+
} | {
|
|
299
|
+
type: "remove-pending";
|
|
300
|
+
amount?: number | undefined;
|
|
301
|
+
user?: {
|
|
302
|
+
uid: string;
|
|
303
|
+
} | undefined;
|
|
304
|
+
sourceId?: string | undefined;
|
|
305
|
+
sourceType?: "invite" | "job" | undefined;
|
|
306
|
+
} | {
|
|
307
|
+
type: "add-active";
|
|
308
|
+
amount?: number | undefined;
|
|
309
|
+
user?: {
|
|
310
|
+
uid: string;
|
|
311
|
+
} | undefined;
|
|
312
|
+
sourceId?: string | undefined;
|
|
313
|
+
sourceType?: "invite" | "job" | undefined;
|
|
314
|
+
} | {
|
|
315
|
+
type: "create-project";
|
|
316
|
+
amount?: number | undefined;
|
|
317
|
+
user?: {
|
|
318
|
+
uid: string;
|
|
319
|
+
} | undefined;
|
|
320
|
+
sourceId?: string | undefined;
|
|
321
|
+
sourceType?: "invite" | "job" | undefined;
|
|
322
|
+
} | {
|
|
323
|
+
type: "convert-invite";
|
|
324
|
+
amount?: number | undefined;
|
|
325
|
+
user?: {
|
|
326
|
+
uid: string;
|
|
327
|
+
} | undefined;
|
|
328
|
+
sourceId?: string | undefined;
|
|
329
|
+
sourceType?: "invite" | "job" | undefined;
|
|
330
|
+
};
|
|
331
|
+
}, {
|
|
332
|
+
projectId: string;
|
|
333
|
+
operation: {
|
|
334
|
+
type: "add-pending";
|
|
335
|
+
amount?: number | undefined;
|
|
336
|
+
user?: {
|
|
337
|
+
uid: string;
|
|
338
|
+
} | undefined;
|
|
339
|
+
sourceId?: string | undefined;
|
|
340
|
+
sourceType?: "invite" | "job" | undefined;
|
|
341
|
+
} | {
|
|
342
|
+
type: "remove-pending";
|
|
343
|
+
amount?: number | undefined;
|
|
344
|
+
user?: {
|
|
345
|
+
uid: string;
|
|
346
|
+
} | undefined;
|
|
347
|
+
sourceId?: string | undefined;
|
|
348
|
+
sourceType?: "invite" | "job" | undefined;
|
|
349
|
+
} | {
|
|
350
|
+
type: "add-active";
|
|
351
|
+
amount?: number | undefined;
|
|
352
|
+
user?: {
|
|
353
|
+
uid: string;
|
|
354
|
+
} | undefined;
|
|
355
|
+
sourceId?: string | undefined;
|
|
356
|
+
sourceType?: "invite" | "job" | undefined;
|
|
357
|
+
} | {
|
|
358
|
+
type: "create-project";
|
|
359
|
+
amount?: number | undefined;
|
|
360
|
+
user?: {
|
|
361
|
+
uid: string;
|
|
362
|
+
} | undefined;
|
|
363
|
+
sourceId?: string | undefined;
|
|
364
|
+
sourceType?: "invite" | "job" | undefined;
|
|
365
|
+
} | {
|
|
366
|
+
type: "convert-invite";
|
|
367
|
+
amount?: number | undefined;
|
|
368
|
+
user?: {
|
|
369
|
+
uid: string;
|
|
370
|
+
} | undefined;
|
|
371
|
+
sourceId?: string | undefined;
|
|
372
|
+
sourceType?: "invite" | "job" | undefined;
|
|
373
|
+
};
|
|
374
|
+
}>;
|
|
375
|
+
export type ManageProjectSharesInput = z.infer<typeof ManageProjectSharesInputSchema>;
|
|
376
|
+
//# sourceMappingURL=share-operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-operation.d.ts","sourceRoot":"","sources":["../../src/schemas/share-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoC/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AAGxD,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGhC,CAAC;AAEZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { projectIdSchema, userIdSchema, } from './atoms.js';
|
|
3
|
+
// Mirrors the ShareOperation TS type in packages/ttt-core/src/types/project.ts.
|
|
4
|
+
// Each branch is .strict() — unknown keys are a contract violation.
|
|
5
|
+
//
|
|
6
|
+
// NOTE: The original ShareOperation type had an optional `projectData: FullProject`
|
|
7
|
+
// field. It was dead — no call site in ttt-prod ever populated it and the
|
|
8
|
+
// shareOperations handler never read it. Removed during the Zod migration.
|
|
9
|
+
//
|
|
10
|
+
// Per-branch shape decisions:
|
|
11
|
+
// - All branches accept optional `amount`, `user`, `sourceId`, `sourceType` to
|
|
12
|
+
// match the existing TS type. Business-logic checks (e.g. "add-pending requires
|
|
13
|
+
// user OR sourceId") live in shareOperations.ts, NOT in the schema.
|
|
14
|
+
// - sourceType is constrained to its two known values.
|
|
15
|
+
const userRefSchema = z.object({
|
|
16
|
+
uid: userIdSchema,
|
|
17
|
+
}).strict();
|
|
18
|
+
const sourceTypeSchema = z.enum(['invite', 'job']);
|
|
19
|
+
export const ShareOperationSchema = z.discriminatedUnion('type', [
|
|
20
|
+
z.object({
|
|
21
|
+
type: z.literal('add-pending'),
|
|
22
|
+
amount: z.number().int().positive().optional(),
|
|
23
|
+
user: userRefSchema.optional(),
|
|
24
|
+
sourceId: z.string().min(1).optional(),
|
|
25
|
+
sourceType: sourceTypeSchema.optional(),
|
|
26
|
+
}).strict(),
|
|
27
|
+
z.object({
|
|
28
|
+
type: z.literal('remove-pending'),
|
|
29
|
+
amount: z.number().int().positive().optional(),
|
|
30
|
+
user: userRefSchema.optional(),
|
|
31
|
+
sourceId: z.string().min(1).optional(),
|
|
32
|
+
sourceType: sourceTypeSchema.optional(),
|
|
33
|
+
}).strict(),
|
|
34
|
+
z.object({
|
|
35
|
+
type: z.literal('add-active'),
|
|
36
|
+
amount: z.number().int().positive().optional(),
|
|
37
|
+
user: userRefSchema.optional(),
|
|
38
|
+
sourceId: z.string().min(1).optional(),
|
|
39
|
+
sourceType: sourceTypeSchema.optional(),
|
|
40
|
+
}).strict(),
|
|
41
|
+
z.object({
|
|
42
|
+
type: z.literal('create-project'),
|
|
43
|
+
amount: z.number().int().positive().optional(),
|
|
44
|
+
user: userRefSchema.optional(),
|
|
45
|
+
sourceId: z.string().min(1).optional(),
|
|
46
|
+
sourceType: sourceTypeSchema.optional(),
|
|
47
|
+
}).strict(),
|
|
48
|
+
z.object({
|
|
49
|
+
type: z.literal('convert-invite'),
|
|
50
|
+
amount: z.number().int().positive().optional(),
|
|
51
|
+
user: userRefSchema.optional(),
|
|
52
|
+
sourceId: z.string().min(1).optional(),
|
|
53
|
+
sourceType: sourceTypeSchema.optional(),
|
|
54
|
+
}).strict(),
|
|
55
|
+
]);
|
|
56
|
+
// Re-export for convenience.
|
|
57
|
+
export const ManageProjectSharesInputSchema = z.object({
|
|
58
|
+
projectId: projectIdSchema,
|
|
59
|
+
operation: ShareOperationSchema,
|
|
60
|
+
}).strict();
|
|
61
|
+
//# sourceMappingURL=share-operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-operation.js","sourceRoot":"","sources":["../../src/schemas/share-operation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,eAAe,EACf,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,gFAAgF;AAChF,oEAAoE;AACpE,EAAE;AACF,oFAAoF;AACpF,0EAA0E;AAC1E,2EAA2E;AAC3E,EAAE;AACF,8BAA8B;AAC9B,+E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