@serve.zone/interfaces 17.3.0 → 17.5.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.
Files changed (39) hide show
  1. package/changelog.md +18 -0
  2. package/dist_ts/00_commitinfo_data.js +1 -1
  3. package/dist_ts/appstore/types.d.ts +76 -1
  4. package/dist_ts/appstore/types.js +7 -2
  5. package/dist_ts/data/deploymentoperation.js +5 -3
  6. package/dist_ts/data/deploymentpreflight.d.ts +2 -2
  7. package/dist_ts/data/gateway.d.ts +9 -0
  8. package/dist_ts/data/index.d.ts +1 -0
  9. package/dist_ts/data/index.js +2 -1
  10. package/dist_ts/data/service.d.ts +2 -0
  11. package/dist_ts/data/service.js +1 -1
  12. package/dist_ts/data/webpush.d.ts +106 -0
  13. package/dist_ts/data/webpush.js +2 -0
  14. package/dist_ts/platform/index.d.ts +3 -1
  15. package/dist_ts/platform/index.js +4 -2
  16. package/dist_ts/platform/pushnotification.d.ts +1 -0
  17. package/dist_ts/platform/storage.d.ts +185 -0
  18. package/dist_ts/platform/storage.js +8 -0
  19. package/dist_ts/platformservice/pushnotification.d.ts +1 -0
  20. package/dist_ts/requests/index.d.ts +3 -1
  21. package/dist_ts/requests/index.js +4 -2
  22. package/dist_ts/requests/webpush.d.ts +132 -0
  23. package/dist_ts/requests/webpush.js +2 -0
  24. package/package.json +1 -1
  25. package/readme.md +112 -1
  26. package/ts/00_commitinfo_data.ts +1 -1
  27. package/ts/appstore/types.ts +104 -1
  28. package/ts/data/deploymentoperation.ts +4 -2
  29. package/ts/data/deploymentpreflight.ts +2 -2
  30. package/ts/data/gateway.ts +9 -0
  31. package/ts/data/index.ts +1 -0
  32. package/ts/data/service.ts +2 -0
  33. package/ts/data/webpush.ts +133 -0
  34. package/ts/platform/index.ts +3 -0
  35. package/ts/platform/pushnotification.ts +1 -0
  36. package/ts/platform/storage.ts +237 -0
  37. package/ts/platformservice/pushnotification.ts +1 -0
  38. package/ts/requests/index.ts +3 -0
  39. package/ts/requests/webpush.ts +184 -0
