need4deed-sdk 0.0.10 → 0.0.11

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 (42) hide show
  1. package/dist/styles/global.css +892 -0
  2. package/dist/styles/n4d.css +896 -0
  3. package/dist/types/index.d.ts +1 -2
  4. package/package.json +17 -10
  5. package/dist/cjs/constants/endpoints.js +0 -10
  6. package/dist/cjs/constants/index.js +0 -17
  7. package/dist/cjs/core/index.js +0 -17
  8. package/dist/cjs/core/utils.js +0 -57
  9. package/dist/cjs/index.js +0 -19
  10. package/dist/cjs/types/api/common.js +0 -2
  11. package/dist/cjs/types/api/event.js +0 -8
  12. package/dist/cjs/types/api/index.js +0 -21
  13. package/dist/cjs/types/api/opportunity.js +0 -14
  14. package/dist/cjs/types/api/testimonial.js +0 -2
  15. package/dist/cjs/types/api/volunteer.js +0 -2
  16. package/dist/cjs/types/core.js +0 -28
  17. package/dist/cjs/types/index.js +0 -18
  18. package/dist/esm/constants/endpoints.js +0 -7
  19. package/dist/esm/constants/index.js +0 -1
  20. package/dist/esm/core/index.js +0 -1
  21. package/dist/esm/core/utils.js +0 -53
  22. package/dist/esm/types/api/common.js +0 -1
  23. package/dist/esm/types/api/event.js +0 -5
  24. package/dist/esm/types/api/index.js +0 -5
  25. package/dist/esm/types/api/opportunity.js +0 -11
  26. package/dist/esm/types/api/testimonial.js +0 -1
  27. package/dist/esm/types/api/volunteer.js +0 -1
  28. package/dist/esm/types/core.js +0 -25
  29. package/dist/esm/types/index.js +0 -2
  30. package/dist/types/types/index.d.ts +0 -2
  31. /package/dist/{types/constants → constants}/endpoints.d.ts +0 -0
  32. /package/dist/{types/constants → constants}/index.d.ts +0 -0
  33. /package/dist/{types/core → core}/index.d.ts +0 -0
  34. /package/dist/{types/core → core}/utils.d.ts +0 -0
  35. /package/dist/{esm/index.js → index.d.ts} +0 -0
  36. /package/dist/types/{types/api → api}/common.d.ts +0 -0
  37. /package/dist/types/{types/api → api}/event.d.ts +0 -0
  38. /package/dist/types/{types/api → api}/index.d.ts +0 -0
  39. /package/dist/types/{types/api → api}/opportunity.d.ts +0 -0
  40. /package/dist/types/{types/api → api}/testimonial.d.ts +0 -0
  41. /package/dist/types/{types/api → api}/volunteer.d.ts +0 -0
  42. /package/dist/types/{types/core.d.ts → core.d.ts} +0 -0
@@ -1,3 +1,2 @@
1
- export * from "./constants";
1
+ export * from "./api";
2
2
  export * from "./core";
