@classytic/arc 2.3.0 → 2.4.2
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/README.md +187 -18
- package/bin/arc.js +11 -3
- package/dist/BaseController-CkM5dUh_.mjs +1031 -0
- package/dist/{EventTransport-BkUDYZEb.d.mts → EventTransport-wc5hSLik.d.mts} +1 -1
- package/dist/{HookSystem-BsGV-j2l.mjs → HookSystem-COkyWztM.mjs} +2 -3
- package/dist/{ResourceRegistry-7Ic20ZMw.mjs → ResourceRegistry-DeCIFlix.mjs} +8 -5
- package/dist/adapters/index.d.mts +3 -5
- package/dist/adapters/index.mjs +2 -3
- package/dist/{prisma-DJbMt3yf.mjs → adapters-DTC4Ug66.mjs} +45 -12
- package/dist/audit/index.d.mts +4 -7
- package/dist/audit/index.mjs +2 -29
- package/dist/audit/mongodb.d.mts +1 -4
- package/dist/audit/mongodb.mjs +2 -3
- package/dist/auth/index.d.mts +7 -9
- package/dist/auth/index.mjs +65 -63
- package/dist/auth/redis-session.d.mts +1 -1
- package/dist/auth/redis-session.mjs +1 -2
- package/dist/{betterAuthOpenApi-DjWDddNc.mjs → betterAuthOpenApi-lz0IRbXJ.mjs} +4 -6
- package/dist/cache/index.d.mts +23 -23
- package/dist/cache/index.mjs +4 -6
- package/dist/{caching-GSDJcA6-.mjs → caching-BSXB-Xr7.mjs} +2 -24
- package/dist/chunk-BpYLSNr0.mjs +14 -0
- package/dist/circuitBreaker-BOBOpN2w.mjs +284 -0
- package/dist/circuitBreaker-JP2GdJ4b.d.mts +206 -0
- package/dist/cli/commands/describe.mjs +24 -7
- package/dist/cli/commands/docs.mjs +6 -7
- package/dist/cli/commands/doctor.d.mts +10 -0
- package/dist/cli/commands/doctor.mjs +156 -0
- package/dist/cli/commands/generate.mjs +66 -17
- package/dist/cli/commands/init.mjs +315 -45
- package/dist/cli/commands/introspect.mjs +2 -4
- package/dist/cli/index.d.mts +1 -10
- package/dist/cli/index.mjs +4 -153
- package/dist/{constants-DdXFXQtN.mjs → constants-Cxde4rpC.mjs} +1 -2
- package/dist/core/index.d.mts +3 -5
- package/dist/core/index.mjs +5 -4
- package/dist/core-C1XCMtqM.mjs +185 -0
- package/dist/{createApp-CgKOPhA4.mjs → createApp-ByWNRsZj.mjs} +64 -35
- package/dist/{defineResource-DWbpJYtm.mjs → defineResource-D9aY5Cy6.mjs} +108 -1157
- package/dist/discovery/index.mjs +37 -5
- package/dist/docs/index.d.mts +6 -9
- package/dist/docs/index.mjs +3 -21
- package/dist/dynamic/index.d.mts +93 -0
- package/dist/dynamic/index.mjs +122 -0
- package/dist/{elevation-DSTbVvYj.mjs → elevation-BEdACOLB.mjs} +5 -36
- package/dist/{elevation-DGo5shaX.d.mts → elevation-Ca_yveIO.d.mts} +41 -7
- package/dist/{errorHandler-C3GY3_ow.mjs → errorHandler--zp54tGc.mjs} +3 -5
- package/dist/errorHandler-Do4vVQ1f.d.mts +139 -0
- package/dist/{errors-DBANPbGr.mjs → errors-rxhfP7Hf.mjs} +1 -2
- package/dist/{eventPlugin-BEOvaDqo.mjs → eventPlugin-Ba00swHF.mjs} +25 -27
- package/dist/{eventPlugin-H6wDDjGO.d.mts → eventPlugin-iGrSEmwJ.d.mts} +105 -5
- package/dist/events/index.d.mts +72 -7
- package/dist/events/index.mjs +216 -4
- package/dist/events/transports/redis-stream-entry.d.mts +1 -1
- package/dist/events/transports/redis-stream-entry.mjs +19 -7
- package/dist/events/transports/redis.d.mts +1 -1
- package/dist/events/transports/redis.mjs +3 -4
- package/dist/factory/index.d.mts +23 -9
- package/dist/factory/index.mjs +48 -3
- package/dist/{fields-Bi_AVKSo.d.mts → fields-DFwdaWCq.d.mts} +1 -1
- package/dist/{fields-CTd_CrKr.mjs → fields-ipsbIRPK.mjs} +1 -2
- package/dist/hooks/index.d.mts +1 -3
- package/dist/hooks/index.mjs +2 -3
- package/dist/idempotency/index.d.mts +5 -5
- package/dist/idempotency/index.mjs +3 -7
- package/dist/idempotency/mongodb.d.mts +1 -1
- package/dist/idempotency/mongodb.mjs +4 -5
- package/dist/idempotency/redis.d.mts +1 -1
- package/dist/idempotency/redis.mjs +2 -5
- package/dist/{fastifyAdapter-6b_eRDBw.d.mts → index-BL8CaQih.d.mts} +56 -57
- package/dist/index-Diqcm14c.d.mts +369 -0
- package/dist/{prisma-Dy5S5F5i.d.mts → index-yhxyjqNb.d.mts} +4 -5
- package/dist/index.d.mts +100 -105
- package/dist/index.mjs +85 -58
- package/dist/integrations/event-gateway.d.mts +1 -1
- package/dist/integrations/event-gateway.mjs +8 -4
- package/dist/integrations/index.d.mts +4 -2
- package/dist/integrations/index.mjs +1 -1
- package/dist/integrations/jobs.d.mts +2 -2
- package/dist/integrations/jobs.mjs +63 -14
- package/dist/integrations/mcp/index.d.mts +219 -0
- package/dist/integrations/mcp/index.mjs +572 -0
- package/dist/integrations/mcp/testing.d.mts +53 -0
- package/dist/integrations/mcp/testing.mjs +104 -0
- package/dist/integrations/streamline.mjs +39 -19
- package/dist/integrations/webhooks.d.mts +56 -0
- package/dist/integrations/webhooks.mjs +139 -0
- package/dist/integrations/websocket-redis.d.mts +46 -0
- package/dist/integrations/websocket-redis.mjs +50 -0
- package/dist/integrations/websocket.d.mts +68 -2
- package/dist/integrations/websocket.mjs +96 -13
- package/dist/{interface-CSNjltAc.d.mts → interface-B4awm1RJ.d.mts} +2 -2
- package/dist/interface-DGmPxakH.d.mts +2213 -0
- package/dist/{keys-DhqDRxv3.mjs → keys-qcD-TVJl.mjs} +3 -4
- package/dist/{logger-ByrvQWZO.mjs → logger-Dz3j1ItV.mjs} +2 -4
- package/dist/{memory-B2v7KrCB.mjs → memory-Cb_7iy9e.mjs} +2 -4
- package/dist/metrics-Csh4nsvv.mjs +224 -0
- package/dist/migrations/index.d.mts +113 -44
- package/dist/migrations/index.mjs +84 -102
- package/dist/{mongodb-DNKEExbf.mjs → mongodb-BuQ7fNTg.mjs} +1 -4
- package/dist/{mongodb-ClykrfGo.d.mts → mongodb-CUpYfxfD.d.mts} +2 -3
- package/dist/{mongodb-Dg8O_gvd.d.mts → mongodb-bga9AbkD.d.mts} +2 -2
- package/dist/{openapi-9nB_kiuR.mjs → openapi-CBmZ6EQN.mjs} +4 -21
- package/dist/org/index.d.mts +12 -14
- package/dist/org/index.mjs +92 -119
- package/dist/org/types.d.mts +2 -2
- package/dist/org/types.mjs +1 -1
- package/dist/permissions/index.d.mts +4 -278
- package/dist/permissions/index.mjs +4 -579
- package/dist/permissions-CA5zg0yK.mjs +751 -0
- package/dist/plugins/index.d.mts +104 -107
- package/dist/plugins/index.mjs +203 -313
- package/dist/plugins/response-cache.mjs +4 -69
- package/dist/plugins/tracing-entry.d.mts +1 -1
- package/dist/plugins/tracing-entry.mjs +24 -11
- package/dist/{pluralize-CM-jZg7p.mjs → pluralize-CcT6qF0a.mjs} +12 -13
- package/dist/policies/index.d.mts +2 -2
- package/dist/policies/index.mjs +80 -83
- package/dist/presets/index.d.mts +26 -19
- package/dist/presets/index.mjs +2 -142
- package/dist/presets/multiTenant.d.mts +1 -4
- package/dist/presets/multiTenant.mjs +4 -6
- package/dist/presets-C9QXJV1u.mjs +422 -0
- package/dist/{queryCachePlugin-B6R0d4av.mjs → queryCachePlugin-ClosZdNS.mjs} +6 -27
- package/dist/{queryCachePlugin-Q6SYuHZ6.d.mts → queryCachePlugin-DcmETvcB.d.mts} +3 -3
- package/dist/queryParser-CgCtsjti.mjs +352 -0
- package/dist/{redis-UwjEp8Ea.d.mts → redis-CQ5YxMC5.d.mts} +2 -2
- package/dist/{redis-stream-CBg0upHI.d.mts → redis-stream-BW9UKLZM.d.mts} +9 -2
- package/dist/registry/index.d.mts +1 -4
- package/dist/registry/index.mjs +3 -4
- package/dist/{introspectionPlugin-B3JkrjwU.mjs → registry-I-ogLgL9.mjs} +1 -8
- package/dist/{requestContext-xi6OKBL-.mjs → requestContext-DYtmNpm5.mjs} +1 -3
- package/dist/resourceToTools-PMFE8HIv.mjs +533 -0
- package/dist/rpc/index.d.mts +90 -0
- package/dist/rpc/index.mjs +248 -0
- package/dist/{schemaConverter-Dtg0Kt9T.mjs → schemaConverter-DjzHpFam.mjs} +1 -2
- package/dist/schemas/index.d.mts +30 -30
- package/dist/schemas/index.mjs +2 -4
- package/dist/scope/index.d.mts +13 -2
- package/dist/scope/index.mjs +18 -5
- package/dist/{sessionManager-D_iEHjQl.d.mts → sessionManager-wbkYj2HL.d.mts} +2 -2
- package/dist/{sse-DkqQ1uxb.mjs → sse-BkViJPlT.mjs} +4 -25
- package/dist/testing/index.d.mts +551 -567
- package/dist/testing/index.mjs +1744 -1799
- package/dist/{tracing-8CEbhF0w.d.mts → tracing-bz_U4EM1.d.mts} +6 -1
- package/dist/{typeGuards-DwxA1t_L.mjs → typeGuards-Cj5Rgvlg.mjs} +1 -2
- package/dist/types/index.d.mts +4 -946
- package/dist/types/index.mjs +2 -4
- package/dist/types-BJmgxNbF.d.mts +275 -0
- package/dist/{types-RLkFVgaw.d.mts → types-BNUccdcf.d.mts} +2 -2
- package/dist/{types-Beqn1Un7.mjs → types-C6TQjtdi.mjs} +30 -2
- package/dist/{types-tKwaViYB.d.mts → types-Dt0-AI6E.d.mts} +68 -27
- package/dist/{types-DelU6kln.mjs → types-ZUu_h0jp.mjs} +1 -2
- package/dist/utils/index.d.mts +254 -351
- package/dist/utils/index.mjs +7 -6
- package/dist/utils-Dc0WhlIl.mjs +594 -0
- package/dist/versioning-BzfeHmhj.mjs +37 -0
- package/package.json +44 -10
- package/skills/arc/SKILL.md +518 -0
- package/skills/arc/references/auth.md +250 -0
- package/skills/arc/references/events.md +272 -0
- package/skills/arc/references/integrations.md +385 -0
- package/skills/arc/references/mcp.md +431 -0
- package/skills/arc/references/production.md +610 -0
- package/skills/arc/references/testing.md +183 -0
- package/dist/audited-CGdLiSlE.mjs +0 -140
- package/dist/chunk-C7Uep-_p.mjs +0 -20
- package/dist/circuitBreaker-CSS2VvL6.mjs +0 -1109
- package/dist/errorHandler-CW3OOeYq.d.mts +0 -72
- package/dist/interface-BtdYtQUA.d.mts +0 -1114
- package/dist/presets-BTeYbw7h.d.mts +0 -57
- package/dist/presets-CeFtfDR8.mjs +0 -119
- /package/dist/{errors-DAWRdiYP.d.mts → errors-CPpvPHT0.d.mts} +0 -0
- /package/dist/{externalPaths-SyPF2tgK.d.mts → externalPaths-DpO-s7r8.d.mts} +0 -0
- /package/dist/{interface-DTbsvIWe.d.mts → interface-D_BWALyZ.d.mts} +0 -0
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { t as PermissionCheck } from "./types-RLkFVgaw.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/permissions/presets.d.ts
|
|
4
|
-
declare namespace presets_d_exports {
|
|
5
|
-
export { adminOnly, authenticated, fullPublic, ownerWithAdminBypass, publicRead, publicReadAdminWrite, readOnly };
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* ResourcePermissions shape — matches the type in types/index.ts
|
|
9
|
-
*/
|
|
10
|
-
interface ResourcePermissions<TDoc = any> {
|
|
11
|
-
list?: PermissionCheck<TDoc>;
|
|
12
|
-
get?: PermissionCheck<TDoc>;
|
|
13
|
-
create?: PermissionCheck<TDoc>;
|
|
14
|
-
update?: PermissionCheck<TDoc>;
|
|
15
|
-
delete?: PermissionCheck<TDoc>;
|
|
16
|
-
}
|
|
17
|
-
type PermissionOverrides<TDoc = any> = Partial<ResourcePermissions<TDoc>>;
|
|
18
|
-
/**
|
|
19
|
-
* Public read, authenticated write.
|
|
20
|
-
* list + get = allowPublic(), create + update + delete = requireAuth()
|
|
21
|
-
*/
|
|
22
|
-
declare function publicRead<TDoc = any>(overrides?: PermissionOverrides<TDoc>): ResourcePermissions<TDoc>;
|
|
23
|
-
/**
|
|
24
|
-
* Public read, admin write.
|
|
25
|
-
* list + get = allowPublic(), create + update + delete = requireRoles(['admin'])
|
|
26
|
-
*/
|
|
27
|
-
declare function publicReadAdminWrite<TDoc = any>(roles?: readonly string[], overrides?: PermissionOverrides<TDoc>): ResourcePermissions<TDoc>;
|
|
28
|
-
/**
|
|
29
|
-
* All operations require authentication.
|
|
30
|
-
*/
|
|
31
|
-
declare function authenticated<TDoc = any>(overrides?: PermissionOverrides<TDoc>): ResourcePermissions<TDoc>;
|
|
32
|
-
/**
|
|
33
|
-
* All operations require specific roles.
|
|
34
|
-
* @param roles - Required roles (user needs at least one). Default: ['admin']
|
|
35
|
-
*/
|
|
36
|
-
declare function adminOnly<TDoc = any>(roles?: readonly string[], overrides?: PermissionOverrides<TDoc>): ResourcePermissions<TDoc>;
|
|
37
|
-
/**
|
|
38
|
-
* Owner-scoped with admin bypass.
|
|
39
|
-
* list = auth (scoped to owner), get = auth, create = auth,
|
|
40
|
-
* update + delete = ownership check with admin bypass.
|
|
41
|
-
*
|
|
42
|
-
* @param ownerField - Field containing owner ID (default: 'userId')
|
|
43
|
-
* @param bypassRoles - Roles that bypass ownership check (default: ['admin'])
|
|
44
|
-
*/
|
|
45
|
-
declare function ownerWithAdminBypass<TDoc = any>(ownerField?: Extract<keyof TDoc, string> | string, bypassRoles?: readonly string[], overrides?: PermissionOverrides<TDoc>): ResourcePermissions<TDoc>;
|
|
46
|
-
/**
|
|
47
|
-
* Full public access — no auth required for any operation.
|
|
48
|
-
* Use sparingly (dev/testing, truly public APIs).
|
|
49
|
-
*/
|
|
50
|
-
declare function fullPublic<TDoc = any>(overrides?: PermissionOverrides<TDoc>): ResourcePermissions<TDoc>;
|
|
51
|
-
/**
|
|
52
|
-
* Read-only: list + get authenticated, write operations denied.
|
|
53
|
-
* Useful for computed/derived resources.
|
|
54
|
-
*/
|
|
55
|
-
declare function readOnly<TDoc = any>(overrides?: PermissionOverrides<TDoc>): ResourcePermissions<TDoc>;
|
|
56
|
-
//#endregion
|
|
57
|
-
export { presets_d_exports as a, readOnly as c, ownerWithAdminBypass as i, authenticated as n, publicRead as o, fullPublic as r, publicReadAdminWrite as s, adminOnly as t };
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./chunk-C7Uep-_p.mjs";
|
|
2
|
-
import { allowPublic, anyOf, requireAuth, requireOwnership, requireRoles } from "./permissions/index.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/permissions/presets.ts
|
|
5
|
-
var presets_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
-
adminOnly: () => adminOnly,
|
|
7
|
-
authenticated: () => authenticated,
|
|
8
|
-
fullPublic: () => fullPublic,
|
|
9
|
-
ownerWithAdminBypass: () => ownerWithAdminBypass,
|
|
10
|
-
publicRead: () => publicRead,
|
|
11
|
-
publicReadAdminWrite: () => publicReadAdminWrite,
|
|
12
|
-
readOnly: () => readOnly
|
|
13
|
-
});
|
|
14
|
-
/**
|
|
15
|
-
* Merge a base preset with user overrides.
|
|
16
|
-
* Overrides replace individual operations — undefined values don't clear them.
|
|
17
|
-
*/
|
|
18
|
-
function withOverrides(base, overrides) {
|
|
19
|
-
if (!overrides) return base;
|
|
20
|
-
const filtered = Object.fromEntries(Object.entries(overrides).filter(([, v]) => v !== void 0));
|
|
21
|
-
return {
|
|
22
|
-
...base,
|
|
23
|
-
...filtered
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Public read, authenticated write.
|
|
28
|
-
* list + get = allowPublic(), create + update + delete = requireAuth()
|
|
29
|
-
*/
|
|
30
|
-
function publicRead(overrides) {
|
|
31
|
-
return withOverrides({
|
|
32
|
-
list: allowPublic(),
|
|
33
|
-
get: allowPublic(),
|
|
34
|
-
create: requireAuth(),
|
|
35
|
-
update: requireAuth(),
|
|
36
|
-
delete: requireAuth()
|
|
37
|
-
}, overrides);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Public read, admin write.
|
|
41
|
-
* list + get = allowPublic(), create + update + delete = requireRoles(['admin'])
|
|
42
|
-
*/
|
|
43
|
-
function publicReadAdminWrite(roles = ["admin"], overrides) {
|
|
44
|
-
return withOverrides({
|
|
45
|
-
list: allowPublic(),
|
|
46
|
-
get: allowPublic(),
|
|
47
|
-
create: requireRoles(roles),
|
|
48
|
-
update: requireRoles(roles),
|
|
49
|
-
delete: requireRoles(roles)
|
|
50
|
-
}, overrides);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* All operations require authentication.
|
|
54
|
-
*/
|
|
55
|
-
function authenticated(overrides) {
|
|
56
|
-
return withOverrides({
|
|
57
|
-
list: requireAuth(),
|
|
58
|
-
get: requireAuth(),
|
|
59
|
-
create: requireAuth(),
|
|
60
|
-
update: requireAuth(),
|
|
61
|
-
delete: requireAuth()
|
|
62
|
-
}, overrides);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* All operations require specific roles.
|
|
66
|
-
* @param roles - Required roles (user needs at least one). Default: ['admin']
|
|
67
|
-
*/
|
|
68
|
-
function adminOnly(roles = ["admin"], overrides) {
|
|
69
|
-
return withOverrides({
|
|
70
|
-
list: requireRoles(roles),
|
|
71
|
-
get: requireRoles(roles),
|
|
72
|
-
create: requireRoles(roles),
|
|
73
|
-
update: requireRoles(roles),
|
|
74
|
-
delete: requireRoles(roles)
|
|
75
|
-
}, overrides);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Owner-scoped with admin bypass.
|
|
79
|
-
* list = auth (scoped to owner), get = auth, create = auth,
|
|
80
|
-
* update + delete = ownership check with admin bypass.
|
|
81
|
-
*
|
|
82
|
-
* @param ownerField - Field containing owner ID (default: 'userId')
|
|
83
|
-
* @param bypassRoles - Roles that bypass ownership check (default: ['admin'])
|
|
84
|
-
*/
|
|
85
|
-
function ownerWithAdminBypass(ownerField = "userId", bypassRoles = ["admin"], overrides) {
|
|
86
|
-
return withOverrides({
|
|
87
|
-
list: requireAuth(),
|
|
88
|
-
get: requireAuth(),
|
|
89
|
-
create: requireAuth(),
|
|
90
|
-
update: anyOf(requireRoles(bypassRoles), requireOwnership(ownerField)),
|
|
91
|
-
delete: anyOf(requireRoles(bypassRoles), requireOwnership(ownerField))
|
|
92
|
-
}, overrides);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Full public access — no auth required for any operation.
|
|
96
|
-
* Use sparingly (dev/testing, truly public APIs).
|
|
97
|
-
*/
|
|
98
|
-
function fullPublic(overrides) {
|
|
99
|
-
return withOverrides({
|
|
100
|
-
list: allowPublic(),
|
|
101
|
-
get: allowPublic(),
|
|
102
|
-
create: allowPublic(),
|
|
103
|
-
update: allowPublic(),
|
|
104
|
-
delete: allowPublic()
|
|
105
|
-
}, overrides);
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Read-only: list + get authenticated, write operations denied.
|
|
109
|
-
* Useful for computed/derived resources.
|
|
110
|
-
*/
|
|
111
|
-
function readOnly(overrides) {
|
|
112
|
-
return withOverrides({
|
|
113
|
-
list: requireAuth(),
|
|
114
|
-
get: requireAuth()
|
|
115
|
-
}, overrides);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
//#endregion
|
|
119
|
-
export { presets_exports as a, readOnly as c, ownerWithAdminBypass as i, authenticated as n, publicRead as o, fullPublic as r, publicReadAdminWrite as s, adminOnly as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|