@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.
Files changed (165) hide show
  1. package/.env +1 -0
  2. package/.env.test +5 -0
  3. package/.github/workflows/npm-publish-github-packages.yml +0 -0
  4. package/.nvmrc +1 -0
  5. package/AGENTS.md +54 -0
  6. package/LICENSE +0 -0
  7. package/README.md +0 -14
  8. package/babel.config.cjs +0 -0
  9. package/coverage/clover.xml +860 -0
  10. package/coverage/coverage-final.json +33 -0
  11. package/coverage/lcov-report/Accounts.js.html +151 -0
  12. package/coverage/lcov-report/Auth.js.html +130 -0
  13. package/coverage/lcov-report/Categories.js.html +121 -0
  14. package/coverage/lcov-report/Changelogs.js.html +118 -0
  15. package/coverage/lcov-report/Client.js.html +349 -0
  16. package/coverage/lcov-report/Configs.js.html +121 -0
  17. package/coverage/lcov-report/ContactForms.js.html +121 -0
  18. package/coverage/lcov-report/ConversationalTopics.js.html +121 -0
  19. package/coverage/lcov-report/Countries.js.html +112 -0
  20. package/coverage/lcov-report/Coupons.js.html +121 -0
  21. package/coverage/lcov-report/Courses.js.html +328 -0
  22. package/coverage/lcov-report/Currencies.js.html +115 -0
  23. package/coverage/lcov-report/Files.js.html +115 -0
  24. package/coverage/lcov-report/Forums.js.html +157 -0
  25. package/coverage/lcov-report/Hashes.js.html +118 -0
  26. package/coverage/lcov-report/Insignias.js.html +121 -0
  27. package/coverage/lcov-report/Languages.js.html +121 -0
  28. package/coverage/lcov-report/MailBlacklist.js.html +118 -0
  29. package/coverage/lcov-report/Organizations.js.html +118 -0
  30. package/coverage/lcov-report/Quizzes.js.html +181 -0
  31. package/coverage/lcov-report/ShortLinks.js.html +121 -0
  32. package/coverage/lcov-report/Surveys.js.html +181 -0
  33. package/coverage/lcov-report/Tags.js.html +121 -0
  34. package/coverage/lcov-report/Taxes.js.html +121 -0
  35. package/coverage/lcov-report/Teacher.js.html +196 -0
  36. package/coverage/lcov-report/Translations.js.html +121 -0
  37. package/coverage/lcov-report/UserTypes.js.html +121 -0
  38. package/coverage/lcov-report/Users.js.html +331 -0
  39. package/coverage/lcov-report/Zoom.js.html +154 -0
  40. package/coverage/lcov-report/base.css +224 -0
  41. package/coverage/lcov-report/block-navigation.js +87 -0
  42. package/coverage/lcov-report/favicon.png +0 -0
  43. package/coverage/lcov-report/index.html +161 -0
  44. package/coverage/lcov-report/prettify.css +1 -0
  45. package/coverage/lcov-report/prettify.js +2 -0
  46. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  47. package/coverage/lcov-report/sorter.js +210 -0
  48. package/coverage/lcov-report/src/Client.js.html +349 -0
  49. package/coverage/lcov-report/src/api/index.html +116 -0
  50. package/coverage/lcov-report/src/api/index.js.html +127 -0
  51. package/coverage/lcov-report/src/api/v1/Accounts.js.html +151 -0
  52. package/coverage/lcov-report/src/api/v1/Auth.js.html +130 -0
  53. package/coverage/lcov-report/src/api/v1/Categories.js.html +121 -0
  54. package/coverage/lcov-report/src/api/v1/Changelogs.js.html +118 -0
  55. package/coverage/lcov-report/src/api/v1/Configs.js.html +121 -0
  56. package/coverage/lcov-report/src/api/v1/ContactForms.js.html +121 -0
  57. package/coverage/lcov-report/src/api/v1/ConversationalTopics.js.html +121 -0
  58. package/coverage/lcov-report/src/api/v1/Countries.js.html +112 -0
  59. package/coverage/lcov-report/src/api/v1/Coupons.js.html +121 -0
  60. package/coverage/lcov-report/src/api/v1/Courses.js.html +355 -0
  61. package/coverage/lcov-report/src/api/v1/Currencies.js.html +115 -0
  62. package/coverage/lcov-report/src/api/v1/Files.js.html +115 -0
  63. package/coverage/lcov-report/src/api/v1/Forums.js.html +157 -0
  64. package/coverage/lcov-report/src/api/v1/Hashes.js.html +118 -0
  65. package/coverage/lcov-report/src/api/v1/Insignias.js.html +121 -0
  66. package/coverage/lcov-report/src/api/v1/Languages.js.html +121 -0
  67. package/coverage/lcov-report/src/api/v1/MailBlacklist.js.html +118 -0
  68. package/coverage/lcov-report/src/api/v1/Organizations.js.html +118 -0
  69. package/coverage/lcov-report/src/api/v1/PaymentMethods.js.html +112 -0
  70. package/coverage/lcov-report/src/api/v1/Quizzes.js.html +181 -0
  71. package/coverage/lcov-report/src/api/v1/ShortLinks.js.html +121 -0
  72. package/coverage/lcov-report/src/api/v1/Surveys.js.html +181 -0
  73. package/coverage/lcov-report/src/api/v1/Tags.js.html +121 -0
  74. package/coverage/lcov-report/src/api/v1/Taxes.js.html +121 -0
  75. package/coverage/lcov-report/src/api/v1/Teacher.js.html +196 -0
  76. package/coverage/lcov-report/src/api/v1/Translations.js.html +121 -0
  77. package/coverage/lcov-report/src/api/v1/UserTypes.js.html +121 -0
  78. package/coverage/lcov-report/src/api/v1/Users.js.html +334 -0
  79. package/coverage/lcov-report/src/api/v1/Zoom.js.html +124 -0
  80. package/coverage/lcov-report/src/api/v1/index.html +521 -0
  81. package/coverage/lcov-report/src/api/v1/index.js.html +295 -0
  82. package/coverage/lcov-report/src/index.html +131 -0
  83. package/coverage/lcov-report/src/index.js.html +109 -0
  84. package/coverage/lcov-report/tests/helpers.js.html +130 -0
  85. package/coverage/lcov-report/tests/index.html +116 -0
  86. package/coverage/lcov-report/tests/integration/cookieJar.js.html +229 -0
  87. package/coverage/lcov-report/tests/integration/index.html +116 -0
  88. package/coverage/lcov.info +1606 -0
  89. package/coverage/test-report.html +980 -0
  90. package/eslint.config.mjs +10 -0
  91. package/index.js +0 -0
  92. package/jest.config.mjs +10 -0
  93. package/package.json +2 -2
  94. package/scss/Services/_notification.scss +0 -0
  95. package/scss/index.scss +0 -0
  96. package/src/Client.js +61 -2
  97. package/src/api/index.js +0 -0
  98. package/src/api/v1/Accounts.js +0 -0
  99. package/src/api/v1/Auth.js +0 -0
  100. package/src/api/v1/Categories.js +0 -0
  101. package/src/api/v1/Changelogs.js +0 -0
  102. package/src/api/v1/Configs.js +0 -0
  103. package/src/api/v1/ContactForms.js +0 -0
  104. package/src/api/v1/ConversationalTopics.js +0 -0
  105. package/src/api/v1/Countries.js +0 -0
  106. package/src/api/v1/Coupons.js +0 -0
  107. package/src/api/v1/Courses.js +3 -1
  108. package/src/api/v1/Currencies.js +0 -0
  109. package/src/api/v1/Files.js +0 -0
  110. package/src/api/v1/Forums.js +0 -0
  111. package/src/api/v1/Hashes.js +0 -0
  112. package/src/api/v1/Insignias.js +0 -0
  113. package/src/api/v1/Languages.js +0 -0
  114. package/src/api/v1/MailBlacklist.js +0 -0
  115. package/src/api/v1/Organizations.js +0 -0
  116. package/src/api/v1/PaymentMethods.js +0 -0
  117. package/src/api/v1/Quizzes.js +0 -0
  118. package/src/api/v1/ShortLinks.js +0 -0
  119. package/src/api/v1/Surveys.js +0 -0
  120. package/src/api/v1/Taxes.js +0 -0
  121. package/src/api/v1/Teacher.js +0 -0
  122. package/src/api/v1/UserTypes.js +0 -0
  123. package/src/api/v1/Users.js +0 -0
  124. package/src/api/v1/Zoom.js +0 -10
  125. package/src/api/v1/index.js +1 -4
  126. package/src/index.js +0 -0
  127. package/tests/client.test.js +64 -1
  128. package/tests/helpers.js +16 -0
  129. package/tests/integration/api/v1/accounts.test.js +37 -0
  130. package/tests/integration/api/v1/auth/login.test.js +60 -0
  131. package/tests/integration/api/v1/categories.test.js +19 -0
  132. package/tests/integration/api/v1/changelogs.test.js +21 -0
  133. package/tests/integration/api/v1/configs.test.js +20 -0
  134. package/tests/integration/api/v1/contact-forms.test.js +24 -0
  135. package/tests/integration/api/v1/conversational-topics.test.js +19 -0
  136. package/tests/integration/api/v1/countries.test.js +20 -0
  137. package/tests/integration/api/v1/coupons.test.js +26 -0
  138. package/tests/integration/api/v1/courses/by-cod.test.js +19 -0
  139. package/tests/integration/api/v1/courses/index.test.js +46 -0
  140. package/tests/integration/api/v1/currencies/index.test.js +24 -0
  141. package/tests/integration/api/v1/currencies/values.test.js +24 -0
  142. package/tests/integration/api/v1/files.test.js +25 -0
  143. package/tests/integration/api/v1/forums/index.test.js +23 -0
  144. package/tests/integration/api/v1/hashes.test.js +26 -0
  145. package/tests/integration/api/v1/insignias.test.js +19 -0
  146. package/tests/integration/api/v1/languages.test.js +28 -0
  147. package/tests/integration/api/v1/mail-blacklist.test.js +26 -0
  148. package/tests/integration/api/v1/organizations.test.js +25 -0
  149. package/tests/integration/api/v1/payment-methods/by-currencies.test.js +51 -0
  150. package/tests/integration/api/v1/quizzes/index.test.js +39 -0
  151. package/tests/integration/api/v1/short-links.test.js +27 -0
  152. package/tests/integration/api/v1/surveys/index.test.js +40 -0
  153. package/tests/integration/api/v1/taxes.test.js +20 -0
  154. package/tests/integration/api/v1/teacher/index.test.js +53 -0
  155. package/tests/integration/api/v1/user-types.test.js +19 -0
  156. package/tests/integration/api/v1/users/cash-receivers.test.js +19 -0
  157. package/tests/integration/api/v1/users/index.test.js +35 -0
  158. package/tests/integration/api/v1/zoom.test.js +24 -0
  159. package/tests/integration/loadEnv.js +0 -0
  160. package/src/api/v1/Tags.js +0 -12
  161. package/src/api/v1/Translations.js +0 -12
  162. package/tests/api/v1.test.js +0 -483
  163. package/tests/integration/api.v1.test.js +0 -138
  164. package/tests/integration/auth.test.js +0 -40
  165. 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
@@ -0,0 +1,5 @@
1
+ INSIGNIA_EDUCATION_API_BASE_URL=http://localhost:8000
2
+ TEST_EMAIL=roquendo@insigniaeducation.com
3
+ TEST_PASSWORD=12345678
4
+ TEST_EMAIL_ADMIN=rodolfoquendo@gmail.com
5
+ TEST_PASSWORD_ADMIN=12345678
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