@insignia-education/api-sdk-js 0.9.23 → 0.9.25
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/.env +1 -0
- package/.env.test +5 -0
- package/.github/workflows/npm-publish-github-packages.yml +0 -0
- package/.nvmrc +1 -0
- package/AGENTS.md +54 -0
- package/LICENSE +0 -0
- package/README.md +0 -14
- package/babel.config.cjs +0 -0
- package/coverage/clover.xml +860 -0
- package/coverage/coverage-final.json +33 -0
- package/coverage/lcov-report/Accounts.js.html +151 -0
- package/coverage/lcov-report/Auth.js.html +130 -0
- package/coverage/lcov-report/Categories.js.html +121 -0
- package/coverage/lcov-report/Changelogs.js.html +118 -0
- package/coverage/lcov-report/Client.js.html +349 -0
- package/coverage/lcov-report/Configs.js.html +121 -0
- package/coverage/lcov-report/ContactForms.js.html +121 -0
- package/coverage/lcov-report/ConversationalTopics.js.html +121 -0
- package/coverage/lcov-report/Countries.js.html +112 -0
- package/coverage/lcov-report/Coupons.js.html +121 -0
- package/coverage/lcov-report/Courses.js.html +328 -0
- package/coverage/lcov-report/Currencies.js.html +115 -0
- package/coverage/lcov-report/Files.js.html +115 -0
- package/coverage/lcov-report/Forums.js.html +157 -0
- package/coverage/lcov-report/Hashes.js.html +118 -0
- package/coverage/lcov-report/Insignias.js.html +121 -0
- package/coverage/lcov-report/Languages.js.html +121 -0
- package/coverage/lcov-report/MailBlacklist.js.html +118 -0
- package/coverage/lcov-report/Organizations.js.html +118 -0
- package/coverage/lcov-report/Quizzes.js.html +181 -0
- package/coverage/lcov-report/ShortLinks.js.html +121 -0
- package/coverage/lcov-report/Surveys.js.html +181 -0
- package/coverage/lcov-report/Tags.js.html +121 -0
- package/coverage/lcov-report/Taxes.js.html +121 -0
- package/coverage/lcov-report/Teacher.js.html +196 -0
- package/coverage/lcov-report/Translations.js.html +121 -0
- package/coverage/lcov-report/UserTypes.js.html +121 -0
- package/coverage/lcov-report/Users.js.html +331 -0
- package/coverage/lcov-report/Zoom.js.html +154 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +161 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/src/Client.js.html +349 -0
- package/coverage/lcov-report/src/api/index.html +116 -0
- package/coverage/lcov-report/src/api/index.js.html +127 -0
- package/coverage/lcov-report/src/api/v1/Accounts.js.html +151 -0
- package/coverage/lcov-report/src/api/v1/Auth.js.html +130 -0
- package/coverage/lcov-report/src/api/v1/Categories.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/Changelogs.js.html +118 -0
- package/coverage/lcov-report/src/api/v1/Configs.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/ContactForms.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/ConversationalTopics.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/Countries.js.html +112 -0
- package/coverage/lcov-report/src/api/v1/Coupons.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/Courses.js.html +355 -0
- package/coverage/lcov-report/src/api/v1/Currencies.js.html +115 -0
- package/coverage/lcov-report/src/api/v1/Files.js.html +115 -0
- package/coverage/lcov-report/src/api/v1/Forums.js.html +157 -0
- package/coverage/lcov-report/src/api/v1/Hashes.js.html +118 -0
- package/coverage/lcov-report/src/api/v1/Insignias.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/Languages.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/MailBlacklist.js.html +118 -0
- package/coverage/lcov-report/src/api/v1/Organizations.js.html +118 -0
- package/coverage/lcov-report/src/api/v1/PaymentMethods.js.html +112 -0
- package/coverage/lcov-report/src/api/v1/Quizzes.js.html +181 -0
- package/coverage/lcov-report/src/api/v1/ShortLinks.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/Surveys.js.html +181 -0
- package/coverage/lcov-report/src/api/v1/Tags.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/Taxes.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/Teacher.js.html +196 -0
- package/coverage/lcov-report/src/api/v1/Translations.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/UserTypes.js.html +121 -0
- package/coverage/lcov-report/src/api/v1/Users.js.html +334 -0
- package/coverage/lcov-report/src/api/v1/Zoom.js.html +124 -0
- package/coverage/lcov-report/src/api/v1/index.html +521 -0
- package/coverage/lcov-report/src/api/v1/index.js.html +295 -0
- package/coverage/lcov-report/src/index.html +131 -0
- package/coverage/lcov-report/src/index.js.html +109 -0
- package/coverage/lcov-report/tests/helpers.js.html +130 -0
- package/coverage/lcov-report/tests/index.html +116 -0
- package/coverage/lcov-report/tests/integration/cookieJar.js.html +229 -0
- package/coverage/lcov-report/tests/integration/index.html +116 -0
- package/coverage/lcov.info +1606 -0
- package/coverage/test-report.html +980 -0
- package/eslint.config.mjs +10 -0
- package/index.js +0 -0
- package/jest.config.mjs +10 -0
- package/package.json +2 -2
- package/scss/Services/_notification.scss +0 -0
- package/scss/index.scss +0 -0
- package/src/Client.js +61 -2
- package/src/api/index.js +0 -0
- package/src/api/v1/Accounts.js +0 -0
- package/src/api/v1/Auth.js +0 -0
- package/src/api/v1/Categories.js +0 -0
- package/src/api/v1/Changelogs.js +0 -0
- package/src/api/v1/Configs.js +0 -0
- package/src/api/v1/ContactForms.js +0 -0
- package/src/api/v1/ConversationalTopics.js +0 -0
- package/src/api/v1/Countries.js +0 -0
- package/src/api/v1/Coupons.js +0 -0
- package/src/api/v1/Courses.js +3 -1
- package/src/api/v1/Currencies.js +0 -0
- package/src/api/v1/Files.js +0 -0
- package/src/api/v1/Forums.js +0 -0
- package/src/api/v1/Hashes.js +0 -0
- package/src/api/v1/Insignias.js +0 -0
- package/src/api/v1/Languages.js +0 -0
- package/src/api/v1/MailBlacklist.js +0 -0
- package/src/api/v1/Organizations.js +0 -0
- package/src/api/v1/PaymentMethods.js +0 -0
- package/src/api/v1/Quizzes.js +0 -0
- package/src/api/v1/ShortLinks.js +0 -0
- package/src/api/v1/Surveys.js +0 -0
- package/src/api/v1/Taxes.js +0 -0
- package/src/api/v1/Teacher.js +0 -0
- package/src/api/v1/UserTypes.js +0 -0
- package/src/api/v1/Users.js +0 -0
- package/src/api/v1/Zoom.js +0 -10
- package/src/api/v1/index.js +1 -4
- package/src/index.js +0 -0
- package/tests/client.test.js +64 -1
- package/tests/helpers.js +16 -0
- package/tests/integration/api/v1/accounts.test.js +37 -0
- package/tests/integration/api/v1/auth/login.test.js +60 -0
- package/tests/integration/api/v1/categories.test.js +19 -0
- package/tests/integration/api/v1/changelogs.test.js +21 -0
- package/tests/integration/api/v1/configs.test.js +20 -0
- package/tests/integration/api/v1/contact-forms.test.js +24 -0
- package/tests/integration/api/v1/conversational-topics.test.js +19 -0
- package/tests/integration/api/v1/countries.test.js +20 -0
- package/tests/integration/api/v1/coupons.test.js +26 -0
- package/tests/integration/api/v1/courses/by-cod.test.js +19 -0
- package/tests/integration/api/v1/courses/index.test.js +46 -0
- package/tests/integration/api/v1/currencies/index.test.js +24 -0
- package/tests/integration/api/v1/currencies/values.test.js +24 -0
- package/tests/integration/api/v1/files.test.js +25 -0
- package/tests/integration/api/v1/forums/index.test.js +23 -0
- package/tests/integration/api/v1/hashes.test.js +26 -0
- package/tests/integration/api/v1/insignias.test.js +19 -0
- package/tests/integration/api/v1/languages.test.js +28 -0
- package/tests/integration/api/v1/mail-blacklist.test.js +26 -0
- package/tests/integration/api/v1/organizations.test.js +25 -0
- package/tests/integration/api/v1/payment-methods/by-currencies.test.js +51 -0
- package/tests/integration/api/v1/quizzes/index.test.js +39 -0
- package/tests/integration/api/v1/short-links.test.js +27 -0
- package/tests/integration/api/v1/surveys/index.test.js +40 -0
- package/tests/integration/api/v1/taxes.test.js +20 -0
- package/tests/integration/api/v1/teacher/index.test.js +53 -0
- package/tests/integration/api/v1/user-types.test.js +19 -0
- package/tests/integration/api/v1/users/cash-receivers.test.js +19 -0
- package/tests/integration/api/v1/users/index.test.js +35 -0
- package/tests/integration/api/v1/zoom.test.js +24 -0
- package/tests/integration/loadEnv.js +0 -0
- package/src/api/v1/Tags.js +0 -12
- package/src/api/v1/Translations.js +0 -12
- package/tests/api/v1.test.js +0 -483
- package/tests/integration/api.v1.test.js +0 -138
- package/tests/integration/auth.test.js +0 -40
- package/tests/integration/cookieJar.js +0 -48
package/.env
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
INSIGNIA_EDUCATION_API_BASE_URL=http://localhost:8000
|
package/.env.test
ADDED
|
File without changes
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
24
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Insignia Education — API SDK (JavaScript)
|
|
2
|
+
|
|
3
|
+
## Requirements
|
|
4
|
+
- Node 24 LTS (`nvm use 24`)
|
|
5
|
+
|
|
6
|
+
## Quick start
|
|
7
|
+
```bash
|
|
8
|
+
nvm use 24
|
|
9
|
+
npm install
|
|
10
|
+
npm test # runs Jest test suite
|
|
11
|
+
npm run lint # ESLint
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## What this is
|
|
15
|
+
A zero-dependency JavaScript SDK that wraps the Insignia Education API (`/api/v1`).
|
|
16
|
+
Consumed by `insignia-education/front` via `@insignia-education/api-sdk-js`.
|
|
17
|
+
|
|
18
|
+
## Structure
|
|
19
|
+
```
|
|
20
|
+
src/
|
|
21
|
+
├── index.js ← main export
|
|
22
|
+
├── api/v1/
|
|
23
|
+
│ ├── index.js ← InsigniaApiV1 class (root client)
|
|
24
|
+
│ ├── Auth.js ← /auth endpoints
|
|
25
|
+
│ ├── Courses.js ← /courses endpoints
|
|
26
|
+
│ ├── Users.js ← /users endpoints
|
|
27
|
+
│ └── ... ← one file per API resource
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage pattern
|
|
31
|
+
```js
|
|
32
|
+
import InsigniaApiV1 from '@insignia-education/api-sdk-js/api/v1';
|
|
33
|
+
const api = new InsigniaApiV1('http://localhost:8000');
|
|
34
|
+
|
|
35
|
+
api.auth.login({ email, password });
|
|
36
|
+
api.courses.get(null, { page: 1 });
|
|
37
|
+
api.users.cashReceivers();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Conventions
|
|
41
|
+
- One class per API resource
|
|
42
|
+
- Methods match HTTP verbs: `get`, `post`, `put`, `patch`, `delete`
|
|
43
|
+
- No external runtime dependencies — only Node built-ins
|
|
44
|
+
- ESM modules (`"type": "module"`)
|
|
45
|
+
|
|
46
|
+
## Adding a new resource
|
|
47
|
+
1. Create `src/api/v1/ResourceName.js` with a class that receives the client
|
|
48
|
+
2. Register it in `src/api/v1/index.js`
|
|
49
|
+
3. Write tests in `src/api/v1/__tests__/ResourceName.test.js`
|
|
50
|
+
|
|
51
|
+
## Never do
|
|
52
|
+
- Don't add runtime dependencies
|
|
53
|
+
- Don't change the constructor signature of `InsigniaApiV1`
|
|
54
|
+
- Don't hardcode API base URLs — always receive from constructor
|
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -311,15 +311,6 @@ await v1.surveys.questions(1).get();
|
|
|
311
311
|
await v1.surveys.questions(1).answers(2).get();
|
|
312
312
|
```
|
|
313
313
|
|
|
314
|
-
### Tags
|
|
315
|
-
|
|
316
|
-
```js
|
|
317
|
-
await v1.tags.get();
|
|
318
|
-
await v1.tags.create(data);
|
|
319
|
-
await v1.tags.edit(1, data);
|
|
320
|
-
await v1.tags.delete(1);
|
|
321
|
-
```
|
|
322
|
-
|
|
323
314
|
### Taxes
|
|
324
315
|
|
|
325
316
|
```js
|
|
@@ -409,11 +400,6 @@ await v1.users.pushEndpoints(1).delete(2);
|
|
|
409
400
|
```js
|
|
410
401
|
await v1.zoom.meetings().get();
|
|
411
402
|
await v1.zoom.meetings().get(1);
|
|
412
|
-
|
|
413
|
-
await v1.zoom.tokens().get();
|
|
414
|
-
await v1.zoom.tokens().create(data);
|
|
415
|
-
await v1.zoom.tokens().edit(1, data);
|
|
416
|
-
await v1.zoom.tokens().delete(1);
|
|
417
403
|
```
|
|
418
404
|
|
|
419
405
|
---
|
package/babel.config.cjs
CHANGED
|
File without changes
|