@magentrix-corp/magentrix-sdk 1.0.3 → 1.0.4
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.
- package/README.md +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npm install @magentrix-corp/magentrix-sdk
|
|
|
24
24
|
### JavaScript/TypeScript
|
|
25
25
|
|
|
26
26
|
```typescript
|
|
27
|
-
import { MagentrixClient } from 'magentrix-sdk'
|
|
27
|
+
import { MagentrixClient } from '@magentrix-corp/magentrix-sdk'
|
|
28
28
|
|
|
29
29
|
const client = new MagentrixClient({
|
|
30
30
|
baseUrl: 'https://your-instance.magentrix.com',
|
|
@@ -56,7 +56,7 @@ console.log(record)
|
|
|
56
56
|
```vue
|
|
57
57
|
<script setup>
|
|
58
58
|
import { ref, onMounted } from 'vue'
|
|
59
|
-
import { useMagentrixSdk } from 'magentrix-sdk/vue'
|
|
59
|
+
import { useMagentrixSdk } from '@magentrix-corp/magentrix-sdk/vue'
|
|
60
60
|
|
|
61
61
|
const client = useMagentrixSdk({
|
|
62
62
|
baseUrl: 'https://your-instance.magentrix.com',
|
|
@@ -313,7 +313,7 @@ await client.deleteMany('Contact', ['id-1', 'id-2', 'id-3'])
|
|
|
313
313
|
Execute a custom API endpoint.
|
|
314
314
|
|
|
315
315
|
```typescript
|
|
316
|
-
import { RequestMethod } from 'magentrix-sdk'
|
|
316
|
+
import { RequestMethod } from '@magentrix-corp/magentrix-sdk'
|
|
317
317
|
|
|
318
318
|
// GET request
|
|
319
319
|
const data = await client.execute('/custom/endpoint', null, RequestMethod.get)
|
|
@@ -345,7 +345,7 @@ The SDK provides two custom error classes:
|
|
|
345
345
|
General SDK errors (authentication, validation, API errors).
|
|
346
346
|
|
|
347
347
|
```typescript
|
|
348
|
-
import { MagentrixError } from 'magentrix-sdk'
|
|
348
|
+
import { MagentrixError } from '@magentrix-corp/magentrix-sdk'
|
|
349
349
|
|
|
350
350
|
try {
|
|
351
351
|
await client.createSession()
|
|
@@ -361,7 +361,7 @@ try {
|
|
|
361
361
|
Database-specific errors with detailed error information.
|
|
362
362
|
|
|
363
363
|
```typescript
|
|
364
|
-
import { DatabaseError } from 'magentrix-sdk'
|
|
364
|
+
import { DatabaseError } from '@magentrix-corp/magentrix-sdk'
|
|
365
365
|
|
|
366
366
|
try {
|
|
367
367
|
await client.create('Account', invalidData)
|
|
@@ -429,7 +429,7 @@ import {
|
|
|
429
429
|
DatabaseError,
|
|
430
430
|
RequestMethod,
|
|
431
431
|
ContentType
|
|
432
|
-
} from 'magentrix-sdk'
|
|
432
|
+
} from '@magentrix-corp/magentrix-sdk'
|
|
433
433
|
|
|
434
434
|
const config: MagentrixConfig = {
|
|
435
435
|
baseUrl: 'https://your-instance.magentrix.com',
|
|
@@ -493,7 +493,7 @@ The SDK provides a dedicated Vue 3 composable:
|
|
|
493
493
|
```vue
|
|
494
494
|
<script setup>
|
|
495
495
|
import { ref, onMounted } from 'vue'
|
|
496
|
-
import { useMagentrixSdk } from 'magentrix-sdk/vue'
|
|
496
|
+
import { useMagentrixSdk } from '@magentrix-corp/magentrix-sdk/vue'
|
|
497
497
|
|
|
498
498
|
const client = useMagentrixSdk({
|
|
499
499
|
baseUrl: 'https://your-instance.magentrix.com',
|
|
@@ -543,7 +543,7 @@ onMounted(() => {
|
|
|
543
543
|
```vue
|
|
544
544
|
<script setup>
|
|
545
545
|
import { ref } from 'vue'
|
|
546
|
-
import { useMagentrixSdk } from 'magentrix-sdk/vue'
|
|
546
|
+
import { useMagentrixSdk } from '@magentrix-corp/magentrix-sdk/vue'
|
|
547
547
|
|
|
548
548
|
const client = useMagentrixSdk({
|
|
549
549
|
baseUrl: 'https://your-instance.magentrix.com',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magentrix-corp/magentrix-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "TypeScript SDK for Magentrix APIs with dual authentication modes, automatic session management, CRUD operations, and Vue 3 integration",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|