@selfcommunity/api-services 0.1.5 → 0.1.6-alpha.2

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 (74) hide show
  1. package/lib/cjs/constants/Endpoints.js +8 -16
  2. package/lib/cjs/index.js +10 -6
  3. package/lib/cjs/services/webhook/index.js +122 -207
  4. package/lib/cjs/types/index.js +12 -0
  5. package/lib/cjs/types/paginatedResponse.js +3 -0
  6. package/lib/cjs/types/webhook.js +3 -0
  7. package/lib/cjs/utils/apiRequest.js +26 -0
  8. package/lib/esm/api-services/src/constants/Endpoints.d.ts.map +1 -1
  9. package/lib/esm/api-services/src/index.d.ts +6 -2
  10. package/lib/esm/api-services/src/index.d.ts.map +1 -1
  11. package/lib/esm/api-services/src/services/webhook/index.d.ts +89 -32
  12. package/lib/esm/api-services/src/services/webhook/index.d.ts.map +1 -1
  13. package/lib/esm/api-services/src/types/index.d.ts +4 -0
  14. package/lib/esm/api-services/src/types/index.d.ts.map +1 -0
  15. package/lib/esm/api-services/src/types/paginatedResponse.d.ts +10 -0
  16. package/lib/esm/api-services/src/types/paginatedResponse.d.ts.map +1 -0
  17. package/lib/esm/api-services/src/types/webhook.d.ts +32 -0
  18. package/lib/esm/api-services/src/types/webhook.d.ts.map +1 -0
  19. package/lib/esm/api-services/src/utils/apiRequest.d.ts +2 -0
  20. package/lib/esm/api-services/src/utils/apiRequest.d.ts.map +1 -0
  21. package/lib/esm/constants/Endpoints.js +8 -16
  22. package/lib/esm/index.js +10 -6
  23. package/lib/esm/services/webhook/index.js +122 -207
  24. package/lib/esm/types/index.js +12 -0
  25. package/lib/esm/types/paginatedResponse.js +3 -0
  26. package/lib/esm/types/src/index.d.ts +9 -0
  27. package/lib/esm/types/src/index.d.ts.map +1 -0
  28. package/lib/esm/types/src/types/auth.d.ts +26 -0
  29. package/lib/esm/types/src/types/auth.d.ts.map +1 -0
  30. package/lib/esm/types/src/types/broadcastMessage.d.ts +73 -0
  31. package/lib/esm/types/src/types/broadcastMessage.d.ts.map +1 -0
  32. package/lib/esm/types/src/types/category.d.ts +100 -0
  33. package/lib/esm/types/src/types/category.d.ts.map +1 -0
  34. package/lib/esm/types/src/types/comment.d.ts +97 -0
  35. package/lib/esm/types/src/types/comment.d.ts.map +1 -0
  36. package/lib/esm/types/src/types/customAdv.d.ts +53 -0
  37. package/lib/esm/types/src/types/customAdv.d.ts.map +1 -0
  38. package/lib/esm/types/src/types/customNotification.d.ts +28 -0
  39. package/lib/esm/types/src/types/customNotification.d.ts.map +1 -0
  40. package/lib/esm/types/src/types/embed.d.ts +33 -0
  41. package/lib/esm/types/src/types/embed.d.ts.map +1 -0
  42. package/lib/esm/types/src/types/feed.d.ts +208 -0
  43. package/lib/esm/types/src/types/feed.d.ts.map +1 -0
  44. package/lib/esm/types/src/types/incubator.d.ts +53 -0
  45. package/lib/esm/types/src/types/incubator.d.ts.map +1 -0
  46. package/lib/esm/types/src/types/index.d.ts +23 -0
  47. package/lib/esm/types/src/types/index.d.ts.map +1 -0
  48. package/lib/esm/types/src/types/location.d.ts +61 -0
  49. package/lib/esm/types/src/types/location.d.ts.map +1 -0
  50. package/lib/esm/types/src/types/media.d.ts +52 -0
  51. package/lib/esm/types/src/types/media.d.ts.map +1 -0
  52. package/lib/esm/types/src/types/notification.d.ts +416 -0
  53. package/lib/esm/types/src/types/notification.d.ts.map +1 -0
  54. package/lib/esm/types/src/types/poll.d.ts +77 -0
  55. package/lib/esm/types/src/types/poll.d.ts.map +1 -0
  56. package/lib/esm/types/src/types/privateMessage.d.ts +109 -0
  57. package/lib/esm/types/src/types/privateMessage.d.ts.map +1 -0
  58. package/lib/esm/types/src/types/prize.d.ts +48 -0
  59. package/lib/esm/types/src/types/prize.d.ts.map +1 -0
  60. package/lib/esm/types/src/types/tag.d.ts +47 -0
  61. package/lib/esm/types/src/types/tag.d.ts.map +1 -0
  62. package/lib/esm/types/src/types/user.d.ts +231 -0
  63. package/lib/esm/types/src/types/user.d.ts.map +1 -0
  64. package/lib/esm/types/src/types/webhook.d.ts +91 -0
  65. package/lib/esm/types/src/types/webhook.d.ts.map +1 -0
  66. package/lib/esm/types/webhook.js +3 -0
  67. package/lib/esm/utils/apiRequest.js +26 -0
  68. package/lib/umd/api-services.js +1 -1
  69. package/lib/umd/api-services.js.map +1 -1
  70. package/package.json +4 -4
  71. package/lib/cjs/services/dynamic_preference/index.js +0 -85
  72. package/lib/esm/api-services/src/services/dynamic_preference/index.d.ts +0 -16
  73. package/lib/esm/api-services/src/services/dynamic_preference/index.d.ts.map +0 -1
  74. package/lib/esm/services/dynamic_preference/index.js +0 -85
@@ -1,43 +1,100 @@
1
+ import { SCWebhookEndpointType, SCWebhookEndpointAttemptType, SCWebhookEndpointSecretType } from '@selfcommunity/types';
2
+ import { WebhookParamType } from '../../types';
3
+ import { SCPaginatedResponse } from '../../types';
1
4
  export interface WebhookApiClientInterface {
2
- getAllWebhookEndpoints(): Promise<any>;
3
- getAllWebhookEvents(): Promise<any>;
4
- createWebhookEndpoint(): Promise<any>;
5
- getASpecificWebhookEndpoint(id: number): Promise<any>;
6
- updateASpecificWebhookEndpoint(id: number): Promise<any>;
7
- updateASingleWebhookEndpointField(id: number): Promise<any>;
5
+ getAllWebhookEndpoints(): Promise<SCPaginatedResponse<SCWebhookEndpointType>>;
6
+ getAllWebhookEvents(): Promise<string[]>;
7
+ createWebhookEndpoint(params: WebhookParamType): Promise<SCWebhookEndpointType>;
8
+ getASpecificWebhookEndpoint(id: number): Promise<SCWebhookEndpointType>;
9
+ updateASpecificWebhookEndpoint(id: number, params: WebhookParamType): Promise<SCWebhookEndpointType>;
10
+ updateASingleWebhookEndpointField(id: number, params: WebhookParamType): Promise<SCWebhookEndpointType>;
8
11
  deleteWebhookEndpoint(id: number): Promise<any>;
9
- getAllWebhookEndpointAttempts(): Promise<any>;
10
- expireWebhookSigningSecret(id: number): Promise<any>;
11
- revealWebhookSigningSecret(id: number): Promise<any>;
12
- resendWebhookEndpointEvent(id: number): Promise<any>;
13
- resendMultipleWebhookEndpointEvent(id: number): Promise<any>;
12
+ getAllWebhookEndpointAttempts(id: number): Promise<SCPaginatedResponse<SCWebhookEndpointAttemptType>>;
13
+ expireWebhookSigningSecret(id: number): Promise<SCWebhookEndpointType>;
14
+ revealWebhookSigningSecret(id: number, password?: string): Promise<SCWebhookEndpointSecretType>;
15
+ resendWebhookEndpointEvent(id: number, event: number): Promise<any>;
16
+ resendMultipleWebhookEndpointEvent(id: number, event: number[]): Promise<any>;
14
17
  }
