m2m-components 3.3.0 → 3.3.1-alpha-aef9a40.0
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/MenuBaseElement.d.mts +24 -0
- package/MenuBaseElement.d.ts +12 -8
- package/MenuBaseElement.js +177 -102
- package/MenuBaseElement.js.map +1 -1
- package/MenuBaseElement.mjs +9 -0
- package/MenuBaseElement.mjs.map +1 -0
- package/{cjs/storage/lib/hub.js → chunk-2X6HV5XJ.mjs} +21 -40
- package/chunk-2X6HV5XJ.mjs.map +1 -0
- package/chunk-3YQYBFME.mjs +102 -0
- package/chunk-3YQYBFME.mjs.map +1 -0
- package/chunk-5FHEMJGG.mjs +97 -0
- package/chunk-5FHEMJGG.mjs.map +1 -0
- package/{cjs/domains.js → chunk-B7STDXYN.mjs} +8 -8
- package/chunk-B7STDXYN.mjs.map +1 -0
- package/chunk-BFPL6AIR.mjs +74 -0
- package/chunk-BFPL6AIR.mjs.map +1 -0
- package/chunk-CB56CZRA.mjs +8491 -0
- package/chunk-CB56CZRA.mjs.map +1 -0
- package/chunk-CEBJL6ZD.mjs +22 -0
- package/chunk-CEBJL6ZD.mjs.map +1 -0
- package/{cjs/endpoints/matsuri-forms.v1.js → chunk-DYNNGZMQ.mjs} +94 -185
- package/chunk-DYNNGZMQ.mjs.map +1 -0
- package/chunk-FDRD4YS4.mjs +34 -0
- package/chunk-FDRD4YS4.mjs.map +1 -0
- package/{cjs/endpoints/m2m-users.v1.js → chunk-GMPQV5TL.mjs} +136 -267
- package/chunk-GMPQV5TL.mjs.map +1 -0
- package/chunk-H66U7VZB.mjs +9 -0
- package/chunk-H66U7VZB.mjs.map +1 -0
- package/chunk-IH72EYIB.mjs +9 -0
- package/chunk-IH72EYIB.mjs.map +1 -0
- package/chunk-IOZIVEOV.mjs +2 -0
- package/chunk-IOZIVEOV.mjs.map +1 -0
- package/{cjs/endpoints/m2m-notifications.v1.js → chunk-ISOF65DB.mjs} +42 -63
- package/chunk-ISOF65DB.mjs.map +1 -0
- package/chunk-JUBOAWNR.mjs +61 -0
- package/chunk-JUBOAWNR.mjs.map +1 -0
- package/chunk-LDSJ6KYP.mjs +28 -0
- package/chunk-LDSJ6KYP.mjs.map +1 -0
- package/chunk-LYVJL4T5.mjs +78 -0
- package/chunk-LYVJL4T5.mjs.map +1 -0
- package/chunk-M4ZBTA6A.mjs +19 -0
- package/chunk-M4ZBTA6A.mjs.map +1 -0
- package/chunk-NO6ZGO5P.mjs +17 -0
- package/chunk-NO6ZGO5P.mjs.map +1 -0
- package/chunk-UCJSCAN5.mjs +45 -0
- package/chunk-UCJSCAN5.mjs.map +1 -0
- package/chunk-UM6FAKR4.mjs +152 -0
- package/chunk-UM6FAKR4.mjs.map +1 -0
- package/{cjs/storage/lib/client.js → chunk-UOPEIK22.mjs} +45 -50
- package/chunk-UOPEIK22.mjs.map +1 -0
- package/chunk-V4ROE7DI.mjs +54 -0
- package/chunk-V4ROE7DI.mjs.map +1 -0
- package/chunk-VNCVFELM.mjs +83 -0
- package/chunk-VNCVFELM.mjs.map +1 -0
- package/chunk-YUHXVW6K.mjs +2 -0
- package/chunk-YUHXVW6K.mjs.map +1 -0
- package/domains.d.mts +11 -0
- package/domains.d.ts +3 -2
- package/domains.js +31 -1
- package/domains.js.map +1 -1
- package/domains.mjs +9 -0
- package/domains.mjs.map +1 -0
- package/endpoints/m2m-notifications.d.mts +7 -0
- package/endpoints/m2m-notifications.d.ts +5 -3
- package/endpoints/m2m-notifications.js +129 -4
- package/endpoints/m2m-notifications.js.map +1 -1
- package/endpoints/m2m-notifications.mjs +12 -0
- package/endpoints/m2m-notifications.mjs.map +1 -0
- package/endpoints/m2m-notifications.v1.d.mts +1 -0
- package/endpoints/m2m-notifications.v1.d.ts +1 -51
- package/endpoints/m2m-notifications.v1.js +95 -102
- package/endpoints/m2m-notifications.v1.js.map +1 -1
- package/endpoints/m2m-notifications.v1.mjs +23 -0
- package/endpoints/m2m-notifications.v1.mjs.map +1 -0
- package/endpoints/m2m-users.d.mts +7 -0
- package/endpoints/m2m-users.d.ts +5 -3
- package/endpoints/m2m-users.js +407 -4
- package/endpoints/m2m-users.js.map +1 -1
- package/endpoints/m2m-users.mjs +12 -0
- package/endpoints/m2m-users.mjs.map +1 -0
- package/endpoints/m2m-users.v1.d.mts +1 -0
- package/endpoints/m2m-users.v1.d.ts +1 -221
- package/endpoints/m2m-users.v1.js +327 -475
- package/endpoints/m2m-users.v1.js.map +1 -1
- package/endpoints/m2m-users.v1.mjs +69 -0
- package/endpoints/m2m-users.v1.mjs.map +1 -0
- package/endpoints/matsuri-forms.d.mts +7 -0
- package/endpoints/matsuri-forms.d.ts +5 -3
- package/endpoints/matsuri-forms.js +291 -4
- package/endpoints/matsuri-forms.js.map +1 -1
- package/endpoints/matsuri-forms.mjs +12 -0
- package/endpoints/matsuri-forms.mjs.map +1 -0
- package/endpoints/matsuri-forms.v1.d.mts +1 -0
- package/endpoints/matsuri-forms.v1.d.ts +1 -177
- package/endpoints/matsuri-forms.v1.js +231 -332
- package/endpoints/matsuri-forms.v1.js.map +1 -1
- package/endpoints/matsuri-forms.v1.mjs +49 -0
- package/endpoints/matsuri-forms.v1.mjs.map +1 -0
- package/feedback/MultipleTextQuestion.d.mts +6 -0
- package/feedback/MultipleTextQuestion.d.ts +6 -3
- package/feedback/MultipleTextQuestion.js +43 -10
- package/feedback/MultipleTextQuestion.js.map +1 -1
- package/feedback/MultipleTextQuestion.mjs +9 -0
- package/feedback/MultipleTextQuestion.mjs.map +1 -0
- package/feedback/SelectQuestion.d.mts +6 -0
- package/feedback/SelectQuestion.d.ts +6 -3
- package/feedback/SelectQuestion.js +55 -18
- package/feedback/SelectQuestion.js.map +1 -1
- package/feedback/SelectQuestion.mjs +9 -0
- package/feedback/SelectQuestion.mjs.map +1 -0
- package/feedback/getRandomId.d.mts +6 -0
- package/feedback/getRandomId.d.ts +3 -2
- package/feedback/getRandomId.js +31 -4
- package/feedback/getRandomId.js.map +1 -1
- package/feedback/getRandomId.mjs +9 -0
- package/feedback/getRandomId.mjs.map +1 -0
- package/feedback/index.d.mts +15 -0
- package/feedback/index.d.ts +7 -5
- package/feedback/index.js +8558 -166
- package/feedback/index.js.map +1 -1
- package/feedback/index.mjs +13 -0
- package/feedback/index.mjs.map +1 -0
- package/global.d.d.mts +4 -0
- package/global.d.d.ts +4 -0
- package/global.d.js +20 -0
- package/global.d.js.map +1 -0
- package/global.d.mjs +2 -0
- package/global.d.mjs.map +1 -0
- package/index.d.mts +6 -0
- package/index.d.ts +6 -9
- package/index.js +421 -8
- package/index.js.map +1 -1
- package/index.mjs +23 -0
- package/index.mjs.map +1 -0
- package/initM2mComponents.d.mts +7 -0
- package/initM2mComponents.d.ts +3 -6
- package/initM2mComponents.js +242 -3
- package/initM2mComponents.js.map +1 -1
- package/initM2mComponents.mjs +11 -0
- package/initM2mComponents.mjs.map +1 -0
- package/m2m-apps-menu.d.mts +16 -0
- package/m2m-apps-menu.d.ts +10 -5
- package/m2m-apps-menu.js +265 -43
- package/m2m-apps-menu.js.map +1 -1
- package/m2m-apps-menu.mjs +11 -0
- package/m2m-apps-menu.mjs.map +1 -0
- package/m2m-notifications.v1-0186835d.d.ts +73 -0
- package/m2m-user-menu.d.mts +17 -0
- package/m2m-user-menu.d.ts +10 -5
- package/m2m-user-menu.js +327 -53
- package/m2m-user-menu.js.map +1 -1
- package/m2m-user-menu.mjs +13 -0
- package/m2m-user-menu.mjs.map +1 -0
- package/m2m-users.v1-c78c72cf.d.ts +289 -0
- package/matsuri-forms.v1-0ffee104.d.ts +225 -0
- package/notification/NotificationProvider.d.mts +18 -0
- package/notification/NotificationProvider.d.ts +10 -7
- package/notification/NotificationProvider.js +185 -51
- package/notification/NotificationProvider.js.map +1 -1
- package/notification/NotificationProvider.mjs +15 -0
- package/notification/NotificationProvider.mjs.map +1 -0
- package/notification/ServiceIdProvider.d.mts +10 -0
- package/notification/ServiceIdProvider.d.ts +8 -5
- package/notification/ServiceIdProvider.js +56 -18
- package/notification/ServiceIdProvider.js.map +1 -1
- package/notification/ServiceIdProvider.mjs +11 -0
- package/notification/ServiceIdProvider.mjs.map +1 -0
- package/notification/api.d.mts +7 -0
- package/notification/api.d.ts +7 -5
- package/notification/api.js +157 -59
- package/notification/api.js.map +1 -1
- package/notification/api.mjs +14 -0
- package/notification/api.mjs.map +1 -0
- package/notification/domain.d.mts +24 -0
- package/notification/domain.d.ts +6 -5
- package/notification/domain.js +19 -1
- package/notification/domain.js.map +1 -1
- package/notification/domain.mjs +3 -0
- package/notification/domain.mjs.map +1 -0
- package/notification/index.d.mts +6 -0
- package/notification/index.d.ts +6 -5
- package/notification/index.js +271 -4
- package/notification/index.js.map +1 -1
- package/notification/index.mjs +30 -0
- package/notification/index.mjs.map +1 -0
- package/package.json +43 -103
- package/releases/m2m-releases-link.d.mts +11 -0
- package/releases/m2m-releases-link.d.ts +9 -5
- package/releases/m2m-releases-link.js +97 -54
- package/releases/m2m-releases-link.js.map +1 -1
- package/releases/m2m-releases-link.mjs +69 -0
- package/releases/m2m-releases-link.mjs.map +1 -0
- package/releases/t.d.mts +3 -0
- package/releases/t.d.ts +3 -2
- package/releases/t.js +31 -1
- package/releases/t.js.map +1 -1
- package/releases/t.mjs +9 -0
- package/releases/t.mjs.map +1 -0
- package/storage/client.d.mts +20 -0
- package/storage/client.d.ts +8 -6
- package/storage/client.js +260 -85
- package/storage/client.js.map +1 -1
- package/storage/client.mjs +14 -0
- package/storage/client.mjs.map +1 -0
- package/storage/hub.d.mts +9 -0
- package/storage/hub.d.ts +6 -4
- package/storage/hub.js +120 -7
- package/storage/hub.js.map +1 -1
- package/storage/hub.mjs +10 -0
- package/storage/hub.mjs.map +1 -0
- package/storage/lib/client.d.mts +27 -0
- package/storage/lib/client.d.ts +4 -5
- package/storage/lib/client.js +76 -57
- package/storage/lib/client.js.map +1 -1
- package/storage/lib/client.mjs +9 -0
- package/storage/lib/client.mjs.map +1 -0
- package/storage/lib/hub.d.mts +15 -0
- package/storage/lib/hub.d.ts +4 -4
- package/storage/lib/hub.js +57 -46
- package/storage/lib/hub.js.map +1 -1
- package/storage/lib/hub.mjs +9 -0
- package/storage/lib/hub.mjs.map +1 -0
- package/storage/useM2mAuth.d.mts +25 -0
- package/storage/useM2mAuth.d.ts +10 -8
- package/storage/useM2mAuth.js +184 -74
- package/storage/useM2mAuth.js.map +1 -1
- package/storage/useM2mAuth.mjs +14 -0
- package/storage/useM2mAuth.mjs.map +1 -0
- package/storage/useM2mAuth.test.d.mts +2 -0
- package/storage/useM2mAuth.test.d.ts +2 -0
- package/storage/useM2mAuth.test.js +60906 -0
- package/storage/useM2mAuth.test.js.map +1 -0
- package/storage/useM2mAuth.test.mjs +60682 -0
- package/storage/useM2mAuth.test.mjs.map +1 -0
- package/cjs/MenuBaseElement.js +0 -207
- package/cjs/MenuBaseElement.js.map +0 -1
- package/cjs/domains.js.map +0 -1
- package/cjs/endpoints/m2m-notifications.js +0 -15
- package/cjs/endpoints/m2m-notifications.js.map +0 -1
- package/cjs/endpoints/m2m-notifications.v1.js.map +0 -1
- package/cjs/endpoints/m2m-users.js +0 -15
- package/cjs/endpoints/m2m-users.js.map +0 -1
- package/cjs/endpoints/m2m-users.v1.js.map +0 -1
- package/cjs/endpoints/matsuri-forms.js +0 -15
- package/cjs/endpoints/matsuri-forms.js.map +0 -1
- package/cjs/endpoints/matsuri-forms.v1.js.map +0 -1
- package/cjs/feedback/MultipleTextQuestion.js +0 -19
- package/cjs/feedback/MultipleTextQuestion.js.map +0 -1
- package/cjs/feedback/SelectQuestion.js +0 -27
- package/cjs/feedback/SelectQuestion.js.map +0 -1
- package/cjs/feedback/getRandomId.js +0 -12
- package/cjs/feedback/getRandomId.js.map +0 -1
- package/cjs/feedback/index.js +0 -185
- package/cjs/feedback/index.js.map +0 -1
- package/cjs/index.js +0 -11
- package/cjs/index.js.map +0 -1
- package/cjs/initM2mComponents.js +0 -17
- package/cjs/initM2mComponents.js.map +0 -1
- package/cjs/m2m-apps-menu.js +0 -95
- package/cjs/m2m-apps-menu.js.map +0 -1
- package/cjs/m2m-user-menu.js +0 -91
- package/cjs/m2m-user-menu.js.map +0 -1
- package/cjs/notification/NotificationProvider.js +0 -84
- package/cjs/notification/NotificationProvider.js.map +0 -1
- package/cjs/notification/ServiceIdProvider.js +0 -33
- package/cjs/notification/ServiceIdProvider.js.map +0 -1
- package/cjs/notification/api.js +0 -55
- package/cjs/notification/api.js.map +0 -1
- package/cjs/notification/domain.js +0 -6
- package/cjs/notification/domain.js.map +0 -1
- package/cjs/notification/index.js +0 -50
- package/cjs/notification/index.js.map +0 -1
- package/cjs/releases/m2m-releases-link.js +0 -99
- package/cjs/releases/m2m-releases-link.js.map +0 -1
- package/cjs/releases/t.js +0 -8
- package/cjs/releases/t.js.map +0 -1
- package/cjs/storage/client.js +0 -89
- package/cjs/storage/client.js.map +0 -1
- package/cjs/storage/hub.js +0 -19
- package/cjs/storage/hub.js.map +0 -1
- package/cjs/storage/lib/client.js.map +0 -1
- package/cjs/storage/lib/hub.js.map +0 -1
- package/cjs/storage/useM2mAuth.js +0 -97
- package/cjs/storage/useM2mAuth.js.map +0 -1
- package/endpoints/m2m-notifications.d.ts.map +0 -1
- package/endpoints/m2m-notifications.v1.d.ts.map +0 -1
- package/endpoints/m2m-users.d.ts.map +0 -1
- package/endpoints/m2m-users.v1.d.ts.map +0 -1
- package/endpoints/matsuri-forms.d.ts.map +0 -1
- package/endpoints/matsuri-forms.v1.d.ts.map +0 -1
- package/feedback/MultipleTextQuestion.d.ts.map +0 -1
- package/feedback/SelectQuestion.d.ts.map +0 -1
- package/feedback/getRandomId.d.ts.map +0 -1
- package/feedback/index.d.ts.map +0 -1
- package/notification/NotificationProvider.d.ts.map +0 -1
- package/notification/ServiceIdProvider.d.ts.map +0 -1
- package/notification/api.d.ts.map +0 -1
- package/notification/domain.d.ts.map +0 -1
- package/notification/index.d.ts.map +0 -1
- package/releases/m2m-releases-link.d.ts.map +0 -1
- package/releases/t.d.ts.map +0 -1
- package/storage/client.d.ts.map +0 -1
- package/storage/hub.d.ts.map +0 -1
- package/storage/lib/client.d.ts.map +0 -1
- package/storage/lib/hub.d.ts.map +0 -1
- package/storage/useM2mAuth.d.ts.map +0 -1
package/notification/api.js
CHANGED
|
@@ -1,66 +1,164 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
'use client'
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/notification/api.ts
|
|
22
|
+
var api_exports = {};
|
|
23
|
+
__export(api_exports, {
|
|
24
|
+
requestSubscribe: () => requestSubscribe,
|
|
25
|
+
requestUnSubscribe: () => requestUnSubscribe,
|
|
26
|
+
requestUpdateNotificationStatusToRead: () => requestUpdateNotificationStatusToRead
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(api_exports);
|
|
29
|
+
var import_matsuri_hooks = require("matsuri-hooks");
|
|
30
|
+
|
|
31
|
+
// src/endpoints/m2m-notifications.v1.ts
|
|
32
|
+
var root = () => {
|
|
33
|
+
let __root = "";
|
|
34
|
+
if (globalThis.M2M_COMPONENTS_ENV === "local") {
|
|
35
|
+
__root = "";
|
|
36
|
+
}
|
|
37
|
+
if (globalThis.M2M_COMPONENTS_ENV === "localDev") {
|
|
38
|
+
__root = "";
|
|
39
|
+
}
|
|
40
|
+
if (globalThis.M2M_COMPONENTS_ENV === "development") {
|
|
41
|
+
__root = "https://api-notifications.dev.m2msystems.cloud";
|
|
42
|
+
}
|
|
43
|
+
if (globalThis.M2M_COMPONENTS_ENV === "production") {
|
|
44
|
+
__root = "https://api-notifications.m2msystems.cloud";
|
|
45
|
+
}
|
|
46
|
+
return __root;
|
|
47
|
+
};
|
|
48
|
+
var healthCheck = () => {
|
|
49
|
+
const __root = root();
|
|
50
|
+
const __queries = Object.entries({}).filter(([_, value]) => {
|
|
51
|
+
return value !== void 0;
|
|
52
|
+
}).map(([key, value]) => {
|
|
53
|
+
return `${key}=${value}`;
|
|
54
|
+
}).join("&");
|
|
55
|
+
const __path = `${__root}/${`health_check`}`;
|
|
56
|
+
return __queries ? `${__path}?${__queries}` : __path;
|
|
57
|
+
};
|
|
58
|
+
var registerNotification = () => {
|
|
59
|
+
const __root = root();
|
|
60
|
+
const __queries = Object.entries({}).filter(([_, value]) => {
|
|
61
|
+
return value !== void 0;
|
|
62
|
+
}).map(([key, value]) => {
|
|
63
|
+
return `${key}=${value}`;
|
|
64
|
+
}).join("&");
|
|
65
|
+
const __path = `${__root}/${`notifications`}`;
|
|
66
|
+
return __queries ? `${__path}?${__queries}` : __path;
|
|
67
|
+
};
|
|
68
|
+
var findNotificationsByServiceId = ({ id }) => {
|
|
69
|
+
const __root = root();
|
|
70
|
+
const __queries = Object.entries({}).filter(([_, value]) => {
|
|
71
|
+
return value !== void 0;
|
|
72
|
+
}).map(([key, value]) => {
|
|
73
|
+
return `${key}=${value}`;
|
|
74
|
+
}).join("&");
|
|
75
|
+
const __path = `${__root}/${`notifications/by_service_id/${id}`}`;
|
|
76
|
+
return __queries ? `${__path}?${__queries}` : __path;
|
|
77
|
+
};
|
|
78
|
+
var updateNotificationStatus = ({ id }) => {
|
|
79
|
+
const __root = root();
|
|
80
|
+
const __queries = Object.entries({}).filter(([_, value]) => {
|
|
81
|
+
return value !== void 0;
|
|
82
|
+
}).map(([key, value]) => {
|
|
83
|
+
return `${key}=${value}`;
|
|
84
|
+
}).join("&");
|
|
85
|
+
const __path = `${__root}/${`notifications/${id}`}`;
|
|
86
|
+
return __queries ? `${__path}?${__queries}` : __path;
|
|
87
|
+
};
|
|
88
|
+
var saveSubscription = () => {
|
|
89
|
+
const __root = root();
|
|
90
|
+
const __queries = Object.entries({}).filter(([_, value]) => {
|
|
91
|
+
return value !== void 0;
|
|
92
|
+
}).map(([key, value]) => {
|
|
93
|
+
return `${key}=${value}`;
|
|
94
|
+
}).join("&");
|
|
95
|
+
const __path = `${__root}/${`subscriptions`}`;
|
|
96
|
+
return __queries ? `${__path}?${__queries}` : __path;
|
|
97
|
+
};
|
|
98
|
+
var findMySubscriptions = () => {
|
|
99
|
+
const __root = root();
|
|
100
|
+
const __queries = Object.entries({}).filter(([_, value]) => {
|
|
101
|
+
return value !== void 0;
|
|
102
|
+
}).map(([key, value]) => {
|
|
103
|
+
return `${key}=${value}`;
|
|
104
|
+
}).join("&");
|
|
105
|
+
const __path = `${__root}/${`subscriptions`}`;
|
|
106
|
+
return __queries ? `${__path}?${__queries}` : __path;
|
|
107
|
+
};
|
|
108
|
+
var m2mNotifications_v1 = {
|
|
109
|
+
healthCheck,
|
|
110
|
+
registerNotification,
|
|
111
|
+
findNotificationsByServiceId,
|
|
112
|
+
updateNotificationStatus,
|
|
113
|
+
saveSubscription,
|
|
114
|
+
findMySubscriptions
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// src/notification/api.ts
|
|
118
|
+
var requestUpdateNotificationStatusToRead = async (token, id) => {
|
|
119
|
+
await (0, import_matsuri_hooks.fetcher)(
|
|
120
|
+
m2mNotifications_v1.updateNotificationStatus({
|
|
13
121
|
id
|
|
14
|
-
}),
|
|
122
|
+
}),
|
|
123
|
+
{
|
|
15
124
|
method: "PUT",
|
|
16
125
|
token,
|
|
17
|
-
body: JSON.stringify({
|
|
18
|
-
status: "read"
|
|
19
|
-
})
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
return function requestUpdateNotificationStatusToRead(_x, _x2) {
|
|
23
|
-
return _ref.apply(this, arguments);
|
|
24
|
-
};
|
|
25
|
-
}();
|
|
26
|
-
export var requestSubscribe = /*#__PURE__*/function () {
|
|
27
|
-
var _ref2 = _asyncToGenerator(function* (token, serviceId, input) {
|
|
28
|
-
var {
|
|
29
|
-
error
|
|
30
|
-
} = yield fetcher(m2mNotifications_v1.saveSubscription(), {
|
|
31
|
-
method: "POST",
|
|
32
|
-
token,
|
|
33
|
-
body: JSON.stringify(_objectSpread(_objectSpread({}, input), {}, {
|
|
34
|
-
serviceId,
|
|
35
|
-
status: "subscribed"
|
|
36
|
-
}))
|
|
37
|
-
});
|
|
38
|
-
if (error) {
|
|
39
|
-
console.error(error);
|
|
126
|
+
body: JSON.stringify({ status: "read" })
|
|
40
127
|
}
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
var requestSubscribe = async (token, serviceId, input) => {
|
|
131
|
+
const { error } = await (0, import_matsuri_hooks.fetcher)(m2mNotifications_v1.saveSubscription(), {
|
|
132
|
+
method: "POST",
|
|
133
|
+
token,
|
|
134
|
+
body: JSON.stringify({
|
|
135
|
+
...input,
|
|
136
|
+
serviceId,
|
|
137
|
+
status: "subscribed"
|
|
138
|
+
})
|
|
41
139
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
status: "denied"
|
|
56
|
-
}))
|
|
57
|
-
});
|
|
58
|
-
if (error) {
|
|
59
|
-
console.error(error);
|
|
60
|
-
}
|
|
140
|
+
if (error) {
|
|
141
|
+
console.error(error);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
var requestUnSubscribe = async (token, serviceId, input) => {
|
|
145
|
+
const { error } = await (0, import_matsuri_hooks.fetcher)(m2mNotifications_v1.saveSubscription(), {
|
|
146
|
+
method: "POST",
|
|
147
|
+
token,
|
|
148
|
+
body: JSON.stringify({
|
|
149
|
+
...input,
|
|
150
|
+
serviceId,
|
|
151
|
+
status: "denied"
|
|
152
|
+
})
|
|
61
153
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
}
|
|
154
|
+
if (error) {
|
|
155
|
+
console.error(error);
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
159
|
+
0 && (module.exports = {
|
|
160
|
+
requestSubscribe,
|
|
161
|
+
requestUnSubscribe,
|
|
162
|
+
requestUpdateNotificationStatusToRead
|
|
163
|
+
});
|
|
66
164
|
//# sourceMappingURL=api.js.map
|
package/notification/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/notification/api.ts","../../src/endpoints/m2m-notifications.v1.ts"],"sourcesContent":["import { Subscription } from \"./domain\";\nimport { fetcher } from \"matsuri-hooks\";\nimport { m2mNotifications_v1 } from \"../endpoints/m2m-notifications.v1\";\n\nexport const requestUpdateNotificationStatusToRead = async (\n token: string,\n id: string\n) => {\n await fetcher(\n m2mNotifications_v1.updateNotificationStatus({\n id,\n }),\n {\n method: \"PUT\",\n token,\n body: JSON.stringify({ status: \"read\" }),\n }\n );\n};\n\nexport const requestSubscribe = async (\n token: string,\n serviceId: string,\n input: Pick<Subscription, \"notificationType\" | \"resourceSubscription\">\n) => {\n const { error } = await fetcher(m2mNotifications_v1.saveSubscription(), {\n method: \"POST\",\n token,\n body: JSON.stringify({\n ...input,\n serviceId,\n status: \"subscribed\",\n }),\n });\n if (error) {\n console.error(error);\n }\n};\n\nexport const requestUnSubscribe = async (\n token: string,\n serviceId: string,\n input: Pick<Subscription, \"notificationType\" | \"resourceSubscription\">\n) => {\n const { error } = await fetcher(m2mNotifications_v1.saveSubscription(), {\n method: \"POST\",\n token,\n body: JSON.stringify({\n ...input,\n serviceId,\n status: \"denied\",\n }),\n });\n if (error) {\n console.error(error);\n }\n};\n","/* eslint-disable */\n/**\n * A function that returns the URL part common to the endpoints.\n */\nexport const root = () => {\n let __root = \"\";\n\n if (globalThis.M2M_COMPONENTS_ENV === \"local\") {\n __root = \"\";\n }\n\n if (globalThis.M2M_COMPONENTS_ENV === \"localDev\") {\n __root = \"\";\n }\n\n if (globalThis.M2M_COMPONENTS_ENV === \"development\") {\n __root = \"https://api-notifications.dev.m2msystems.cloud\";\n }\n\n if (globalThis.M2M_COMPONENTS_ENV === \"production\") {\n __root = \"https://api-notifications.m2msystems.cloud\";\n }\n\n return __root;\n};\n/**\n * health check\n *\n */\nexport const healthCheck = () => {\n const __root = root();\n const __queries = Object.entries({})\n .filter(([_, value]) => {\n return value !== undefined;\n })\n .map(([key, value]) => {\n return `${key}=${value}`;\n })\n .join(\"&\");\n const __path = `${__root}/${`health_check`}`;\n return __queries ? `${__path}?${__queries}` : __path;\n};\n\n/**\n * 通知を登録する\n *\n */\nexport const registerNotification = () => {\n const __root = root();\n const __queries = Object.entries({})\n .filter(([_, value]) => {\n return value !== undefined;\n })\n .map(([key, value]) => {\n return `${key}=${value}`;\n })\n .join(\"&\");\n const __path = `${__root}/${`notifications`}`;\n return __queries ? `${__path}?${__queries}` : __path;\n};\n\n/**\n * 自分宛の通知をserviceIdを使って取得する\n *\n */\nexport const findNotificationsByServiceId = ({ id }: { id: string }) => {\n const __root = root();\n const __queries = Object.entries({})\n .filter(([_, value]) => {\n return value !== undefined;\n })\n .map(([key, value]) => {\n return `${key}=${value}`;\n })\n .join(\"&\");\n const __path = `${__root}/${`notifications/by_service_id/${id}`}`;\n return __queries ? `${__path}?${__queries}` : __path;\n};\n\n/**\n * 通知のステータスを更新する\n *\n */\nexport const updateNotificationStatus = ({ id }: { id: string }) => {\n const __root = root();\n const __queries = Object.entries({})\n .filter(([_, value]) => {\n return value !== undefined;\n })\n .map(([key, value]) => {\n return `${key}=${value}`;\n })\n .join(\"&\");\n const __path = `${__root}/${`notifications/${id}`}`;\n return __queries ? `${__path}?${__queries}` : __path;\n};\n\n/**\n * 通知の購読を更新する\n *\n */\nexport const saveSubscription = () => {\n const __root = root();\n const __queries = Object.entries({})\n .filter(([_, value]) => {\n return value !== undefined;\n })\n .map(([key, value]) => {\n return `${key}=${value}`;\n })\n .join(\"&\");\n const __path = `${__root}/${`subscriptions`}`;\n return __queries ? `${__path}?${__queries}` : __path;\n};\n\n/**\n * 自分の購読している通知を取得する\n *\n */\nexport const findMySubscriptions = () => {\n const __root = root();\n const __queries = Object.entries({})\n .filter(([_, value]) => {\n return value !== undefined;\n })\n .map(([key, value]) => {\n return `${key}=${value}`;\n })\n .join(\"&\");\n const __path = `${__root}/${`subscriptions`}`;\n return __queries ? `${__path}?${__queries}` : __path;\n};\nexport const m2mNotifications_v1 = {\n healthCheck,\n registerNotification,\n findNotificationsByServiceId,\n updateNotificationStatus,\n saveSubscription,\n findMySubscriptions,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,2BAAwB;;;ACGjB,IAAM,OAAO,MAAM;AACxB,MAAI,SAAS;AAEb,MAAI,WAAW,uBAAuB,SAAS;AAC7C,aAAS;AAAA,EACX;AAEA,MAAI,WAAW,uBAAuB,YAAY;AAChD,aAAS;AAAA,EACX;AAEA,MAAI,WAAW,uBAAuB,eAAe;AACnD,aAAS;AAAA,EACX;AAEA,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;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ADvIO,IAAM,wCAAwC,OACnD,OACA,OACG;AACH,YAAM;AAAA,IACJ,oBAAoB,yBAAyB;AAAA,MAC3C;AAAA,IACF,CAAC;AAAA,IACD;AAAA,MACE,QAAQ;AAAA,MACR;AAAA,MACA,MAAM,KAAK,UAAU,EAAE,QAAQ,OAAO,CAAC;AAAA,IACzC;AAAA,EACF;AACF;AAEO,IAAM,mBAAmB,OAC9B,OACA,WACA,UACG;AACH,QAAM,EAAE,MAAM,IAAI,UAAM,8BAAQ,oBAAoB,iBAAiB,GAAG;AAAA,IACtE,QAAQ;AAAA,IACR;AAAA,IACA,MAAM,KAAK,UAAU;AAAA,MACnB,GAAG;AAAA,MACH;AAAA,MACA,QAAQ;AAAA,IACV,CAAC;AAAA,EACH,CAAC;AACD,MAAI,OAAO;AACT,YAAQ,MAAM,KAAK;AAAA,EACrB;AACF;AAEO,IAAM,qBAAqB,OAChC,OACA,WACA,UACG;AACH,QAAM,EAAE,MAAM,IAAI,UAAM,8BAAQ,oBAAoB,iBAAiB,GAAG;AAAA,IACtE,QAAQ;AAAA,IACR;AAAA,IACA,MAAM,KAAK,UAAU;AAAA,MACnB,GAAG;AAAA,MACH;AAAA,MACA,QAAQ;AAAA,IACV,CAAC;AAAA,EACH,CAAC;AACD,MAAI,OAAO;AACT,YAAQ,MAAM,KAAK;AAAA,EACrB;AACF;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import {
|
|
3
|
+
requestSubscribe,
|
|
4
|
+
requestUnSubscribe,
|
|
5
|
+
requestUpdateNotificationStatusToRead
|
|
6
|
+
} from "../chunk-V4ROE7DI.mjs";
|
|
7
|
+
import "../chunk-ISOF65DB.mjs";
|
|
8
|
+
import "../chunk-JUBOAWNR.mjs";
|
|
9
|
+
export {
|
|
10
|
+
requestSubscribe,
|
|
11
|
+
requestUnSubscribe,
|
|
12
|
+
requestUpdateNotificationStatusToRead
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=api.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface Notification {
|
|
2
|
+
createdAt: number;
|
|
3
|
+
id: string;
|
|
4
|
+
message: string;
|
|
5
|
+
notificationType: string;
|
|
6
|
+
resourceId: string;
|
|
7
|
+
serviceId: string;
|
|
8
|
+
status: "unread" | "read";
|
|
9
|
+
userId: string;
|
|
10
|
+
}
|
|
11
|
+
interface ResourceSubscription {
|
|
12
|
+
resourceSelectType: "specific" | "any";
|
|
13
|
+
resourceId: string;
|
|
14
|
+
}
|
|
15
|
+
type SubscriptionStatus = "default" | "subscribed" | "denied";
|
|
16
|
+
interface Subscription {
|
|
17
|
+
userId: string;
|
|
18
|
+
serviceId: string;
|
|
19
|
+
notificationType: string;
|
|
20
|
+
resourceSubscription: ResourceSubscription;
|
|
21
|
+
status: SubscriptionStatus;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { Notification, ResourceSubscription, Subscription, SubscriptionStatus };
|
package/notification/domain.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
interface Notification {
|
|
2
2
|
createdAt: number;
|
|
3
3
|
id: string;
|
|
4
4
|
message: string;
|
|
@@ -8,16 +8,17 @@ export interface Notification {
|
|
|
8
8
|
status: "unread" | "read";
|
|
9
9
|
userId: string;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
interface ResourceSubscription {
|
|
12
12
|
resourceSelectType: "specific" | "any";
|
|
13
13
|
resourceId: string;
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
type SubscriptionStatus = "default" | "subscribed" | "denied";
|
|
16
|
+
interface Subscription {
|
|
17
17
|
userId: string;
|
|
18
18
|
serviceId: string;
|
|
19
19
|
notificationType: string;
|
|
20
20
|
resourceSubscription: ResourceSubscription;
|
|
21
21
|
status: SubscriptionStatus;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
export { Notification, ResourceSubscription, Subscription, SubscriptionStatus };
|
package/notification/domain.js
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
'use client'
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
|
|
17
|
+
// src/notification/domain.ts
|
|
18
|
+
var domain_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(domain_exports);
|
|
2
20
|
//# sourceMappingURL=domain.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/notification/domain.ts"],"sourcesContent":["export interface Notification {\n createdAt: number;\n id: string;\n message: string;\n notificationType: string;\n resourceId: string;\n serviceId: string;\n status: \"unread\" | \"read\";\n userId: string;\n}\n\nexport interface ResourceSubscription {\n resourceSelectType: \"specific\" | \"any\";\n resourceId: string;\n}\n\nexport type SubscriptionStatus = \"default\" | \"subscribed\" | \"denied\";\n\nexport interface Subscription {\n userId: string;\n serviceId: string;\n notificationType: string;\n resourceSubscription: ResourceSubscription;\n status: SubscriptionStatus;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Notification, ResourceSubscription, Subscription, SubscriptionStatus } from './domain.mjs';
|
|
2
|
+
export { requestSubscribe, requestUnSubscribe, requestUpdateNotificationStatusToRead } from './api.mjs';
|
|
3
|
+
export { ServiceIdProvider, useServiceId } from './ServiceIdProvider.mjs';
|
|
4
|
+
export { NotificationsProvider, useNotificationPermission, useNotifications } from './NotificationProvider.mjs';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'react';
|
package/notification/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
|
|
1
|
+
export { Notification, ResourceSubscription, Subscription, SubscriptionStatus } from './domain.js';
|
|
2
|
+
export { requestSubscribe, requestUnSubscribe, requestUpdateNotificationStatusToRead } from './api.js';
|
|
3
|
+
export { ServiceIdProvider, useServiceId } from './ServiceIdProvider.js';
|
|
4
|
+
export { NotificationsProvider, useNotificationPermission, useNotifications } from './NotificationProvider.js';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import 'react';
|