@nebutra/contracts 0.1.0 → 0.1.1

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.
@@ -0,0 +1,37 @@
1
+
2
+ > @nebutra/contracts@0.1.1 build /home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/commerce/contracts
3
+ > tsup
4
+
5
+ CLI Building entry: src/billing.ts, src/events.ts, src/identity.ts, src/index.ts, src/notifications.ts
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v8.5.1
8
+ CLI Using tsup config: /home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/commerce/contracts/tsup.config.ts
9
+ CLI Target: es2022
10
+ CLI Cleaning output folder
11
+ ESM Build start
12
+ ESM dist/billing.js 332.00 B
13
+ ESM dist/events.js 173.00 B
14
+ ESM dist/identity.js 563.00 B
15
+ ESM dist/index.js 2.01 KB
16
+ ESM dist/chunk-NFJTVIKD.js 1.32 KB
17
+ ESM dist/chunk-2NXI4PJM.js 565.00 B
18
+ ESM dist/chunk-5JNQ2KAT.js 2.07 KB
19
+ ESM dist/notifications.js 1.11 KB
20
+ ESM dist/chunk-F4BR76CX.js 2.91 KB
21
+ ESM dist/billing.js.map 71.00 B
22
+ ESM dist/events.js.map 71.00 B
23
+ ESM dist/identity.js.map 71.00 B
24
+ ESM dist/index.js.map 71.00 B
25
+ ESM dist/chunk-NFJTVIKD.js.map 2.78 KB
26
+ ESM dist/chunk-2NXI4PJM.js.map 1.16 KB
27
+ ESM dist/chunk-5JNQ2KAT.js.map 4.47 KB
28
+ ESM dist/notifications.js.map 71.00 B
29
+ ESM dist/chunk-F4BR76CX.js.map 6.05 KB
30
+ ESM ⚡️ Build success in 66ms
31
+ DTS Build start
32
+ DTS ⚡️ Build success in 25419ms
33
+ DTS dist/index.d.ts 1.69 KB
34
+ DTS dist/billing.d.ts 2.11 KB
35
+ DTS dist/events.d.ts 1020.00 B
36
+ DTS dist/identity.d.ts 4.03 KB
37
+ DTS dist/notifications.d.ts 6.09 KB
@@ -0,0 +1,4 @@
1
+
2
+ > @nebutra/contracts@0.1.1 typecheck /home/runner/work/Nebutra-Sailor/Nebutra-Sailor/packages/commerce/contracts
3
+ > tsc --noEmit
4
+
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # @nebutra/contracts
2
+
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Publish registry package metadata under the MIT license.
@@ -0,0 +1,59 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const UsageTypeContractSchema: z.ZodEnum<{
4
+ API_CALL: "API_CALL";
5
+ AI_TOKEN: "AI_TOKEN";
6
+ STORAGE: "STORAGE";
7
+ COMPUTE: "COMPUTE";
8
+ BANDWIDTH: "BANDWIDTH";
9
+ CUSTOM: "CUSTOM";
10
+ }>;
11
+ type UsageTypeContract = z.infer<typeof UsageTypeContractSchema>;
12
+ declare const UsageLedgerSourceContractSchema: z.ZodEnum<{
13
+ API: "API";
14
+ WORKFLOW: "WORKFLOW";
15
+ WEBHOOK: "WEBHOOK";
16
+ SYSTEM: "SYSTEM";
17
+ BACKFILL: "BACKFILL";
18
+ }>;
19
+ type UsageLedgerSourceContract = z.infer<typeof UsageLedgerSourceContractSchema>;
20
+ declare const UsageLedgerEntryInputSchema: z.ZodObject<{
21
+ organizationId: z.ZodString;
22
+ idempotencyKey: z.ZodString;
23
+ eventId: z.ZodOptional<z.ZodString>;
24
+ subscriptionId: z.ZodOptional<z.ZodString>;
25
+ userId: z.ZodOptional<z.ZodString>;
26
+ source: z.ZodDefault<z.ZodEnum<{
27
+ API: "API";
28
+ WORKFLOW: "WORKFLOW";
29
+ WEBHOOK: "WEBHOOK";
30
+ SYSTEM: "SYSTEM";
31
+ BACKFILL: "BACKFILL";
32
+ }>>;
33
+ type: z.ZodEnum<{
34
+ API_CALL: "API_CALL";
35
+ AI_TOKEN: "AI_TOKEN";
36
+ STORAGE: "STORAGE";
37
+ COMPUTE: "COMPUTE";
38
+ BANDWIDTH: "BANDWIDTH";
39
+ CUSTOM: "CUSTOM";
40
+ }>;
41
+ resource: z.ZodOptional<z.ZodString>;
42
+ quantity: z.ZodNumber;
43
+ unit: z.ZodDefault<z.ZodString>;
44
+ unitCost: z.ZodOptional<z.ZodNumber>;
45
+ totalCost: z.ZodOptional<z.ZodNumber>;
46
+ currency: z.ZodDefault<z.ZodString>;
47
+ occurredAt: z.ZodCoercedDate<unknown>;
48
+ ingestVersion: z.ZodDefault<z.ZodString>;
49
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
50
+ }, z.core.$strip>;
51
+ type UsageLedgerEntryInput = z.infer<typeof UsageLedgerEntryInputSchema>;
52
+ declare const PricingCatalogVersionSchema: z.ZodObject<{
53
+ planSlug: z.ZodString;
54
+ version: z.ZodString;
55
+ effectiveFrom: z.ZodCoercedDate<unknown>;
56
+ }, z.core.$strip>;
57
+ type PricingCatalogVersion = z.infer<typeof PricingCatalogVersionSchema>;
58
+
59
+ export { type PricingCatalogVersion, PricingCatalogVersionSchema, type UsageLedgerEntryInput, UsageLedgerEntryInputSchema, type UsageLedgerSourceContract, UsageLedgerSourceContractSchema, type UsageTypeContract, UsageTypeContractSchema };
@@ -0,0 +1,13 @@
1
+ import {
2
+ PricingCatalogVersionSchema,
3
+ UsageLedgerEntryInputSchema,
4
+ UsageLedgerSourceContractSchema,
5
+ UsageTypeContractSchema
6
+ } from "./chunk-NFJTVIKD.js";
7
+ export {
8
+ PricingCatalogVersionSchema,
9
+ UsageLedgerEntryInputSchema,
10
+ UsageLedgerSourceContractSchema,
11
+ UsageTypeContractSchema
12
+ };
13
+ //# sourceMappingURL=billing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,21 @@
1
+ // src/events.ts
2
+ import { z } from "zod";
3
+ var EventContextSchema = z.object({
4
+ tenantId: z.string().min(1),
5
+ userId: z.string().min(1).optional(),
6
+ requestId: z.string().min(1).optional(),
7
+ traceId: z.string().min(1).optional(),
8
+ occurredAt: z.coerce.date(),
9
+ contractVersion: z.literal("v1").default("v1")
10
+ });
11
+ var EventEnvelopeSchema = z.object({
12
+ eventName: z.string().min(1),
13
+ context: EventContextSchema,
14
+ payload: z.record(z.string(), z.unknown())
15
+ });
16
+
17
+ export {
18
+ EventContextSchema,
19
+ EventEnvelopeSchema
20
+ };
21
+ //# sourceMappingURL=chunk-2NXI4PJM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/events.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const EventContextSchema = z.object({\n tenantId: z.string().min(1),\n userId: z.string().min(1).optional(),\n requestId: z.string().min(1).optional(),\n traceId: z.string().min(1).optional(),\n occurredAt: z.coerce.date(),\n contractVersion: z.literal(\"v1\").default(\"v1\"),\n});\nexport type EventContext = z.infer<typeof EventContextSchema>;\n\nexport const EventEnvelopeSchema = z.object({\n eventName: z.string().min(1),\n context: EventContextSchema,\n payload: z.record(z.string(), z.unknown()),\n});\nexport type EventEnvelope = z.infer<typeof EventEnvelopeSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,qBAAqB,EAAE,OAAO;AAAA,EACzC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC1B,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACnC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACtC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACpC,YAAY,EAAE,OAAO,KAAK;AAAA,EAC1B,iBAAiB,EAAE,QAAQ,IAAI,EAAE,QAAQ,IAAI;AAC/C,CAAC;AAGM,IAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC3B,SAAS;AAAA,EACT,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC;AAC3C,CAAC;","names":[]}
@@ -0,0 +1,63 @@
1
+ // src/identity.ts
2
+ import { z } from "zod";
3
+ var AuthProviderSchema = z.enum(["clerk", "authjs", "nebutra", "custom"]);
4
+ var CanonicalRoleSchema = z.enum(["OWNER", "ADMIN", "MEMBER", "VIEWER"]);
5
+ var CanonicalPlanSchema = z.enum(["FREE", "PRO", "ENTERPRISE"]);
6
+ var CanonicalIdentitySchema = z.object({
7
+ provider: AuthProviderSchema,
8
+ userId: z.string().min(1),
9
+ organizationId: z.string().min(1).optional(),
10
+ role: CanonicalRoleSchema.optional(),
11
+ plan: CanonicalPlanSchema.optional(),
12
+ email: z.string().email().optional(),
13
+ sessionId: z.string().min(1).optional(),
14
+ claimsVersion: z.literal("v1").default("v1")
15
+ });
16
+ var ExternalAccountLinkSchema = z.object({
17
+ provider: AuthProviderSchema,
18
+ providerUserId: z.string().min(1),
19
+ internalUserId: z.string().min(1),
20
+ linkedAt: z.coerce.date(),
21
+ metadata: z.record(z.string(), z.unknown()).default({})
22
+ });
23
+ var TenantHeaderContractSchema = z.object({
24
+ "x-user-id": z.string().min(1).optional(),
25
+ "x-organization-id": z.string().min(1).optional(),
26
+ "x-role": z.string().min(1).optional(),
27
+ "x-plan": CanonicalPlanSchema.optional()
28
+ });
29
+ var NebutraOAuthScopeSchema = z.enum([
30
+ "openid",
31
+ "profile",
32
+ "email",
33
+ "organization:read",
34
+ "organization:write",
35
+ "content:read",
36
+ "content:write",
37
+ "billing:read"
38
+ ]);
39
+ var OAuthClientTypeSchema = z.enum(["CONFIDENTIAL", "PUBLIC"]);
40
+ var OAuthClientRegistrationSchema = z.object({
41
+ name: z.string().min(1).max(255),
42
+ description: z.string().max(1e3).optional(),
43
+ type: OAuthClientTypeSchema.default("CONFIDENTIAL"),
44
+ redirectUris: z.array(z.string().url()).min(1),
45
+ allowedScopes: z.array(NebutraOAuthScopeSchema).default(["openid", "profile"]),
46
+ websiteUrl: z.string().url().optional(),
47
+ logoUrl: z.string().url().optional(),
48
+ privacyPolicyUrl: z.string().url().optional(),
49
+ tosUrl: z.string().url().optional()
50
+ });
51
+
52
+ export {
53
+ AuthProviderSchema,
54
+ CanonicalRoleSchema,
55
+ CanonicalPlanSchema,
56
+ CanonicalIdentitySchema,
57
+ ExternalAccountLinkSchema,
58
+ TenantHeaderContractSchema,
59
+ NebutraOAuthScopeSchema,
60
+ OAuthClientTypeSchema,
61
+ OAuthClientRegistrationSchema
62
+ };
63
+ //# sourceMappingURL=chunk-5JNQ2KAT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/identity.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const AuthProviderSchema = z.enum([\"clerk\", \"authjs\", \"nebutra\", \"custom\"]);\nexport type AuthProvider = z.infer<typeof AuthProviderSchema>;\n\nexport const CanonicalRoleSchema = z.enum([\"OWNER\", \"ADMIN\", \"MEMBER\", \"VIEWER\"]);\nexport type CanonicalRole = z.infer<typeof CanonicalRoleSchema>;\n\nexport const CanonicalPlanSchema = z.enum([\"FREE\", \"PRO\", \"ENTERPRISE\"]);\nexport type CanonicalPlan = z.infer<typeof CanonicalPlanSchema>;\n\nexport const CanonicalIdentitySchema = z.object({\n provider: AuthProviderSchema,\n userId: z.string().min(1),\n organizationId: z.string().min(1).optional(),\n role: CanonicalRoleSchema.optional(),\n plan: CanonicalPlanSchema.optional(),\n email: z.string().email().optional(),\n sessionId: z.string().min(1).optional(),\n claimsVersion: z.literal(\"v1\").default(\"v1\"),\n});\nexport type CanonicalIdentity = z.infer<typeof CanonicalIdentitySchema>;\n\nexport const ExternalAccountLinkSchema = z.object({\n provider: AuthProviderSchema,\n providerUserId: z.string().min(1),\n internalUserId: z.string().min(1),\n linkedAt: z.coerce.date(),\n metadata: z.record(z.string(), z.unknown()).default({}),\n});\nexport type ExternalAccountLink = z.infer<typeof ExternalAccountLinkSchema>;\n\nexport const TenantHeaderContractSchema = z.object({\n \"x-user-id\": z.string().min(1).optional(),\n \"x-organization-id\": z.string().min(1).optional(),\n \"x-role\": z.string().min(1).optional(),\n \"x-plan\": CanonicalPlanSchema.optional(),\n});\nexport type TenantHeaderContract = z.infer<typeof TenantHeaderContractSchema>;\n\n// ============================================\n// OAuth 2.0 / OIDC Scope & Client Contracts\n// ============================================\n\nexport const NebutraOAuthScopeSchema = z.enum([\n \"openid\",\n \"profile\",\n \"email\",\n \"organization:read\",\n \"organization:write\",\n \"content:read\",\n \"content:write\",\n \"billing:read\",\n]);\nexport type NebutraOAuthScope = z.infer<typeof NebutraOAuthScopeSchema>;\n\nexport const OAuthClientTypeSchema = z.enum([\"CONFIDENTIAL\", \"PUBLIC\"]);\nexport type OAuthClientType = z.infer<typeof OAuthClientTypeSchema>;\n\nexport const OAuthClientRegistrationSchema = z.object({\n name: z.string().min(1).max(255),\n description: z.string().max(1000).optional(),\n type: OAuthClientTypeSchema.default(\"CONFIDENTIAL\"),\n redirectUris: z.array(z.string().url()).min(1),\n allowedScopes: z.array(NebutraOAuthScopeSchema).default([\"openid\", \"profile\"]),\n websiteUrl: z.string().url().optional(),\n logoUrl: z.string().url().optional(),\n privacyPolicyUrl: z.string().url().optional(),\n tosUrl: z.string().url().optional(),\n});\nexport type OAuthClientRegistration = z.infer<typeof OAuthClientRegistrationSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,qBAAqB,EAAE,KAAK,CAAC,SAAS,UAAU,WAAW,QAAQ,CAAC;AAG1E,IAAM,sBAAsB,EAAE,KAAK,CAAC,SAAS,SAAS,UAAU,QAAQ,CAAC;AAGzE,IAAM,sBAAsB,EAAE,KAAK,CAAC,QAAQ,OAAO,YAAY,CAAC;AAGhE,IAAM,0BAA0B,EAAE,OAAO;AAAA,EAC9C,UAAU;AAAA,EACV,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACxB,gBAAgB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EAC3C,MAAM,oBAAoB,SAAS;AAAA,EACnC,MAAM,oBAAoB,SAAS;AAAA,EACnC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS;AAAA,EACnC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACtC,eAAe,EAAE,QAAQ,IAAI,EAAE,QAAQ,IAAI;AAC7C,CAAC;AAGM,IAAM,4BAA4B,EAAE,OAAO;AAAA,EAChD,UAAU;AAAA,EACV,gBAAgB,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAChC,gBAAgB,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAChC,UAAU,EAAE,OAAO,KAAK;AAAA,EACxB,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC;AAGM,IAAM,6BAA6B,EAAE,OAAO;AAAA,EACjD,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACxC,qBAAqB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EAChD,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACrC,UAAU,oBAAoB,SAAS;AACzC,CAAC;AAOM,IAAM,0BAA0B,EAAE,KAAK;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,wBAAwB,EAAE,KAAK,CAAC,gBAAgB,QAAQ,CAAC;AAG/D,IAAM,gCAAgC,EAAE,OAAO;AAAA,EACpD,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/B,aAAa,EAAE,OAAO,EAAE,IAAI,GAAI,EAAE,SAAS;AAAA,EAC3C,MAAM,sBAAsB,QAAQ,cAAc;AAAA,EAClD,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EAC7C,eAAe,EAAE,MAAM,uBAAuB,EAAE,QAAQ,CAAC,UAAU,SAAS,CAAC;AAAA,EAC7E,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACtC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACnC,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC5C,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AACpC,CAAC;","names":[]}
@@ -0,0 +1,85 @@
1
+ // src/notifications.ts
2
+ import { z } from "zod";
3
+ var NotificationChannelContractSchema = z.enum(["in_app", "email", "push", "sms", "chat"]);
4
+ var NotificationFrequencyContractSchema = z.enum([
5
+ "immediate",
6
+ "daily",
7
+ "weekly",
8
+ "never"
9
+ ]);
10
+ var NotificationRuntimeStatusContractSchema = z.object({
11
+ provider: z.enum(["novu", "direct"]),
12
+ providerLabel: z.string().min(1),
13
+ mode: z.enum(["managed", "self_hosted", "preview", "degraded"]),
14
+ canManagePreferences: z.boolean(),
15
+ canViewInbox: z.boolean(),
16
+ canMarkInboxRead: z.boolean(),
17
+ summary: z.string().min(1),
18
+ reason: z.string().optional(),
19
+ missing: z.array(z.string())
20
+ });
21
+ var NotificationPreferenceContractSchema = z.object({
22
+ userId: z.string().min(1),
23
+ tenantId: z.string().min(1).optional(),
24
+ channel: NotificationChannelContractSchema,
25
+ enabled: z.boolean(),
26
+ disabledCategories: z.array(z.string()).optional(),
27
+ frequency: NotificationFrequencyContractSchema,
28
+ updatedAt: z.string().datetime().optional()
29
+ });
30
+ var NotificationItemContractSchema = z.object({
31
+ id: z.string().min(1),
32
+ userId: z.string().min(1),
33
+ tenantId: z.string().min(1).optional(),
34
+ type: z.string().min(1),
35
+ title: z.string(),
36
+ body: z.string(),
37
+ data: z.record(z.string(), z.unknown()).optional(),
38
+ read: z.boolean(),
39
+ createdAt: z.string().datetime(),
40
+ updatedAt: z.string().datetime()
41
+ });
42
+ var NotificationListQueryContractSchema = z.object({
43
+ limit: z.coerce.number().int().min(1).max(100).default(50),
44
+ offset: z.coerce.number().int().min(0).default(0),
45
+ unreadOnly: z.coerce.boolean().optional()
46
+ });
47
+ var NotificationListResponseContractSchema = z.object({
48
+ items: z.array(NotificationItemContractSchema),
49
+ total: z.number().int().nonnegative(),
50
+ unreadCount: z.number().int().nonnegative()
51
+ });
52
+ var NotificationUnreadCountResponseContractSchema = z.object({
53
+ count: z.number().int().nonnegative()
54
+ });
55
+ var NotificationMarkReadRequestContractSchema = z.object({
56
+ ids: z.array(z.string().min(1)).min(1).max(100)
57
+ });
58
+ var NotificationMutationCountResponseContractSchema = z.object({
59
+ count: z.number().int().nonnegative()
60
+ });
61
+ var NotificationSettingsUpdateRequestContractSchema = z.object({
62
+ type: z.string().min(1),
63
+ channel: NotificationChannelContractSchema,
64
+ enabled: z.boolean()
65
+ });
66
+ var NotificationSettingsUpdateResponseContractSchema = z.object({
67
+ ok: z.literal(true),
68
+ preference: NotificationPreferenceContractSchema
69
+ });
70
+
71
+ export {
72
+ NotificationChannelContractSchema,
73
+ NotificationFrequencyContractSchema,
74
+ NotificationRuntimeStatusContractSchema,
75
+ NotificationPreferenceContractSchema,
76
+ NotificationItemContractSchema,
77
+ NotificationListQueryContractSchema,
78
+ NotificationListResponseContractSchema,
79
+ NotificationUnreadCountResponseContractSchema,
80
+ NotificationMarkReadRequestContractSchema,
81
+ NotificationMutationCountResponseContractSchema,
82
+ NotificationSettingsUpdateRequestContractSchema,
83
+ NotificationSettingsUpdateResponseContractSchema
84
+ };
85
+ //# sourceMappingURL=chunk-F4BR76CX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/notifications.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const NotificationChannelContractSchema = z.enum([\"in_app\", \"email\", \"push\", \"sms\", \"chat\"]);\nexport type NotificationChannelContract = z.infer<typeof NotificationChannelContractSchema>;\n\nexport const NotificationFrequencyContractSchema = z.enum([\n \"immediate\",\n \"daily\",\n \"weekly\",\n \"never\",\n]);\nexport type NotificationFrequencyContract = z.infer<typeof NotificationFrequencyContractSchema>;\n\nexport const NotificationRuntimeStatusContractSchema = z.object({\n provider: z.enum([\"novu\", \"direct\"]),\n providerLabel: z.string().min(1),\n mode: z.enum([\"managed\", \"self_hosted\", \"preview\", \"degraded\"]),\n canManagePreferences: z.boolean(),\n canViewInbox: z.boolean(),\n canMarkInboxRead: z.boolean(),\n summary: z.string().min(1),\n reason: z.string().optional(),\n missing: z.array(z.string()),\n});\nexport type NotificationRuntimeStatusContract = z.infer<\n typeof NotificationRuntimeStatusContractSchema\n>;\n\nexport const NotificationPreferenceContractSchema = z.object({\n userId: z.string().min(1),\n tenantId: z.string().min(1).optional(),\n channel: NotificationChannelContractSchema,\n enabled: z.boolean(),\n disabledCategories: z.array(z.string()).optional(),\n frequency: NotificationFrequencyContractSchema,\n updatedAt: z.string().datetime().optional(),\n});\nexport type NotificationPreferenceContract = z.infer<typeof NotificationPreferenceContractSchema>;\n\nexport const NotificationItemContractSchema = z.object({\n id: z.string().min(1),\n userId: z.string().min(1),\n tenantId: z.string().min(1).optional(),\n type: z.string().min(1),\n title: z.string(),\n body: z.string(),\n data: z.record(z.string(), z.unknown()).optional(),\n read: z.boolean(),\n createdAt: z.string().datetime(),\n updatedAt: z.string().datetime(),\n});\nexport type NotificationItemContract = z.infer<typeof NotificationItemContractSchema>;\n\nexport const NotificationListQueryContractSchema = z.object({\n limit: z.coerce.number().int().min(1).max(100).default(50),\n offset: z.coerce.number().int().min(0).default(0),\n unreadOnly: z.coerce.boolean().optional(),\n});\nexport type NotificationListQueryContract = z.infer<typeof NotificationListQueryContractSchema>;\n\nexport const NotificationListResponseContractSchema = z.object({\n items: z.array(NotificationItemContractSchema),\n total: z.number().int().nonnegative(),\n unreadCount: z.number().int().nonnegative(),\n});\nexport type NotificationListResponseContract = z.infer<\n typeof NotificationListResponseContractSchema\n>;\n\nexport const NotificationUnreadCountResponseContractSchema = z.object({\n count: z.number().int().nonnegative(),\n});\nexport type NotificationUnreadCountResponseContract = z.infer<\n typeof NotificationUnreadCountResponseContractSchema\n>;\n\nexport const NotificationMarkReadRequestContractSchema = z.object({\n ids: z.array(z.string().min(1)).min(1).max(100),\n});\nexport type NotificationMarkReadRequestContract = z.infer<\n typeof NotificationMarkReadRequestContractSchema\n>;\n\nexport const NotificationMutationCountResponseContractSchema = z.object({\n count: z.number().int().nonnegative(),\n});\nexport type NotificationMutationCountResponseContract = z.infer<\n typeof NotificationMutationCountResponseContractSchema\n>;\n\nexport const NotificationSettingsUpdateRequestContractSchema = z.object({\n type: z.string().min(1),\n channel: NotificationChannelContractSchema,\n enabled: z.boolean(),\n});\nexport type NotificationSettingsUpdateRequestContract = z.infer<\n typeof NotificationSettingsUpdateRequestContractSchema\n>;\n\nexport const NotificationSettingsUpdateResponseContractSchema = z.object({\n ok: z.literal(true),\n preference: NotificationPreferenceContractSchema,\n});\nexport type NotificationSettingsUpdateResponseContract = z.infer<\n typeof NotificationSettingsUpdateResponseContractSchema\n>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,oCAAoC,EAAE,KAAK,CAAC,UAAU,SAAS,QAAQ,OAAO,MAAM,CAAC;AAG3F,IAAM,sCAAsC,EAAE,KAAK;AAAA,EACxD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,0CAA0C,EAAE,OAAO;AAAA,EAC9D,UAAU,EAAE,KAAK,CAAC,QAAQ,QAAQ,CAAC;AAAA,EACnC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC/B,MAAM,EAAE,KAAK,CAAC,WAAW,eAAe,WAAW,UAAU,CAAC;AAAA,EAC9D,sBAAsB,EAAE,QAAQ;AAAA,EAChC,cAAc,EAAE,QAAQ;AAAA,EACxB,kBAAkB,EAAE,QAAQ;AAAA,EAC5B,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACzB,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AAC7B,CAAC;AAKM,IAAM,uCAAuC,EAAE,OAAO;AAAA,EAC3D,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACxB,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACrC,SAAS;AAAA,EACT,SAAS,EAAE,QAAQ;AAAA,EACnB,oBAAoB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;AAAA,EACjD,WAAW;AAAA,EACX,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;AAC5C,CAAC;AAGM,IAAM,iCAAiC,EAAE,OAAO;AAAA,EACrD,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACpB,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACxB,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACrC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACtB,OAAO,EAAE,OAAO;AAAA,EAChB,MAAM,EAAE,OAAO;AAAA,EACf,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAAE,SAAS;AAAA,EACjD,MAAM,EAAE,QAAQ;AAAA,EAChB,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,WAAW,EAAE,OAAO,EAAE,SAAS;AACjC,CAAC;AAGM,IAAM,sCAAsC,EAAE,OAAO;AAAA,EAC1D,OAAO,EAAE,OAAO,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,QAAQ,EAAE;AAAA,EACzD,QAAQ,EAAE,OAAO,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC;AAAA,EAChD,YAAY,EAAE,OAAO,QAAQ,EAAE,SAAS;AAC1C,CAAC;AAGM,IAAM,yCAAyC,EAAE,OAAO;AAAA,EAC7D,OAAO,EAAE,MAAM,8BAA8B;AAAA,EAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY;AAAA,EACpC,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY;AAC5C,CAAC;AAKM,IAAM,gDAAgD,EAAE,OAAO;AAAA,EACpE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY;AACtC,CAAC;AAKM,IAAM,4CAA4C,EAAE,OAAO;AAAA,EAChE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAChD,CAAC;AAKM,IAAM,kDAAkD,EAAE,OAAO;AAAA,EACtE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY;AACtC,CAAC;AAKM,IAAM,kDAAkD,EAAE,OAAO;AAAA,EACtE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACtB,SAAS;AAAA,EACT,SAAS,EAAE,QAAQ;AACrB,CAAC;AAKM,IAAM,mDAAmD,EAAE,OAAO;AAAA,EACvE,IAAI,EAAE,QAAQ,IAAI;AAAA,EAClB,YAAY;AACd,CAAC;","names":[]}
@@ -0,0 +1,48 @@
1
+ // src/billing.ts
2
+ import { z } from "zod";
3
+ var UsageTypeContractSchema = z.enum([
4
+ "API_CALL",
5
+ "AI_TOKEN",
6
+ "STORAGE",
7
+ "COMPUTE",
8
+ "BANDWIDTH",
9
+ "CUSTOM"
10
+ ]);
11
+ var UsageLedgerSourceContractSchema = z.enum([
12
+ "API",
13
+ "WORKFLOW",
14
+ "WEBHOOK",
15
+ "SYSTEM",
16
+ "BACKFILL"
17
+ ]);
18
+ var UsageLedgerEntryInputSchema = z.object({
19
+ organizationId: z.string().min(1),
20
+ idempotencyKey: z.string().min(1),
21
+ eventId: z.string().min(1).optional(),
22
+ subscriptionId: z.string().min(1).optional(),
23
+ userId: z.string().min(1).optional(),
24
+ source: UsageLedgerSourceContractSchema.default("API"),
25
+ type: UsageTypeContractSchema,
26
+ resource: z.string().min(1).optional(),
27
+ quantity: z.number().int().positive(),
28
+ unit: z.string().min(1).default("unit"),
29
+ unitCost: z.number().nonnegative().optional(),
30
+ totalCost: z.number().nonnegative().optional(),
31
+ currency: z.string().length(3).default("USD"),
32
+ occurredAt: z.coerce.date(),
33
+ ingestVersion: z.string().min(1).default("v1"),
34
+ metadata: z.record(z.string(), z.unknown()).default({})
35
+ });
36
+ var PricingCatalogVersionSchema = z.object({
37
+ planSlug: z.string().min(1),
38
+ version: z.string().min(1),
39
+ effectiveFrom: z.coerce.date()
40
+ });
41
+
42
+ export {
43
+ UsageTypeContractSchema,
44
+ UsageLedgerSourceContractSchema,
45
+ UsageLedgerEntryInputSchema,
46
+ PricingCatalogVersionSchema
47
+ };
48
+ //# sourceMappingURL=chunk-NFJTVIKD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/billing.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const UsageTypeContractSchema = z.enum([\n \"API_CALL\",\n \"AI_TOKEN\",\n \"STORAGE\",\n \"COMPUTE\",\n \"BANDWIDTH\",\n \"CUSTOM\",\n]);\nexport type UsageTypeContract = z.infer<typeof UsageTypeContractSchema>;\n\nexport const UsageLedgerSourceContractSchema = z.enum([\n \"API\",\n \"WORKFLOW\",\n \"WEBHOOK\",\n \"SYSTEM\",\n \"BACKFILL\",\n]);\nexport type UsageLedgerSourceContract = z.infer<typeof UsageLedgerSourceContractSchema>;\n\nexport const UsageLedgerEntryInputSchema = z.object({\n organizationId: z.string().min(1),\n idempotencyKey: z.string().min(1),\n eventId: z.string().min(1).optional(),\n subscriptionId: z.string().min(1).optional(),\n userId: z.string().min(1).optional(),\n source: UsageLedgerSourceContractSchema.default(\"API\"),\n type: UsageTypeContractSchema,\n resource: z.string().min(1).optional(),\n quantity: z.number().int().positive(),\n unit: z.string().min(1).default(\"unit\"),\n unitCost: z.number().nonnegative().optional(),\n totalCost: z.number().nonnegative().optional(),\n currency: z.string().length(3).default(\"USD\"),\n occurredAt: z.coerce.date(),\n ingestVersion: z.string().min(1).default(\"v1\"),\n metadata: z.record(z.string(), z.unknown()).default({}),\n});\nexport type UsageLedgerEntryInput = z.infer<typeof UsageLedgerEntryInputSchema>;\n\nexport const PricingCatalogVersionSchema = z.object({\n planSlug: z.string().min(1),\n version: z.string().min(1),\n effectiveFrom: z.coerce.date(),\n});\nexport type PricingCatalogVersion = z.infer<typeof PricingCatalogVersionSchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,0BAA0B,EAAE,KAAK;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,kCAAkC,EAAE,KAAK;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,8BAA8B,EAAE,OAAO;AAAA,EAClD,gBAAgB,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAChC,gBAAgB,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAChC,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACpC,gBAAgB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EAC3C,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACnC,QAAQ,gCAAgC,QAAQ,KAAK;AAAA,EACrD,MAAM;AAAA,EACN,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS;AAAA,EACrC,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACpC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,QAAQ,MAAM;AAAA,EACtC,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS;AAAA,EAC5C,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS;AAAA,EAC7C,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,QAAQ,KAAK;AAAA,EAC5C,YAAY,EAAE,OAAO,KAAK;AAAA,EAC1B,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,QAAQ,IAAI;AAAA,EAC7C,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;AACxD,CAAC;AAGM,IAAM,8BAA8B,EAAE,OAAO;AAAA,EAClD,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EAC1B,SAAS,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACzB,eAAe,EAAE,OAAO,KAAK;AAC/B,CAAC;","names":[]}
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const EventContextSchema: z.ZodObject<{
4
+ tenantId: z.ZodString;
5
+ userId: z.ZodOptional<z.ZodString>;
6
+ requestId: z.ZodOptional<z.ZodString>;
7
+ traceId: z.ZodOptional<z.ZodString>;
8
+ occurredAt: z.ZodCoercedDate<unknown>;
9
+ contractVersion: z.ZodDefault<z.ZodLiteral<"v1">>;
10
+ }, z.core.$strip>;
11
+ type EventContext = z.infer<typeof EventContextSchema>;
12
+ declare const EventEnvelopeSchema: z.ZodObject<{
13
+ eventName: z.ZodString;
14
+ context: z.ZodObject<{
15
+ tenantId: z.ZodString;
16
+ userId: z.ZodOptional<z.ZodString>;
17
+ requestId: z.ZodOptional<z.ZodString>;
18
+ traceId: z.ZodOptional<z.ZodString>;
19
+ occurredAt: z.ZodCoercedDate<unknown>;
20
+ contractVersion: z.ZodDefault<z.ZodLiteral<"v1">>;
21
+ }, z.core.$strip>;
22
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
23
+ }, z.core.$strip>;
24
+ type EventEnvelope = z.infer<typeof EventEnvelopeSchema>;
25
+
26
+ export { type EventContext, EventContextSchema, type EventEnvelope, EventEnvelopeSchema };
package/dist/events.js ADDED
@@ -0,0 +1,9 @@
1
+ import {
2
+ EventContextSchema,
3
+ EventEnvelopeSchema
4
+ } from "./chunk-2NXI4PJM.js";
5
+ export {
6
+ EventContextSchema,
7
+ EventEnvelopeSchema
8
+ };
9
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,113 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const AuthProviderSchema: z.ZodEnum<{
4
+ custom: "custom";
5
+ clerk: "clerk";
6
+ authjs: "authjs";
7
+ nebutra: "nebutra";
8
+ }>;
9
+ type AuthProvider = z.infer<typeof AuthProviderSchema>;
10
+ declare const CanonicalRoleSchema: z.ZodEnum<{
11
+ OWNER: "OWNER";
12
+ ADMIN: "ADMIN";
13
+ MEMBER: "MEMBER";
14
+ VIEWER: "VIEWER";
15
+ }>;
16
+ type CanonicalRole = z.infer<typeof CanonicalRoleSchema>;
17
+ declare const CanonicalPlanSchema: z.ZodEnum<{
18
+ FREE: "FREE";
19
+ PRO: "PRO";
20
+ ENTERPRISE: "ENTERPRISE";
21
+ }>;
22
+ type CanonicalPlan = z.infer<typeof CanonicalPlanSchema>;
23
+ declare const CanonicalIdentitySchema: z.ZodObject<{
24
+ provider: z.ZodEnum<{
25
+ custom: "custom";
26
+ clerk: "clerk";
27
+ authjs: "authjs";
28
+ nebutra: "nebutra";
29
+ }>;
30
+ userId: z.ZodString;
31
+ organizationId: z.ZodOptional<z.ZodString>;
32
+ role: z.ZodOptional<z.ZodEnum<{
33
+ OWNER: "OWNER";
34
+ ADMIN: "ADMIN";
35
+ MEMBER: "MEMBER";
36
+ VIEWER: "VIEWER";
37
+ }>>;
38
+ plan: z.ZodOptional<z.ZodEnum<{
39
+ FREE: "FREE";
40
+ PRO: "PRO";
41
+ ENTERPRISE: "ENTERPRISE";
42
+ }>>;
43
+ email: z.ZodOptional<z.ZodString>;
44
+ sessionId: z.ZodOptional<z.ZodString>;
45
+ claimsVersion: z.ZodDefault<z.ZodLiteral<"v1">>;
46
+ }, z.core.$strip>;
47
+ type CanonicalIdentity = z.infer<typeof CanonicalIdentitySchema>;
48
+ declare const ExternalAccountLinkSchema: z.ZodObject<{
49
+ provider: z.ZodEnum<{
50
+ custom: "custom";
51
+ clerk: "clerk";
52
+ authjs: "authjs";
53
+ nebutra: "nebutra";
54
+ }>;
55
+ providerUserId: z.ZodString;
56
+ internalUserId: z.ZodString;
57
+ linkedAt: z.ZodCoercedDate<unknown>;
58
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
59
+ }, z.core.$strip>;
60
+ type ExternalAccountLink = z.infer<typeof ExternalAccountLinkSchema>;
61
+ declare const TenantHeaderContractSchema: z.ZodObject<{
62
+ "x-user-id": z.ZodOptional<z.ZodString>;
63
+ "x-organization-id": z.ZodOptional<z.ZodString>;
64
+ "x-role": z.ZodOptional<z.ZodString>;
65
+ "x-plan": z.ZodOptional<z.ZodEnum<{
66
+ FREE: "FREE";
67
+ PRO: "PRO";
68
+ ENTERPRISE: "ENTERPRISE";
69
+ }>>;
70
+ }, z.core.$strip>;
71
+ type TenantHeaderContract = z.infer<typeof TenantHeaderContractSchema>;
72
+ declare const NebutraOAuthScopeSchema: z.ZodEnum<{
73
+ email: "email";
74
+ openid: "openid";
75
+ profile: "profile";
76
+ "organization:read": "organization:read";
77
+ "organization:write": "organization:write";
78
+ "content:read": "content:read";
79
+ "content:write": "content:write";
80
+ "billing:read": "billing:read";
81
+ }>;
82
+ type NebutraOAuthScope = z.infer<typeof NebutraOAuthScopeSchema>;
83
+ declare const OAuthClientTypeSchema: z.ZodEnum<{
84
+ CONFIDENTIAL: "CONFIDENTIAL";
85
+ PUBLIC: "PUBLIC";
86
+ }>;
87
+ type OAuthClientType = z.infer<typeof OAuthClientTypeSchema>;
88
+ declare const OAuthClientRegistrationSchema: z.ZodObject<{
89
+ name: z.ZodString;
90
+ description: z.ZodOptional<z.ZodString>;
91
+ type: z.ZodDefault<z.ZodEnum<{
92
+ CONFIDENTIAL: "CONFIDENTIAL";
93
+ PUBLIC: "PUBLIC";
94
+ }>>;
95
+ redirectUris: z.ZodArray<z.ZodString>;
96
+ allowedScopes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
97
+ email: "email";
98
+ openid: "openid";
99
+ profile: "profile";
100
+ "organization:read": "organization:read";
101
+ "organization:write": "organization:write";
102
+ "content:read": "content:read";
103
+ "content:write": "content:write";
104
+ "billing:read": "billing:read";
105
+ }>>>;
106
+ websiteUrl: z.ZodOptional<z.ZodString>;
107
+ logoUrl: z.ZodOptional<z.ZodString>;
108
+ privacyPolicyUrl: z.ZodOptional<z.ZodString>;
109
+ tosUrl: z.ZodOptional<z.ZodString>;
110
+ }, z.core.$strip>;
111
+ type OAuthClientRegistration = z.infer<typeof OAuthClientRegistrationSchema>;
112
+
113
+ export { type AuthProvider, AuthProviderSchema, type CanonicalIdentity, CanonicalIdentitySchema, type CanonicalPlan, CanonicalPlanSchema, type CanonicalRole, CanonicalRoleSchema, type ExternalAccountLink, ExternalAccountLinkSchema, type NebutraOAuthScope, NebutraOAuthScopeSchema, type OAuthClientRegistration, OAuthClientRegistrationSchema, type OAuthClientType, OAuthClientTypeSchema, type TenantHeaderContract, TenantHeaderContractSchema };
@@ -0,0 +1,23 @@
1
+ import {
2
+ AuthProviderSchema,
3
+ CanonicalIdentitySchema,
4
+ CanonicalPlanSchema,
5
+ CanonicalRoleSchema,
6
+ ExternalAccountLinkSchema,
7
+ NebutraOAuthScopeSchema,
8
+ OAuthClientRegistrationSchema,
9
+ OAuthClientTypeSchema,
10
+ TenantHeaderContractSchema
11
+ } from "./chunk-5JNQ2KAT.js";
12
+ export {
13
+ AuthProviderSchema,
14
+ CanonicalIdentitySchema,
15
+ CanonicalPlanSchema,
16
+ CanonicalRoleSchema,
17
+ ExternalAccountLinkSchema,
18
+ NebutraOAuthScopeSchema,
19
+ OAuthClientRegistrationSchema,
20
+ OAuthClientTypeSchema,
21
+ TenantHeaderContractSchema
22
+ };
23
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,5 @@
1
+ export { PricingCatalogVersion, PricingCatalogVersionSchema, UsageLedgerEntryInput, UsageLedgerEntryInputSchema, UsageLedgerSourceContract, UsageLedgerSourceContractSchema, UsageTypeContract, UsageTypeContractSchema } from './billing.js';
2
+ export { EventContext, EventContextSchema, EventEnvelope, EventEnvelopeSchema } from './events.js';
3
+ export { AuthProvider, AuthProviderSchema, CanonicalIdentity, CanonicalIdentitySchema, CanonicalPlan, CanonicalPlanSchema, CanonicalRole, CanonicalRoleSchema, ExternalAccountLink, ExternalAccountLinkSchema, NebutraOAuthScope, NebutraOAuthScopeSchema, OAuthClientRegistration, OAuthClientRegistrationSchema, OAuthClientType, OAuthClientTypeSchema, TenantHeaderContract, TenantHeaderContractSchema } from './identity.js';
4
+ export { NotificationChannelContract, NotificationChannelContractSchema, NotificationFrequencyContract, NotificationFrequencyContractSchema, NotificationItemContract, NotificationItemContractSchema, NotificationListQueryContract, NotificationListQueryContractSchema, NotificationListResponseContract, NotificationListResponseContractSchema, NotificationMarkReadRequestContract, NotificationMarkReadRequestContractSchema, NotificationMutationCountResponseContract, NotificationMutationCountResponseContractSchema, NotificationPreferenceContract, NotificationPreferenceContractSchema, NotificationRuntimeStatusContract, NotificationRuntimeStatusContractSchema, NotificationSettingsUpdateRequestContract, NotificationSettingsUpdateRequestContractSchema, NotificationSettingsUpdateResponseContract, NotificationSettingsUpdateResponseContractSchema, NotificationUnreadCountResponseContract, NotificationUnreadCountResponseContractSchema } from './notifications.js';
5
+ import 'zod';
package/dist/index.js ADDED
@@ -0,0 +1,65 @@
1
+ import {
2
+ PricingCatalogVersionSchema,
3
+ UsageLedgerEntryInputSchema,
4
+ UsageLedgerSourceContractSchema,
5
+ UsageTypeContractSchema
6
+ } from "./chunk-NFJTVIKD.js";
7
+ import {
8
+ EventContextSchema,
9
+ EventEnvelopeSchema
10
+ } from "./chunk-2NXI4PJM.js";
11
+ import {
12
+ AuthProviderSchema,
13
+ CanonicalIdentitySchema,
14
+ CanonicalPlanSchema,
15
+ CanonicalRoleSchema,
16
+ ExternalAccountLinkSchema,
17
+ NebutraOAuthScopeSchema,
18
+ OAuthClientRegistrationSchema,
19
+ OAuthClientTypeSchema,
20
+ TenantHeaderContractSchema
21
+ } from "./chunk-5JNQ2KAT.js";
22
+ import {
23
+ NotificationChannelContractSchema,
24
+ NotificationFrequencyContractSchema,
25
+ NotificationItemContractSchema,
26
+ NotificationListQueryContractSchema,
27
+ NotificationListResponseContractSchema,
28
+ NotificationMarkReadRequestContractSchema,
29
+ NotificationMutationCountResponseContractSchema,
30
+ NotificationPreferenceContractSchema,
31
+ NotificationRuntimeStatusContractSchema,
32
+ NotificationSettingsUpdateRequestContractSchema,
33
+ NotificationSettingsUpdateResponseContractSchema,
34
+ NotificationUnreadCountResponseContractSchema
35
+ } from "./chunk-F4BR76CX.js";
36
+ export {
37
+ AuthProviderSchema,
38
+ CanonicalIdentitySchema,
39
+ CanonicalPlanSchema,
40
+ CanonicalRoleSchema,
41
+ EventContextSchema,
42
+ EventEnvelopeSchema,
43
+ ExternalAccountLinkSchema,
44
+ NebutraOAuthScopeSchema,
45
+ NotificationChannelContractSchema,
46
+ NotificationFrequencyContractSchema,
47
+ NotificationItemContractSchema,
48
+ NotificationListQueryContractSchema,
49
+ NotificationListResponseContractSchema,
50
+ NotificationMarkReadRequestContractSchema,
51
+ NotificationMutationCountResponseContractSchema,
52
+ NotificationPreferenceContractSchema,
53
+ NotificationRuntimeStatusContractSchema,
54
+ NotificationSettingsUpdateRequestContractSchema,
55
+ NotificationSettingsUpdateResponseContractSchema,
56
+ NotificationUnreadCountResponseContractSchema,
57
+ OAuthClientRegistrationSchema,
58
+ OAuthClientTypeSchema,
59
+ PricingCatalogVersionSchema,
60
+ TenantHeaderContractSchema,
61
+ UsageLedgerEntryInputSchema,
62
+ UsageLedgerSourceContractSchema,
63
+ UsageTypeContractSchema
64
+ };
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,144 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const NotificationChannelContractSchema: z.ZodEnum<{
4
+ email: "email";
5
+ in_app: "in_app";
6
+ push: "push";
7
+ sms: "sms";
8
+ chat: "chat";
9
+ }>;
10
+ type NotificationChannelContract = z.infer<typeof NotificationChannelContractSchema>;
11
+ declare const NotificationFrequencyContractSchema: z.ZodEnum<{
12
+ never: "never";
13
+ immediate: "immediate";
14
+ daily: "daily";
15
+ weekly: "weekly";
16
+ }>;
17
+ type NotificationFrequencyContract = z.infer<typeof NotificationFrequencyContractSchema>;
18
+ declare const NotificationRuntimeStatusContractSchema: z.ZodObject<{
19
+ provider: z.ZodEnum<{
20
+ novu: "novu";
21
+ direct: "direct";
22
+ }>;
23
+ providerLabel: z.ZodString;
24
+ mode: z.ZodEnum<{
25
+ managed: "managed";
26
+ self_hosted: "self_hosted";
27
+ preview: "preview";
28
+ degraded: "degraded";
29
+ }>;
30
+ canManagePreferences: z.ZodBoolean;
31
+ canViewInbox: z.ZodBoolean;
32
+ canMarkInboxRead: z.ZodBoolean;
33
+ summary: z.ZodString;
34
+ reason: z.ZodOptional<z.ZodString>;
35
+ missing: z.ZodArray<z.ZodString>;
36
+ }, z.core.$strip>;
37
+ type NotificationRuntimeStatusContract = z.infer<typeof NotificationRuntimeStatusContractSchema>;
38
+ declare const NotificationPreferenceContractSchema: z.ZodObject<{
39
+ userId: z.ZodString;
40
+ tenantId: z.ZodOptional<z.ZodString>;
41
+ channel: z.ZodEnum<{
42
+ email: "email";
43
+ in_app: "in_app";
44
+ push: "push";
45
+ sms: "sms";
46
+ chat: "chat";
47
+ }>;
48
+ enabled: z.ZodBoolean;
49
+ disabledCategories: z.ZodOptional<z.ZodArray<z.ZodString>>;
50
+ frequency: z.ZodEnum<{
51
+ never: "never";
52
+ immediate: "immediate";
53
+ daily: "daily";
54
+ weekly: "weekly";
55
+ }>;
56
+ updatedAt: z.ZodOptional<z.ZodString>;
57
+ }, z.core.$strip>;
58
+ type NotificationPreferenceContract = z.infer<typeof NotificationPreferenceContractSchema>;
59
+ declare const NotificationItemContractSchema: z.ZodObject<{
60
+ id: z.ZodString;
61
+ userId: z.ZodString;
62
+ tenantId: z.ZodOptional<z.ZodString>;
63
+ type: z.ZodString;
64
+ title: z.ZodString;
65
+ body: z.ZodString;
66
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
67
+ read: z.ZodBoolean;
68
+ createdAt: z.ZodString;
69
+ updatedAt: z.ZodString;
70
+ }, z.core.$strip>;
71
+ type NotificationItemContract = z.infer<typeof NotificationItemContractSchema>;
72
+ declare const NotificationListQueryContractSchema: z.ZodObject<{
73
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
74
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
75
+ unreadOnly: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
76
+ }, z.core.$strip>;
77
+ type NotificationListQueryContract = z.infer<typeof NotificationListQueryContractSchema>;
78
+ declare const NotificationListResponseContractSchema: z.ZodObject<{
79
+ items: z.ZodArray<z.ZodObject<{
80
+ id: z.ZodString;
81
+ userId: z.ZodString;
82
+ tenantId: z.ZodOptional<z.ZodString>;
83
+ type: z.ZodString;
84
+ title: z.ZodString;
85
+ body: z.ZodString;
86
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
87
+ read: z.ZodBoolean;
88
+ createdAt: z.ZodString;
89
+ updatedAt: z.ZodString;
90
+ }, z.core.$strip>>;
91
+ total: z.ZodNumber;
92
+ unreadCount: z.ZodNumber;
93
+ }, z.core.$strip>;
94
+ type NotificationListResponseContract = z.infer<typeof NotificationListResponseContractSchema>;
95
+ declare const NotificationUnreadCountResponseContractSchema: z.ZodObject<{
96
+ count: z.ZodNumber;
97
+ }, z.core.$strip>;
98
+ type NotificationUnreadCountResponseContract = z.infer<typeof NotificationUnreadCountResponseContractSchema>;
99
+ declare const NotificationMarkReadRequestContractSchema: z.ZodObject<{
100
+ ids: z.ZodArray<z.ZodString>;
101
+ }, z.core.$strip>;
102
+ type NotificationMarkReadRequestContract = z.infer<typeof NotificationMarkReadRequestContractSchema>;
103
+ declare const NotificationMutationCountResponseContractSchema: z.ZodObject<{
104
+ count: z.ZodNumber;
105
+ }, z.core.$strip>;
106
+ type NotificationMutationCountResponseContract = z.infer<typeof NotificationMutationCountResponseContractSchema>;
107
+ declare const NotificationSettingsUpdateRequestContractSchema: z.ZodObject<{
108
+ type: z.ZodString;
109
+ channel: z.ZodEnum<{
110
+ email: "email";
111
+ in_app: "in_app";
112
+ push: "push";
113
+ sms: "sms";
114
+ chat: "chat";
115
+ }>;
116
+ enabled: z.ZodBoolean;
117
+ }, z.core.$strip>;
118
+ type NotificationSettingsUpdateRequestContract = z.infer<typeof NotificationSettingsUpdateRequestContractSchema>;
119
+ declare const NotificationSettingsUpdateResponseContractSchema: z.ZodObject<{
120
+ ok: z.ZodLiteral<true>;
121
+ preference: z.ZodObject<{
122
+ userId: z.ZodString;
123
+ tenantId: z.ZodOptional<z.ZodString>;
124
+ channel: z.ZodEnum<{
125
+ email: "email";
126
+ in_app: "in_app";
127
+ push: "push";
128
+ sms: "sms";
129
+ chat: "chat";
130
+ }>;
131
+ enabled: z.ZodBoolean;
132
+ disabledCategories: z.ZodOptional<z.ZodArray<z.ZodString>>;
133
+ frequency: z.ZodEnum<{
134
+ never: "never";
135
+ immediate: "immediate";
136
+ daily: "daily";
137
+ weekly: "weekly";
138
+ }>;
139
+ updatedAt: z.ZodOptional<z.ZodString>;
140
+ }, z.core.$strip>;
141
+ }, z.core.$strip>;
142
+ type NotificationSettingsUpdateResponseContract = z.infer<typeof NotificationSettingsUpdateResponseContractSchema>;
143
+
144
+ export { type NotificationChannelContract, NotificationChannelContractSchema, type NotificationFrequencyContract, NotificationFrequencyContractSchema, type NotificationItemContract, NotificationItemContractSchema, type NotificationListQueryContract, NotificationListQueryContractSchema, type NotificationListResponseContract, NotificationListResponseContractSchema, type NotificationMarkReadRequestContract, NotificationMarkReadRequestContractSchema, type NotificationMutationCountResponseContract, NotificationMutationCountResponseContractSchema, type NotificationPreferenceContract, NotificationPreferenceContractSchema, type NotificationRuntimeStatusContract, NotificationRuntimeStatusContractSchema, type NotificationSettingsUpdateRequestContract, NotificationSettingsUpdateRequestContractSchema, type NotificationSettingsUpdateResponseContract, NotificationSettingsUpdateResponseContractSchema, type NotificationUnreadCountResponseContract, NotificationUnreadCountResponseContractSchema };
@@ -0,0 +1,29 @@
1
+ import {
2
+ NotificationChannelContractSchema,
3
+ NotificationFrequencyContractSchema,
4
+ NotificationItemContractSchema,
5
+ NotificationListQueryContractSchema,
6
+ NotificationListResponseContractSchema,
7
+ NotificationMarkReadRequestContractSchema,
8
+ NotificationMutationCountResponseContractSchema,
9
+ NotificationPreferenceContractSchema,
10
+ NotificationRuntimeStatusContractSchema,
11
+ NotificationSettingsUpdateRequestContractSchema,
12
+ NotificationSettingsUpdateResponseContractSchema,
13
+ NotificationUnreadCountResponseContractSchema
14
+ } from "./chunk-F4BR76CX.js";
15
+ export {
16
+ NotificationChannelContractSchema,
17
+ NotificationFrequencyContractSchema,
18
+ NotificationItemContractSchema,
19
+ NotificationListQueryContractSchema,
20
+ NotificationListResponseContractSchema,
21
+ NotificationMarkReadRequestContractSchema,
22
+ NotificationMutationCountResponseContractSchema,
23
+ NotificationPreferenceContractSchema,
24
+ NotificationRuntimeStatusContractSchema,
25
+ NotificationSettingsUpdateRequestContractSchema,
26
+ NotificationSettingsUpdateResponseContractSchema,
27
+ NotificationUnreadCountResponseContractSchema
28
+ };
29
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@nebutra/contracts",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Canonical API/event/domain contracts for Nebutra superstarter",
5
5
  "private": false,
6
- "license": "AGPL-3.0",
6
+ "license": "MIT",
7
7
  "type": "module",
8
8
  "main": "./dist/index.js",
9
9
  "types": "./dist/index.d.ts",