18
+ /**
19
+ * Contains all the endpoints needed to manage webhooks.
20
+ */
15
21
  export declare class WebhookApiClient {
16
- static getAllWebhookEndpoints(): Promise<any>;
17
- static getAllWebhookEvents(): Promise<any>;
18
- static createWebhookEndpoint(): Promise<any>;
19
- static getASpecificWebhookEndpoint(id: number): Promise<any>;
20
- static updateASpecificWebhookEndpoint(id: number): Promise<any>;
21
- static updateASingleWebhookEndpointField(id: number): Promise<any>;
22
+ /**
23
+ * This endpoint retrieves all webhook endpoints
24
+ */
25
+ static getAllWebhookEndpoints(): Promise<SCPaginatedResponse<SCWebhookEndpointType>>;
26
+ /**
27
+ * This endpoint retrieves webhook events that can be enabled in the endpoint.
28
+ */
29
+ static getAllWebhookEvents(): Promise<string[]>;
30
+ /**
31
+ * This endpoint creates a webhook endpoint and connects it to the given webhook events.
32
+ * @param data
33
+ */
34
+ static createWebhookEndpoint(data: WebhookParamType): Promise<SCWebhookEndpointType>;
35
+ /**
36
+ * This endpoint retrieves a specific webhook endpoint using ID.
37
+ * @param id
38
+ */
39
+ static getASpecificWebhookEndpoint(id: number): Promise<SCWebhookEndpointType>;
40
+ /**
41
+ * This endpoint updates a specific webhook endpoint.
42
+ * @param id
43
+ * @param params
44
+ */
45
+ static updateASpecificWebhookEndpoint(id: number, params: WebhookParamType): Promise<SCWebhookEndpointType>;
46
+ /**
47
+ * This endpoint updates a specific field for a specific webhook endpoint.
48
+ * @param id
49
+ * @param params
50
+ */
51
+ static updateASingleWebhookEndpointField(id: number, params: WebhookParamType): Promise<SCWebhookEndpointType>;
52
+ /**
53
+ * This endpoint deletes a Webhook Endpoint.
54
+ * @param id
55
+ */
22
56
  static deleteWebhookEndpoint(id: number): Promise<any>;
23
- static getAllWebhookEndpointAttempts(id: number): Promise<any>;
24
- static expireWebhookSigningSecret(id: number): Promise<any>;
25
- static revealWebhookSigningSecret(id: number): Promise<any>;
26
- static resendWebhookEndpointEvent(id: number): Promise<any>;
27
- static resendMultipleWebhookEndpointEvent(id: number): Promise<any>;
57
+ /**
58
+ * This endpoint retrieves the attempts related to this endpoint.
59
+ * @param id
60
+ */
61
+ static getAllWebhookEndpointAttempts(id: number): Promise<SCPaginatedResponse<SCWebhookEndpointAttemptType>>;
62
+ /**
63
+ * This endpoint expires the secret associated with this endpoint.
64
+ * @param id
65
+ */
66
+ static expireWebhookSigningSecret(id: number): Promise<SCWebhookEndpointType>;
67
+ /**
68
+ * This endpoint reveals the secret associated with this endpoint.
69
+ * @param id
70
+ * @param password
71
+ */
72
+ static revealWebhookSigningSecret(id: number, password?: string): Promise<SCWebhookEndpointSecretType>;
73
+ /**
74
+ * This endpoint resends the event specified as parameter to the endpoint specified by the id parameter.
75
+ * @param id
76
+ * @param event
77
+ */
78
+ static resendWebhookEndpointEvent(id: number, event: number): Promise<any>;
79
+ /**
80
+ * This endpoint resends the events specified as parameters to the endpoint specified by the id parameter.
81
+ * @param id
82
+ * @param event
83
+ */
84
+ static resendMultipleWebhookEndpointEvent(id: number, event: number[]): Promise<any>;
28
85
  }
