@relyio/sdk 0.2.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 (45) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +201 -0
  3. package/README.md +314 -0
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/chunk-2QUK2ZGD.js +738 -0
  6. package/dist/chunk-7W4MJXQ4.cjs +4429 -0
  7. package/dist/chunk-FJK7ZWKK.cjs +776 -0
  8. package/dist/chunk-HT6NFRM2.cjs +196 -0
  9. package/dist/chunk-I3ESNANB.js +177 -0
  10. package/dist/chunk-IY5LSKXU.js +3 -0
  11. package/dist/chunk-MWMSFIWN.cjs +17 -0
  12. package/dist/chunk-PPA2WWOH.cjs +4 -0
  13. package/dist/chunk-RJBIJ2ZK.js +4375 -0
  14. package/dist/chunk-XQ4QHWZE.js +13 -0
  15. package/dist/client/index.cjs +17 -0
  16. package/dist/client/index.d.cts +3 -0
  17. package/dist/client/index.d.ts +3 -0
  18. package/dist/client/index.js +4 -0
  19. package/dist/define-schema-DHvUCKwj.d.cts +2101 -0
  20. package/dist/define-schema-DHvUCKwj.d.ts +2101 -0
  21. package/dist/index-B-KiFHbx.d.ts +2708 -0
  22. package/dist/index-BsUqCAu8.d.cts +7855 -0
  23. package/dist/index-BsUqCAu8.d.ts +7855 -0
  24. package/dist/index-DGWaawHt.d.cts +2708 -0
  25. package/dist/index.cjs +499 -0
  26. package/dist/index.d.cts +523 -0
  27. package/dist/index.d.ts +523 -0
  28. package/dist/index.js +148 -0
  29. package/dist/react/index.cjs +4 -0
  30. package/dist/react/index.d.cts +2 -0
  31. package/dist/react/index.d.ts +2 -0
  32. package/dist/react/index.js +3 -0
  33. package/dist/schema/index.cjs +157 -0
  34. package/dist/schema/index.d.cts +223 -0
  35. package/dist/schema/index.d.ts +223 -0
  36. package/dist/schema/index.js +4 -0
  37. package/dist/types/index.cjs +6 -0
  38. package/dist/types/index.d.cts +1 -0
  39. package/dist/types/index.d.ts +1 -0
  40. package/dist/types/index.js +3 -0
  41. package/dist/utils/index.cjs +81 -0
  42. package/dist/utils/index.d.cts +87 -0
  43. package/dist/utils/index.d.ts +87 -0
  44. package/dist/utils/index.js +4 -0
  45. package/package.json +159 -0