@@ -0,0 +1,184 @@
1
+ import * as plugins from '../plugins.js';
2
+ import type { IIdentity } from '../data/user.js';
3
+ import type {
4
+ IWebPushBinding,
5
+ IWebPushCredentialOneTimeSecret,
6
+ IWebPushDeliveryStatus,
7
+ IWebPushNotificationPayload,
8
+ IWebPushResourceOwner,
9
+ IWebPushServiceStatus,
10
+ IWebPushSubscription,
11
+ TWebPushCancellationTarget,
12
+ TWebPushUrgency,
13
+ } from '../data/webpush.js';
14
+
15
+ /** Control-plane authentication. Never accepted by application delivery RPCs. */
16
+ export interface IWebPushControlRequestAuth {
17
+ identity?: IIdentity;
18
+ apiToken?: string;
19
+ }
20
+
21
+ /** Required service credential. Owner scope is resolved exclusively from it. */
22
+ export interface IWebPushAppCredentialAuth {
23
+ credentialId: string;
24
+ credentialSecret: string;
25
+ identity?: never;
26
+ apiToken?: never;
27
+ }
28
+
29
+ export type TWebPushBindingSync = Omit<
30
+ IWebPushBinding,
31
+ 'id' | 'status' | 'credential' | 'vapidKeys' | 'createdAt' | 'updatedAt' | 'createdBy'
32
+ > & {
33
+ id?: string;
34
+ };
35
+
36
+ export interface IReq_ListWebPushBindings extends plugins.typedrequestInterfaces.implementsTR<
37
+ plugins.typedrequestInterfaces.ITypedRequest,
38
+ IReq_ListWebPushBindings
39
+ > {
40
+ method: 'listWebPushBindings';
41
+ request: {
42
+ auth: IWebPushControlRequestAuth;
43
+ owner?: Partial<IWebPushResourceOwner>;
44
+ };
45
+ response: {
46
+ bindings: IWebPushBinding[];
47
+ };
48
+ }
49
+
50
+ export interface IReq_SyncWebPushBinding extends plugins.typedrequestInterfaces.implementsTR<
51
+ plugins.typedrequestInterfaces.ITypedRequest,
52
+ IReq_SyncWebPushBinding
53
+ > {
54
+ method: 'syncWebPushBinding';
55
+ request: {
56
+ auth: IWebPushControlRequestAuth;
57
+ binding: TWebPushBindingSync;
58
+ };
59
+ response: {
60
+ success: boolean;
61
+ binding?: IWebPushBinding;
62
+ credential?: IWebPushCredentialOneTimeSecret;
63
+ message?: string;
64
+ };
65
+ }
66
+
67
+ export interface IReq_DeleteWebPushBinding extends plugins.typedrequestInterfaces.implementsTR<
68
+ plugins.typedrequestInterfaces.ITypedRequest,
69
+ IReq_DeleteWebPushBinding
70
+ > {
71
+ method: 'deleteWebPushBinding';
72
+ request: {
73
+ auth: IWebPushControlRequestAuth;
74
+ id: string;
75
+ };
76
+ response: {
77
+ success: boolean;
78
+ message?: string;
79
+ };
80
+ }
81
+
82
+ export interface IReq_RotateWebPushCredential extends plugins.typedrequestInterfaces.implementsTR<
83
+ plugins.typedrequestInterfaces.ITypedRequest,
84
+ IReq_RotateWebPushCredential
85
+ > {
86
+ method: 'rotateWebPushCredential';
87
+ request: {
88
+ auth: IWebPushControlRequestAuth;
89
+ credentialId: string;
90
+ };
91
+ response: {
92
+ success: boolean;
93
+ credential?: IWebPushCredentialOneTimeSecret;
94
+ message?: string;
95
+ };
96
+ }
97
+
98
+ export interface IReq_RotateWebPushVapidKey extends plugins.typedrequestInterfaces.implementsTR<
99
+ plugins.typedrequestInterfaces.ITypedRequest,
100
+ IReq_RotateWebPushVapidKey
101
+ > {
102
+ method: 'rotateWebPushVapidKey';
103
+ request: {
104
+ auth: IWebPushControlRequestAuth;
105
+ bindingId: string;
106
+ };
107
+ response: {
108
+ success: boolean;
109
+ binding?: IWebPushBinding;
110
+ message?: string;
111
+ };
112
+ }
113
+
114
+ export interface IReq_GetWebPushServiceStatus extends plugins.typedrequestInterfaces.implementsTR<
115
+ plugins.typedrequestInterfaces.ITypedRequest,
116
+ IReq_GetWebPushServiceStatus
117
+ > {
118
+ method: 'getWebPushServiceStatus';
119
+ request: {
120
+ auth: IWebPushAppCredentialAuth;
121
+ owner?: never;
122
+ };
123
+ response: IWebPushServiceStatus;
124
+ }
125
+
126
+ export interface IReq_EnqueueWebPush extends plugins.typedrequestInterfaces.implementsTR<
127
+ plugins.typedrequestInterfaces.ITypedRequest,
128
+ IReq_EnqueueWebPush
129
+ > {
130
+ method: 'enqueueWebPush';
131
+ request: {
132
+ auth: IWebPushAppCredentialAuth;
133
+ /** Required credential-scoped replay key. */
134
+ idempotencyKey: string;
135
+ /** Opaque application identity; never a raw endpoint. */
136
+ subscriptionId: string;
137
+ subscription: IWebPushSubscription;
138
+ vapidKeyId: string;
139
+ payload: IWebPushNotificationPayload;
140
+ ttlSeconds?: number;
141
+ urgency?: TWebPushUrgency;
142
+ /** Provider derives an opaque RFC Topic HMAC; this value is never sent raw. */
143
+ collapseKey?: string;
144
+ owner?: never;
145
+ };
146
+ response: {
147
+ accepted: boolean;
148
+ spoolItemId?: string;
149
+ message?: string;
150
+ };
151
+ }
152
+
153
+ export interface IReq_CancelWebPush extends plugins.typedrequestInterfaces.implementsTR<
154
+ plugins.typedrequestInterfaces.ITypedRequest,
155
+ IReq_CancelWebPush
156
+ > {
157
+ method: 'cancelWebPush';
158
+ request: {
159
+ auth: IWebPushAppCredentialAuth;
160
+ target: TWebPushCancellationTarget;
161
+ owner?: never;
162
+ };
163
+ response: {
164
+ success: boolean;
165
+ cancelledCount: number;
166
+ alreadyTerminalCount: number;
167
+ message?: string;
168
+ };
169
+ }
170
+
171
+ export interface IReq_GetWebPushDeliveryStatus extends plugins.typedrequestInterfaces.implementsTR<
172
+ plugins.typedrequestInterfaces.ITypedRequest,
173
+ IReq_GetWebPushDeliveryStatus
174
+ > {
175
+ method: 'getWebPushDeliveryStatus';
176
+ request: {
177
+ auth: IWebPushAppCredentialAuth;
178
+ spoolItemId: string;
179
+ owner?: never;
180
+ };
181
+ response: {
182
+ delivery?: IWebPushDeliveryStatus;
183
+ };
184
+ }