@voyantjs/octo 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,93 @@
1
+ export declare const bookingTransactionDetailsRef: import("drizzle-orm/pg-core").PgTableWithColumns<{
2
+ name: "booking_transaction_details";
3
+ schema: undefined;
4
+ columns: {
5
+ bookingId: import("drizzle-orm/pg-core").PgColumn<{
6
+ name: "booking_id";
7
+ tableName: "booking_transaction_details";
8
+ dataType: "string";
9
+ columnType: "PgText";
10
+ data: string;
11
+ driverParam: string;
12
+ notNull: true;
13
+ hasDefault: false;
14
+ isPrimaryKey: true;
15
+ isAutoincrement: false;
16
+ hasRuntimeDefault: false;
17
+ enumValues: [string, ...string[]];
18
+ baseColumn: never;
19
+ identity: undefined;
20
+ generated: undefined;
21
+ }, {}, {}>;
22
+ offerId: import("drizzle-orm/pg-core").PgColumn<{
23
+ name: "offer_id";
24
+ tableName: "booking_transaction_details";
25
+ dataType: "string";
26
+ columnType: "PgText";
27
+ data: string;
28
+ driverParam: string;
29
+ notNull: false;
30
+ hasDefault: false;
31
+ isPrimaryKey: false;
32
+ isAutoincrement: false;
33
+ hasRuntimeDefault: false;
34
+ enumValues: [string, ...string[]];
35
+ baseColumn: never;
36
+ identity: undefined;
37
+ generated: undefined;
38
+ }, {}, {}>;
39
+ orderId: import("drizzle-orm/pg-core").PgColumn<{
40
+ name: "order_id";
41
+ tableName: "booking_transaction_details";
42
+ dataType: "string";
43
+ columnType: "PgText";
44
+ data: string;
45
+ driverParam: string;
46
+ notNull: false;
47
+ hasDefault: false;
48
+ isPrimaryKey: false;
49
+ isAutoincrement: false;
50
+ hasRuntimeDefault: false;
51
+ enumValues: [string, ...string[]];
52
+ baseColumn: never;
53
+ identity: undefined;
54
+ generated: undefined;
55
+ }, {}, {}>;
56
+ createdAt: import("drizzle-orm/pg-core").PgColumn<{
57
+ name: "created_at";
58
+ tableName: "booking_transaction_details";
59
+ dataType: "date";
60
+ columnType: "PgTimestamp";
61
+ data: Date;
62
+ driverParam: string;
63
+ notNull: true;
64
+ hasDefault: true;
65
+ isPrimaryKey: false;
66
+ isAutoincrement: false;
67
+ hasRuntimeDefault: false;
68
+ enumValues: undefined;
69
+ baseColumn: never;
70
+ identity: undefined;
71
+ generated: undefined;
72
+ }, {}, {}>;
73
+ updatedAt: import("drizzle-orm/pg-core").PgColumn<{
74
+ name: "updated_at";
75
+ tableName: "booking_transaction_details";
76
+ dataType: "date";
77
+ columnType: "PgTimestamp";
78
+ data: Date;
79
+ driverParam: string;
80
+ notNull: true;
81
+ hasDefault: true;
82
+ isPrimaryKey: false;
83
+ isAutoincrement: false;
84
+ hasRuntimeDefault: false;
85
+ enumValues: undefined;
86
+ baseColumn: never;
87
+ identity: undefined;
88
+ generated: undefined;
89
+ }, {}, {}>;
90
+ };
91
+ dialect: "pg";
92
+ }>;
93
+ //# sourceMappingURL=transactions-ref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactions-ref.d.ts","sourceRoot":"","sources":["../src/transactions-ref.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMvC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import { pgTable, text, timestamp } from "drizzle-orm/pg-core";
2
+ export const bookingTransactionDetailsRef = pgTable("booking_transaction_details", {
3
+ bookingId: text("booking_id").primaryKey(),
4
+ offerId: text("offer_id"),
5
+ orderId: text("order_id"),
6
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
7
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
8
+ });
@@ -0,0 +1,200 @@
1
+ export type OctoAvailabilityType = "START_TIME" | "OPENING_HOURS";
2
+ export type OctoUnitType = "ADULT" | "CHILD" | "YOUTH" | "INFANT" | "FAMILY" | "SENIOR" | "STUDENT" | "MILITARY" | "OTHER";
3
+ export type OctoAvailabilityStatus = "AVAILABLE" | "FREESALE" | "SOLD_OUT" | "LIMITED" | "CLOSED";
4
+ export type OctoBookingStatus = "ON_HOLD" | "CONFIRMED" | "EXPIRED" | "CANCELLED";
5
+ export interface OctoProjectedUnitRestrictions {
6
+ minAge?: number;
7
+ maxAge?: number;
8
+ minQuantity?: number;
9
+ maxQuantity?: number;
10
+ occupancyMin?: number;
11
+ occupancyMax?: number;
12
+ }
13
+ export interface OctoProjectedUnit {
14
+ id: string;
15
+ name: string;
16
+ code: string | null;
17
+ type: OctoUnitType;
18
+ restrictions: OctoProjectedUnitRestrictions;
19
+ }
20
+ export interface OctoProjectedOption {
21
+ id: string;
22
+ name: string;
23
+ code: string | null;
24
+ default: boolean;
25
+ availabilityLocalStartTimes: string[];
26
+ units: OctoProjectedUnit[];
27
+ }
28
+ export interface OctoProjectedProductContent {
29
+ highlights: Array<{
30
+ id: string;
31
+ title: string;
32
+ description: string | null;
33
+ }>;
34
+ inclusions: Array<{
35
+ id: string;
36
+ title: string;
37
+ description: string | null;
38
+ }>;
39
+ exclusions: Array<{
40
+ id: string;
41
+ title: string;
42
+ description: string | null;
43
+ }>;
44
+ importantInformation: Array<{
45
+ id: string;
46
+ title: string;
47
+ description: string | null;
48
+ }>;
49
+ faqs: Array<{
50
+ id: string;
51
+ question: string;
52
+ answer: string;
53
+ }>;
54
+ locations: Array<{
55
+ id: string;
56
+ type: string;
57
+ title: string;
58
+ address: string | null;
59
+ city: string | null;
60
+ countryCode: string | null;
61
+ latitude: number | null;
62
+ longitude: number | null;
63
+ googlePlaceId: string | null;
64
+ applePlaceId: string | null;
65
+ tripadvisorLocationId: string | null;
66
+ }>;
67
+ }
68
+ export interface OctoProjectedProduct {
69
+ id: string;
70
+ name: string;
71
+ description: string | null;
72
+ timeZone: string | null;
73
+ availabilityType: OctoAvailabilityType;
74
+ allowFreesale: boolean;
75
+ instantConfirmation: boolean;
76
+ options: OctoProjectedOption[];
77
+ content: OctoProjectedProductContent;
78
+ extensions: {
79
+ status: string;
80
+ visibility: string;
81
+ activated: boolean;
82
+ facilityId: string | null;
83
+ bookingMode: string;
84
+ capabilityCodes: string[];
85
+ deliveryFormats: string[];
86
+ };
87
+ }
88
+ export interface OctoProjectedAvailability {
89
+ id: string;
90
+ productId: string;
91
+ optionId: string | null;
92
+ localDateTimeStart: string;
93
+ localDateTimeEnd: string | null;
94
+ timeZone: string;
95
+ status: OctoAvailabilityStatus;
96
+ vacancies: number | null;
97
+ capacity: number | null;
98
+ }
99
+ export interface OctoProjectedBookingContact {
100
+ participantId: string;
101
+ firstName: string;
102
+ lastName: string;
103
+ email: string | null;
104
+ phone: string | null;
105
+ language: string | null;
106
+ }
107
+ export interface OctoProjectedBookingUnitItem {
108
+ bookingItemId: string;
109
+ title: string;
110
+ itemType: string;
111
+ status: string;
112
+ quantity: number;
113
+ productId: string | null;
114
+ optionId: string | null;
115
+ unitId: string | null;
116
+ pricingCategoryId: string | null;
117
+ availabilityId: string | null;
118
+ participantIds: string[];
119
+ }
120
+ export interface OctoProjectedBookingFulfillment {
121
+ id: string;
122
+ bookingItemId: string | null;
123
+ participantId: string | null;
124
+ type: string;
125
+ deliveryChannel: string;
126
+ status: string;
127
+ artifactUrl: string | null;
128
+ payload: Record<string, unknown> | null;
129
+ issuedAt: string | null;
130
+ revokedAt: string | null;
131
+ }
132
+ export interface OctoProjectedBookingArtifact {
133
+ fulfillmentId: string;
134
+ bookingItemId: string | null;
135
+ participantId: string | null;
136
+ type: string;
137
+ deliveryChannel: string;
138
+ status: string;
139
+ artifactUrl: string | null;
140
+ downloadUrl: string | null;
141
+ pdfUrl: string | null;
142
+ qrCode: string | null;
143
+ barcode: string | null;
144
+ voucherCode: string | null;
145
+ issuedAt: string | null;
146
+ revokedAt: string | null;
147
+ }
148
+ export interface OctoProjectedBookingSupplierReference {
149
+ id: string;
150
+ supplierServiceId: string | null;
151
+ serviceName: string;
152
+ status: string;
153
+ supplierReference: string | null;
154
+ confirmedAt: string | null;
155
+ }
156
+ export interface OctoProjectedBookingRedemptionEvent {
157
+ id: string;
158
+ bookingItemId: string | null;
159
+ participantId: string | null;
160
+ redeemedAt: string;
161
+ redeemedBy: string | null;
162
+ location: string | null;
163
+ method: string;
164
+ metadata: Record<string, unknown> | null;
165
+ }
166
+ export interface OctoProjectedBookingReferences {
167
+ resellerReference: string | null;
168
+ offerId: string | null;
169
+ offerNumber: string | null;
170
+ orderId: string | null;
171
+ orderNumber: string | null;
172
+ supplierReferences: OctoProjectedBookingSupplierReference[];
173
+ }
174
+ export interface OctoProjectedBooking {
175
+ id: string;
176
+ bookingNumber: string;
177
+ status: OctoBookingStatus;
178
+ availabilityId: string | null;
179
+ contact: OctoProjectedBookingContact | null;
180
+ unitItems: OctoProjectedBookingUnitItem[];
181
+ fulfillments: OctoProjectedBookingFulfillment[];
182
+ artifacts: OctoProjectedBookingArtifact[];
183
+ redemptions: OctoProjectedBookingRedemptionEvent[];
184
+ references: OctoProjectedBookingReferences;
185
+ holdExpiresAt: string | null;
186
+ confirmedAt: string | null;
187
+ cancelledAt: string | null;
188
+ expiredAt: string | null;
189
+ utcRedeemedAt: string | null;
190
+ extensions: {
191
+ sourceType: string;
192
+ externalBookingRef: string | null;
193
+ communicationLanguage: string | null;
194
+ personId: string | null;
195
+ organizationId: string | null;
196
+ sellCurrency: string;
197
+ baseCurrency: string | null;
198
+ };
199
+ }
200
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG,eAAe,CAAA;AAEjE,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,UAAU,GACV,OAAO,CAAA;AAEX,MAAM,MAAM,sBAAsB,GAC9B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EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,UAAU,EAAE;QACV,UAAU,EAAE,MAAM,CAAA;QAClB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;QACjC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAA;QACpC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;QACvB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;QAC7B,YAAY,EAAE,MAAM,CAAA;QACpB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;KAC5B,CAAA;CACF"}
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,55 @@
1
+ import { z } from "zod";
2
+ export declare const octoProductListQuerySchema: z.ZodObject<{
3
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
4
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
5
+ status: z.ZodOptional<z.ZodEnum<{
6
+ draft: "draft";
7
+ active: "active";
8
+ archived: "archived";
9
+ }>>;
10
+ bookingMode: z.ZodOptional<z.ZodEnum<{
11
+ date: "date";
12
+ open: "open";
13
+ other: "other";
14
+ date_time: "date_time";
15
+ stay: "stay";
16
+ transfer: "transfer";
17
+ itinerary: "itinerary";
18
+ }>>;
19
+ visibility: z.ZodOptional<z.ZodEnum<{
20
+ public: "public";
21
+ private: "private";
22
+ hidden: "hidden";
23
+ }>>;
24
+ activated: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
25
+ facilityId: z.ZodOptional<z.ZodString>;
26
+ search: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strip>;
28
+ export declare const octoBookingListQuerySchema: z.ZodObject<{
29
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
30
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
31
+ status: z.ZodOptional<z.ZodEnum<{
32
+ cancelled: "cancelled";
33
+ draft: "draft";
34
+ on_hold: "on_hold";
35
+ confirmed: "confirmed";
36
+ in_progress: "in_progress";
37
+ completed: "completed";
38
+ expired: "expired";
39
+ }>>;
40
+ search: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>;
42
+ export declare const octoAvailabilityListQuerySchema: z.ZodObject<{
43
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
44
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
45
+ productId: z.ZodOptional<z.ZodString>;
46
+ optionId: z.ZodOptional<z.ZodString>;
47
+ localDateStart: z.ZodOptional<z.ZodString>;
48
+ localDateEnd: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strip>;
50
+ export declare const octoAvailabilityCalendarQuerySchema: z.ZodObject<{
51
+ optionId: z.ZodOptional<z.ZodString>;
52
+ localDateStart: z.ZodOptional<z.ZodString>;
53
+ localDateEnd: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>;
55
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AA6BvB,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;iBAOrC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;iBAGrC,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;iBAgBzC,CAAA;AAEH,eAAO,MAAM,mCAAmC;;;;iBAe7C,CAAA"}
@@ -0,0 +1,63 @@
1
+ import { z } from "zod";
2
+ const paginationSchema = z.object({
3
+ limit: z.coerce.number().int().min(1).max(200).default(50),
4
+ offset: z.coerce.number().int().min(0).default(0),
5
+ });
6
+ const isoDateSchema = z.string().date();
7
+ const productStatusSchema = z.enum(["draft", "active", "archived"]);
8
+ const productBookingModeSchema = z.enum([
9
+ "date",
10
+ "date_time",
11
+ "open",
12
+ "stay",
13
+ "transfer",
14
+ "itinerary",
15
+ "other",
16
+ ]);
17
+ const productVisibilitySchema = z.enum(["public", "private", "hidden"]);
18
+ const bookingStatusSchema = z.enum([
19
+ "draft",
20
+ "on_hold",
21
+ "confirmed",
22
+ "in_progress",
23
+ "completed",
24
+ "expired",
25
+ "cancelled",
26
+ ]);
27
+ export const octoProductListQuerySchema = paginationSchema.extend({
28
+ status: productStatusSchema.optional(),
29
+ bookingMode: productBookingModeSchema.optional(),
30
+ visibility: productVisibilitySchema.optional(),
31
+ activated: z.coerce.boolean().optional(),
32
+ facilityId: z.string().optional(),
33
+ search: z.string().optional(),
34
+ });
35
+ export const octoBookingListQuerySchema = paginationSchema.extend({
36
+ status: bookingStatusSchema.optional(),
37
+ search: z.string().optional(),
38
+ });
39
+ export const octoAvailabilityListQuerySchema = paginationSchema
40
+ .extend({
41
+ productId: z.string().optional(),
42
+ optionId: z.string().optional(),
43
+ localDateStart: isoDateSchema.optional(),
44
+ localDateEnd: isoDateSchema.optional(),
45
+ })
46
+ .refine((value) => !value.localDateStart ||
47
+ !value.localDateEnd ||
48
+ value.localDateStart <= value.localDateEnd, {
49
+ message: "localDateStart must be before or equal to localDateEnd",
50
+ path: ["localDateEnd"],
51
+ });
52
+ export const octoAvailabilityCalendarQuerySchema = z
53
+ .object({
54
+ optionId: z.string().optional(),
55
+ localDateStart: isoDateSchema.optional(),
56
+ localDateEnd: isoDateSchema.optional(),
57
+ })
58
+ .refine((value) => !value.localDateStart ||
59
+ !value.localDateEnd ||
60
+ value.localDateStart <= value.localDateEnd, {
61
+ message: "localDateStart must be before or equal to localDateEnd",
62
+ path: ["localDateEnd"],
63
+ });
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@voyantjs/octo",
3
+ "version": "0.1.0",
4
+ "license": "FSL-1.1-Apache-2.0",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js"
10
+ },
11
+ "./routes": {
12
+ "types": "./dist/routes.d.ts",
13
+ "import": "./dist/routes.js"
14
+ },
15
+ "./service": {
16
+ "types": "./dist/service.d.ts",
17
+ "import": "./dist/service.js"
18
+ },
19
+ "./types": {
20
+ "types": "./dist/types.d.ts",
21
+ "import": "./dist/types.js"
22
+ },
23
+ "./validation": {
24
+ "types": "./dist/validation.d.ts",
25
+ "import": "./dist/validation.js"
26
+ }
27
+ },
28
+ "dependencies": {
29
+ "drizzle-orm": "^0.45.2",
30
+ "hono": "^4.12.10",
31
+ "zod": "^4.3.6",
32
+ "@voyantjs/availability": "0.1.0",
33
+ "@voyantjs/core": "0.1.0",
34
+ "@voyantjs/db": "0.1.0",
35
+ "@voyantjs/hono": "0.1.0",
36
+ "@voyantjs/products": "0.1.0",
37
+ "@voyantjs/transactions": "0.1.0",
38
+ "@voyantjs/bookings": "0.1.0"
39
+ },
40
+ "devDependencies": {
41
+ "typescript": "^6.0.2",
42
+ "@voyantjs/voyant-typescript-config": "0.1.0"
43
+ },
44
+ "files": [
45
+ "dist"
46
+ ],
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "scripts": {
51
+ "typecheck": "tsc --noEmit",
52
+ "lint": "biome check src/",
53
+ "test": "vitest run",
54
+ "build": "tsc -p tsconfig.json",
55
+ "clean": "rm -rf dist"
56
+ },
57
+ "main": "./dist/index.js",
58
+ "types": "./dist/index.d.ts"
59
+ }