29
86
  export default class WebhookService {
30
- static getAllWebhookEndpoints(): Promise<any>;
87
+ static getAllWebhookEndpoints(): Promise<SCPaginatedResponse<SCWebhookEndpointType>>;
31
88
  static getAllWebhookEvents(): Promise<any>;
32
- static createWebhookEndpoint(): Promise<any>;
33
- static getASpecificWebhookEndpoint(id: number): Promise<any>;
34
- static updateASpecificWebhookEndpoint(id: number): Promise<any>;
35
- static updateASingleWebhookEndpointField(id: number): Promise<any>;
89
+ static createWebhookEndpoint(params: WebhookParamType): Promise<SCWebhookEndpointType>;
90
+ static getASpecificWebhookEndpoint(id: number): Promise<SCWebhookEndpointType>;
91
+ static updateASpecificWebhookEndpoint(id: number, params: WebhookParamType): Promise<SCWebhookEndpointType>;
92
+ static updateASingleWebhookEndpointField(id: number, params: WebhookParamType): Promise<SCWebhookEndpointType>;
36
93
  static deleteWebhookEndpoint(id: number): Promise<any>;
37
- static getAllWebhookEndpointAttempts(id: number): Promise<any>;
38
- static expireWebhookSigningSecret(id: number): Promise<any>;
39
- static revealWebhookSigningSecret(id: number): Promise<any>;
40
- static resendWebhookEndpointEvent(id: number): Promise<any>;
41
- static resendMultipleWebhookEndpointEvent(id: number): Promise<any>;
94
+ static getAllWebhookEndpointAttempts(id: number): Promise<SCPaginatedResponse<SCWebhookEndpointAttemptType>>;
95
+ static expireWebhookSigningSecret(id: number): Promise<SCWebhookEndpointType>;
96
+ static revealWebhookSigningSecret(id: number, password?: string): Promise<SCWebhookEndpointSecretType>;
97
+ static resendWebhookEndpointEvent(id: number, event: number): Promise<any>;
98
+ static resendMultipleWebhookEndpointEvent(id: number, event: number[]): Promise<any>;
42
99
  }
43
100
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/services/webhook/index.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,yBAAyB;IACxC,sBAAsB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACvC,mBAAmB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,2BAA2B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACtD,8BAA8B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,iCAAiC,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,G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AO,cAAc;WACpB,sBAAsB,IAAI,OAAO,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;WAG7E,mBAAmB,IAAI,OAAO,CAAC,GAAG,CAAC;WAGnC,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC;WAG/E,2BAA2B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;WAGvE,8BAA8B,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC;WAGpG,iCAAiC,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC;WAGvG,qBAAqB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;WAG/C,6BAA6B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,4BAA4B,CAAC,CAAC;WAGrG,0BAA0B,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;WAGtE,0BAA0B,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC;WAG/F,0BAA0B,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;WAGnE,kCAAkC,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAG3F"}
@@ -0,0 +1,4 @@
1
+ import { SCPaginatedResponse } from './paginatedResponse';
2
+ import { WebhookParamType, WebhookEventsType } from './webhook';
3
+ export { SCPaginatedResponse, WebhookParamType, WebhookEventsType };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAC,MAAM,WAAW,CAAC;AAE9D,OAAO,EAAC,mBAAmB,EAAE,gBAAgB,EAAE,iBAAiB,EAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * SCPaginatedResponse Interface
3
+ */
4
+ export interface SCPaginatedResponse<T = []> {
5
+ count: number;
6
+ next: string;
7
+ previous: string;
8
+ results: T;
9
+ }
10
+ //# sourceMappingURL=paginatedResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paginatedResponse.d.ts","sourceRoot":"","sources":["../../../../../src/types/paginatedResponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,EAAE;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,CAAC,CAAC;CACZ"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Interface WebhookParamType
3
+ */
4
+ export interface WebhookParamType {
5
+ /**
6
+ * Active status
7
+ */
8
+ is_active?: boolean;
9
+ /**
10
+ * Webhook target
11
+ */
12
+ target: string;
13
+ /**
14
+ * Webhook description
15
+ */
16
+ description?: string;
17
+ /**
18
+ * Webhook events
19
+ */
20
+ events: WebhookEventsType[];
21
+ /**
22
+ * Webhook SSL certificates for HTTPS requests.
23
+ */
24
+ ssl_cert_verification?: boolean;
25
+ }
26
+ /**
27
+ * Interface WebhookEventsType
28
+ */
29
+ export interface WebhookEventsType {
30
+ type: string;
31
+ }
32
+ //# sourceMappingURL=webhook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../../../src/types/webhook.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,2 @@
1
+ export declare function apiRequest(url: string, method: string, data?: any): Promise<any>;
2
+ //# sourceMappingURL=apiRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiRequest.d.ts","sourceRoot":"","sources":["../../../../../src/utils/apiRequest.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,gBAkBjE"}
@@ -14,6 +14,14 @@ const Endpoints = {
14
14
  method: 'POST'
15
15
  },
