@monterosa/sdk-interact-interop 0.18.10 → 2.0.0-rc.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/dist/api.d.ts CHANGED
@@ -9,7 +9,22 @@
9
9
  */
10
10
  import { Listings, Localised } from './types';
11
11
  /**
12
+ * Fetches the Project listings feed from the CDN.
13
+ *
14
+ * @param host - The static host domain (e.g. `cdn-example.monterosa.cloud`)
15
+ * @param projectId - The Project UUID
16
+ * @returns A promise resolving to the Project listings containing Events
17
+ *
12
18
  * @internal
13
19
  */
14
20
  export declare function fetchListings(host: string, projectId: string): Promise<Listings>;
21
+ /**
22
+ * Fetches the Project settings from the CDN.
23
+ *
24
+ * @param host - The static host domain (e.g. `cdn-example.monterosa.cloud`)
25
+ * @param id - The Project UUID
26
+ * @returns A promise resolving to localised Project settings
27
+ *
28
+ * @internal
29
+ */
15
30
  export declare function fetchSettings(host: string, id: string): Promise<Localised<Record<string, unknown>>>;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Provides type definitions shared between Interact Kit consumers.
3
+ *
4
+ * @packageDocumentation
5
+ */
1
6
  /**
2
7
  * @license
3
8
  * index.ts
@@ -7,9 +12,4 @@
7
12
  *
8
13
  * More details on the license can be found at https://www.monterosa.co/sdk/license
9
14
  */
10
- /**
11
- * Monterosa SDK / Interact Interoperability
12
- *
13
- * @packageDocumentation
14
- */
15
15
  export * from './api';
@@ -8,6 +8,12 @@
8
8
  * More details on the license can be found at https://www.monterosa.co/sdk/license
9
9
  */
10
10
  /**
11
+ * Fetches the Project listings feed from the CDN.
12
+ *
13
+ * @param host - The static host domain (e.g. `cdn-example.monterosa.cloud`)
14
+ * @param projectId - The Project UUID
15
+ * @returns A promise resolving to the Project listings containing Events
16
+ *
11
17
  * @internal
12
18
  */