3
- export * from "./types";
package/package.json CHANGED
@@ -1,18 +1,25 @@
1
1
  {
2
2
  "name": "need4deed-sdk",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Need4Deed.org SDK",
5
- "main": "dist/cjs/index.js",
6
- "module": "dist/esm/index.mjs",
7
- "types": "dist/types/index.d.ts",
5
+ "type": "commonjs",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
+ "exports": {
12
+ ".": {
13
+ "require": "./dist/index.js",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "./styles/*": "./dist/styles/*",
17
+ "./package.json": "./package.json"
18
+ },
11
19
  "scripts": {
12
- "build:cjs": "tsc --project tsconfig.cjs.json",
13
- "build:esm": "tsc --project tsconfig.esm.json",
14
- "build:types": "tsc --project tsconfig.cjs.json --emitDeclarationOnly --declarationDir dist/types",
15
- "build": "yarn build:cjs && yarn build:esm && yarn build:types",
20
+ "build:copy-assets": "mkdir -p dist/styles && cp src/styles/*.css dist/styles/",
21
+ "build:tsc": "tsc",
22
+ "build": "yarn build:tsc && yarn build:copy-assets",
16
23
  "watch": "tsc --watch --project tsconfig.cjs.json",
17
24
  "prepublishOnly": "yarn build",
18
25
  "publish": "yarn publish",
@@ -35,9 +42,9 @@
35
42
  "url": "https://github.com/need4deed-org/sdk.git"
36
43
  },
37
44
  "devDependencies": {
38
- "typescript": "^5.8.3",
39
45
  "@types/react": "^18.0.0",
40
- "@types/react-dom": "^18.0.0"
46
+ "@types/react-dom": "^18.0.0",
47
+ "typescript": "^5.8.3"
41
48
  },
42
49
  "peerDependencies": {
43
50
  "react": "^17.0.0 || ^18.0.0",
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Endpoint = void 0;
4
- var Endpoint;
5
- (function (Endpoint) {
6
- Endpoint["OPPORTUNITY"] = "/opportunity";
7
- Endpoint["EVENT"] = "/event";
8
- Endpoint["TESTIMONIAL"] = "/testimonial";
9
- Endpoint["VOLUNTEER"] = "/volunteer";
10
- })(Endpoint || (exports.Endpoint = Endpoint = {}));
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./endpoints"), exports);
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./utils"), exports);
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchFn = fetchFn;
4
- exports.snakeToCamelCase = snakeToCamelCase;
5
- function fetchFn({ url, options, fnDTO, }) {
6
- return fetch(url, options)
7
- .then((response) => {
8
- if (response.ok)
9
- return response.json();
10
- throw new Error(response.statusText);
11
- })
12
- .then((data) => {
13
- return fnDTO ? fnDTO(data) : data;
14
- });
15
- }
16
- /**
17
- * Converts the keys of an object from snake_case to camelCase.
18
- * Handles nested objects and arrays recursively.
19
- *
20
- * @param snakeCaseObject The object with keys in snake_case.
21
- * @returns A new object with keys converted to camelCase.
22
- */
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- function snakeToCamelCase(snakeCaseObject) {
25
- if (snakeCaseObject === null || typeof snakeCaseObject !== "object") {
26
- return snakeCaseObject;
27
- }
28
- // Handle arrays
29
- if (Array.isArray(snakeCaseObject)) {
30
- return snakeCaseObject.map((item) => snakeToCamelCase(item));
31
- }
32
- // Handle objects
33
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
- const camelCaseObject = {};
35
- Object.keys(snakeCaseObject).forEach((key) => {
36
- if (Object.prototype.hasOwnProperty.call(snakeCaseObject, key)) {
37
- let camelCaseKey;
38
- // skip if all caps
39
- if (key.match(/^[A-Z0-9_]+$/)) {
40
- camelCaseKey = key;
41
- }
42
- else {
43
- // Convert snake_case key to camelCase
44
- const parts = key.split("_");
45
- camelCaseKey =
46
- parts[0] +
47
- parts
48
- .slice(1)
49
- .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
50
- .join("");
51
- }
52
- // Recursively convert nested values
53
- camelCaseObject[camelCaseKey] = snakeToCamelCase(snakeCaseObject[key]);
54
- }
55
- });
56
- return camelCaseObject;
57
- }
package/dist/cjs/index.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./constants"), exports);
18
- __exportStar(require("./core"), exports);
19
- __exportStar(require("./types"), exports);
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EventN4DType = void 0;
4
- var EventN4DType;
5
- (function (EventN4DType) {
6
- EventN4DType["PARTY"] = "party";
7
- EventN4DType["WORKSHOP"] = "workshop";
8
- })(EventN4DType || (exports.EventN4DType = EventN4DType = {}));
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./common"), exports);
18
- __exportStar(require("./event"), exports);
19
- __exportStar(require("./opportunity"), exports);
20
- __exportStar(require("./testimonial"), exports);
21
- __exportStar(require("./volunteer"), exports);
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TranslatedIntoType = exports.OpportunityType = void 0;
4
- var OpportunityType;
5
- (function (OpportunityType) {
6
- OpportunityType["GENERAL"] = "volunteering";
7
- OpportunityType["ACCOMPANYING"] = "accompanying";
8
- })(OpportunityType || (exports.OpportunityType = OpportunityType = {}));
9
- var TranslatedIntoType;
10
- (function (TranslatedIntoType) {
11
- TranslatedIntoType["DEUTSCHE"] = "deutsche";
12
- TranslatedIntoType["ENGLISH_OK"] = "englishOk";
13
- TranslatedIntoType["NO_TRANSLATION"] = "noTranslation";
14
- })(TranslatedIntoType || (exports.TranslatedIntoType = TranslatedIntoType = {}));
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpMethod = exports.LangProficiency = exports.Lang = void 0;
4
- var Lang;
5
- (function (Lang) {
6
- Lang["EN"] = "en";
7
- Lang["DE"] = "de";
8
- })(Lang || (exports.Lang = Lang = {}));
9
- var LangProficiency;
10
- (function (LangProficiency) {
11
- LangProficiency["BEGINER"] = "beginer";
12
- LangProficiency["INTERMEDIATE"] = "intermediate";
13
- LangProficiency["ADVANCED"] = "advanced";
14
- LangProficiency["FLUENT"] = "fluent";
15
- LangProficiency["NATIVE"] = "native";
16
- })(LangProficiency || (exports.LangProficiency = LangProficiency = {}));
17
- var HttpMethod;
18
- (function (HttpMethod) {
19
- HttpMethod["GET"] = "GET";
20
- HttpMethod["HEAD"] = "HEAD";
21
- HttpMethod["POST"] = "POST";
22
- HttpMethod["PUT"] = "PUT";
23
- HttpMethod["DELETE"] = "DELETE";
24
- HttpMethod["TRACE"] = "TRACE";
25
- HttpMethod["OPTIONS"] = "OPTIONS";
26
- HttpMethod["CONNECT"] = "CONNECT";
27
- HttpMethod["PATCH"] = "PATCH";
28
- })(HttpMethod || (exports.HttpMethod = HttpMethod = {}));
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./api"), exports);
18
- __exportStar(require("./core"), exports);
@@ -1,7 +0,0 @@
1
- export var Endpoint;
2
- (function (Endpoint) {
3
- Endpoint["OPPORTUNITY"] = "/opportunity";
4
- Endpoint["EVENT"] = "/event";
5
- Endpoint["TESTIMONIAL"] = "/testimonial";
6
- Endpoint["VOLUNTEER"] = "/volunteer";
7
- })(Endpoint || (Endpoint = {}));
@@ -1 +0,0 @@
1
- export * from "./endpoints";
@@ -1 +0,0 @@
1
- export * from "./utils";
@@ -1,53 +0,0 @@
1
- export function fetchFn({ url, options, fnDTO, }) {
2
- return fetch(url, options)
3
- .then((response) => {
4
- if (response.ok)
5
- return response.json();
6
- throw new Error(response.statusText);
7
- })
8
- .then((data) => {
9
- return fnDTO ? fnDTO(data) : data;
10
- });
11
- }
12
- /**
13
- * Converts the keys of an object from snake_case to camelCase.
14
- * Handles nested objects and arrays recursively.
15
- *
16
- * @param snakeCaseObject The object with keys in snake_case.
17
- * @returns A new object with keys converted to camelCase.
18
- */
19
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
- export function snakeToCamelCase(snakeCaseObject) {
21
- if (snakeCaseObject === null || typeof snakeCaseObject !== "object") {
22
- return snakeCaseObject;
23
- }
24
- // Handle arrays
25
- if (Array.isArray(snakeCaseObject)) {
26
- return snakeCaseObject.map((item) => snakeToCamelCase(item));
27
- }
28
- // Handle objects
29
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
- const camelCaseObject = {};
31
- Object.keys(snakeCaseObject).forEach((key) => {
32
- if (Object.prototype.hasOwnProperty.call(snakeCaseObject, key)) {
33
- let camelCaseKey;
34
- // skip if all caps
35
- if (key.match(/^[A-Z0-9_]+$/)) {
36
- camelCaseKey = key;
37
- }
38
- else {
39
- // Convert snake_case key to camelCase
40
- const parts = key.split("_");
41
- camelCaseKey =
42
- parts[0] +
43
- parts
44
- .slice(1)
45
- .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
46
- .join("");
47
- }
48
- // Recursively convert nested values
49
- camelCaseObject[camelCaseKey] = snakeToCamelCase(snakeCaseObject[key]);
50
- }
51
- });
52
- return camelCaseObject;
53
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- export var EventN4DType;
2
- (function (EventN4DType) {
3
- EventN4DType["PARTY"] = "party";
4
- EventN4DType["WORKSHOP"] = "workshop";
5
- })(EventN4DType || (EventN4DType = {}));
@@ -1,5 +0,0 @@
1
- export * from "./common";
2
- export * from "./event";
3
- export * from "./opportunity";
4
- export * from "./testimonial";
5
- export * from "./volunteer";
@@ -1,11 +0,0 @@
1
- export var OpportunityType;
2
- (function (OpportunityType) {
3
- OpportunityType["GENERAL"] = "volunteering";
4
- OpportunityType["ACCOMPANYING"] = "accompanying";
5
- })(OpportunityType || (OpportunityType = {}));
6
- export var TranslatedIntoType;
7
- (function (TranslatedIntoType) {
8
- TranslatedIntoType["DEUTSCHE"] = "deutsche";
9
- TranslatedIntoType["ENGLISH_OK"] = "englishOk";
10
- TranslatedIntoType["NO_TRANSLATION"] = "noTranslation";
11
- })(TranslatedIntoType || (TranslatedIntoType = {}));
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,25 +0,0 @@
1
- export var Lang;
2
- (function (Lang) {
3
- Lang["EN"] = "en";
4
- Lang["DE"] = "de";
5
- })(Lang || (Lang = {}));
6
- export var LangProficiency;
7
- (function (LangProficiency) {
8
- LangProficiency["BEGINER"] = "beginer";
9
- LangProficiency["INTERMEDIATE"] = "intermediate";
10
- LangProficiency["ADVANCED"] = "advanced";
11
- LangProficiency["FLUENT"] = "fluent";
12
- LangProficiency["NATIVE"] = "native";
13
- })(LangProficiency || (LangProficiency = {}));
14
- export var HttpMethod;
15
- (function (HttpMethod) {
16
- HttpMethod["GET"] = "GET";
17
- HttpMethod["HEAD"] = "HEAD";
18
- HttpMethod["POST"] = "POST";
19
- HttpMethod["PUT"] = "PUT";
20
- HttpMethod["DELETE"] = "DELETE";
21
- HttpMethod["TRACE"] = "TRACE";
22
- HttpMethod["OPTIONS"] = "OPTIONS";
23
- HttpMethod["CONNECT"] = "CONNECT";
24
- HttpMethod["PATCH"] = "PATCH";
25
- })(HttpMethod || (HttpMethod = {}));
@@ -1,2 +0,0 @@
1
- export * from "./api";
2
- export * from "./core";
@@ -1,2 +0,0 @@
1
- export * from "./api";
2
- export * from "./core";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes