@molda-org/events-tickets 0.1.0-next.5 → 0.1.0-next.7
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/index.d.ts +147 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/package.json +14 -6
- package/index.d.ts +0 -20
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { MoldaModuleDefinition, MoldaModuleShape } from '@molda-org/module-contracts';
|
|
2
|
+
import { type ModuleRepository } from '@molda-org/module-runtime';
|
|
3
|
+
export type EventsTicketsAction = 'createEvent' | 'issueTicket' | 'cancelTicket' | 'checkInTicket';
|
|
4
|
+
export type EventsTicketsView = 'upcomingEvents' | 'ticketSales' | 'attendance';
|
|
5
|
+
export type EventsTicketsHook = 'useEvents' | 'useTickets' | 'useAttendance';
|
|
6
|
+
export interface EventsTicketsModuleShape extends MoldaModuleShape<'events-tickets', EventsTicketsAction, EventsTicketsView, EventsTicketsHook> {
|
|
7
|
+
readonly stage: 'phase-two';
|
|
8
|
+
readonly category: 'operations';
|
|
9
|
+
readonly purpose: 'Events, capacity, ticket issuance, cancellation, transfer evidence, and check-in.';
|
|
10
|
+
}
|
|
11
|
+
export type EventsTicketsModule = MoldaModuleDefinition<EventsTicketsModuleShape>;
|
|
12
|
+
export declare const EventsTicketsActionIds: readonly ["createEvent", "issueTicket", "cancelTicket", "checkInTicket"];
|
|
13
|
+
export declare const EventsTicketsViewIds: readonly ["upcomingEvents", "ticketSales", "attendance"];
|
|
14
|
+
export declare const EventsTicketsHookIds: readonly ["useEvents", "useTickets", "useAttendance"];
|
|
15
|
+
export declare const EventsTicketsSpecification: {
|
|
16
|
+
readonly id: "events-tickets";
|
|
17
|
+
readonly version: "1.0.0";
|
|
18
|
+
readonly actions: {
|
|
19
|
+
readonly createEvent: {
|
|
20
|
+
readonly kind: "create";
|
|
21
|
+
readonly collection: "events";
|
|
22
|
+
readonly permission: "create.event";
|
|
23
|
+
readonly event: "create.event";
|
|
24
|
+
};
|
|
25
|
+
readonly issueTicket: {
|
|
26
|
+
readonly kind: "create";
|
|
27
|
+
readonly collection: "tickets";
|
|
28
|
+
readonly permission: "issue.ticket";
|
|
29
|
+
readonly event: "issue.ticket";
|
|
30
|
+
};
|
|
31
|
+
readonly cancelTicket: {
|
|
32
|
+
readonly kind: "transition";
|
|
33
|
+
readonly collection: "tickets";
|
|
34
|
+
readonly permission: "cancel.ticket";
|
|
35
|
+
readonly event: "cancel.ticket";
|
|
36
|
+
readonly status: "cancelled";
|
|
37
|
+
readonly allowedFrom: readonly ["issued"];
|
|
38
|
+
readonly confirmation: "required";
|
|
39
|
+
};
|
|
40
|
+
readonly checkInTicket: {
|
|
41
|
+
readonly kind: "transition";
|
|
42
|
+
readonly collection: "tickets";
|
|
43
|
+
readonly permission: "check.in.ticket";
|
|
44
|
+
readonly event: "check.in.ticket";
|
|
45
|
+
readonly status: "checked-in";
|
|
46
|
+
readonly allowedFrom: readonly ["issued"];
|
|
47
|
+
readonly confirmation: "required";
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly views: {
|
|
51
|
+
readonly upcomingEvents: {
|
|
52
|
+
readonly kind: "list";
|
|
53
|
+
readonly collection: "events";
|
|
54
|
+
readonly permission: "upcoming.events.read";
|
|
55
|
+
};
|
|
56
|
+
readonly ticketSales: {
|
|
57
|
+
readonly kind: "list";
|
|
58
|
+
readonly collection: "tickets";
|
|
59
|
+
readonly permission: "ticket.sales.read";
|
|
60
|
+
};
|
|
61
|
+
readonly attendance: {
|
|
62
|
+
readonly kind: "list";
|
|
63
|
+
readonly collection: "tickets";
|
|
64
|
+
readonly permission: "attendance.read";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
readonly migrations: readonly [{
|
|
68
|
+
readonly version: 1;
|
|
69
|
+
readonly description: "Create events-tickets collections and indexes";
|
|
70
|
+
}];
|
|
71
|
+
readonly fixtures: readonly [{
|
|
72
|
+
readonly id: "events-tickets-baseline";
|
|
73
|
+
readonly description: "Deterministic events-tickets production-case fixture";
|
|
74
|
+
}];
|
|
75
|
+
};
|
|
76
|
+
export declare const EventsTicketsBlueprint: import("@molda-org/module-runtime").ModuleBlueprint<{
|
|
77
|
+
[k: string]: import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
78
|
+
id: string;
|
|
79
|
+
data: Record<string, unknown>;
|
|
80
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
81
|
+
data: Record<string, unknown>;
|
|
82
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
83
|
+
id: string;
|
|
84
|
+
expectedRevision: number;
|
|
85
|
+
patch: Record<string, unknown>;
|
|
86
|
+
reason?: string | undefined;
|
|
87
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
88
|
+
id: string;
|
|
89
|
+
expectedRevision: number;
|
|
90
|
+
patch: Record<string, unknown>;
|
|
91
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>>;
|
|
92
|
+
}, {
|
|
93
|
+
[k: string]: import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
94
|
+
id: string;
|
|
95
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
96
|
+
limit: number;
|
|
97
|
+
equals?: Record<string, unknown> | undefined;
|
|
98
|
+
}, readonly import("@molda-org/module-runtime").ModuleRecord<Record<string, unknown>>[]>;
|
|
99
|
+
}>;
|
|
100
|
+
export declare function createEventsTicketsService(repository: ModuleRepository): {
|
|
101
|
+
blueprint: import("@molda-org/module-runtime").ModuleBlueprint<{
|
|
102
|
+
[k: string]: import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
103
|
+
id: string;
|
|
104
|
+
data: Record<string, unknown>;
|
|
105
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
106
|
+
data: Record<string, unknown>;
|
|
107
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
108
|
+
id: string;
|
|
109
|
+
expectedRevision: number;
|
|
110
|
+
patch: Record<string, unknown>;
|
|
111
|
+
reason?: string | undefined;
|
|
112
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleActionDefinition<{
|
|
113
|
+
id: string;
|
|
114
|
+
expectedRevision: number;
|
|
115
|
+
patch: Record<string, unknown>;
|
|
116
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>>;
|
|
117
|
+
}, {
|
|
118
|
+
[k: string]: import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
119
|
+
id: string;
|
|
120
|
+
}, import("@molda-org/module-runtime").ModuleRecord<Readonly<Record<string, unknown>>>> | import("@molda-org/module-runtime").ModuleViewDefinition<{
|
|
121
|
+
limit: number;
|
|
122
|
+
equals?: Record<string, unknown> | undefined;
|
|
123
|
+
}, readonly import("@molda-org/module-runtime").ModuleRecord<Record<string, unknown>>[]>;
|
|
124
|
+
}>;
|
|
125
|
+
executeAction<TKey extends string>(actionId: TKey, unsafeInput: {
|
|
126
|
+
id: string;
|
|
127
|
+
data: Record<string, unknown>;
|
|
128
|
+
} | {
|
|
129
|
+
data: Record<string, unknown>;
|
|
130
|
+
} | {
|
|
131
|
+
id: string;
|
|
132
|
+
expectedRevision: number;
|
|
133
|
+
patch: Record<string, unknown>;
|
|
134
|
+
reason?: string | undefined;
|
|
135
|
+
} | {
|
|
136
|
+
id: string;
|
|
137
|
+
expectedRevision: number;
|
|
138
|
+
patch: Record<string, unknown>;
|
|
139
|
+
}, invocation: import("@molda-org/module-runtime").ModuleActionInvocation): Promise<import("@molda-org/module-runtime").ModuleActionExecution<never>>;
|
|
140
|
+
executeView<TKey extends string>(viewId: TKey, unsafeInput: {
|
|
141
|
+
id: string;
|
|
142
|
+
} | {
|
|
143
|
+
limit: number;
|
|
144
|
+
equals?: Record<string, unknown> | undefined;
|
|
145
|
+
}, context: import("@molda-org/module-runtime").ModuleExecutionContext): Promise<never>;
|
|
146
|
+
};
|
|
147
|
+
export declare function createEventsTicketsRuntimeModule(repository: ModuleRepository): import("@molda-org/module-runtime").ResourceModuleContribution;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createResourceModuleContribution, createResourceModuleService, defineResourceModule, } from '@molda-org/module-runtime';
|
|
2
|
+
export const EventsTicketsActionIds = ["createEvent", "issueTicket", "cancelTicket", "checkInTicket"];
|
|
3
|
+
export const EventsTicketsViewIds = ["upcomingEvents", "ticketSales", "attendance"];
|
|
4
|
+
export const EventsTicketsHookIds = ["useEvents", "useTickets", "useAttendance"];
|
|
5
|
+
export const EventsTicketsSpecification = {
|
|
6
|
+
id: 'events-tickets',
|
|
7
|
+
version: '1.0.0',
|
|
8
|
+
actions: {
|
|
9
|
+
createEvent: { kind: 'create', collection: 'events', permission: 'create.event', event: 'create.event' },
|
|
10
|
+
issueTicket: { kind: 'create', collection: 'tickets', permission: 'issue.ticket', event: 'issue.ticket' },
|
|
11
|
+
cancelTicket: { kind: 'transition', collection: 'tickets', permission: 'cancel.ticket', event: 'cancel.ticket', status: 'cancelled', allowedFrom: ["issued"], confirmation: 'required' },
|
|
12
|
+
checkInTicket: { kind: 'transition', collection: 'tickets', permission: 'check.in.ticket', event: 'check.in.ticket', status: 'checked-in', allowedFrom: ["issued"], confirmation: 'required' },
|
|
13
|
+
},
|
|
14
|
+
views: {
|
|
15
|
+
upcomingEvents: { kind: 'list', collection: 'events', permission: 'upcoming.events.read' },
|
|
16
|
+
ticketSales: { kind: 'list', collection: 'tickets', permission: 'ticket.sales.read' },
|
|
17
|
+
attendance: { kind: 'list', collection: 'tickets', permission: 'attendance.read' },
|
|
18
|
+
},
|
|
19
|
+
migrations: [{ version: 1, description: 'Create events-tickets collections and indexes' }],
|
|
20
|
+
fixtures: [{ id: 'events-tickets-baseline', description: 'Deterministic events-tickets production-case fixture' }],
|
|
21
|
+
};
|
|
22
|
+
export const EventsTicketsBlueprint = defineResourceModule(EventsTicketsSpecification);
|
|
23
|
+
export function createEventsTicketsService(repository) {
|
|
24
|
+
return createResourceModuleService(EventsTicketsSpecification, repository);
|
|
25
|
+
}
|
|
26
|
+
export function createEventsTicketsRuntimeModule(repository) {
|
|
27
|
+
return createResourceModuleContribution(EventsTicketsSpecification, repository);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,oBAAoB,GAGrB,MAAM,2BAA2B,CAAC;AAcnC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,aAAa,EAAC,aAAa,EAAC,cAAc,EAAC,eAAe,CAAU,CAAC;AAC5G,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,gBAAgB,EAAC,aAAa,EAAC,YAAY,CAAU,CAAC;AAC3F,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,WAAW,EAAC,YAAY,EAAC,eAAe,CAAU,CAAC;AAExF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,EAAE,EAAE,gBAAgB;IACpB,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE;QACP,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,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C;AAC7E,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,UAA4B;IAC3E,OAAO,gCAAgC,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAC;AAClF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molda-org/events-tickets",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.7",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"types": "./index.d.ts",
|
|
6
5
|
"exports": {
|
|
7
6
|
".": {
|
|
8
|
-
"types": "./index.d.ts"
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"import": "./dist/index.js"
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
|
-
"
|
|
12
|
+
"dist"
|
|
13
13
|
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc -p tsconfig.json",
|
|
16
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
17
|
+
},
|
|
14
18
|
"dependencies": {
|
|
15
|
-
"@molda-org/module-contracts": "0.1.0-next.
|
|
16
|
-
"@molda-org/module-runtime": "0.1.0-next.
|
|
19
|
+
"@molda-org/module-contracts": "0.1.0-next.7",
|
|
20
|
+
"@molda-org/module-runtime": "0.1.0-next.7"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "22.19.19",
|
|
24
|
+
"typescript": "5.9.3"
|
|
17
25
|
},
|
|
18
26
|
"publishConfig": {
|
|
19
27
|
"access": "public",
|
package/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { MoldaModuleDefinition, MoldaModuleShape } from '@molda-org/module-contracts';
|
|
2
|
-
|
|
3
|
-
export type EventsTicketsAction = 'createEvent' | 'issueTicket' | 'cancelTicket' | 'checkInTicket';
|
|
4
|
-
export type EventsTicketsView = 'upcomingEvents' | 'ticketSales' | 'attendance';
|
|
5
|
-
export type EventsTicketsHook = 'useEvents' | 'useTickets';
|
|
6
|
-
|
|
7
|
-
export interface EventsTicketsModuleShape
|
|
8
|
-
extends MoldaModuleShape<
|
|
9
|
-
'events-tickets',
|
|
10
|
-
EventsTicketsAction,
|
|
11
|
-
EventsTicketsView,
|
|
12
|
-
EventsTicketsHook
|
|
13
|
-
> {
|
|
14
|
-
readonly stage: 'phase-two';
|
|
15
|
-
readonly category: 'operations';
|
|
16
|
-
readonly purpose: 'Events, capacity, ticket types, registration, admission, and attendance.';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type EventsTicketsModule = MoldaModuleDefinition<EventsTicketsModuleShape>;
|
|
20
|
-
|