@wix/seatings 1.0.5 → 1.0.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.
@@ -2,5 +2,6 @@
2
2
  "sideEffects": false,
3
3
  "module": "../build/es/context.js",
4
4
  "main": "../build/cjs/context.js",
5
- "typings": "../build/cjs/context.d.ts"
5
+ "typings": "../build/cjs/context.d.ts",
6
+ "typesBundle": "../type-bundles/context.bundle.d.ts"
6
7
  }
package/meta/package.json CHANGED
@@ -2,5 +2,6 @@
2
2
  "sideEffects": false,
3
3
  "module": "../build/es/meta.js",
4
4
  "main": "../build/cjs/meta.js",
5
- "typings": "../build/cjs/meta.d.ts"
5
+ "typings": "../build/cjs/meta.d.ts",
6
+ "typesBundle": "../type-bundles/meta.bundle.d.ts"
6
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/seatings",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -9,22 +9,27 @@
9
9
  "module": "build/es/index.js",
10
10
  "main": "build/cjs/index.js",
11
11
  "typings": "./build/cjs/index.d.ts",
12
+ "typesBundle": "./type-bundles/index.bundle.d.ts",
12
13
  "files": [
13
14
  "build",
14
15
  "frontend/package.json",
15
16
  "meta",
16
- "context"
17
+ "context",
18
+ "type-bundles"
17
19
  ],
18
20
  "dependencies": {
19
- "@wix/seatings_seating-plan": "1.0.5",
20
- "@wix/seatings_seating-reservation": "1.0.4"
21
+ "@wix/seatings_seating-plan": "1.0.7",
22
+ "@wix/seatings_seating-reservation": "1.0.6"
21
23
  },
22
24
  "devDependencies": {
23
- "@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz",
25
+ "glob": "^10.4.1",
26
+ "rollup": "^4.18.0",
27
+ "rollup-plugin-dts": "^6.1.1",
24
28
  "typescript": "^5.3.2"
25
29
  },
26
30
  "scripts": {
27
- "build": "tsc -b tsconfig.json tsconfig.esm.json",
31
+ "build": "tsc -b tsconfig.json tsconfig.esm.json && npm run build:dts-bundles",
32
+ "build:dts-bundles": "test -f config/rollup-config.js && rollup --config config/rollup-config.js || echo 'Warning: config/rollup-config.js not found!'",
28
33
  "test": ":"
29
34
  },
30
35
  "wix": {
@@ -38,5 +43,5 @@
38
43
  "fqdn": ""
39
44
  }
40
45
  },
41
- "falconPackageHash": "84aaab79c78beecb8b025d4b38e3c821a6efc8816e3c7afe950d4fe4"
46
+ "falconPackageHash": "83892f074986dec02616826f97564c822be70a75e0bb07bc42c395a4"
42
47
  }