@@ -0,0 +1,81 @@
1
+ 'use strict';
2
+
3
+ var chunkHT6NFRM2_cjs = require('../chunk-HT6NFRM2.cjs');
4
+ require('../chunk-MWMSFIWN.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "camelToSnake", {
9
+ enumerable: true,
10
+ get: function () { return chunkHT6NFRM2_cjs.camelToSnake; }
11
+ });
12
+ Object.defineProperty(exports, "createDeferred", {
13
+ enumerable: true,
14
+ get: function () { return chunkHT6NFRM2_cjs.createDeferred; }
15
+ });
16
+ Object.defineProperty(exports, "debounce", {
17
+ enumerable: true,
18
+ get: function () { return chunkHT6NFRM2_cjs.debounce; }
19
+ });
20
+ Object.defineProperty(exports, "deepClone", {
21
+ enumerable: true,
22
+ get: function () { return chunkHT6NFRM2_cjs.deepClone; }
23
+ });
24
+ Object.defineProperty(exports, "generateId", {
25
+ enumerable: true,
26
+ get: function () { return chunkHT6NFRM2_cjs.generateId; }
27
+ });
28
+ Object.defineProperty(exports, "isBrowser", {
29
+ enumerable: true,
30
+ get: function () { return chunkHT6NFRM2_cjs.isBrowser; }
31
+ });
32
+ Object.defineProperty(exports, "isNode", {
33
+ enumerable: true,
34
+ get: function () { return chunkHT6NFRM2_cjs.isNode; }
35
+ });
36
+ Object.defineProperty(exports, "isPlainObject", {
37
+ enumerable: true,
38
+ get: function () { return chunkHT6NFRM2_cjs.isPlainObject; }
39
+ });
40
+ Object.defineProperty(exports, "isValidEmail", {
41
+ enumerable: true,
42
+ get: function () { return chunkHT6NFRM2_cjs.isValidEmail; }
43
+ });
44
+ Object.defineProperty(exports, "isValidUrl", {
45
+ enumerable: true,
46
+ get: function () { return chunkHT6NFRM2_cjs.isValidUrl; }
47
+ });
48
+ Object.defineProperty(exports, "mergeDeep", {
49
+ enumerable: true,
50
+ get: function () { return chunkHT6NFRM2_cjs.mergeDeep; }
51
+ });
52
+ Object.defineProperty(exports, "omit", {
53
+ enumerable: true,
54
+ get: function () { return chunkHT6NFRM2_cjs.omit; }
55
+ });
56
+ Object.defineProperty(exports, "pick", {
57
+ enumerable: true,
58
+ get: function () { return chunkHT6NFRM2_cjs.pick; }
59
+ });
60
+ Object.defineProperty(exports, "retry", {
61
+ enumerable: true,
62
+ get: function () { return chunkHT6NFRM2_cjs.retry; }
63
+ });
64
+ Object.defineProperty(exports, "sleep", {
65
+ enumerable: true,
66
+ get: function () { return chunkHT6NFRM2_cjs.sleep; }
67
+ });
68
+ Object.defineProperty(exports, "snakeToCamel", {
69
+ enumerable: true,
70
+ get: function () { return chunkHT6NFRM2_cjs.snakeToCamel; }
71
+ });
72
+ Object.defineProperty(exports, "throttle", {
73
+ enumerable: true,
74
+ get: function () { return chunkHT6NFRM2_cjs.throttle; }
75
+ });
76
+ Object.defineProperty(exports, "toSafeString", {
77
+ enumerable: true,
78
+ get: function () { return chunkHT6NFRM2_cjs.toSafeString; }
79
+ });
80
+ //# sourceMappingURL=index.cjs.map
81
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Utility functions for the RelyIO SDK
3
+ */
4
+ /**
5
+ * Check if code is running in a browser environment
6
+ */
7
+ declare function isBrowser(): boolean;
8
+ /**
9
+ * Check if code is running in a Node.js environment
10
+ */
11
+ declare function isNode(): boolean;
12
+ /**
13
+ * Deep clone an object
14
+ */
15
+ declare function deepClone<T>(obj: T): T;
16
+ /**
17
+ * Debounce function calls
18
+ */
19
+ declare function debounce<T extends (..._args: unknown[]) => unknown>(func: T, wait: number): (...args: Parameters<T>) => void;
20
+ /**
21
+ * Throttle function calls
22
+ */
23
+ declare function throttle<T extends (..._args: unknown[]) => unknown>(func: T, limit: number): (...args: Parameters<T>) => void;
24
+ /**
25
+ * Create a promise that can be resolved/rejected externally
26
+ */
27
+ declare function createDeferred<T = unknown>(): {
28
+ promise: Promise<T>;
29
+ resolve: (value: T | PromiseLike<T>) => void;
30
+ reject: (reason?: unknown) => void;
31
+ };
32
+ /**
33
+ * Wait for a specified amount of time
34
+ */
35
+ declare function sleep(ms: number): Promise<void>;
36
+ /**
37
+ * Retry a function with exponential backoff
38
+ */
39
+ declare function retry<T>(fn: () => Promise<T>, options?: {
40
+ maxAttempts?: number;
41
+ baseDelay?: number;
42
+ maxDelay?: number;
43
+ backoffFactor?: number;
44
+ jitter?: boolean;
45
+ }): Promise<T>;
46
+ /**
47
+ * Convert a value to a safe string for logging
48
+ */
49
+ declare function toSafeString(value: unknown): string;
50
+ /**
51
+ * Generate a unique ID
52
+ */
53
+ declare function generateId(): string;
54
+ /**
55
+ * Check if a value is a plain object
56
+ */
57
+ declare function isPlainObject(value: unknown): value is Record<string, unknown>;
58
+ /**
59
+ * Merge objects deeply
60
+ */
61
+ declare function mergeDeep<T extends Record<string, unknown>>(target: T, ...sources: Partial<T>[]): T;
62
+ /**
63
+ * Pick specific keys from an object
64
+ */
65
+ declare function pick<T extends Record<string, unknown>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
66
+ /**
67
+ * Omit specific keys from an object
68
+ */
69
+ declare function omit<T extends Record<string, unknown>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
70
+ /**
71
+ * Convert camelCase to snake_case
72
+ */
73
+ declare function camelToSnake(str: string): string;
74
+ /**
75
+ * Convert snake_case to camelCase
76
+ */
77
+ declare function snakeToCamel(str: string): string;
78
+ /**
79
+ * Validate email format
80
+ */
81
+ declare function isValidEmail(email: string): boolean;
82
+ /**
83
+ * Validate URL format
84
+ */
85
+ declare function isValidUrl(url: string): boolean;
86
+
87
+ export { camelToSnake, createDeferred, debounce, deepClone, generateId, isBrowser, isNode, isPlainObject, isValidEmail, isValidUrl, mergeDeep, omit, pick, retry, sleep, snakeToCamel, throttle, toSafeString };
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Utility functions for the RelyIO SDK
3
+ */
4
+ /**
5
+ * Check if code is running in a browser environment
6
+ */
7
+ declare function isBrowser(): boolean;
8
+ /**
9
+ * Check if code is running in a Node.js environment
10
+ */
11
+ declare function isNode(): boolean;
12
+ /**
13
+ * Deep clone an object
14
+ */
15
+ declare function deepClone<T>(obj: T): T;
16
+ /**
17
+ * Debounce function calls
18
+ */
19
+ declare function debounce<T extends (..._args: unknown[]) => unknown>(func: T, wait: number): (...args: Parameters<T>) => void;
20
+ /**
21
+ * Throttle function calls
22
+ */
23
+ declare function throttle<T extends (..._args: unknown[]) => unknown>(func: T, limit: number): (...args: Parameters<T>) => void;
24
+ /**
25
+ * Create a promise that can be resolved/rejected externally
26
+ */
27
+ declare function createDeferred<T = unknown>(): {
28
+ promise: Promise<T>;
29
+ resolve: (value: T | PromiseLike<T>) => void;
30
+ reject: (reason?: unknown) => void;
31
+ };
32
+ /**
33
+ * Wait for a specified amount of time
34
+ */
35
+ declare function sleep(ms: number): Promise<void>;
36
+ /**
37
+ * Retry a function with exponential backoff
38
+ */
39
+ declare function retry<T>(fn: () => Promise<T>, options?: {
40
+ maxAttempts?: number;
41
+ baseDelay?: number;
42
+ maxDelay?: number;
43
+ backoffFactor?: number;
44
+ jitter?: boolean;
45
+ }): Promise<T>;
46
+ /**
47
+ * Convert a value to a safe string for logging
48
+ */
49
+ declare function toSafeString(value: unknown): string;
50
+ /**
51
+ * Generate a unique ID
52
+ */
53
+ declare function generateId(): string;
54
+ /**
55
+ * Check if a value is a plain object
56
+ */
57
+ declare function isPlainObject(value: unknown): value is Record<string, unknown>;
58
+ /**
59
+ * Merge objects deeply
60
+ */
61
+ declare function mergeDeep<T extends Record<string, unknown>>(target: T, ...sources: Partial<T>[]): T;
62
+ /**
63
+ * Pick specific keys from an object
64
+ */
65
+ declare function pick<T extends Record<string, unknown>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
66
+ /**
67
+ * Omit specific keys from an object
68
+ */
69
+ declare function omit<T extends Record<string, unknown>, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
70
+ /**
71
+ * Convert camelCase to snake_case
72
+ */
73
+ declare function camelToSnake(str: string): string;
74
+ /**
75
+ * Convert snake_case to camelCase
76
+ */
77
+ declare function snakeToCamel(str: string): string;
78
+ /**
79
+ * Validate email format
80
+ */
81
+ declare function isValidEmail(email: string): boolean;
82
+ /**
83
+ * Validate URL format
84
+ */
85
+ declare function isValidUrl(url: string): boolean;
86
+
87
+ export { camelToSnake, createDeferred, debounce, deepClone, generateId, isBrowser, isNode, isPlainObject, isValidEmail, isValidUrl, mergeDeep, omit, pick, retry, sleep, snakeToCamel, throttle, toSafeString };
@@ -0,0 +1,4 @@
1
+ export { camelToSnake, createDeferred, debounce, deepClone, generateId, isBrowser, isNode, isPlainObject, isValidEmail, isValidUrl, mergeDeep, omit, pick, retry, sleep, snakeToCamel, throttle, toSafeString } from '../chunk-I3ESNANB.js';
2
+ import '../chunk-XQ4QHWZE.js';
3
+ //# sourceMappingURL=index.js.map
4
+ //# sourceMappingURL=index.js.map
package/package.json ADDED
@@ -0,0 +1,159 @@
1
+ {
2
+ "name": "@relyio/sdk",
3
+ "version": "0.2.0",
4
+ "description": "The official TypeScript SDK for RelyIO - a type-safe, performant, and developer-friendly client library",
5
+ "keywords": [
6
+ "relyio",
7
+ "cms",
8
+ "headless",
9
+ "typescript",
10
+ "sdk",
11
+ "content-management",
12
+ "api-client",
13
+ "real-time",
14
+ "offline-first"
15
+ ],
16
+ "author": "RelyIO Team <team@relyio.com>",
17
+ "license": "Apache-2.0",
18
+ "homepage": "https://relyio.com",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/relyio/relyio.git",
22
+ "directory": "packages/customer/sdk"
23
+ },
24
+ "bugs": {
25
+ "email": "team@relyio.com"
26
+ },
27
+ "type": "module",
28
+ "main": "./dist/index.js",
29
+ "module": "./dist/index.js",
30
+ "types": "./dist/index.d.ts",
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.ts",
34
+ "import": "./dist/index.js",
35
+ "require": "./dist/index.cjs"
36
+ },
37
+ "./schema": {
38
+ "types": "./dist/schema/index.d.ts",
39
+ "import": "./dist/schema/index.js",
40
+ "require": "./dist/schema/index.cjs"
41
+ },
42
+ "./react": {
43
+ "types": "./dist/react/index.d.ts",
44
+ "import": "./dist/react/index.js",
45
+ "require": "./dist/react/index.cjs"
46
+ },
47
+ "./types": {
48
+ "types": "./dist/types/index.d.ts",
49
+ "import": "./dist/types/index.js",
50
+ "require": "./dist/types/index.cjs"
51
+ },
52
+ "./client": {
53
+ "types": "./dist/client/index.d.ts",
54
+ "import": "./dist/client/index.js",
55
+ "require": "./dist/client/index.cjs"
56
+ },
57
+ "./utils": {
58
+ "types": "./dist/utils/index.d.ts",
59
+ "import": "./dist/utils/index.js",
60
+ "require": "./dist/utils/index.cjs"
61
+ }
62
+ },
63
+ "files": [
64
+ "dist",
65
+ "!dist/**/*.map",
66
+ "README.md",
67
+ "CHANGELOG.md"
68
+ ],
69
+ "sideEffects": false,
70
+ "engines": {
71
+ "node": ">=18.0.0"
72
+ },
73
+ "dependencies": {
74
+ "mitt": "^3.0.1"
75
+ },
76
+ "devDependencies": {
77
+ "@changesets/cli": "2.29.4",
78
+ "@eslint/js": "9.39.5",
79
+ "@types/node": "24.13.3",
80
+ "@types/react": "19.2.18",
81
+ "@typescript-eslint/eslint-plugin": "^8.18.1",
82
+ "@typescript-eslint/parser": "^8.18.1",
83
+ "@vitest/coverage-v8": "4.1.11",
84
+ "@vitest/ui": "4.1.11",
85
+ "bundlesize2": "^0.0.31",
86
+ "eslint": "9.39.5",
87
+ "eslint-config-prettier": "10.1.8",
88
+ "eslint-plugin-import": "2.32.0",
89
+ "openapi-typescript": "7.13.0",
90
+ "prettier": "3.5.3",
91
+ "rimraf": "6.1.3",
92
+ "tsup": "8.5.1",
93
+ "typedoc": "^0.27.5",
94
+ "typescript": "5.9.3",
95
+ "vitest": "4.1.11",
96
+ "@relyio/eslint-config": "0.0.0",
97
+ "@relyio/api-contract": "0.1.0"
98
+ },
99
+ "peerDependencies": {
100
+ "typescript": ">=4.9.0",
101
+ "react": ">=18.0.0"
102
+ },
103
+ "peerDependenciesMeta": {
104
+ "typescript": {
105
+ "optional": true
106
+ },
107
+ "react": {
108
+ "optional": true
109
+ }
110
+ },
111
+ "bundlesize": [
112
+ {
113
+ "path": "./dist/index.js",
114
+ "maxSize": "15kb",
115
+ "compression": "gzip"
116
+ },
117
+ {
118
+ "path": "./dist/client.js",
119
+ "maxSize": "10kb",
120
+ "compression": "gzip"
121
+ },
122
+ {
123
+ "path": "./dist/types.js",
124
+ "maxSize": "5kb",
125
+ "compression": "gzip"
126
+ },
127
+ {
128
+ "path": "./dist/utils.js",
129
+ "maxSize": "8kb",
130
+ "compression": "gzip"
131
+ }
132
+ ],
133
+ "publishConfig": {
134
+ "access": "public",
135
+ "registry": "https://registry.npmjs.org/"
136
+ },
137
+ "scripts": {
138
+ "build": "tsup",
139
+ "build:watch": "tsup --watch",
140
+ "build:analyze": "tsup --metafile",
141
+ "dev": "tsup --watch --onSuccess \"echo 'SDK build complete'\"",
142
+ "clean": "rimraf dist",
143
+ "test": "vitest run",
144
+ "test:watch": "vitest --watch",
145
+ "test:coverage": "vitest --coverage",
146
+ "test:ui": "vitest --ui",
147
+ "type:check": "tsc --noEmit",
148
+ "codegen:openapi": "node ../../../scripts/emit-openapi-types.mjs ../../../apps/services/api/openapi-spec.json src/http/api-schema.ts",
149
+ "lint:write": "eslint . --fix",
150
+ "lint:check": "eslint .",
151
+ "format:write": "prettier --write \"src/**/*.{ts,tsx,json,md}\"",
152
+ "docs": "typedoc",
153
+ "docs:watch": "typedoc --watch",
154
+ "benchmark": "vitest bench",
155
+ "size": "bundlesize",
156
+ "release": "changeset publish",
157
+ "version": "changeset version"
158
+ }
159
+ }