13
19
  async function fetchListings(host, projectId) {
@@ -15,7 +21,13 @@ async function fetchListings(host, projectId) {
15
21
  const data = (await response.json());
16
22
  return data;
17
23
  }
18
- /*
24
+ /**
25
+ * Fetches the Project settings from the CDN.
26
+ *
27
+ * @param host - The static host domain (e.g. `cdn-example.monterosa.cloud`)
28
+ * @param id - The Project UUID
29
+ * @returns A promise resolving to localised Project settings
30
+ *
19
31
  * @internal
20
32
  */
21
33
  async function fetchSettings(host, id) {
@@ -25,4 +37,4 @@ async function fetchSettings(host, id) {
25
37
  }
26
38
 
27
39
  export { fetchListings, fetchSettings };
28
- //# sourceMappingURL=index.esm2017.js.map
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../src/api.ts"],"sourcesContent":["/**\n * @license\n * api.ts\n * interact-interop\n *\n * Copyright © 2025 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Listings, Localised } from './types';\n\n/**\n * Fetches the Project listings feed from the CDN.\n *\n * @param host - The static host domain (e.g. `cdn-example.monterosa.cloud`)\n * @param projectId - The Project UUID\n * @returns A promise resolving to the Project listings containing Events\n *\n * @internal\n */\nexport async function fetchListings(\n host: string,\n projectId: string,\n): Promise<Listings> {\n const response = await fetch(\n `https://${host}/projects/${projectId.substring(\n 0,\n 2,\n )}/${projectId}/listings.json`,\n );\n\n const data = (await response.json()) as Listings;\n\n return data;\n}\n\n/**\n * Fetches the Project settings from the CDN.\n *\n * @param host - The static host domain (e.g. `cdn-example.monterosa.cloud`)\n * @param id - The Project UUID\n * @returns A promise resolving to localised Project settings\n *\n * @internal\n */\nexport async function fetchSettings(\n host: string,\n id: string,\n): Promise<Localised<Record<string, unknown>>> {\n const response = await fetch(\n `https://${host}/projects/${id.substring(0, 2)}/${id}/settings.json`,\n );\n\n const data = (await response.json()) as Localised<Record<string, unknown>>;\n\n return data;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;AAQG;AAIH;;;;;;;;AAQG;AACI,eAAe,aAAa,CACjC,IAAY,EACZ,SAAiB,EAAA;IAEjB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,CAAW,QAAA,EAAA,IAAI,aAAa,SAAS,CAAC,SAAS,CAC7C,CAAC,EACD,CAAC,CACF,IAAI,SAAS,CAAA,cAAA,CAAgB,CAC/B,CAAC;IAEF,MAAM,IAAI,IAAI,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAa,CAAC;AAEjD,IAAA,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;AAQG;AACI,eAAe,aAAa,CACjC,IAAY,EACZ,EAAU,EAAA;IAEV,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,CAAW,QAAA,EAAA,IAAI,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA,cAAA,CAAgB,CACrE,CAAC;IAEF,MAAM,IAAI,IAAI,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAuC,CAAC;AAE3E,IAAA,OAAO,IAAI,CAAC;AACd;;;;"}
package/dist/types.d.ts CHANGED
@@ -26,7 +26,7 @@ export interface ExtensionAsset {
26
26
  *
27
27
  * - when `false` is set, a developer can decide on their own how to handle it
28
28
  */
29
- autoload?: 'js' | 'css' | false;
29
+ autoload?: 'js' | 'css2' | false;
30
30
  }
31
31
  export interface ProjectLocale {
32
32
  default: boolean;
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "@monterosa/sdk-interact-interop",
3
- "version": "0.18.10",
3
+ "version": "2.0.0-rc.2",
4
4
  "description": "Launcher Interoperability for the Monterosa SDK",
5
- "author": "Monterosa <hello@monterosa.co.uk> (https://www.monterosa.co/)",
6
- "main": "dist/index.cjs.js",
7
- "browser": "dist/index.esm2017.js",
8
- "module": "dist/index.esm2017.js",
9
- "esm5": "dist/index.esm5.js",
5
+ "author": "Monterosa Productions Limited <hello@monterosa.co.uk> (https://www.monterosa.co/)",
6
+ "main": "./dist/index.js",
10
7
  "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ }
14
+ },
11
15
  "files": [
12
16
  "dist"
13
17
  ],
@@ -19,22 +23,31 @@
19
23
  "test:ci": "jest --color --ci --reporters=jest-junit --coverage",
20
24
  "api-report": "api-extractor run --local --verbose"
21
25
  },
22
- "keywords": [],
26
+ "keywords": [
27
+ "monterosa",
28
+ "sdk",
29
+ "interaction-cloud",
30
+ "interact",
31
+ "interop"
32
+ ],
23
33
  "license": "MIT",
24
34
  "devDependencies": {
25
35
  "@rollup/plugin-json": "^4.1.0",
26
- "@types/jest": "^27.0.1",
27
- "jest": "^27.1.0",
36
+ "@rollup/plugin-node-resolve": "^13.3.0",
37
+ "@rollup/plugin-terser": "^0.4.4",
38
+ "@types/jest": "29.5.3",
39
+ "jest": "29.6.1",
28
40
  "jest-fetch-mock": "^3.0.3",
29
41
  "jest-junit": "^13.0.0",
30
42
  "rollup": "^2.57.0",
31
- "rollup-plugin-typescript2": "^0.30.0",
32
- "ts-jest": "^27.0.5",
43
+ "rollup-plugin-dts": "^4.0.0",
44
+ "rollup-plugin-typescript2": "^0.36.0",
45
+ "ts-jest": "29.1.1",
33
46
  "tslib": "^2.3.0",
34
- "typescript": "^4.4.2"
47
+ "typescript": "4.9.5"
35
48
  },
36
49
  "publishConfig": {
37
50
  "access": "public"
38
51
  },
39
- "gitHead": "94e238b4c612d70a2ffbc9e1dcec5e55cd029927"
52
+ "gitHead": "0e2d4cd71055bf0ab38ec5a73d6040c55151da1c"
40
53
  }
package/dist/index.cjs.js DELETED
@@ -1,108 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- /*! *****************************************************************************
6
- Copyright (c) Microsoft Corporation.
7
-
8
- Permission to use, copy, modify, and/or distribute this software for any
9
- purpose with or without fee is hereby granted.
10
-
11
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17
- PERFORMANCE OF THIS SOFTWARE.
18
- ***************************************************************************** */
19
-
20
- function __awaiter(thisArg, _arguments, P, generator) {
21
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
22
- return new (P || (P = Promise))(function (resolve, reject) {
23
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
24
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
25
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
26
- step((generator = generator.apply(thisArg, _arguments || [])).next());
27
- });
28
- }
29
-
30
- function __generator(thisArg, body) {
31
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
32
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
33
- function verb(n) { return function (v) { return step([n, v]); }; }
34
- function step(op) {
35
- if (f) throw new TypeError("Generator is already executing.");
36
- while (_) try {
37
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
38
- if (y = 0, t) op = [op[0] & 2, t.value];
39
- switch (op[0]) {
40
- case 0: case 1: t = op; break;
41
- case 4: _.label++; return { value: op[1], done: false };
42
- case 5: _.label++; y = op[1]; op = [0]; continue;
43
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
44
- default:
45
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
46
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
47
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
48
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
49
- if (t[2]) _.ops.pop();
50
- _.trys.pop(); continue;
51
- }
52
- op = body.call(thisArg, _);
53
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
54
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
55
- }
56
- }
57
-
58
- /**
59
- * @license
60
- * api.ts
61
- * interact-interop
62
- *
63
- * Copyright © 2025 Monterosa Productions Limited. All rights reserved.
64
- *
65
- * More details on the license can be found at https://www.monterosa.co/sdk/license
66
- */
67
- /**
68
- * @internal
69
- */
70
- function fetchListings(host, projectId) {
71
- return __awaiter(this, void 0, void 0, function () {
72
- var response, data;
73
- return __generator(this, function (_a) {
74
- switch (_a.label) {
75
- case 0: return [4 /*yield*/, fetch("https://" + host + "/projects/" + projectId.substring(0, 2) + "/" + projectId + "/listings.json")];
76
- case 1:
77
- response = _a.sent();
78
- return [4 /*yield*/, response.json()];
79
- case 2:
80
- data = (_a.sent());
81
- return [2 /*return*/, data];
82
- }
83
- });
84
- });
85
- }
86
- /*
87
- * @internal
88
- */
89
- function fetchSettings(host, id) {
90
- return __awaiter(this, void 0, void 0, function () {
91
- var response, data;
92
- return __generator(this, function (_a) {
93
- switch (_a.label) {
94
- case 0: return [4 /*yield*/, fetch("https://" + host + "/projects/" + id.substring(0, 2) + "/" + id + "/settings.json")];
95
- case 1:
96
- response = _a.sent();
97
- return [4 /*yield*/, response.json()];
98
- case 2:
99
- data = (_a.sent());
100
- return [2 /*return*/, data];
101
- }
102
- });
103
- });
104
- }
105
-
106
- exports.fetchListings = fetchListings;
107
- exports.fetchSettings = fetchSettings;
108
- //# sourceMappingURL=index.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/api.ts"],"sourcesContent":["/**\n * @license\n * api.ts\n * interact-interop\n *\n * Copyright © 2025 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Listings, Localised } from './types';\n\n/**\n * @internal\n */\nexport async function fetchListings(\n host: string,\n projectId: string,\n): Promise<Listings> {\n const response = await fetch(\n `https://${host}/projects/${projectId.substring(\n 0,\n 2,\n )}/${projectId}/listings.json`,\n );\n\n const data = (await response.json()) as Listings;\n\n return data;\n}\n\n/*\n * @internal\n */\nexport async function fetchSettings(\n host: string,\n id: string,\n): Promise<Localised<Record<string, unknown>>> {\n const response = await fetch(\n `https://${host}/projects/${id.substring(0, 2)}/${id}/settings.json`,\n );\n\n const data = (await response.json()) as Localised<Record<string, unknown>>;\n\n return data;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;AAQG;AAIH;;AAEG;AACmB,SAAA,aAAa,CACjC,IAAY,EACZ,SAAiB,EAAA;;;;;AAEA,gBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,YAAM,KAAK,CAC1B,UAAA,GAAW,IAAI,GAAA,YAAA,GAAa,SAAS,CAAC,SAAS,CAC7C,CAAC,EACD,CAAC,CACF,SAAI,SAAS,GAAA,gBAAgB,CAC/B,CAAA,CAAA;;AALK,oBAAA,QAAQ,GAAG,EAKhB,CAAA,IAAA,EAAA,CAAA;AAEa,oBAAA,OAAA,CAAA,CAAA,YAAM,QAAQ,CAAC,IAAI,EAAE,CAAA,CAAA;;oBAA7B,IAAI,IAAI,EAAA,CAAA,IAAA,EAAqB,CAAa,CAAA;AAEhD,oBAAA,OAAA,CAAA,CAAA,aAAO,IAAI,CAAC,CAAA;;;;AACb,CAAA;AAED;;AAEG;AACmB,SAAA,aAAa,CACjC,IAAY,EACZ,EAAU,EAAA;;;;;AAEO,gBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,YAAM,KAAK,CAC1B,UAAA,GAAW,IAAI,GAAA,YAAA,GAAa,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,SAAI,EAAE,GAAA,gBAAgB,CACrE,CAAA,CAAA;;AAFK,oBAAA,QAAQ,GAAG,EAEhB,CAAA,IAAA,EAAA,CAAA;AAEa,oBAAA,OAAA,CAAA,CAAA,YAAM,QAAQ,CAAC,IAAI,EAAE,CAAA,CAAA;;oBAA7B,IAAI,IAAI,EAAA,CAAA,IAAA,EAAqB,CAAuC,CAAA;AAE1E,oBAAA,OAAA,CAAA,CAAA,aAAO,IAAI,CAAC,CAAA;;;;AACb;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm2017.js","sources":["../src/api.ts"],"sourcesContent":["/**\n * @license\n * api.ts\n * interact-interop\n *\n * Copyright © 2025 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Listings, Localised } from './types';\n\n/**\n * @internal\n */\nexport async function fetchListings(\n host: string,\n projectId: string,\n): Promise<Listings> {\n const response = await fetch(\n `https://${host}/projects/${projectId.substring(\n 0,\n 2,\n )}/${projectId}/listings.json`,\n );\n\n const data = (await response.json()) as Listings;\n\n return data;\n}\n\n/*\n * @internal\n */\nexport async function fetchSettings(\n host: string,\n id: string,\n): Promise<Localised<Record<string, unknown>>> {\n const response = await fetch(\n `https://${host}/projects/${id.substring(0, 2)}/${id}/settings.json`,\n );\n\n const data = (await response.json()) as Localised<Record<string, unknown>>;\n\n return data;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;AAQG;AAIH;;AAEG;AACI,eAAe,aAAa,CACjC,IAAY,EACZ,SAAiB,EAAA;IAEjB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,CAAW,QAAA,EAAA,IAAI,aAAa,SAAS,CAAC,SAAS,CAC7C,CAAC,EACD,CAAC,CACF,IAAI,SAAS,CAAA,cAAA,CAAgB,CAC/B,CAAC;IAEF,MAAM,IAAI,IAAI,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAa,CAAC;AAEjD,IAAA,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;AAEG;AACI,eAAe,aAAa,CACjC,IAAY,EACZ,EAAU,EAAA;IAEV,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,CAAW,QAAA,EAAA,IAAI,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA,cAAA,CAAgB,CACrE,CAAC;IAEF,MAAM,IAAI,IAAI,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAuC,CAAC;AAE3E,IAAA,OAAO,IAAI,CAAC;AACd;;;;"}
@@ -1,103 +0,0 @@
1
- /*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
-
16
- function __awaiter(thisArg, _arguments, P, generator) {
17
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
- return new (P || (P = Promise))(function (resolve, reject) {
19
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
- step((generator = generator.apply(thisArg, _arguments || [])).next());
23
- });
24
- }
25
-
26
- function __generator(thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- }
53
-
54
- /**
55
- * @license
56
- * api.ts
57
- * interact-interop
58
- *
59
- * Copyright © 2025 Monterosa Productions Limited. All rights reserved.
60
- *
61
- * More details on the license can be found at https://www.monterosa.co/sdk/license
62
- */
63
- /**
64
- * @internal
65
- */
66
- function fetchListings(host, projectId) {
67
- return __awaiter(this, void 0, void 0, function () {
68
- var response, data;
69
- return __generator(this, function (_a) {
70
- switch (_a.label) {
71
- case 0: return [4 /*yield*/, fetch("https://" + host + "/projects/" + projectId.substring(0, 2) + "/" + projectId + "/listings.json")];
72
- case 1:
73
- response = _a.sent();
74
- return [4 /*yield*/, response.json()];
75
- case 2:
76
- data = (_a.sent());
77
- return [2 /*return*/, data];
78
- }
79
- });
80
- });
81
- }
82
- /*
83
- * @internal
84
- */
85
- function fetchSettings(host, id) {
86
- return __awaiter(this, void 0, void 0, function () {
87
- var response, data;
88
- return __generator(this, function (_a) {
89
- switch (_a.label) {
90
- case 0: return [4 /*yield*/, fetch("https://" + host + "/projects/" + id.substring(0, 2) + "/" + id + "/settings.json")];
91
- case 1:
92
- response = _a.sent();
93
- return [4 /*yield*/, response.json()];
94
- case 2:
95
- data = (_a.sent());
96
- return [2 /*return*/, data];
97
- }
98
- });
99
- });
100
- }
101
-
102
- export { fetchListings, fetchSettings };
103
- //# sourceMappingURL=index.esm5.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm5.js","sources":["../src/api.ts"],"sourcesContent":["/**\n * @license\n * api.ts\n * interact-interop\n *\n * Copyright © 2025 Monterosa Productions Limited. All rights reserved.\n *\n * More details on the license can be found at https://www.monterosa.co/sdk/license\n */\n\nimport { Listings, Localised } from './types';\n\n/**\n * @internal\n */\nexport async function fetchListings(\n host: string,\n projectId: string,\n): Promise<Listings> {\n const response = await fetch(\n `https://${host}/projects/${projectId.substring(\n 0,\n 2,\n )}/${projectId}/listings.json`,\n );\n\n const data = (await response.json()) as Listings;\n\n return data;\n}\n\n/*\n * @internal\n */\nexport async function fetchSettings(\n host: string,\n id: string,\n): Promise<Localised<Record<string, unknown>>> {\n const response = await fetch(\n `https://${host}/projects/${id.substring(0, 2)}/${id}/settings.json`,\n );\n\n const data = (await response.json()) as Localised<Record<string, unknown>>;\n\n return data;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;AAQG;AAIH;;AAEG;AACmB,SAAA,aAAa,CACjC,IAAY,EACZ,SAAiB,EAAA;;;;;AAEA,gBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,YAAM,KAAK,CAC1B,UAAA,GAAW,IAAI,GAAA,YAAA,GAAa,SAAS,CAAC,SAAS,CAC7C,CAAC,EACD,CAAC,CACF,SAAI,SAAS,GAAA,gBAAgB,CAC/B,CAAA,CAAA;;AALK,oBAAA,QAAQ,GAAG,EAKhB,CAAA,IAAA,EAAA,CAAA;AAEa,oBAAA,OAAA,CAAA,CAAA,YAAM,QAAQ,CAAC,IAAI,EAAE,CAAA,CAAA;;oBAA7B,IAAI,IAAI,EAAA,CAAA,IAAA,EAAqB,CAAa,CAAA;AAEhD,oBAAA,OAAA,CAAA,CAAA,aAAO,IAAI,CAAC,CAAA;;;;AACb,CAAA;AAED;;AAEG;AACmB,SAAA,aAAa,CACjC,IAAY,EACZ,EAAU,EAAA;;;;;AAEO,gBAAA,KAAA,CAAA,EAAA,OAAA,CAAA,CAAA,YAAM,KAAK,CAC1B,UAAA,GAAW,IAAI,GAAA,YAAA,GAAa,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,SAAI,EAAE,GAAA,gBAAgB,CACrE,CAAA,CAAA;;AAFK,oBAAA,QAAQ,GAAG,EAEhB,CAAA,IAAA,EAAA,CAAA;AAEa,oBAAA,OAAA,CAAA,CAAA,YAAM,QAAQ,CAAC,IAAI,EAAE,CAAA,CAAA;;oBAA7B,IAAI,IAAI,EAAA,CAAA,IAAA,EAAqB,CAAuC,CAAA;AAE1E,oBAAA,OAAA,CAAA,CAAA,aAAO,IAAI,CAAC,CAAA;;;;AACb;;;;"}