@wix/blog_categories
Advanced tools
Comparing version 1.0.34 to 1.0.35
@@ -5,111 +5,13 @@ "use strict"; | ||
const blog_v3_category_categories_public_1 = require("./blog-v3-category-categories.public"); | ||
const context_1 = require("@wix/sdk-runtime/context"); | ||
const blog_v3_category_categories_public_2 = require("./blog-v3-category-categories.public"); | ||
const blog_v3_category_categories_public_3 = require("./blog-v3-category-categories.public"); | ||
const blog_v3_category_categories_public_4 = require("./blog-v3-category-categories.public"); | ||
const getCategory = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context | ||
.initWixModules(blog_v3_category_categories_public_1.getCategory, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
exports.getCategory = getCategory; | ||
const getCategoryBySlug = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context | ||
.initWixModules(blog_v3_category_categories_public_1.getCategoryBySlug, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
exports.getCategoryBySlug = getCategoryBySlug; | ||
const listCategories = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context | ||
.initWixModules(blog_v3_category_categories_public_1.listCategories, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
exports.listCategories = listCategories; | ||
const queryCategories = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context | ||
.initWixModules(blog_v3_category_categories_public_1.queryCategories, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
exports.queryCategories = queryCategories; | ||
const onCategoryCreated = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context.initWixModules(blog_v3_category_categories_public_2.onCategoryCreated).apply(undefined, args); | ||
}; | ||
exports.onCategoryCreated = onCategoryCreated; | ||
const onCategoryUpdated = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context.initWixModules(blog_v3_category_categories_public_3.onCategoryUpdated).apply(undefined, args); | ||
}; | ||
exports.onCategoryUpdated = onCategoryUpdated; | ||
const onCategoryDeleted = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context.initWixModules(blog_v3_category_categories_public_4.onCategoryDeleted).apply(undefined, args); | ||
}; | ||
exports.onCategoryDeleted = onCategoryDeleted; | ||
exports.getCategory = (0, context_1.contextualizeRESTModule)(blog_v3_category_categories_public_1.getCategory, 1); | ||
exports.getCategoryBySlug = (0, context_1.contextualizeRESTModule)(blog_v3_category_categories_public_1.getCategoryBySlug, 1); | ||
exports.listCategories = (0, context_1.contextualizeRESTModule)(blog_v3_category_categories_public_1.listCategories, 1); | ||
exports.queryCategories = (0, context_1.contextualizeRESTModule)(blog_v3_category_categories_public_1.queryCategories, 1); | ||
exports.onCategoryCreated = (0, context_1.contextualizeEventDefinitionModule)(blog_v3_category_categories_public_2.onCategoryCreated); | ||
exports.onCategoryUpdated = (0, context_1.contextualizeEventDefinitionModule)(blog_v3_category_categories_public_3.onCategoryUpdated); | ||
exports.onCategoryDeleted = (0, context_1.contextualizeEventDefinitionModule)(blog_v3_category_categories_public_4.onCategoryDeleted); | ||
//# sourceMappingURL=blog-v3-category-categories.context.js.map |
import { getCategory as publicGetCategory, getCategoryBySlug as publicGetCategoryBySlug, listCategories as publicListCategories, queryCategories as publicQueryCategories, } from './blog-v3-category-categories.public'; | ||
import { contextualizeRESTModule, contextualizeEventDefinitionModule, } from '@wix/sdk-runtime/context'; | ||
import { onCategoryCreated as publicOnCategoryCreated } from './blog-v3-category-categories.public'; | ||
import { onCategoryUpdated as publicOnCategoryUpdated } from './blog-v3-category-categories.public'; | ||
import { onCategoryDeleted as publicOnCategoryDeleted } from './blog-v3-category-categories.public'; | ||
export const getCategory = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context | ||
.initWixModules(publicGetCategory, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const getCategoryBySlug = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context | ||
.initWixModules(publicGetCategoryBySlug, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const listCategories = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context | ||
.initWixModules(publicListCategories, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const queryCategories = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context | ||
.initWixModules(publicQueryCategories, args[1]?.supressAuth ? true : false) | ||
.apply(undefined, args); | ||
}; | ||
export const onCategoryCreated = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context.initWixModules(publicOnCategoryCreated).apply(undefined, args); | ||
}; | ||
export const onCategoryUpdated = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context.initWixModules(publicOnCategoryUpdated).apply(undefined, args); | ||
}; | ||
export const onCategoryDeleted = (...args) => { | ||
const context = | ||
// @ts-expect-error | ||
typeof $wixContext !== 'undefined' | ||
? // @ts-expect-error | ||
$wixContext | ||
: // @ts-expect-error | ||
globalThis.__wix_context__; | ||
if (!context) { | ||
throw new Error('Wix context is not available. Make sure to initialize the Wix context before using SDK modules'); | ||
} | ||
return context.initWixModules(publicOnCategoryDeleted).apply(undefined, args); | ||
}; | ||
export const getCategory = contextualizeRESTModule(publicGetCategory, 1); | ||
export const getCategoryBySlug = contextualizeRESTModule(publicGetCategoryBySlug, 1); | ||
export const listCategories = contextualizeRESTModule(publicListCategories, 1); | ||
export const queryCategories = contextualizeRESTModule(publicQueryCategories, 1); | ||
export const onCategoryCreated = contextualizeEventDefinitionModule(publicOnCategoryCreated); | ||
export const onCategoryUpdated = contextualizeEventDefinitionModule(publicOnCategoryUpdated); | ||
export const onCategoryDeleted = contextualizeEventDefinitionModule(publicOnCategoryDeleted); | ||
//# sourceMappingURL=blog-v3-category-categories.context.js.map |
{ | ||
"name": "@wix/blog_categories", | ||
"version": "1.0.34", | ||
"version": "1.0.35", | ||
"publishConfig": { | ||
@@ -23,7 +23,6 @@ "registry": "https://registry.npmjs.org/", | ||
"@wix/motion-edm-autogen-query-wrapper": "^1.0.37", | ||
"@wix/sdk-runtime": "^0.2.12", | ||
"@wix/sdk-types": "^1.7.1" | ||
"@wix/sdk-runtime": "^0.3.2", | ||
"@wix/sdk-types": "^1.9.0" | ||
}, | ||
"devDependencies": { | ||
"@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz", | ||
"glob": "^10.4.1", | ||
@@ -49,3 +48,3 @@ "rollup": "^4.18.0", | ||
}, | ||
"falconPackageHash": "5a72e3dd925d88a42c9b9c4e93d0d2ae1691d9acc0622104f494ee91" | ||
"falconPackageHash": "ac26521559330cab2b95930838a33b297f6917727bb96872b6cfebd0" | ||
} |
@@ -579,2 +579,3 @@ interface Category { | ||
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>; | ||
fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>; | ||
} | ||
@@ -605,9 +606,16 @@ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>; | ||
isDomainEvent?: boolean; | ||
transformations?: unknown; | ||
transformations?: (envelope: unknown) => Payload; | ||
__payload: Payload; | ||
}; | ||
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>; | ||
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>; | ||
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>; | ||
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void; | ||
declare global { | ||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged. | ||
interface SymbolConstructor { | ||
readonly observable: symbol; | ||
} | ||
} | ||
declare function getCategory$1(httpClient: HttpClient): (categoryId: string, options?: GetCategoryOptions) => Promise<GetCategoryResponse & GetCategoryResponseNonNullableFields>; | ||
@@ -614,0 +622,0 @@ declare function getCategoryBySlug$1(httpClient: HttpClient): (slug: string, options?: GetCategoryBySlugOptions) => Promise<GetCategoryBySlugResponse & GetCategoryBySlugResponseNonNullableFields>; |
@@ -1062,2 +1062,3 @@ interface Category { | ||
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>; | ||
fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>; | ||
} | ||
@@ -1087,7 +1088,14 @@ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>; | ||
isDomainEvent?: boolean; | ||
transformations?: unknown; | ||
transformations?: (envelope: unknown) => Payload; | ||
__payload: Payload; | ||
}; | ||
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>; | ||
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>; | ||
declare global { | ||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged. | ||
interface SymbolConstructor { | ||
readonly observable: symbol; | ||
} | ||
} | ||
declare const __metadata: { | ||
@@ -1094,0 +1102,0 @@ PACKAGE_NAME: string; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4
442008
10702
+ Added@wix/sdk-context@0.0.1(transitive)
+ Added@wix/sdk-runtime@0.3.19(transitive)
- Removed@wix/sdk-runtime@0.2.12(transitive)
Updated@wix/sdk-runtime@^0.3.2
Updated@wix/sdk-types@^1.9.0