16
16
 
17
+ /**
18
+ * Dynamic Preference Endpoints
19
+ */
20
+ Preferences: {
21
+ url: (0, _utils.urlReplacer)('/api/v2/dynamic_preference/'),
22
+ method: 'GET'
23
+ },
24
+
17
25
  /**
18
26
  * SSO Endpoints
19
27
  */
@@ -26,22 +34,6 @@ const Endpoints = {
26
34
  method: 'POST'
27
35
  },
28
36
 
29
- /**
30
- * Dynamic Preference Endpoints
31
- */
32
- Preferences: {
33
- url: (0, _utils.urlReplacer)('/api/v2/dynamic_preference/'),
34
- method: 'GET'
35
- },
36
- PreferencesSearch: {
37
- url: (0, _utils.urlReplacer)('/api/v2/dynamic_preference/search/'),
38
- method: 'GET'
39
- },
40
- SpecificPreference: {
41
- url: (0, _utils.urlReplacer)('/api/v2/dynamic_preference/$(id)/'),
42
- method: 'GET'
43
- },
44
-
45
37
  /**
46
38
  * Features Endpoints
47
39
  * */
package/lib/esm/index.js CHANGED
@@ -22,6 +22,10 @@ var _token = require("./utils/token");
22
22
  exports.generateJWTToken = _token.generateJWTToken;
23
23
  exports.parseJwt = _token.parseJwt;
24
24
 
25
+ var _apiRequest = require("./utils/apiRequest");
26
+
27
+ exports.apiRequest = _apiRequest.apiRequest;
28
+
25
29
  var _category = _interopRequireWildcard(require("./services/category"));
26
30
 
27
31
  exports.CategoryService = _category.default;
@@ -52,12 +56,6 @@ exports.DataPortabilityService = _data_portability.default;
52
56
  exports.DataPortabilityApiClient = _data_portability.DataPortabilityApiClient;
53
57
  exports.DataPortabilityApiClientInterface = _data_portability.DataPortabilityApiClientInterface;
54
58
 
55
- var _dynamic_preference = _interopRequireWildcard(require("./services/dynamic_preference"));
56
-
57
- exports.DynamicPreferenceService = _dynamic_preference.default;
58
- exports.DynamicPreferenceApiClient = _dynamic_preference.DynamicPreferenceApiClient;
59
- exports.DynamicPreferenceApiClientInterface = _dynamic_preference.DynamicPreferenceApiClientInterface;
60
-
61
59
  var _embed = _interopRequireWildcard(require("./services/embed"));
62
60
 
63
61
  exports.EmbedService = _embed.default;
@@ -178,6 +176,12 @@ exports.WebhookService = _webhook.default;
178
176
  exports.WebhookApiClient = _webhook.WebhookApiClient;
179
177
  exports.WebhookApiClientInterface = _webhook.WebhookApiClientInterface;
180
178
 
179
+ var _types = require("./types");
180
+
181
+ exports.SCPaginatedResponse = _types.SCPaginatedResponse;
182
+ exports.WebhookParamType = _types.WebhookParamType;
183
+ exports.WebhookEventsType = _types.WebhookEventsType;
184
+
181
185
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
182
186
 
183
187
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }