@formbricks/js
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -8,2 +8,20 @@ import { z } from 'zod'; | ||
declare interface ApiErrorResponse { | ||
code: | ||
| "not_found" | ||
| "gone" | ||
| "bad_request" | ||
| "internal_server_error" | ||
| "unauthorized" | ||
| "method_not_allowed" | ||
| "not_authenticated" | ||
| "forbidden" | ||
| "network_error"; | ||
message: string; | ||
status: number; | ||
url: URL; | ||
details?: Record<string, string | string[] | number | number[] | boolean | boolean[]>; | ||
responseMessage?: string; | ||
} | ||
declare class AttributeAPI { | ||
@@ -16,3 +34,4 @@ private apiHost; | ||
message: string; | ||
}, NetworkError | Error>>; | ||
details?: Record<string, string>; | ||
}, ApiErrorResponse>>; | ||
} | ||
@@ -23,3 +42,2 @@ | ||
display: DisplayAPI; | ||
people: PeopleAPI; | ||
storage: StorageAPI; | ||
@@ -36,10 +54,13 @@ attribute: AttributeAPI; | ||
id: string; | ||
}, NetworkError | Error>>; | ||
}, ApiErrorResponse>>; | ||
} | ||
declare const formbricks: { | ||
declare const formbricks: TFormbricks; | ||
export default formbricks; | ||
declare const formbricks_2: { | ||
init: (initConfig: TJsConfigInput) => Promise<void>; | ||
setEmail: (email: string) => Promise<void>; | ||
setAttribute: (key: string, value: any) => Promise<void>; | ||
track: (name: string, properties?: TJsTrackProperties) => Promise<void>; | ||
setAttribute: (key: string, value: string) => Promise<void>; | ||
track: (code: string, properties?: TJsTrackProperties) => Promise<void>; | ||
logout: () => Promise<void>; | ||
@@ -56,21 +77,2 @@ reset: () => Promise<void>; | ||
declare const formbricksApp: TFormbricksApp; | ||
export default formbricksApp; | ||
declare interface NetworkError { | ||
code: "network_error"; | ||
message: string; | ||
status: number; | ||
url: URL; | ||
} | ||
declare class PeopleAPI { | ||
private apiHost; | ||
private environmentId; | ||
constructor(apiHost: string, environmentId: string); | ||
create(userId: string): Promise<Result<{ | ||
userId: string; | ||
}, NetworkError | Error>>; | ||
} | ||
declare class ResponseAPI { | ||
@@ -82,4 +84,4 @@ private apiHost; | ||
id: string; | ||
}, NetworkError | Error>>; | ||
update({ responseId, finished, data, ttc, variables, language, }: TResponseUpdateInputWithResponseId): Promise<Result<object, NetworkError | Error>>; | ||
}, ApiErrorResponse>>; | ||
update({ responseId, finished, endingId, data, ttc, variables, language, }: TResponseUpdateInputWithResponseId): Promise<Result<object, ApiErrorResponse>>; | ||
} | ||
@@ -104,3 +106,3 @@ | ||
declare type TFormbricksApp = typeof formbricks; | ||
declare type TFormbricks = typeof formbricks_2; | ||
@@ -155,2 +157,3 @@ declare type TJsConfigInput = z.infer<typeof ZJsConfigInput>; | ||
finished: z.boolean(), | ||
endingId: z.string().nullish(), | ||
language: z.string().optional(), | ||
@@ -179,2 +182,3 @@ data: ZResponseData, | ||
finished: z.boolean(), | ||
endingId: z.string().nullish(), | ||
data: ZResponseData, | ||
@@ -196,5 +200,4 @@ variables: ZResponseVariables.optional(), | ||
interface Window { | ||
formbricks: TFormbricksApp | undefined; | ||
formbricks: TFormbricks | undefined; | ||
} | ||
} | ||
@@ -77,6 +77,6 @@ let isInitializing = false; | ||
}; | ||
const formbricksApp = new Proxy({}, formbricksProxyHandler); | ||
const formbricks = new Proxy({}, formbricksProxyHandler); | ||
export { | ||
formbricksApp as default | ||
formbricks as default | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@formbricks/js", | ||
"license": "MIT", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Formbricks-js allows you to connect your index to Formbricks, display surveys and trigger events.", | ||
@@ -22,5 +22,5 @@ "homepage": "https://formbricks.com", | ||
"exports": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts" | ||
"require": "./dist/index.cjs" | ||
}, | ||
@@ -36,9 +36,9 @@ "typesVersions": { | ||
"devDependencies": { | ||
"terser": "5.31.6", | ||
"vite": "5.4.8", | ||
"vite-plugin-dts": "3.9.1", | ||
"terser": "5.37.0", | ||
"vite": "6.0.3", | ||
"vite-plugin-dts": "4.3.0", | ||
"@formbricks/types": "0.0.0", | ||
"@formbricks/js-core": "1.0.0", | ||
"@formbricks/config-typescript": "1.0.0", | ||
"@formbricks/eslint-config": "0.0.0", | ||
"@formbricks/js-core": "1.0.0" | ||
"@formbricks/eslint-config": "0.0.0" | ||
}, | ||
@@ -45,0 +45,0 @@ "peerDependencies": { |
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
Unstable ownership
Supply chain riskA new collaborator has begun publishing package versions. Package stability and security risk may be elevated.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
25636
250
1
1