@atomic-solutions/woocommerce-api-client 0.3.0 → 0.4.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.
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs.map +1 -1
- package/dist/http/index.d.mts +2 -2
- package/dist/http/index.d.ts +2 -2
- package/dist/index.d.mts +70 -131
- package/dist/index.d.ts +70 -131
- package/dist/index.js +30 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -3
- package/dist/index.mjs.map +1 -1
- package/dist/testing/index.d.mts +76 -0
- package/dist/testing/index.d.ts +76 -0
- package/dist/testing/index.js +2103 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/index.mjs +2091 -0
- package/dist/testing/index.mjs.map +1 -0
- package/dist/{types-CgTmmyIP.d.mts → types-BF4_UUqp.d.mts} +1 -1
- package/dist/{types-CgTmmyIP.d.ts → types-BF4_UUqp.d.ts} +1 -1
- package/dist/utils/index.d.mts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/package.json +17 -5
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { S as StoreApiVersion, C as CartHeadersAdapter, J as JwtTokenAdapter } from '../types-BF4_UUqp.mjs';
|
|
2
|
+
import 'axios';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
type DescribeFn = (name: string, fn: () => void) => void;
|
|
6
|
+
type ItFn = (name: string, fn: () => void | Promise<void>, timeout?: number) => void;
|
|
7
|
+
type BeforeAllFn = (fn: () => void | Promise<void>, timeout?: number) => void;
|
|
8
|
+
type AfterAllFn = (fn: () => void | Promise<void>, timeout?: number) => void;
|
|
9
|
+
type ExpectFn = (value: unknown) => {
|
|
10
|
+
toBe: (expected: unknown) => void;
|
|
11
|
+
toBeGreaterThan: (expected: number) => void;
|
|
12
|
+
toHaveProperty: (prop: string) => void;
|
|
13
|
+
toBeTruthy: () => void;
|
|
14
|
+
toContain: (expected: unknown) => void;
|
|
15
|
+
toMatch: (expected: RegExp) => void;
|
|
16
|
+
not: {
|
|
17
|
+
toBeNull: () => void;
|
|
18
|
+
toBeUndefined: () => void;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
interface WooCommerceTestSuiteOptions {
|
|
22
|
+
baseURL: string;
|
|
23
|
+
consumerKey: string;
|
|
24
|
+
consumerSecret: string;
|
|
25
|
+
storeApiVersion?: StoreApiVersion;
|
|
26
|
+
wpUsername?: string;
|
|
27
|
+
wpPassword?: string;
|
|
28
|
+
timeout?: number;
|
|
29
|
+
describe?: DescribeFn;
|
|
30
|
+
it?: ItFn;
|
|
31
|
+
expect?: ExpectFn;
|
|
32
|
+
beforeAll?: BeforeAllFn;
|
|
33
|
+
afterAll?: AfterAllFn;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare function createWooCommerceTestSuite(options: WooCommerceTestSuiteOptions): void;
|
|
37
|
+
|
|
38
|
+
interface AdminClient {
|
|
39
|
+
deleteOrder: (id: number, force?: boolean) => Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
declare function createAdminClient(options: {
|
|
42
|
+
baseURL: string;
|
|
43
|
+
consumerKey: string;
|
|
44
|
+
consumerSecret: string;
|
|
45
|
+
}): AdminClient;
|
|
46
|
+
|
|
47
|
+
declare const TEST_BILLING_ADDRESS: {
|
|
48
|
+
first_name: string;
|
|
49
|
+
last_name: string;
|
|
50
|
+
company: string;
|
|
51
|
+
address_1: string;
|
|
52
|
+
address_2: string;
|
|
53
|
+
city: string;
|
|
54
|
+
state: string;
|
|
55
|
+
postcode: string;
|
|
56
|
+
country: string;
|
|
57
|
+
phone: string;
|
|
58
|
+
email: string;
|
|
59
|
+
};
|
|
60
|
+
declare const TEST_SHIPPING_ADDRESS: {
|
|
61
|
+
first_name: string;
|
|
62
|
+
last_name: string;
|
|
63
|
+
company: string;
|
|
64
|
+
address_1: string;
|
|
65
|
+
address_2: string;
|
|
66
|
+
city: string;
|
|
67
|
+
state: string;
|
|
68
|
+
postcode: string;
|
|
69
|
+
country: string;
|
|
70
|
+
phone: string;
|
|
71
|
+
};
|
|
72
|
+
declare function createInMemoryCartAdapter(): CartHeadersAdapter;
|
|
73
|
+
declare function createStaticJwtAdapter(token: string): JwtTokenAdapter;
|
|
74
|
+
declare function loginForJwt(baseURL: string, username: string, password: string): Promise<string>;
|
|
75
|
+
|
|
76
|
+
export { type AdminClient, TEST_BILLING_ADDRESS, TEST_SHIPPING_ADDRESS, type WooCommerceTestSuiteOptions, createAdminClient, createInMemoryCartAdapter, createStaticJwtAdapter, createWooCommerceTestSuite, loginForJwt };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { S as StoreApiVersion, C as CartHeadersAdapter, J as JwtTokenAdapter } from '../types-BF4_UUqp.js';
|
|
2
|
+
import 'axios';
|
|
3
|
+
import 'zod';
|
|
4
|
+
|
|
5
|
+
type DescribeFn = (name: string, fn: () => void) => void;
|
|
6
|
+
type ItFn = (name: string, fn: () => void | Promise<void>, timeout?: number) => void;
|
|
7
|
+
type BeforeAllFn = (fn: () => void | Promise<void>, timeout?: number) => void;
|
|
8
|
+
type AfterAllFn = (fn: () => void | Promise<void>, timeout?: number) => void;
|
|
9
|
+
type ExpectFn = (value: unknown) => {
|
|
10
|
+
toBe: (expected: unknown) => void;
|
|
11
|
+
toBeGreaterThan: (expected: number) => void;
|
|
12
|
+
toHaveProperty: (prop: string) => void;
|
|
13
|
+
toBeTruthy: () => void;
|
|
14
|
+
toContain: (expected: unknown) => void;
|
|
15
|
+
toMatch: (expected: RegExp) => void;
|
|
16
|
+
not: {
|
|
17
|
+
toBeNull: () => void;
|
|
18
|
+
toBeUndefined: () => void;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
interface WooCommerceTestSuiteOptions {
|
|
22
|
+
baseURL: string;
|
|
23
|
+
consumerKey: string;
|
|
24
|
+
consumerSecret: string;
|
|
25
|
+
storeApiVersion?: StoreApiVersion;
|
|
26
|
+
wpUsername?: string;
|
|
27
|
+
wpPassword?: string;
|
|
28
|
+
timeout?: number;
|
|
29
|
+
describe?: DescribeFn;
|
|
30
|
+
it?: ItFn;
|
|
31
|
+
expect?: ExpectFn;
|
|
32
|
+
beforeAll?: BeforeAllFn;
|
|
33
|
+
afterAll?: AfterAllFn;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare function createWooCommerceTestSuite(options: WooCommerceTestSuiteOptions): void;
|
|
37
|
+
|
|
38
|
+
interface AdminClient {
|
|
39
|
+
deleteOrder: (id: number, force?: boolean) => Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
declare function createAdminClient(options: {
|
|
42
|
+
baseURL: string;
|
|
43
|
+
consumerKey: string;
|
|
44
|
+
consumerSecret: string;
|
|
45
|
+
}): AdminClient;
|
|
46
|
+
|
|
47
|
+
declare const TEST_BILLING_ADDRESS: {
|
|
48
|
+
first_name: string;
|
|
49
|
+
last_name: string;
|
|
50
|
+
company: string;
|
|
51
|
+
address_1: string;
|
|
52
|
+
address_2: string;
|
|
53
|
+
city: string;
|
|
54
|
+
state: string;
|
|
55
|
+
postcode: string;
|
|
56
|
+
country: string;
|
|
57
|
+
phone: string;
|
|
58
|
+
email: string;
|
|
59
|
+
};
|
|
60
|
+
declare const TEST_SHIPPING_ADDRESS: {
|
|
61
|
+
first_name: string;
|
|
62
|
+
last_name: string;
|
|
63
|
+
company: string;
|
|
64
|
+
address_1: string;
|
|
65
|
+
address_2: string;
|
|
66
|
+
city: string;
|
|
67
|
+
state: string;
|
|
68
|
+
postcode: string;
|
|
69
|
+
country: string;
|
|
70
|
+
phone: string;
|
|
71
|
+
};
|
|
72
|
+
declare function createInMemoryCartAdapter(): CartHeadersAdapter;
|
|
73
|
+
declare function createStaticJwtAdapter(token: string): JwtTokenAdapter;
|
|
74
|
+
declare function loginForJwt(baseURL: string, username: string, password: string): Promise<string>;
|
|
75
|
+
|
|
76
|
+
export { type AdminClient, TEST_BILLING_ADDRESS, TEST_SHIPPING_ADDRESS, type WooCommerceTestSuiteOptions, createAdminClient, createInMemoryCartAdapter, createStaticJwtAdapter, createWooCommerceTestSuite, loginForJwt };
|