hivesigner 4.0.0 → 4.1.0

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.
Files changed (52) hide show
  1. package/README.md +16 -2
  2. package/lib/client.d.ts +19 -2
  3. package/lib/hivesigner.min.js +1 -1
  4. package/lib/index.d.ts +4 -0
  5. package/lib/index.js +67 -9
  6. package/lib/pkce.d.ts +16 -0
  7. package/lib/types/index.d.ts +1 -0
  8. package/lib/types/login-options.interface.d.ts +2 -0
  9. package/lib/types/token-response.interface.d.ts +8 -0
  10. package/package.json +4 -1
  11. package/.claude/settings.local.json +0 -12
  12. package/.eslintignore +0 -3
  13. package/.eslintrc.js +0 -16
  14. package/CLAUDE.md +0 -142
  15. package/docs/CNAME +0 -1
  16. package/docs/index.html +0 -221
  17. package/jest.config.js +0 -10
  18. package/rollup.config.js +0 -13
  19. package/src/client.spec.ts +0 -453
  20. package/src/client.ts +0 -318
  21. package/src/consts/api-url.const.ts +0 -1
  22. package/src/consts/base-url.const.ts +0 -1
  23. package/src/consts/beta-url.const.ts +0 -1
  24. package/src/consts/index.ts +0 -3
  25. package/src/default-import.spec.ts +0 -10
  26. package/src/factories/index.ts +0 -1
  27. package/src/factories/initialize.factory.spec.ts +0 -9
  28. package/src/factories/initialize.factory.ts +0 -7
  29. package/src/index.ts +0 -16
  30. package/src/methods/index.ts +0 -4
  31. package/src/methods/send-operation.method.spec.ts +0 -47
  32. package/src/methods/send-operation.method.ts +0 -14
  33. package/src/methods/send-operations.method.spec.ts +0 -47
  34. package/src/methods/send-operations.method.ts +0 -14
  35. package/src/methods/send-transaction.method.spec.ts +0 -47
  36. package/src/methods/send-transaction.method.ts +0 -14
  37. package/src/methods/sign.method.spec.ts +0 -60
  38. package/src/methods/sign.method.ts +0 -22
  39. package/src/modules-import.spec.ts +0 -11
  40. package/src/require-import.spec.js +0 -16
  41. package/src/require-import.spec.ts +0 -10
  42. package/src/types/callback-function.type.ts +0 -1
  43. package/src/types/client-config.interface.ts +0 -8
  44. package/src/types/hive.types.ts +0 -12
  45. package/src/types/index.ts +0 -6
  46. package/src/types/login-options.interface.ts +0 -3
  47. package/src/types/send-response.type.ts +0 -1
  48. package/src/types/sign-errors.interface.ts +0 -4
  49. package/src/utilities/index.ts +0 -1
  50. package/src/utilities/is-browser.util.ts +0 -3
  51. package/tsconfig.json +0 -17
  52. package/webpack.config.js +0 -33
@@ -1,16 +0,0 @@
1
- const hs = require('../lib/index');
2
-
3
- global.fetch = jest.fn().mockResolvedValue({
4
- status: 200,
5
- json: async () => ({ error: '' })
6
- });
7
-
8
- describe('Require import testing', function () {
9
- it('should be instance of Client and call me', function () {
10
- const client = new hs.Client({ accessToken: 'some_wrong_access_token' });
11
- expect(client).toBeInstanceOf(hs.Client);
12
-
13
- const me = client.me();
14
- expect(me).toBeInstanceOf(Promise);
15
- });
16
- });
@@ -1,10 +0,0 @@
1
- const hivesigner = require('../lib/index')
2
-
3
- describe('Testing default import', function () {
4
- it('should contain Client class', function () {
5
- expect(hivesigner.Client).toBeTruthy()
6
-
7
- const client = new hivesigner.Client({})
8
- expect(client).toBeInstanceOf(hivesigner.Client)
9
- })
10
- })
@@ -1 +0,0 @@
1
- export type CallbackFunction = (error: any, response: any) => any
@@ -1,8 +0,0 @@
1
- export interface ClientConfig {
2
- apiURL?: string
3
- app?: string
4
- callbackURL?: string
5
- scope?: string[]
6
- responseType?: string
7
- accessToken?: string
8
- }
@@ -1,12 +0,0 @@
1
- export interface Operation {
2
- 0: string
3
- 1: { [key: string]: any }
4
- }
5
-
6
- export interface Transaction {
7
- ref_block_num: number
8
- ref_block_prefix: number
9
- expiration: string
10
- operations: Operation[]
11
- extensions: any[]
12
- }
@@ -1,6 +0,0 @@
1
- export * from './client-config.interface'
2
- export * from './sign-errors.interface'
3
- export * from './callback-function.type'
4
- export * from './login-options.interface'
5
- export * from './send-response.type'
6
- export * from './hive.types'
@@ -1,3 +0,0 @@
1
- export interface LoginOptions {
2
- state: string
3
- }
@@ -1 +0,0 @@
1
- export type SendResponse = any
@@ -1,4 +0,0 @@
1
- export interface SignErrors {
2
- error: string
3
- error_description: string
4
- }
@@ -1 +0,0 @@
1
- export * from './is-browser.util'
@@ -1,3 +0,0 @@
1
- export function isBrowser(): boolean {
2
- return typeof window !== 'undefined' && !!window
3
- }
package/tsconfig.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "outDir": "./lib/",
4
- "moduleResolution": "node",
5
- "noImplicitAny": true,
6
- "allowSyntheticDefaultImports": true,
7
- "sourceMap": true,
8
- "module": "commonjs",
9
- "target": "ES2017",
10
- "lib": ["ES2017", "DOM"],
11
- "allowJs": false,
12
- "skipLibCheck": true,
13
- "declaration": true,
14
- "rootDir": "src"
15
- },
16
- "exclude": ["./**/*.spec.ts", "jest.config.js", "rollup.config.js"]
17
- }
package/webpack.config.js DELETED
@@ -1,33 +0,0 @@
1
- const path = require('path');
2
- const pkg = require('./package.json');
3
- const libraryName = pkg.name;
4
-
5
- module.exports = {
6
- entry: [
7
- path.resolve(__dirname, './src/index.ts')
8
- ],
9
- output: {
10
- path: path.resolve(__dirname, './lib'),
11
- filename: `${libraryName}.min.js`,
12
- library: libraryName,
13
- },
14
- module: {
15
- rules: [
16
- {
17
- test: /\.ts$/,
18
- loader: 'ts-loader',
19
- exclude: /node_modules/,
20
- options: {
21
- compilerOptions: {
22
- declaration: false,
23
- sourceMap: false,
24
- }
25
- },
26
- },
27
- ]
28
- },
29
- resolve: {
30
- extensions: ['.ts', '.js'],
31
- },
32
- mode: 'production'
33
- }