@@ -0,0 +1,147 @@
1
+ type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
2
+ interface HttpClient$1 {
3
+ request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
4
+ fetchWithAuth: typeof fetch;
5
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
6
+ }
7
+ type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
8
+ type HttpResponse$1<T = any> = {
9
+ data: T;
10
+ status: number;
11
+ statusText: string;
12
+ headers: any;
13
+ request?: any;
14
+ };
15
+ type RequestOptions$1<_TResponse = any, Data = any> = {
16
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
17
+ url: string;
18
+ data?: Data;
19
+ params?: URLSearchParams;
20
+ } & APIMetadata$1;
21
+ type APIMetadata$1 = {
22
+ methodFqn?: string;
23
+ entityFqdn?: string;
24
+ packageName?: string;
25
+ };
26
+ type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
27
+ type EventDefinition$1<Payload = unknown, Type extends string = string> = {
28
+ __type: 'event-definition';
29
+ type: Type;
30
+ isDomainEvent?: boolean;
31
+ transformations?: (envelope: unknown) => Payload;
32
+ __payload: Payload;
33
+ };
34
+ declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
35
+ type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
36
+ type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
37
+
38
+ declare global {
39
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
40
+ interface SymbolConstructor {
41
+ readonly observable: symbol;
42
+ }
43
+ }
44
+
45
+ declare function createRESTModule$1<T extends RESTFunctionDescriptor$1>(descriptor: T, elevated?: boolean): BuildRESTFunction$1<T> & T;
46
+
47
+ declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
48
+
49
+ declare const createSeatingPlan: ReturnType<typeof createRESTModule$1<typeof publicCreateSeatingPlan>>;
50
+ declare const updateSeatingPlan: ReturnType<typeof createRESTModule$1<typeof publicUpdateSeatingPlan>>;
51
+ declare const copySeatingPlan: ReturnType<typeof createRESTModule$1<typeof publicCopySeatingPlan>>;
52
+ declare const querySeatingPlan: ReturnType<typeof createRESTModule$1<typeof publicQuerySeatingPlan>>;
53
+ declare const getSeatingPlan: ReturnType<typeof createRESTModule$1<typeof publicGetSeatingPlan>>;
54
+ declare const findSeatingPlan: ReturnType<typeof createRESTModule$1<typeof publicFindSeatingPlan>>;
55
+ declare const deleteSeatingPlan: ReturnType<typeof createRESTModule$1<typeof publicDeleteSeatingPlan>>;
56
+ declare const updateSeatingPlanThumbnail: ReturnType<typeof createRESTModule$1<typeof publicUpdateSeatingPlanThumbnail>>;
57
+ declare const getSeatingPlanThumbnail: ReturnType<typeof createRESTModule$1<typeof publicGetSeatingPlanThumbnail>>;
58
+ declare const onSeatingPlanCreated: ReturnType<typeof createEventModule$1<typeof publicOnSeatingPlanCreated>>;
59
+ declare const onSeatingPlanUpdated: ReturnType<typeof createEventModule$1<typeof publicOnSeatingPlanUpdated>>;
60
+ declare const onSeatingPlanDeleted: ReturnType<typeof createEventModule$1<typeof publicOnSeatingPlanDeleted>>;
61
+
62
+ declare const context$1_copySeatingPlan: typeof copySeatingPlan;
63
+ declare const context$1_createSeatingPlan: typeof createSeatingPlan;
64
+ declare const context$1_deleteSeatingPlan: typeof deleteSeatingPlan;
65
+ declare const context$1_findSeatingPlan: typeof findSeatingPlan;
66
+ declare const context$1_getSeatingPlan: typeof getSeatingPlan;
67
+ declare const context$1_getSeatingPlanThumbnail: typeof getSeatingPlanThumbnail;
68
+ declare const context$1_onSeatingPlanCreated: typeof onSeatingPlanCreated;
69
+ declare const context$1_onSeatingPlanDeleted: typeof onSeatingPlanDeleted;
70
+ declare const context$1_onSeatingPlanUpdated: typeof onSeatingPlanUpdated;
71
+ declare const context$1_querySeatingPlan: typeof querySeatingPlan;
72
+ declare const context$1_updateSeatingPlan: typeof updateSeatingPlan;
73
+ declare const context$1_updateSeatingPlanThumbnail: typeof updateSeatingPlanThumbnail;
74
+ declare namespace context$1 {
75
+ export { context$1_copySeatingPlan as copySeatingPlan, context$1_createSeatingPlan as createSeatingPlan, context$1_deleteSeatingPlan as deleteSeatingPlan, context$1_findSeatingPlan as findSeatingPlan, context$1_getSeatingPlan as getSeatingPlan, context$1_getSeatingPlanThumbnail as getSeatingPlanThumbnail, context$1_onSeatingPlanCreated as onSeatingPlanCreated, context$1_onSeatingPlanDeleted as onSeatingPlanDeleted, context$1_onSeatingPlanUpdated as onSeatingPlanUpdated, context$1_querySeatingPlan as querySeatingPlan, context$1_updateSeatingPlan as updateSeatingPlan, context$1_updateSeatingPlanThumbnail as updateSeatingPlanThumbnail };
76
+ }
77
+
78
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
79
+ interface HttpClient {
80
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
81
+ fetchWithAuth: typeof fetch;
82
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
83
+ }
84
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
85
+ type HttpResponse<T = any> = {
86
+ data: T;
87
+ status: number;
88
+ statusText: string;
89
+ headers: any;
90
+ request?: any;
91
+ };
92
+ type RequestOptions<_TResponse = any, Data = any> = {
93
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
94
+ url: string;
95
+ data?: Data;
96
+ params?: URLSearchParams;
97
+ } & APIMetadata;
98
+ type APIMetadata = {
99
+ methodFqn?: string;
100
+ entityFqdn?: string;
101
+ packageName?: string;
102
+ };
103
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
104
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
105
+ __type: 'event-definition';
106
+ type: Type;
107
+ isDomainEvent?: boolean;
108
+ transformations?: (envelope: unknown) => Payload;
109
+ __payload: Payload;
110
+ };
111
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
112
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
113
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
114
+
115
+ declare global {
116
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
117
+ interface SymbolConstructor {
118
+ readonly observable: symbol;
119
+ }
120
+ }
121
+
122
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
123
+
124
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
125
+
126
+ declare const createSeatingReservation: ReturnType<typeof createRESTModule<typeof publicCreateSeatingReservation>>;
127
+ declare const getReservation: ReturnType<typeof createRESTModule<typeof publicGetReservation>>;
128
+ declare const querySeatingReservation: ReturnType<typeof createRESTModule<typeof publicQuerySeatingReservation>>;
129
+ declare const deleteSeatingReservation: ReturnType<typeof createRESTModule<typeof publicDeleteSeatingReservation>>;
130
+ declare const getSeatingCategoriesSummary: ReturnType<typeof createRESTModule<typeof publicGetSeatingCategoriesSummary>>;
131
+ declare const getSeatingReservationsSummary: ReturnType<typeof createRESTModule<typeof publicGetSeatingReservationsSummary>>;
132
+ declare const onSeatingReservationCreated: ReturnType<typeof createEventModule<typeof publicOnSeatingReservationCreated>>;
133
+ declare const onSeatingReservationDeleted: ReturnType<typeof createEventModule<typeof publicOnSeatingReservationDeleted>>;
134
+
135
+ declare const context_createSeatingReservation: typeof createSeatingReservation;
136
+ declare const context_deleteSeatingReservation: typeof deleteSeatingReservation;
137
+ declare const context_getReservation: typeof getReservation;
138
+ declare const context_getSeatingCategoriesSummary: typeof getSeatingCategoriesSummary;
139
+ declare const context_getSeatingReservationsSummary: typeof getSeatingReservationsSummary;
140
+ declare const context_onSeatingReservationCreated: typeof onSeatingReservationCreated;
141
+ declare const context_onSeatingReservationDeleted: typeof onSeatingReservationDeleted;
142
+ declare const context_querySeatingReservation: typeof querySeatingReservation;
143
+ declare namespace context {
144
+ export { context_createSeatingReservation as createSeatingReservation, context_deleteSeatingReservation as deleteSeatingReservation, context_getReservation as getReservation, context_getSeatingCategoriesSummary as getSeatingCategoriesSummary, context_getSeatingReservationsSummary as getSeatingReservationsSummary, context_onSeatingReservationCreated as onSeatingReservationCreated, context_onSeatingReservationDeleted as onSeatingReservationDeleted, context_querySeatingReservation as querySeatingReservation };
145
+ }
146
+
147
+ export { context$1 as seatingPlan, context as seatingReservation };