@blackfisk/blackfisk-vue-storefront-sdk 1.0.2
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/lib/api-extractor.data.d.ts +11 -0
- package/lib/api-extractor.data.d.ts.map +1 -0
- package/lib/client/index.d.ts +2 -0
- package/lib/client/index.d.ts.map +1 -0
- package/lib/connector.d.ts +12 -0
- package/lib/connector.d.ts.map +1 -0
- package/lib/index.cjs.js +115 -0
- package/lib/index.cjs.js.map +1 -0
- package/lib/index.d.ts +19 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.es.js +106 -0
- package/lib/index.es.js.map +1 -0
- package/lib/methods/exampleMethod/index.d.ts +22 -0
- package/lib/methods/exampleMethod/index.d.ts.map +1 -0
- package/lib/methods/getPageContent/index.d.ts +22 -0
- package/lib/methods/getPageContent/index.d.ts.map +1 -0
- package/lib/methods/getProductCollection/index.d.ts +22 -0
- package/lib/methods/getProductCollection/index.d.ts.map +1 -0
- package/lib/methods/index.d.ts +4 -0
- package/lib/methods/index.d.ts.map +1 -0
- package/lib/types/MethodOptions.d.ts +16 -0
- package/lib/types/MethodOptions.d.ts.map +1 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/options.d.ts +10 -0
- package/lib/types/options.d.ts.map +1 -0
- package/package.json +33 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sdk-connector` for Vue Storefront 2 integration bolierplate.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* In here you can find all references to the integration SDK connector.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export * from './types';
|
|
10
|
+
export * from './methods';
|
|
11
|
+
//# sourceMappingURL=api-extractor.data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-extractor.data.d.ts","sourceRoot":"","sources":["../src/api-extractor.data.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,+BAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Options } from './types';
|
|
2
|
+
import * as methods from './methods/index';
|
|
3
|
+
/**
|
|
4
|
+
* Connector methods.
|
|
5
|
+
*/
|
|
6
|
+
declare type Methods = typeof methods;
|
|
7
|
+
/**
|
|
8
|
+
* Initialize the Boilerplate connector.
|
|
9
|
+
*/
|
|
10
|
+
export declare const boilerplateConnector: (options: Options) => Methods;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=connector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAE3C;;GAEG;AACH,aAAK,OAAO,GAAG,OAAO,OAAO,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,oBAAoB,YAAa,OAAO,KAAG,OAIvD,CAAC"}
|
package/lib/index.cjs.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var axios = require('axios');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
10
|
+
|
|
11
|
+
const client = axios__default["default"].create();
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Method summary - General information about the SDK method, usually a single sentence.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* In this section, we have been adding detailed information such as:
|
|
18
|
+
* * what API middleware endpoint this method is calling,
|
|
19
|
+
* * what SAP OCC API endpoints are being called as a result of using this method,
|
|
20
|
+
* * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),
|
|
21
|
+
* * simply everything what helps with understanding how it works.
|
|
22
|
+
*
|
|
23
|
+
* @param props
|
|
24
|
+
* Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.
|
|
25
|
+
*
|
|
26
|
+
* @returns
|
|
27
|
+
* Human-friendly information what the SDK methods returns.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.
|
|
31
|
+
*/
|
|
32
|
+
async function exampleMethod(props) {
|
|
33
|
+
const { data } = await client.post('exampleEndpoint', props);
|
|
34
|
+
return data;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Method summary - General information about the SDK method, usually a single sentence.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* In this section, we have been adding detailed information such as:
|
|
42
|
+
* * what API middleware endpoint this method is calling,
|
|
43
|
+
* * what SAP OCC API endpoints are being called as a result of using this method,
|
|
44
|
+
* * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),
|
|
45
|
+
* * simply everything what helps with understanding how it works.
|
|
46
|
+
*
|
|
47
|
+
* @param props
|
|
48
|
+
* Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.
|
|
49
|
+
*
|
|
50
|
+
* @returns
|
|
51
|
+
* Human-friendly information what the SDK methods returns.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.
|
|
55
|
+
*/
|
|
56
|
+
async function getPageContent(props) {
|
|
57
|
+
const { data } = await client.post('getPageContent', props);
|
|
58
|
+
return data;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Method summary - General information about the SDK method, usually a single sentence.
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* In this section, we have been adding detailed information such as:
|
|
66
|
+
* * what API middleware endpoint this method is calling,
|
|
67
|
+
* * what SAP OCC API endpoints are being called as a result of using this method,
|
|
68
|
+
* * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),
|
|
69
|
+
* * simply everything what helps with understanding how it works.
|
|
70
|
+
*
|
|
71
|
+
* @param props
|
|
72
|
+
* Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.
|
|
73
|
+
*
|
|
74
|
+
* @returns
|
|
75
|
+
* Human-friendly information what the SDK methods returns.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.
|
|
79
|
+
*/
|
|
80
|
+
async function getProductCollection(props) {
|
|
81
|
+
const { data } = await client.post('getProductCollection', props);
|
|
82
|
+
return data;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var methods = /*#__PURE__*/Object.freeze({
|
|
86
|
+
__proto__: null,
|
|
87
|
+
exampleMethod: exampleMethod,
|
|
88
|
+
getPageContent: getPageContent,
|
|
89
|
+
getProductCollection: getProductCollection
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Initialize the Boilerplate connector.
|
|
94
|
+
*/
|
|
95
|
+
const boilerplateConnector = (options) => {
|
|
96
|
+
client.defaults.baseURL = options.apiUrl;
|
|
97
|
+
return methods;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Boilerplate module.
|
|
102
|
+
*/
|
|
103
|
+
const boilerplateModule = (options) => {
|
|
104
|
+
return {
|
|
105
|
+
connector: boilerplateConnector({
|
|
106
|
+
apiUrl: options.apiUrl,
|
|
107
|
+
}),
|
|
108
|
+
utils: {},
|
|
109
|
+
subscribers: {},
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
exports.boilerplateModule = boilerplateModule;
|
|
114
|
+
exports.client = client;
|
|
115
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/client/index.ts","../src/methods/exampleMethod/index.ts","../src/methods/getPageContent/index.ts","../src/methods/getProductCollection/index.ts","../src/connector.ts","../src/index.ts"],"sourcesContent":["import axios from 'axios';\n\nexport const client = axios.create();","import { client } from '../../client';\nimport { TODO } from '../../types';\n\n/**\n * Method summary - General information about the SDK method, usually a single sentence.\n * \n * @remarks\n * In this section, we have been adding detailed information such as:\n * * what API middleware endpoint this method is calling,\n * * what SAP OCC API endpoints are being called as a result of using this method,\n * * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),\n * * simply everything what helps with understanding how it works.\n * \n * @param props\n * Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.\n * \n * @returns\n * Human-friendly information what the SDK methods returns.\n * \n * @example\n * A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.\n */\nexport async function exampleMethod(props: TODO) {\n const { data } = await client.post<TODO>('exampleEndpoint', props);\n return data\n}\n","import { client } from '../../client';\nimport { TODO } from '../../types';\n\n/**\n * Method summary - General information about the SDK method, usually a single sentence.\n * \n * @remarks\n * In this section, we have been adding detailed information such as:\n * * what API middleware endpoint this method is calling,\n * * what SAP OCC API endpoints are being called as a result of using this method,\n * * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),\n * * simply everything what helps with understanding how it works.\n * \n * @param props\n * Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.\n * \n * @returns\n * Human-friendly information what the SDK methods returns.\n * \n * @example\n * A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.\n */\nexport async function getPageContent(props: TODO) {\n const { data } = await client.post<TODO>('getPageContent', props);\n return data\n}\n","import { client } from '../../client';\nimport { TODO } from '../../types';\n\n/**\n * Method summary - General information about the SDK method, usually a single sentence.\n * \n * @remarks\n * In this section, we have been adding detailed information such as:\n * * what API middleware endpoint this method is calling,\n * * what SAP OCC API endpoints are being called as a result of using this method,\n * * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),\n * * simply everything what helps with understanding how it works.\n * \n * @param props\n * Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.\n * \n * @returns\n * Human-friendly information what the SDK methods returns.\n * \n * @example\n * A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.\n */\nexport async function getProductCollection(props: TODO) {\n const { data } = await client.post<TODO>('getProductCollection', props);\n return data\n}\n","import { client } from './client';\nimport { Options } from './types';\nimport * as methods from './methods/index';\n\n/**\n * Connector methods.\n */\ntype Methods = typeof methods;\n\n/**\n * Initialize the Boilerplate connector.\n */\nexport const boilerplateConnector = (options: Options): Methods => {\n client.defaults.baseURL = options.apiUrl;\n\n return methods;\n};\n","import { boilerplateConnector } from './connector';\nimport type { Options } from './types';\nimport type { Module } from '@vue-storefront/sdk';\n\n/**\n * Boulerplate module type.\n */\nexport interface BoilerplateModuleType extends Module {\n /**\n * The connector of the Boilerplate module.\n */\n connector: ReturnType<typeof boilerplateConnector>;\n}\n\n/**\n * Boilerplate module.\n */\nexport const boilerplateModule = (options: Options): BoilerplateModuleType => {\n return {\n connector: boilerplateConnector({\n apiUrl: options.apiUrl,\n }),\n utils: {},\n subscribers: {},\n }\n};\n\nexport { client } from './client';\n\nexport * from './types';\n"],"names":["axios"],"mappings":";;;;;;;;;;MAEa,MAAM,GAAGA,yBAAK,CAAC,MAAM;;ACClC;;;;;;;;;;;;;;;;;;AAkBG;AACI,eAAe,aAAa,CAAC,KAAW,EAAA;AAC7C,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAO,iBAAiB,EAAE,KAAK,CAAC,CAAC;AACnE,IAAA,OAAO,IAAI,CAAA;AACb;;ACtBA;;;;;;;;;;;;;;;;;;AAkBG;AACI,eAAe,cAAc,CAAC,KAAW,EAAA;AAC9C,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAO,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAClE,IAAA,OAAO,IAAI,CAAA;AACb;;ACtBA;;;;;;;;;;;;;;;;;;AAkBG;AACI,eAAe,oBAAoB,CAAC,KAAW,EAAA;AACpD,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAO,sBAAsB,EAAE,KAAK,CAAC,CAAC;AACxE,IAAA,OAAO,IAAI,CAAA;AACb;;;;;;;;;AChBA;;AAEG;AACI,MAAM,oBAAoB,GAAG,CAAC,OAAgB,KAAa;IAChE,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;AAEzC,IAAA,OAAO,OAAO,CAAC;AACjB,CAAC;;ACFD;;AAEG;AACU,MAAA,iBAAiB,GAAG,CAAC,OAAgB,KAA2B;IAC3E,OAAO;QACL,SAAS,EAAE,oBAAoB,CAAC;YAC9B,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC;AACF,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,WAAW,EAAE,EAAE;KAChB,CAAA;AACH;;;;;"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { boilerplateConnector } from './connector';
|
|
2
|
+
import type { Options } from './types';
|
|
3
|
+
import type { Module } from '@vue-storefront/sdk';
|
|
4
|
+
/**
|
|
5
|
+
* Boulerplate module type.
|
|
6
|
+
*/
|
|
7
|
+
export interface BoilerplateModuleType extends Module {
|
|
8
|
+
/**
|
|
9
|
+
* The connector of the Boilerplate module.
|
|
10
|
+
*/
|
|
11
|
+
connector: ReturnType<typeof boilerplateConnector>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Boilerplate module.
|
|
15
|
+
*/
|
|
16
|
+
export declare const boilerplateModule: (options: Options) => BoilerplateModuleType;
|
|
17
|
+
export { client } from './client';
|
|
18
|
+
export * from './types';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,MAAM;IACnD;;OAEG;IACH,SAAS,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;CACpD;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,YAAa,OAAO,KAAG,qBAQpD,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,cAAc,SAAS,CAAC"}
|
package/lib/index.es.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
|
|
3
|
+
const client = axios.create();
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Method summary - General information about the SDK method, usually a single sentence.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* In this section, we have been adding detailed information such as:
|
|
10
|
+
* * what API middleware endpoint this method is calling,
|
|
11
|
+
* * what SAP OCC API endpoints are being called as a result of using this method,
|
|
12
|
+
* * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),
|
|
13
|
+
* * simply everything what helps with understanding how it works.
|
|
14
|
+
*
|
|
15
|
+
* @param props
|
|
16
|
+
* Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.
|
|
17
|
+
*
|
|
18
|
+
* @returns
|
|
19
|
+
* Human-friendly information what the SDK methods returns.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.
|
|
23
|
+
*/
|
|
24
|
+
async function exampleMethod(props) {
|
|
25
|
+
const { data } = await client.post('exampleEndpoint', props);
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Method summary - General information about the SDK method, usually a single sentence.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* In this section, we have been adding detailed information such as:
|
|
34
|
+
* * what API middleware endpoint this method is calling,
|
|
35
|
+
* * what SAP OCC API endpoints are being called as a result of using this method,
|
|
36
|
+
* * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),
|
|
37
|
+
* * simply everything what helps with understanding how it works.
|
|
38
|
+
*
|
|
39
|
+
* @param props
|
|
40
|
+
* Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.
|
|
41
|
+
*
|
|
42
|
+
* @returns
|
|
43
|
+
* Human-friendly information what the SDK methods returns.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.
|
|
47
|
+
*/
|
|
48
|
+
async function getPageContent(props) {
|
|
49
|
+
const { data } = await client.post('getPageContent', props);
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Method summary - General information about the SDK method, usually a single sentence.
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* In this section, we have been adding detailed information such as:
|
|
58
|
+
* * what API middleware endpoint this method is calling,
|
|
59
|
+
* * what SAP OCC API endpoints are being called as a result of using this method,
|
|
60
|
+
* * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),
|
|
61
|
+
* * simply everything what helps with understanding how it works.
|
|
62
|
+
*
|
|
63
|
+
* @param props
|
|
64
|
+
* Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.
|
|
65
|
+
*
|
|
66
|
+
* @returns
|
|
67
|
+
* Human-friendly information what the SDK methods returns.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.
|
|
71
|
+
*/
|
|
72
|
+
async function getProductCollection(props) {
|
|
73
|
+
const { data } = await client.post('getProductCollection', props);
|
|
74
|
+
return data;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var methods = /*#__PURE__*/Object.freeze({
|
|
78
|
+
__proto__: null,
|
|
79
|
+
exampleMethod: exampleMethod,
|
|
80
|
+
getPageContent: getPageContent,
|
|
81
|
+
getProductCollection: getProductCollection
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Initialize the Boilerplate connector.
|
|
86
|
+
*/
|
|
87
|
+
const boilerplateConnector = (options) => {
|
|
88
|
+
client.defaults.baseURL = options.apiUrl;
|
|
89
|
+
return methods;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Boilerplate module.
|
|
94
|
+
*/
|
|
95
|
+
const boilerplateModule = (options) => {
|
|
96
|
+
return {
|
|
97
|
+
connector: boilerplateConnector({
|
|
98
|
+
apiUrl: options.apiUrl,
|
|
99
|
+
}),
|
|
100
|
+
utils: {},
|
|
101
|
+
subscribers: {},
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export { boilerplateModule, client };
|
|
106
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/client/index.ts","../src/methods/exampleMethod/index.ts","../src/methods/getPageContent/index.ts","../src/methods/getProductCollection/index.ts","../src/connector.ts","../src/index.ts"],"sourcesContent":["import axios from 'axios';\n\nexport const client = axios.create();","import { client } from '../../client';\nimport { TODO } from '../../types';\n\n/**\n * Method summary - General information about the SDK method, usually a single sentence.\n * \n * @remarks\n * In this section, we have been adding detailed information such as:\n * * what API middleware endpoint this method is calling,\n * * what SAP OCC API endpoints are being called as a result of using this method,\n * * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),\n * * simply everything what helps with understanding how it works.\n * \n * @param props\n * Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.\n * \n * @returns\n * Human-friendly information what the SDK methods returns.\n * \n * @example\n * A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.\n */\nexport async function exampleMethod(props: TODO) {\n const { data } = await client.post<TODO>('exampleEndpoint', props);\n return data\n}\n","import { client } from '../../client';\nimport { TODO } from '../../types';\n\n/**\n * Method summary - General information about the SDK method, usually a single sentence.\n * \n * @remarks\n * In this section, we have been adding detailed information such as:\n * * what API middleware endpoint this method is calling,\n * * what SAP OCC API endpoints are being called as a result of using this method,\n * * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),\n * * simply everything what helps with understanding how it works.\n * \n * @param props\n * Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.\n * \n * @returns\n * Human-friendly information what the SDK methods returns.\n * \n * @example\n * A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.\n */\nexport async function getPageContent(props: TODO) {\n const { data } = await client.post<TODO>('getPageContent', props);\n return data\n}\n","import { client } from '../../client';\nimport { TODO } from '../../types';\n\n/**\n * Method summary - General information about the SDK method, usually a single sentence.\n * \n * @remarks\n * In this section, we have been adding detailed information such as:\n * * what API middleware endpoint this method is calling,\n * * what SAP OCC API endpoints are being called as a result of using this method,\n * * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),\n * * simply everything what helps with understanding how it works.\n * \n * @param props\n * Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.\n * \n * @returns\n * Human-friendly information what the SDK methods returns.\n * \n * @example\n * A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.\n */\nexport async function getProductCollection(props: TODO) {\n const { data } = await client.post<TODO>('getProductCollection', props);\n return data\n}\n","import { client } from './client';\nimport { Options } from './types';\nimport * as methods from './methods/index';\n\n/**\n * Connector methods.\n */\ntype Methods = typeof methods;\n\n/**\n * Initialize the Boilerplate connector.\n */\nexport const boilerplateConnector = (options: Options): Methods => {\n client.defaults.baseURL = options.apiUrl;\n\n return methods;\n};\n","import { boilerplateConnector } from './connector';\nimport type { Options } from './types';\nimport type { Module } from '@vue-storefront/sdk';\n\n/**\n * Boulerplate module type.\n */\nexport interface BoilerplateModuleType extends Module {\n /**\n * The connector of the Boilerplate module.\n */\n connector: ReturnType<typeof boilerplateConnector>;\n}\n\n/**\n * Boilerplate module.\n */\nexport const boilerplateModule = (options: Options): BoilerplateModuleType => {\n return {\n connector: boilerplateConnector({\n apiUrl: options.apiUrl,\n }),\n utils: {},\n subscribers: {},\n }\n};\n\nexport { client } from './client';\n\nexport * from './types';\n"],"names":[],"mappings":";;MAEa,MAAM,GAAG,KAAK,CAAC,MAAM;;ACClC;;;;;;;;;;;;;;;;;;AAkBG;AACI,eAAe,aAAa,CAAC,KAAW,EAAA;AAC7C,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAO,iBAAiB,EAAE,KAAK,CAAC,CAAC;AACnE,IAAA,OAAO,IAAI,CAAA;AACb;;ACtBA;;;;;;;;;;;;;;;;;;AAkBG;AACI,eAAe,cAAc,CAAC,KAAW,EAAA;AAC9C,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAO,gBAAgB,EAAE,KAAK,CAAC,CAAC;AAClE,IAAA,OAAO,IAAI,CAAA;AACb;;ACtBA;;;;;;;;;;;;;;;;;;AAkBG;AACI,eAAe,oBAAoB,CAAC,KAAW,EAAA;AACpD,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAO,sBAAsB,EAAE,KAAK,CAAC,CAAC;AACxE,IAAA,OAAO,IAAI,CAAA;AACb;;;;;;;;;AChBA;;AAEG;AACI,MAAM,oBAAoB,GAAG,CAAC,OAAgB,KAAa;IAChE,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;AAEzC,IAAA,OAAO,OAAO,CAAC;AACjB,CAAC;;ACFD;;AAEG;AACU,MAAA,iBAAiB,GAAG,CAAC,OAAgB,KAA2B;IAC3E,OAAO;QACL,SAAS,EAAE,oBAAoB,CAAC;YAC9B,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC;AACF,QAAA,KAAK,EAAE,EAAE;AACT,QAAA,WAAW,EAAE,EAAE;KAChB,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TODO } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Method summary - General information about the SDK method, usually a single sentence.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* In this section, we have been adding detailed information such as:
|
|
7
|
+
* * what API middleware endpoint this method is calling,
|
|
8
|
+
* * what SAP OCC API endpoints are being called as a result of using this method,
|
|
9
|
+
* * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),
|
|
10
|
+
* * simply everything what helps with understanding how it works.
|
|
11
|
+
*
|
|
12
|
+
* @param props
|
|
13
|
+
* Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.
|
|
14
|
+
*
|
|
15
|
+
* @returns
|
|
16
|
+
* Human-friendly information what the SDK methods returns.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.
|
|
20
|
+
*/
|
|
21
|
+
export declare function exampleMethod(props: TODO): Promise<any>;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/methods/exampleMethod/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,IAAI,gBAG9C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TODO } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Method summary - General information about the SDK method, usually a single sentence.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* In this section, we have been adding detailed information such as:
|
|
7
|
+
* * what API middleware endpoint this method is calling,
|
|
8
|
+
* * what SAP OCC API endpoints are being called as a result of using this method,
|
|
9
|
+
* * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),
|
|
10
|
+
* * simply everything what helps with understanding how it works.
|
|
11
|
+
*
|
|
12
|
+
* @param props
|
|
13
|
+
* Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.
|
|
14
|
+
*
|
|
15
|
+
* @returns
|
|
16
|
+
* Human-friendly information what the SDK methods returns.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getPageContent(props: TODO): Promise<any>;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/methods/getPageContent/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,IAAI,gBAG/C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TODO } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Method summary - General information about the SDK method, usually a single sentence.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* In this section, we have been adding detailed information such as:
|
|
7
|
+
* * what API middleware endpoint this method is calling,
|
|
8
|
+
* * what SAP OCC API endpoints are being called as a result of using this method,
|
|
9
|
+
* * when this method can be used and when it can’t (e.g. logged-in vs anonymous users),
|
|
10
|
+
* * simply everything what helps with understanding how it works.
|
|
11
|
+
*
|
|
12
|
+
* @param props
|
|
13
|
+
* Just like our API methods, our SDK connector methods accept a single props parameter which carries relevant sub-properties. Therefore, there isn’t much to be described within that TSDoc section.
|
|
14
|
+
*
|
|
15
|
+
* @returns
|
|
16
|
+
* Human-friendly information what the SDK methods returns.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* A short code snippet showing how to use the method. Usually we have more than one @example. We should strive for adding as many examples as possible here, with multiple param configurations.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getProductCollection(props: TODO): Promise<any>;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/methods/getProductCollection/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,IAAI,gBAGrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/methods/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
/**
|
|
3
|
+
* Definition of the MethodOptions parameter.
|
|
4
|
+
*/
|
|
5
|
+
export interface MethodOptions {
|
|
6
|
+
/**
|
|
7
|
+
* {@link https://axios-http.com/docs/req_config | AxiosRequestConfig} object
|
|
8
|
+
* You can use it to override Axios request configuration
|
|
9
|
+
*/
|
|
10
|
+
axiosRequestConfig?: Readonly<AxiosRequestConfig>;
|
|
11
|
+
/**
|
|
12
|
+
* Additional optional fields. Its usage depends on the custom implementation.
|
|
13
|
+
*/
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=MethodOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MethodOptions.d.ts","sourceRoot":"","sources":["../../src/types/MethodOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,aAAa;IAE5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAElD;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,oBAAY,IAAI,GAAG,GAAG,CAAC;AAEvB,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/types/options.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blackfisk/blackfisk-vue-storefront-sdk",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"main": "lib/index.cjs.js",
|
|
5
|
+
"module": "lib/index.es.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "rimraf lib && rollup -c",
|
|
12
|
+
"dev": "rimraf lib && rollup -c -w",
|
|
13
|
+
"lint": "eslint . --ext .ts",
|
|
14
|
+
"test": "npm run test:unit && npm run test:integration",
|
|
15
|
+
"test:unit": "jest ./unit -c ./jest.config.unit.js",
|
|
16
|
+
"test:integration": "jest ./integration -c ./jest.config.integration.js --runInBand",
|
|
17
|
+
"test:integration:init": "rm -rf __tests__/integration/__nock-fixtures__ && jest ./integration -c ./jest.config.integration.js --runInBand",
|
|
18
|
+
"test:watch": "jest --watch",
|
|
19
|
+
"test:coverage": "jest --coverage --passWithNoTests",
|
|
20
|
+
"prepublish": "npm run build"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"axios": "^0.27.2"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@blackfisk/blackfisk-vue-storefront-api": "^1.0.2",
|
|
27
|
+
"@vue-storefront/sdk": "1.0.1",
|
|
28
|
+
"msw": "^0.47.3",
|
|
29
|
+
"nock": "^13.2.9",
|
|
30
|
+
"rollup-plugin-typescript2": "^0.34.1"
|
|
31
|
+
},
|
|
32
|
+
"gitHead": "90beb5104539291e597a9e1ca339c7ec8fa54c46"
|
|
33
|
+
}
|