@coveo/atomic-hosted-page
Advanced tools
Comparing version 0.2.3 to 0.3.0
@@ -1,2 +0,2 @@ | ||
import{p as i,b as t}from"./p-d60c5453.js";const o=()=>{const t=import.meta.url;const o={};if(t!==""){o.resourcesUrl=new URL(".",t).href}return i(o)};o().then((i=>t([["p-07fbb443",[[0,"atomic-hosted-page",{initialize:[64]}]]],["p-786c2c25",[[0,"atomic-simple-builder",{initialize:[64]}]]]],i))); | ||
import{p as i,b as t}from"./p-d60c5453.js";const n=()=>{const t=import.meta.url;const n={};if(t!==""){n.resourcesUrl=new URL(".",t).href}return i(n)};n().then((i=>t([["p-f3be730a",[[0,"atomic-hosted-page",{initialize:[64],getOrganizationEndpoints:[64]}]]],["p-5ed67567",[[0,"atomic-simple-builder",{initialize:[64],getOrganizationEndpoints:[64]}]]]],i))); | ||
//# sourceMappingURL=atomic-hosted-page.esm.js.map |
@@ -6,3 +6,3 @@ 'use strict'; | ||
const index = require('./index-4798ddc4.js'); | ||
const hostedPages = require('./hosted-pages-728de99f.js'); | ||
const hostedPages = require('./hosted-pages-319cf6fc.js'); | ||
@@ -14,17 +14,9 @@ const AtomicHostedPage = class { | ||
validateOptions(opts) { | ||
try { | ||
new hostedPages.Schema({ | ||
organizationId: new hostedPages.StringValue({ required: true, emptyAllowed: false }), | ||
pageId: new hostedPages.StringValue({ required: true, emptyAllowed: false }), | ||
accessToken: new hostedPages.StringValue({ required: true, emptyAllowed: false }), | ||
platformUrl: new hostedPages.StringValue({ required: false, emptyAllowed: false }), | ||
}).validate(opts); | ||
} | ||
catch (e) { | ||
console.error(e); | ||
} | ||
hostedPages.validateOptions(opts, { | ||
pageId: new hostedPages.StringValue({ required: true, emptyAllowed: false }), | ||
}); | ||
} | ||
async initialize(options) { | ||
this.validateOptions(options); | ||
const platformUrl = options.platformUrl || 'https://platform.cloud.coveo.com'; | ||
const platformUrl = hostedPages.extractPlatformUrl(options); | ||
try { | ||
@@ -42,2 +34,10 @@ const pageResponse = await fetch(`${platformUrl}/rest/organizations/${options.organizationId}/hostedpages/${options.pageId}`, { | ||
} | ||
/** | ||
* Returns the unique, organization-specific endpoint(s) | ||
* @param {string} organizationId | ||
* @param {'prod'|'hipaa'|'staging'|'dev'} [env=Prod] | ||
*/ | ||
async getOrganizationEndpoints(organizationId, env = 'prod') { | ||
return hostedPages.on(organizationId, env); | ||
} | ||
get element() { return index.getElement(this); } | ||
@@ -44,0 +44,0 @@ }; |
@@ -18,5 +18,5 @@ 'use strict'; | ||
patchBrowser().then(options => { | ||
return index.bootstrapLazy([["atomic-hosted-page.cjs",[[0,"atomic-hosted-page",{"initialize":[64]}]]],["atomic-simple-builder.cjs",[[0,"atomic-simple-builder",{"initialize":[64]}]]]], options); | ||
return index.bootstrapLazy([["atomic-hosted-page.cjs",[[0,"atomic-hosted-page",{"initialize":[64],"getOrganizationEndpoints":[64]}]]],["atomic-simple-builder.cjs",[[0,"atomic-simple-builder",{"initialize":[64],"getOrganizationEndpoints":[64]}]]]], options); | ||
}); | ||
//# sourceMappingURL=atomic-hosted-page.cjs.js.map |
@@ -6,3 +6,3 @@ 'use strict'; | ||
const index = require('./index-4798ddc4.js'); | ||
const hostedPages = require('./hosted-pages-728de99f.js'); | ||
const hostedPages = require('./hosted-pages-319cf6fc.js'); | ||
@@ -14,17 +14,9 @@ const AtomicSimpleBuilder = class { | ||
validateOptions(opts) { | ||
try { | ||
new hostedPages.Schema({ | ||
organizationId: new hostedPages.StringValue({ required: true, emptyAllowed: false }), | ||
interfaceId: new hostedPages.StringValue({ required: true, emptyAllowed: false }), | ||
accessToken: new hostedPages.StringValue({ required: true, emptyAllowed: false }), | ||
platformUrl: new hostedPages.StringValue({ required: false, emptyAllowed: false }), | ||
}).validate(opts); | ||
} | ||
catch (e) { | ||
console.error(e); | ||
} | ||
hostedPages.validateOptions(opts, { | ||
interfaceId: new hostedPages.StringValue({ required: true, emptyAllowed: false }), | ||
}); | ||
} | ||
async initialize(options) { | ||
this.validateOptions(options); | ||
const platformUrl = options.platformUrl || 'https://platform.cloud.coveo.com'; | ||
const platformUrl = hostedPages.extractPlatformUrl(options); | ||
try { | ||
@@ -42,2 +34,10 @@ const pageResponse = await fetch(`${platformUrl}/rest/organizations/${options.organizationId}/searchinterfaces/${options.interfaceId}/hostedpage/v1`, { | ||
} | ||
/** | ||
* Returns the unique, organization-specific endpoint(s) | ||
* @param {string} organizationId | ||
* @param {'prod'|'hipaa'|'staging'|'dev'} [env=Prod] | ||
*/ | ||
async getOrganizationEndpoints(organizationId, env = 'prod') { | ||
return hostedPages.on(organizationId, env); | ||
} | ||
get element() { return index.getElement(this); } | ||
@@ -44,0 +44,0 @@ }; |
@@ -17,3 +17,3 @@ 'use strict'; | ||
return patchEsm().then(() => { | ||
return index.bootstrapLazy([["atomic-hosted-page.cjs",[[0,"atomic-hosted-page",{"initialize":[64]}]]],["atomic-simple-builder.cjs",[[0,"atomic-simple-builder",{"initialize":[64]}]]]], options); | ||
return index.bootstrapLazy([["atomic-hosted-page.cjs",[[0,"atomic-hosted-page",{"initialize":[64],"getOrganizationEndpoints":[64]}]]],["atomic-simple-builder.cjs",[[0,"atomic-simple-builder",{"initialize":[64],"getOrganizationEndpoints":[64]}]]]], options); | ||
}); | ||
@@ -20,0 +20,0 @@ }; |
import { r as registerInstance, g as getElement } from './index-7c6277cb.js'; | ||
import { S as Schema, a as StringValue, p as processHostedPage } from './hosted-pages-51734977.js'; | ||
import { v as validateOptions, p as processHostedPage, o as on, S as StringValue, e as extractPlatformUrl } from './hosted-pages-16a03b46.js'; | ||
@@ -9,17 +9,9 @@ const AtomicHostedPage = class { | ||
validateOptions(opts) { | ||
try { | ||
new Schema({ | ||
organizationId: new StringValue({ required: true, emptyAllowed: false }), | ||
pageId: new StringValue({ required: true, emptyAllowed: false }), | ||
accessToken: new StringValue({ required: true, emptyAllowed: false }), | ||
platformUrl: new StringValue({ required: false, emptyAllowed: false }), | ||
}).validate(opts); | ||
} | ||
catch (e) { | ||
console.error(e); | ||
} | ||
validateOptions(opts, { | ||
pageId: new StringValue({ required: true, emptyAllowed: false }), | ||
}); | ||
} | ||
async initialize(options) { | ||
this.validateOptions(options); | ||
const platformUrl = options.platformUrl || 'https://platform.cloud.coveo.com'; | ||
const platformUrl = extractPlatformUrl(options); | ||
try { | ||
@@ -37,2 +29,10 @@ const pageResponse = await fetch(`${platformUrl}/rest/organizations/${options.organizationId}/hostedpages/${options.pageId}`, { | ||
} | ||
/** | ||
* Returns the unique, organization-specific endpoint(s) | ||
* @param {string} organizationId | ||
* @param {'prod'|'hipaa'|'staging'|'dev'} [env=Prod] | ||
*/ | ||
async getOrganizationEndpoints(organizationId, env = 'prod') { | ||
return on(organizationId, env); | ||
} | ||
get element() { return getElement(this); } | ||
@@ -39,0 +39,0 @@ }; |
@@ -16,5 +16,5 @@ import { p as promiseResolve, b as bootstrapLazy } from './index-7c6277cb.js'; | ||
patchBrowser().then(options => { | ||
return bootstrapLazy([["atomic-hosted-page",[[0,"atomic-hosted-page",{"initialize":[64]}]]],["atomic-simple-builder",[[0,"atomic-simple-builder",{"initialize":[64]}]]]], options); | ||
return bootstrapLazy([["atomic-hosted-page",[[0,"atomic-hosted-page",{"initialize":[64],"getOrganizationEndpoints":[64]}]]],["atomic-simple-builder",[[0,"atomic-simple-builder",{"initialize":[64],"getOrganizationEndpoints":[64]}]]]], options); | ||
}); | ||
//# sourceMappingURL=atomic-hosted-page.js.map |
import { r as registerInstance, g as getElement } from './index-7c6277cb.js'; | ||
import { S as Schema, a as StringValue, p as processHostedPage } from './hosted-pages-51734977.js'; | ||
import { v as validateOptions, p as processHostedPage, o as on, S as StringValue, e as extractPlatformUrl } from './hosted-pages-16a03b46.js'; | ||
@@ -9,17 +9,9 @@ const AtomicSimpleBuilder = class { | ||
validateOptions(opts) { | ||
try { | ||
new Schema({ | ||
organizationId: new StringValue({ required: true, emptyAllowed: false }), | ||
interfaceId: new StringValue({ required: true, emptyAllowed: false }), | ||
accessToken: new StringValue({ required: true, emptyAllowed: false }), | ||
platformUrl: new StringValue({ required: false, emptyAllowed: false }), | ||
}).validate(opts); | ||
} | ||
catch (e) { | ||
console.error(e); | ||
} | ||
validateOptions(opts, { | ||
interfaceId: new StringValue({ required: true, emptyAllowed: false }), | ||
}); | ||
} | ||
async initialize(options) { | ||
this.validateOptions(options); | ||
const platformUrl = options.platformUrl || 'https://platform.cloud.coveo.com'; | ||
const platformUrl = extractPlatformUrl(options); | ||
try { | ||
@@ -37,2 +29,10 @@ const pageResponse = await fetch(`${platformUrl}/rest/organizations/${options.organizationId}/searchinterfaces/${options.interfaceId}/hostedpage/v1`, { | ||
} | ||
/** | ||
* Returns the unique, organization-specific endpoint(s) | ||
* @param {string} organizationId | ||
* @param {'prod'|'hipaa'|'staging'|'dev'} [env=Prod] | ||
*/ | ||
async getOrganizationEndpoints(organizationId, env = 'prod') { | ||
return on(organizationId, env); | ||
} | ||
get element() { return getElement(this); } | ||
@@ -39,0 +39,0 @@ }; |
@@ -13,3 +13,3 @@ import { p as promiseResolve, b as bootstrapLazy } from './index-7c6277cb.js'; | ||
return patchEsm().then(() => { | ||
return bootstrapLazy([["atomic-hosted-page",[[0,"atomic-hosted-page",{"initialize":[64]}]]],["atomic-simple-builder",[[0,"atomic-simple-builder",{"initialize":[64]}]]]], options); | ||
return bootstrapLazy([["atomic-hosted-page",[[0,"atomic-hosted-page",{"initialize":[64],"getOrganizationEndpoints":[64]}]]],["atomic-simple-builder",[[0,"atomic-simple-builder",{"initialize":[64],"getOrganizationEndpoints":[64]}]]]], options); | ||
}); | ||
@@ -16,0 +16,0 @@ }; |
@@ -0,3 +1,5 @@ | ||
import { PlatformEnvironment } from '@coveo/headless'; | ||
import { ComponentInterface } from '../../stencil-public-runtime'; | ||
interface AtomicHostedPageInitializationOptions { | ||
import { InitializationOptions } from '../utils/options-utils'; | ||
interface AtomicHostedPageInitializationOptions extends InitializationOptions { | ||
/** | ||
@@ -7,16 +9,2 @@ * The unique identifier of the hosted page. | ||
pageId: string; | ||
/** | ||
* The unique identifier of the target Coveo Cloud organization (e.g., `mycoveocloudorganizationg8tp8wu3`) | ||
*/ | ||
organizationId: string; | ||
/** | ||
* The access token to use to authenticate requests against the Coveo Cloud endpoints. Typically, this will be an API key or search token that grants the privileges to execute queries and push usage analytics data in the target Coveo Cloud organization. | ||
*/ | ||
accessToken: string; | ||
/** | ||
* The Plaform URL to use. (e.g., https://platform.cloud.coveo.com) | ||
* The platformUrl() helper method can be useful to know what url is available. | ||
* @defaultValue `https://platform.cloud.coveo.com` | ||
*/ | ||
platformUrl?: string; | ||
} | ||
@@ -32,3 +20,14 @@ /** | ||
initialize(options: AtomicHostedPageInitializationOptions): Promise<void>; | ||
/** | ||
* Returns the unique, organization-specific endpoint(s) | ||
* @param {string} organizationId | ||
* @param {'prod'|'hipaa'|'staging'|'dev'} [env=Prod] | ||
*/ | ||
getOrganizationEndpoints(organizationId: string, env?: PlatformEnvironment): Promise<{ | ||
platform: string; | ||
analytics: string; | ||
search: string; | ||
admin: string; | ||
}>; | ||
} | ||
export {}; |
@@ -0,3 +1,5 @@ | ||
import { PlatformEnvironment } from '@coveo/headless'; | ||
import { ComponentInterface } from '../../stencil-public-runtime'; | ||
interface AtomicSimpleBuilderInitializationOptions { | ||
import { InitializationOptions } from '../utils/options-utils'; | ||
interface AtomicSimpleBuilderInitializationOptions extends InitializationOptions { | ||
/** | ||
@@ -7,16 +9,2 @@ * The unique identifier of the search interface. | ||
interfaceId: string; | ||
/** | ||
* The unique identifier of the target Coveo Cloud organization (e.g., `mycoveocloudorganizationg8tp8wu3`) | ||
*/ | ||
organizationId: string; | ||
/** | ||
* The access token to use to authenticate requests against the Coveo Cloud endpoints. Typically, this will be an API key or search token that grants the privileges to execute queries and push usage analytics data in the target Coveo Cloud organization. | ||
*/ | ||
accessToken: string; | ||
/** | ||
* The Plaform URL to use. (e.g., https://platform.cloud.coveo.com) | ||
* The platformUrl() helper method can be useful to know what url is available. | ||
* @defaultValue `https://platform.cloud.coveo.com` | ||
*/ | ||
platformUrl?: string; | ||
} | ||
@@ -32,3 +20,14 @@ /** | ||
initialize(options: AtomicSimpleBuilderInitializationOptions): Promise<void>; | ||
/** | ||
* Returns the unique, organization-specific endpoint(s) | ||
* @param {string} organizationId | ||
* @param {'prod'|'hipaa'|'staging'|'dev'} [env=Prod] | ||
*/ | ||
getOrganizationEndpoints(organizationId: string, env?: PlatformEnvironment): Promise<{ | ||
platform: string; | ||
analytics: string; | ||
search: string; | ||
admin: string; | ||
}>; | ||
} | ||
export {}; |
@@ -8,7 +8,20 @@ /* eslint-disable */ | ||
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime"; | ||
import { PlatformEnvironment } from "@coveo/headless"; | ||
export namespace Components { | ||
interface AtomicHostedPage { | ||
/** | ||
* Returns the unique, organization-specific endpoint(s) | ||
* @param organizationId | ||
* @param env | ||
*/ | ||
"getOrganizationEndpoints": (organizationId: string, env?: PlatformEnvironment) => Promise<{ platform: string; analytics: string; search: string; admin: string; }>; | ||
"initialize": (options: AtomicHostedPageInitializationOptions) => Promise<void>; | ||
} | ||
interface AtomicSimpleBuilder { | ||
/** | ||
* Returns the unique, organization-specific endpoint(s) | ||
* @param organizationId | ||
* @param env | ||
*/ | ||
"getOrganizationEndpoints": (organizationId: string, env?: PlatformEnvironment) => Promise<{ platform: string; analytics: string; search: string; admin: string; }>; | ||
"initialize": (options: AtomicSimpleBuilderInitializationOptions) => Promise<void>; | ||
@@ -15,0 +28,0 @@ } |
{ | ||
"name": "@coveo/atomic-hosted-page", | ||
"description": "Web Component used to inject a Coveo Hosted Search Page in the DOM.", | ||
"version": "0.2.3", | ||
"version": "0.3.0", | ||
"repository": { | ||
@@ -36,2 +36,3 @@ "type": "git", | ||
"@coveo/bueno": "0.43.1", | ||
"@coveo/headless": "2.14.0", | ||
"@stencil/core": "2.17.3" | ||
@@ -38,0 +39,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3791256
63
6791
3
17
+ Added@coveo/headless@2.14.0
+ Added@babel/runtime@7.26.0(transitive)
+ Added@coveo/headless@2.14.0(transitive)
+ Added@hapi/bourne@2.1.0(transitive)
+ Added@reduxjs/toolkit@1.8.5(transitive)
+ Added@types/node@22.10.0(transitive)
+ Added@types/pino@6.3.12(transitive)
+ Added@types/pino-pretty@5.0.0(transitive)
+ Added@types/pino-std-serializers@4.0.0(transitive)
+ Added@types/redux-mock-store@1.0.3(transitive)
+ Added@zxing/text-encoding@0.9.0(transitive)
+ Addedabab@2.0.6(transitive)
+ Addedansi-styles@3.2.1(transitive)
+ Addedargs@5.0.3(transitive)
+ Addedatomic-sleep@1.0.0(transitive)
+ Addedavailable-typed-arrays@1.0.7(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcamelcase@5.0.0(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcolorette@1.4.0(transitive)
+ Addedcoveo.analytics@2.23.8(transitive)
+ Addedcross-fetch@3.1.5(transitive)
+ Addeddateformat@4.6.3(transitive)
+ Addeddayjs@1.11.5(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addedencoding@0.1.13(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedexponential-backoff@3.1.0(transitive)
+ Addedfast-equals@2.0.4(transitive)
+ Addedfast-redact@3.5.0(transitive)
+ Addedfast-safe-stringify@2.1.1(transitive)
+ Addedflatstr@1.0.12(transitive)
+ Addedfor-each@0.3.3(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addedimmer@9.0.21(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-arguments@1.1.1(transitive)
+ Addedis-callable@1.2.7(transitive)
+ Addedis-generator-function@1.0.10(transitive)
+ Addedis-typed-array@1.1.13(transitive)
+ Addedjmespath@0.15.0(transitive)
+ Addedjoycon@3.1.1(transitive)
+ Addedleven@2.1.0(transitive)
+ Addedlodash.isplainobject@4.0.6(transitive)
+ Addedmri@1.1.4(transitive)
+ Addednode-abort-controller@1.2.1(transitive)
+ Addednode-fetch@2.6.7(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpino@6.14.0(transitive)
+ Addedpino-pretty@6.0.0(transitive)
+ Addedpino-std-serializers@3.2.07.0.0(transitive)
+ Addedpossible-typed-array-names@1.0.0(transitive)
+ Addedprocess-warning@1.0.0(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedquick-format-unescaped@4.0.4(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedredux@4.2.0(transitive)
+ Addedredux-mock-store@1.5.4(transitive)
+ Addedredux-thunk@2.4.1(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedreselect@4.1.8(transitive)
+ Addedrfdc@1.4.1(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedsonic-boom@1.4.12.8.0(transitive)
+ Addedsplit2@3.2.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-json-comments@3.1.1(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedts-debounce@3.0.0(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addedutil@0.12.5(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedweb-encoding@1.1.5(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwhich-typed-array@1.1.15(transitive)
+ Addedwrappy@1.0.2(transitive)