@cloudcommerce/api 0.0.33 → 0.0.35
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/.turbo/turbo-build.log +2 -2
- package/.turbo/turbo-test.log +5 -4
- package/lib/index.d.ts +2 -112
- package/lib/types.d.ts +1 -1
- package/package.json +1 -1
- package/src/types.ts +4 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
[35m@cloudcommerce/api:build[0m: cache hit, replaying output [
|
|
1
|
+
[35m@cloudcommerce/api:build[0m: cache hit, replaying output [2m45197c6d0e34d0b6[0m
|
|
2
2
|
[35m@cloudcommerce/api:build: [0m
|
|
3
|
-
[35m@cloudcommerce/api:build: [0m> @cloudcommerce/api@0.0.
|
|
3
|
+
[35m@cloudcommerce/api:build: [0m> @cloudcommerce/api@0.0.34 build /home/leo/code/ecomplus/cloud-commerce/packages/api
|
|
4
4
|
[35m@cloudcommerce/api:build: [0m> sh ../../scripts/build-lib.sh && cp -r src/types lib/
|
|
5
5
|
[35m@cloudcommerce/api:build: [0m
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
[36m@cloudcommerce/api:test[0m: cache hit, replaying output [
|
|
1
|
+
[36m@cloudcommerce/api:test[0m: cache hit, replaying output [2m8e4d2cd55253616b[0m
|
|
2
2
|
[36m@cloudcommerce/api:test: [0m
|
|
3
|
-
[36m@cloudcommerce/api:test: [0m> @cloudcommerce/api@0.0.
|
|
3
|
+
[36m@cloudcommerce/api:test: [0m> @cloudcommerce/api@0.0.34 test /home/leo/code/ecomplus/cloud-commerce/packages/api
|
|
4
4
|
[36m@cloudcommerce/api:test: [0m> tsc -p ../../tsconfig.test.json && vitest run
|
|
5
5
|
[36m@cloudcommerce/api:test: [0m
|
|
6
6
|
[36m@cloudcommerce/api:test: [0m
|
|
7
|
-
[36m@cloudcommerce/api:test: [0m RUN v0.
|
|
7
|
+
[36m@cloudcommerce/api:test: [0m RUN v0.19.1 /home/leo/code/ecomplus/cloud-commerce/packages/api
|
|
8
8
|
[36m@cloudcommerce/api:test: [0m
|
|
9
9
|
[36m@cloudcommerce/api:test: [0m ✓ tests/index.test.ts > Read product and typecheck SKU
|
|
10
10
|
[36m@cloudcommerce/api:test: [0m ✓ tests/index.test.ts > 404 with different Store ID from env
|
|
@@ -14,5 +14,6 @@
|
|
|
14
14
|
[36m@cloudcommerce/api:test: [0m
|
|
15
15
|
[36m@cloudcommerce/api:test: [0mTest Files 1 passed (1)
|
|
16
16
|
[36m@cloudcommerce/api:test: [0m Tests 5 passed (5)
|
|
17
|
-
[36m@cloudcommerce/api:test: [0m Time
|
|
17
|
+
[36m@cloudcommerce/api:test: [0m Time 8.41s (in thread 1.63s, 514.90%)
|
|
18
18
|
[36m@cloudcommerce/api:test: [0m
|
|
19
|
+
[36m@cloudcommerce/api:test: [0mclose timed out after 1000ms
|
package/lib/index.d.ts
CHANGED
|
@@ -26,62 +26,7 @@ declare const api: {
|
|
|
26
26
|
}>;
|
|
27
27
|
get: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E, config?: C | undefined) => Promise<Response & {
|
|
28
28
|
config: Config;
|
|
29
|
-
data: E extends `${string}/${string}/${string}` ? any : E extends `products/${string}` ? import("./types").Products : E extends `categories/${string}` ? import("./types").Categories : E extends `brands/${string}` ? import("./types").Brands : E extends `collections/${string}` ? import("./types").Collections : E extends `grids/${string}` ? import("./types").Grids : E extends `carts/${string}` ? import("./types").Carts : E extends `orders/${string}` ? import("./types").Orders : E extends `customers/${string}` ? import("./types").Customers : E extends `stores/${string}` ? import("./types").Stores : E extends `applications/${string}` ? import("./types").Applications : E extends `authentications/${string}` ? import("./types
|
|
30
|
-
result: E extends infer T_1 ? T_1 extends E ? T_1 extends "products" | `products?${string}` ? import("./types").Products[] : T_1 extends "categories" | `categories?${string}` ? import("./types").Categories[] : T_1 extends "brands" | `brands?${string}` ? import("./types").Brands[] : T_1 extends "collections" | `collections?${string}` ? import("./types").Collections[] : T_1 extends "grids" | `grids?${string}` ? import("./types").Grids[] : T_1 extends "carts" | `carts?${string}` ? import("./types").Carts[] : T_1 extends "orders" | `orders?${string}` ? import("./types").Orders[] : T_1 extends "customers" | `customers?${string}` ? import("./types").Customers[] : T_1 extends "stores" | `stores?${string}` ? import("./types").Stores[] : T_1 extends "applications" | `applications?${string}` ? import("./types").Applications[] : T_1 extends "authentications" | `authentications?${string}` ? import("./types/authentications").Authentications[] : never : never : never;
|
|
31
|
-
meta: {
|
|
32
|
-
offset: number;
|
|
33
|
-
limit: number;
|
|
34
|
-
fields: string[];
|
|
35
|
-
} & {
|
|
36
|
-
count?: number | undefined;
|
|
37
|
-
sort: {
|
|
38
|
-
field: string;
|
|
39
|
-
order: 1 | -1;
|
|
40
|
-
}[];
|
|
41
|
-
query: {
|
|
42
|
-
[key: string]: any;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
} : E extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` | "events/me" ? {
|
|
46
|
-
result: ({
|
|
47
|
-
timestamp: string;
|
|
48
|
-
store_id?: number | undefined;
|
|
49
|
-
resource?: string | undefined;
|
|
50
|
-
authentication_id?: (string & {
|
|
51
|
-
length: 24;
|
|
52
|
-
}) | null | undefined;
|
|
53
|
-
resource_id?: (string & {
|
|
54
|
-
length: 24;
|
|
55
|
-
}) | undefined;
|
|
56
|
-
action: string;
|
|
57
|
-
modified_fields: string[];
|
|
58
|
-
method?: number | undefined;
|
|
59
|
-
endpoint?: string | undefined;
|
|
60
|
-
body?: any;
|
|
61
|
-
ip?: string | undefined;
|
|
62
|
-
} & (E extends infer T_2 ? T_2 extends E ? T_2 extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" ? {
|
|
63
|
-
resource_id: string & {
|
|
64
|
-
length: 24;
|
|
65
|
-
};
|
|
66
|
-
authentication_id: (string & {
|
|
67
|
-
length: 24;
|
|
68
|
-
}) | null;
|
|
69
|
-
} : T_2 extends `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` ? {
|
|
70
|
-
authentication_id: (string & {
|
|
71
|
-
length: 24;
|
|
72
|
-
}) | null;
|
|
73
|
-
} : T_2 extends "events/me" ? {
|
|
74
|
-
resource: import("./types").Resource;
|
|
75
|
-
resource_id: string & {
|
|
76
|
-
length: 24;
|
|
77
|
-
};
|
|
78
|
-
} : never : never : never))[];
|
|
79
|
-
meta: {
|
|
80
|
-
offset: number;
|
|
81
|
-
limit: number;
|
|
82
|
-
fields: string[];
|
|
83
|
-
};
|
|
84
|
-
} : any;
|
|
29
|
+
data: E extends `${string}/${string}/${string}` ? any : E extends `products/${string}` ? import("./types").Products : E extends `categories/${string}` ? import("./types").Categories : E extends `brands/${string}` ? import("./types").Brands : E extends `collections/${string}` ? import("./types").Collections : E extends `grids/${string}` ? import("./types").Grids : E extends `carts/${string}` ? import("./types").Carts : E extends `orders/${string}` ? import("./types").Orders : E extends `customers/${string}` ? import("./types").Customers : E extends `stores/${string}` ? import("./types").Stores : E extends `applications/${string}` ? import("./types").Applications : E extends `authentications/${string}` ? import("./types").Authentications : E extends ResourceOpQuery ? import("./types").ResourceListResult<E> : E extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` | "events/me" ? import("./types").EventsResult<E> : any;
|
|
85
30
|
}>;
|
|
86
31
|
post: <E_1 extends Endpoint, C_1 extends AbstractedAuthConfig>(endpoint: E_1, body: E_1 extends "products" | `products/${string}` ? {
|
|
87
32
|
categories?: {
|
|
@@ -5089,62 +5034,7 @@ declare type AbstractedAuthConfig = AbstractedConfig & {
|
|
|
5089
5034
|
};
|
|
5090
5035
|
declare const get: <E extends Endpoint, C extends AbstractedConfig>(endpoint: E, config?: C | undefined) => Promise<Response & {
|
|
5091
5036
|
config: Config;
|
|
5092
|
-
data: E extends `${string}/${string}/${string}` ? any : E extends `products/${string}` ? import("./types").Products : E extends `categories/${string}` ? import("./types").Categories : E extends `brands/${string}` ? import("./types").Brands : E extends `collections/${string}` ? import("./types").Collections : E extends `grids/${string}` ? import("./types").Grids : E extends `carts/${string}` ? import("./types").Carts : E extends `orders/${string}` ? import("./types").Orders : E extends `customers/${string}` ? import("./types").Customers : E extends `stores/${string}` ? import("./types").Stores : E extends `applications/${string}` ? import("./types").Applications : E extends `authentications/${string}` ? import("./types
|
|
5093
|
-
result: E extends infer T_1 ? T_1 extends E ? T_1 extends "products" | `products?${string}` ? import("./types").Products[] : T_1 extends "categories" | `categories?${string}` ? import("./types").Categories[] : T_1 extends "brands" | `brands?${string}` ? import("./types").Brands[] : T_1 extends "collections" | `collections?${string}` ? import("./types").Collections[] : T_1 extends "grids" | `grids?${string}` ? import("./types").Grids[] : T_1 extends "carts" | `carts?${string}` ? import("./types").Carts[] : T_1 extends "orders" | `orders?${string}` ? import("./types").Orders[] : T_1 extends "customers" | `customers?${string}` ? import("./types").Customers[] : T_1 extends "stores" | `stores?${string}` ? import("./types").Stores[] : T_1 extends "applications" | `applications?${string}` ? import("./types").Applications[] : T_1 extends "authentications" | `authentications?${string}` ? import("./types/authentications").Authentications[] : never : never : never;
|
|
5094
|
-
meta: {
|
|
5095
|
-
offset: number;
|
|
5096
|
-
limit: number;
|
|
5097
|
-
fields: string[];
|
|
5098
|
-
} & {
|
|
5099
|
-
count?: number | undefined;
|
|
5100
|
-
sort: {
|
|
5101
|
-
field: string;
|
|
5102
|
-
order: 1 | -1;
|
|
5103
|
-
}[];
|
|
5104
|
-
query: {
|
|
5105
|
-
[key: string]: any;
|
|
5106
|
-
};
|
|
5107
|
-
};
|
|
5108
|
-
} : E extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` | "events/me" ? {
|
|
5109
|
-
result: ({
|
|
5110
|
-
timestamp: string;
|
|
5111
|
-
store_id?: number | undefined;
|
|
5112
|
-
resource?: string | undefined;
|
|
5113
|
-
authentication_id?: (string & {
|
|
5114
|
-
length: 24;
|
|
5115
|
-
}) | null | undefined;
|
|
5116
|
-
resource_id?: (string & {
|
|
5117
|
-
length: 24;
|
|
5118
|
-
}) | undefined;
|
|
5119
|
-
action: string;
|
|
5120
|
-
modified_fields: string[];
|
|
5121
|
-
method?: number | undefined;
|
|
5122
|
-
endpoint?: string | undefined;
|
|
5123
|
-
body?: any;
|
|
5124
|
-
ip?: string | undefined;
|
|
5125
|
-
} & (E extends infer T_2 ? T_2 extends E ? T_2 extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" ? {
|
|
5126
|
-
resource_id: string & {
|
|
5127
|
-
length: 24;
|
|
5128
|
-
};
|
|
5129
|
-
authentication_id: (string & {
|
|
5130
|
-
length: 24;
|
|
5131
|
-
}) | null;
|
|
5132
|
-
} : T_2 extends `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` ? {
|
|
5133
|
-
authentication_id: (string & {
|
|
5134
|
-
length: 24;
|
|
5135
|
-
}) | null;
|
|
5136
|
-
} : T_2 extends "events/me" ? {
|
|
5137
|
-
resource: import("./types").Resource;
|
|
5138
|
-
resource_id: string & {
|
|
5139
|
-
length: 24;
|
|
5140
|
-
};
|
|
5141
|
-
} : never : never : never))[];
|
|
5142
|
-
meta: {
|
|
5143
|
-
offset: number;
|
|
5144
|
-
limit: number;
|
|
5145
|
-
fields: string[];
|
|
5146
|
-
};
|
|
5147
|
-
} : any;
|
|
5037
|
+
data: E extends `${string}/${string}/${string}` ? any : E extends `products/${string}` ? import("./types").Products : E extends `categories/${string}` ? import("./types").Categories : E extends `brands/${string}` ? import("./types").Brands : E extends `collections/${string}` ? import("./types").Collections : E extends `grids/${string}` ? import("./types").Grids : E extends `carts/${string}` ? import("./types").Carts : E extends `orders/${string}` ? import("./types").Orders : E extends `customers/${string}` ? import("./types").Customers : E extends `stores/${string}` ? import("./types").Stores : E extends `applications/${string}` ? import("./types").Applications : E extends `authentications/${string}` ? import("./types").Authentications : E extends ResourceOpQuery ? import("./types").ResourceListResult<E> : E extends "events/products" | "events/categories" | "events/brands" | "events/collections" | "events/grids" | "events/carts" | "events/orders" | "events/customers" | "events/stores" | "events/applications" | "events/authentications" | `events/products/${string}` | `events/categories/${string}` | `events/brands/${string}` | `events/collections/${string}` | `events/grids/${string}` | `events/carts/${string}` | `events/orders/${string}` | `events/customers/${string}` | `events/stores/${string}` | `events/applications/${string}` | `events/authentications/${string}` | "events/me" ? import("./types").EventsResult<E> : any;
|
|
5148
5038
|
}>;
|
|
5149
5039
|
declare const post: <E extends Endpoint, C extends AbstractedAuthConfig>(endpoint: E, body: E extends "products" | `products/${string}` ? {
|
|
5150
5040
|
categories?: {
|
package/lib/types.d.ts
CHANGED
|
@@ -91,4 +91,4 @@ declare type ResponseBody<TConfig extends Config> = TConfig['method'] extends 'p
|
|
|
91
91
|
declare type DocSchema<Document extends any> = Omit<Document, '_id' | 'store_id' | 'store_ids' | 'created_at' | 'updated_at'>;
|
|
92
92
|
declare type SetDocEndpoint<TResource extends Resource> = TResource | `${TResource}/${ResourceId}`;
|
|
93
93
|
declare type RequestBody<TConfig extends Config> = TConfig['method'] extends undefined | 'get' | 'delete' ? undefined : TConfig['method'] extends 'patch' ? any : TConfig['endpoint'] extends SetDocEndpoint<'products'> ? DocSchema<Products> : TConfig['endpoint'] extends SetDocEndpoint<'categories'> ? DocSchema<Categories> : TConfig['endpoint'] extends SetDocEndpoint<'brands'> ? DocSchema<Brands> : TConfig['endpoint'] extends SetDocEndpoint<'collections'> ? DocSchema<Collections> : TConfig['endpoint'] extends SetDocEndpoint<'grids'> ? DocSchema<Grids> : TConfig['endpoint'] extends SetDocEndpoint<'carts'> ? DocSchema<Carts> : TConfig['endpoint'] extends SetDocEndpoint<'orders'> ? DocSchema<Orders> : TConfig['endpoint'] extends SetDocEndpoint<'customers'> ? DocSchema<Customers> : TConfig['endpoint'] extends SetDocEndpoint<'stores'> ? DocSchema<Stores> : TConfig['endpoint'] extends SetDocEndpoint<'applications'> ? DocSchema<Applications> : TConfig['endpoint'] extends SetDocEndpoint<'authentications'> ? DocSchema<Authentications> : any;
|
|
94
|
-
export type { Products, Categories, Brands, Collections, Grids, Carts, Orders, Customers, Stores, Applications, Resource, ResourceAndId, ResourceOpQuery, Endpoint, Method, Config, ResponseBody, RequestBody, };
|
|
94
|
+
export type { Products, Categories, Brands, Collections, Grids, Carts, Orders, Customers, Stores, Applications, Authentications, Resource, ResourceId, ResourceAndId, ResourceOpQuery, Endpoint, Method, Config, ResourceListResult, EventsResult, ResponseBody, RequestBody, };
|
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -182,12 +182,16 @@ export type {
|
|
|
182
182
|
Customers,
|
|
183
183
|
Stores,
|
|
184
184
|
Applications,
|
|
185
|
+
Authentications,
|
|
185
186
|
Resource,
|
|
187
|
+
ResourceId,
|
|
186
188
|
ResourceAndId,
|
|
187
189
|
ResourceOpQuery,
|
|
188
190
|
Endpoint,
|
|
189
191
|
Method,
|
|
190
192
|
Config,
|
|
193
|
+
ResourceListResult,
|
|
194
|
+
EventsResult,
|
|
191
195
|
ResponseBody,
|
|
192
196
|
RequestBody,
|
|
193
197
|
};
|