@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.
- package/changelog.md +18 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/appstore/types.d.ts +76 -1
- package/dist_ts/appstore/types.js +7 -2
- package/dist_ts/data/deploymentoperation.js +5 -3
- package/dist_ts/data/deploymentpreflight.d.ts +2 -2
- package/dist_ts/data/gateway.d.ts +9 -0
- package/dist_ts/data/index.d.ts +1 -0
- package/dist_ts/data/index.js +2 -1
- package/dist_ts/data/service.d.ts +2 -0
- package/dist_ts/data/service.js +1 -1
- package/dist_ts/data/webpush.d.ts +106 -0
- package/dist_ts/data/webpush.js +2 -0
- package/dist_ts/platform/index.d.ts +3 -1
- package/dist_ts/platform/index.js +4 -2
- package/dist_ts/platform/pushnotification.d.ts +1 -0
- package/dist_ts/platform/storage.d.ts +185 -0
- package/dist_ts/platform/storage.js +8 -0
- package/dist_ts/platformservice/pushnotification.d.ts +1 -0
- package/dist_ts/requests/index.d.ts +3 -1
- package/dist_ts/requests/index.js +4 -2
- package/dist_ts/requests/webpush.d.ts +132 -0
- package/dist_ts/requests/webpush.js +2 -0
- package/package.json +1 -1
- package/readme.md +112 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/appstore/types.ts +104 -1
- package/ts/data/deploymentoperation.ts +4 -2
- package/ts/data/deploymentpreflight.ts +2 -2
- package/ts/data/gateway.ts +9 -0
- package/ts/data/index.ts +1 -0
- package/ts/data/service.ts +2 -0
- package/ts/data/webpush.ts +133 -0
- package/ts/platform/index.ts +3 -0
- package/ts/platform/pushnotification.ts +1 -0
- package/ts/platform/storage.ts +237 -0
- package/ts/platformservice/pushnotification.ts +1 -0
- package/ts/requests/index.ts +3 -0
- package/ts/requests/webpush.ts +184 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend-neutral storage vocabulary shared by App Store manifests, control
|
|
3
|
+
* planes, and fulfillment adapters. Physical providers and runtime attachment
|
|
4
|
+
* details intentionally do not belong in these contracts.
|
|
5
|
+
*/
|
|
6
|
+
export type TStorageResourceKind = 'filesystem' | 'objectStorage';
|
|
7
|
+
/**
|
|
8
|
+
* Compatibility bridge for the existing generic platform capability. New
|
|
9
|
+
* filesystem requests intentionally have no generic IPlatformBinding mapping.
|
|
10
|
+
*/
|
|
11
|
+
export declare const storageKindPlatformCapabilityIds: {
|
|
12
|
+
readonly objectStorage: "objectstorage";
|
|
13
|
+
};
|
|
14
|
+
export type TFilesystemStorageAccessMode = 'ReadWriteOnce' | 'ReadOnlyMany' | 'ReadWriteMany';
|
|
15
|
+
export type TObjectStorageAccessMode = 'readOnly' | 'readWrite';
|
|
16
|
+
export type TStoragePerformanceTier = 'standard' | 'highIops' | 'capacity';
|
|
17
|
+
export type TStorageDurability = 'ephemeral' | 'persistent';
|
|
18
|
+
export type TStorageTopology = 'singleNode' | 'multiNode';
|
|
19
|
+
export type TStorageSnapshotMode = 'none' | 'portable' | 'native';
|
|
20
|
+
export type TStorageReclaimPolicy = 'retain' | 'delete';
|
|
21
|
+
/**
|
|
22
|
+
* A positive base-2 quantity written as an integer followed by KiB, MiB, GiB,
|
|
23
|
+
* or TiB, for example `20GiB`. Parsers must reject every other representation.
|
|
24
|
+
*/
|
|
25
|
+
export type TStorageCapacityQuantity = string;
|
|
26
|
+
export interface IStorageCapacityRequest {
|
|
27
|
+
request: TStorageCapacityQuantity;
|
|
28
|
+
/**
|
|
29
|
+
* A hard upper bound. A request with a limit can only be fulfilled by a
|
|
30
|
+
* class whose granted capabilities include hardQuota.
|
|
31
|
+
*/
|
|
32
|
+
limit?: TStorageCapacityQuantity;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* App-facing requirements describe policy, never a concrete provider class.
|
|
36
|
+
* Values in a `required` block are hard constraints; values in `preferred`
|
|
37
|
+
* influence selection but may not weaken required constraints.
|
|
38
|
+
*/
|
|
39
|
+
export interface IStorageClassRequirement {
|
|
40
|
+
performanceTier?: TStoragePerformanceTier;
|
|
41
|
+
durability?: TStorageDurability;
|
|
42
|
+
topology?: TStorageTopology;
|
|
43
|
+
hardQuota?: true;
|
|
44
|
+
snapshots?: Exclude<TStorageSnapshotMode, 'none'>;
|
|
45
|
+
backup?: true;
|
|
46
|
+
encryptedInTransit?: true;
|
|
47
|
+
}
|
|
48
|
+
export interface IStorageGrantedCapabilities {
|
|
49
|
+
performanceTier: TStoragePerformanceTier;
|
|
50
|
+
durability: TStorageDurability;
|
|
51
|
+
topology: TStorageTopology;
|
|
52
|
+
hardQuota: boolean;
|
|
53
|
+
snapshots: TStorageSnapshotMode;
|
|
54
|
+
backup: boolean;
|
|
55
|
+
encryptedInTransit: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface IStorageClassCapabilitiesBase {
|
|
58
|
+
/** Opaque operator-defined policy class ID, not a physical backend name. */
|
|
59
|
+
classId: string;
|
|
60
|
+
/** Changes whenever matching behavior or guarantees change. */
|
|
61
|
+
revision: string;
|
|
62
|
+
kind: TStorageResourceKind;
|
|
63
|
+
performanceTiers: TStoragePerformanceTier[];
|
|
64
|
+
durabilities: TStorageDurability[];
|
|
65
|
+
topologies: TStorageTopology[];
|
|
66
|
+
hardQuota: boolean;
|
|
67
|
+
snapshotModes: TStorageSnapshotMode[];
|
|
68
|
+
backup: boolean;
|
|
69
|
+
encryptedInTransit: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface IFilesystemStorageClassCapabilities extends IStorageClassCapabilitiesBase {
|
|
72
|
+
kind: 'filesystem';
|
|
73
|
+
accessModes: TFilesystemStorageAccessMode[];
|
|
74
|
+
}
|
|
75
|
+
export interface IObjectStorageClassCapabilities extends IStorageClassCapabilitiesBase {
|
|
76
|
+
kind: 'objectStorage';
|
|
77
|
+
accessModes: TObjectStorageAccessMode[];
|
|
78
|
+
versioning: boolean;
|
|
79
|
+
retention: boolean;
|
|
80
|
+
}
|
|
81
|
+
export type TStorageClassCapabilities = IFilesystemStorageClassCapabilities | IObjectStorageClassCapabilities;
|
|
82
|
+
/**
|
|
83
|
+
* Fulfillment adapters advertise only portable guarantees. Provider names,
|
|
84
|
+
* addresses, mount options, principals, and credential values are private.
|
|
85
|
+
*/
|
|
86
|
+
export interface IStorageCapabilityAdvertisement {
|
|
87
|
+
schemaVersion: 1;
|
|
88
|
+
featureIds: string[];
|
|
89
|
+
classes: TStorageClassCapabilities[];
|
|
90
|
+
}
|
|
91
|
+
export interface IObjectStorageEnvironmentDelivery {
|
|
92
|
+
type: 'environment';
|
|
93
|
+
/**
|
|
94
|
+
* Explicit target keys prevent two named bindings from silently overwriting
|
|
95
|
+
* each other. Every required field must have a distinct environment key.
|
|
96
|
+
*/
|
|
97
|
+
keys: {
|
|
98
|
+
endpoint: string;
|
|
99
|
+
bucket: string;
|
|
100
|
+
region: string;
|
|
101
|
+
accessKeyId: string;
|
|
102
|
+
secretAccessKey: string;
|
|
103
|
+
sessionToken?: string;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export interface IObjectStorageSecretFileDelivery {
|
|
107
|
+
type: 'secretFile';
|
|
108
|
+
/** Canonical absolute path below /run/secrets/. */
|
|
109
|
+
targetPath: string;
|
|
110
|
+
/**
|
|
111
|
+
* JSON object with endpoint, bucket, region, accessKeyId,
|
|
112
|
+
* secretAccessKey, and optional sessionToken fields.
|
|
113
|
+
*/
|
|
114
|
+
format: 'servezone-object-storage-v1';
|
|
115
|
+
}
|
|
116
|
+
export type TObjectStorageDelivery = IObjectStorageEnvironmentDelivery | IObjectStorageSecretFileDelivery;
|
|
117
|
+
export type TResolvedStorageBindingStatus = 'requested' | 'provisioning' | 'ready' | 'degraded' | 'failed' | 'releasing' | 'retained' | 'released';
|
|
118
|
+
export type TStorageBindingFailureCode = 'unsupportedCapability' | 'policyUnavailable' | 'provisionFailed' | 'attachmentFailed' | 'quotaExceeded' | 'credentialsUnavailable' | 'backendUnavailable' | 'migrationRequired';
|
|
119
|
+
export interface IStorageBindingFailure {
|
|
120
|
+
code: TStorageBindingFailureCode;
|
|
121
|
+
message: string;
|
|
122
|
+
retryable: boolean;
|
|
123
|
+
observedAt: number;
|
|
124
|
+
}
|
|
125
|
+
export interface IResolvedStoragePolicyRef {
|
|
126
|
+
/** Opaque operator-defined policy class ID selected for this request. */
|
|
127
|
+
classId: string;
|
|
128
|
+
revision: string;
|
|
129
|
+
}
|
|
130
|
+
export interface IResolvedStorageCapacity {
|
|
131
|
+
requested?: TStorageCapacityQuantity;
|
|
132
|
+
granted?: TStorageCapacityQuantity;
|
|
133
|
+
limit?: TStorageCapacityQuantity;
|
|
134
|
+
}
|
|
135
|
+
export interface IResolvedStorageBindingBase {
|
|
136
|
+
schemaVersion: 1;
|
|
137
|
+
/** Stable binding/allocation identity. */
|
|
138
|
+
id: string;
|
|
139
|
+
serviceId: string;
|
|
140
|
+
/** Stable App Store storageRequests[].id. */
|
|
141
|
+
requestId: string;
|
|
142
|
+
/**
|
|
143
|
+
* Canonical digest of the normalized request. Adapters use it to distinguish
|
|
144
|
+
* an idempotent reconciliation from a migration.
|
|
145
|
+
*/
|
|
146
|
+
requestDigest: string;
|
|
147
|
+
kind: TStorageResourceKind;
|
|
148
|
+
generation: number;
|
|
149
|
+
observedGeneration: number;
|
|
150
|
+
status: TResolvedStorageBindingStatus;
|
|
151
|
+
policy: IResolvedStoragePolicyRef;
|
|
152
|
+
capabilities: IStorageGrantedCapabilities;
|
|
153
|
+
/** Opaque resource identity; never a host path, export, or provider URL. */
|
|
154
|
+
resourceRef: string;
|
|
155
|
+
capacity?: IResolvedStorageCapacity;
|
|
156
|
+
failure?: IStorageBindingFailure;
|
|
157
|
+
createdAt?: number;
|
|
158
|
+
updatedAt?: number;
|
|
159
|
+
}
|
|
160
|
+
export interface IResolvedFilesystemStorageBinding extends IResolvedStorageBindingBase {
|
|
161
|
+
kind: 'filesystem';
|
|
162
|
+
mountPath: string;
|
|
163
|
+
accessMode: TFilesystemStorageAccessMode;
|
|
164
|
+
}
|
|
165
|
+
export interface IStorageObjectCredentialsRef {
|
|
166
|
+
secretBundleId: string;
|
|
167
|
+
accessKeyIdKey: string;
|
|
168
|
+
secretAccessKeyKey: string;
|
|
169
|
+
sessionTokenKey?: string;
|
|
170
|
+
}
|
|
171
|
+
export interface IResolvedObjectStorageConnection {
|
|
172
|
+
endpoint: string;
|
|
173
|
+
bucket: string;
|
|
174
|
+
region: string;
|
|
175
|
+
}
|
|
176
|
+
export interface IResolvedObjectStorageBinding extends IResolvedStorageBindingBase {
|
|
177
|
+
kind: 'objectStorage';
|
|
178
|
+
accessMode: TObjectStorageAccessMode;
|
|
179
|
+
connection: IResolvedObjectStorageConnection;
|
|
180
|
+
credentials: IStorageObjectCredentialsRef;
|
|
181
|
+
delivery: TObjectStorageDelivery;
|
|
182
|
+
versioning: boolean;
|
|
183
|
+
retentionDays?: number;
|
|
184
|
+
}
|
|
185
|
+
export type TResolvedStorageBinding = IResolvedFilesystemStorageBinding | IResolvedObjectStorageBinding;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility bridge for the existing generic platform capability. New
|
|
3
|
+
* filesystem requests intentionally have no generic IPlatformBinding mapping.
|
|
4
|
+
*/
|
|
5
|
+
export const storageKindPlatformCapabilityIds = {
|
|
6
|
+
objectStorage: 'objectstorage',
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL3BsYXRmb3JtL3N0b3JhZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBTUE7OztHQUdHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sZ0NBQWdDLEdBQUc7SUFDOUMsYUFBYSxFQUFFLGVBQWU7Q0FDdEIsQ0FBQyJ9
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as plugins from '../plugins.js';
|
|
2
|
+
/** @deprecated Use the credential-scoped requests.webpush contracts. */
|
|
2
3
|
export interface IRequest_SendPushNotification extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IRequest_SendPushNotification> {
|
|
3
4
|
method: 'sendPushNotification';
|
|
4
5
|
request: {
|
|
@@ -31,7 +31,9 @@ import * as settingsRequests from './settings.js';
|
|
|
31
31
|
import * as statusRequests from './status.js';
|
|
32
32
|
import * as taskRequests from './task.js';
|
|
33
33
|
import * as versionRequests from './version.js';
|
|
34
|
-
|
|
34
|
+
import * as webPushRequests from './webpush.js';
|
|
35
|
+
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, certificateRequests as certificate, clusterRequests as cluster, configRequests as config, corestoreRequests as corestore, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, gatewayRequests as gateway, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, platformRequests as platform, routingRequests as routing, secretBundleRequests as secretbundle, secretGroupRequests as secretgroup, serverRequests as server, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, };
|
|
35
36
|
export * from './inform.js';
|
|
36
37
|
export * from './hostedapp.js';
|
|
37
38
|
export * from './mail.js';
|
|
39
|
+
export * from './webpush.js';
|
|
@@ -32,8 +32,10 @@ import * as settingsRequests from './settings.js';
|
|
|
32
32
|
import * as statusRequests from './status.js';
|
|
33
33
|
import * as taskRequests from './task.js';
|
|
34
34
|
import * as versionRequests from './version.js';
|
|
35
|
-
|
|
35
|
+
import * as webPushRequests from './webpush.js';
|
|
36
|
+
export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, certificateRequests as certificate, clusterRequests as cluster, configRequests as config, corestoreRequests as corestore, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, gatewayRequests as gateway, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, platformRequests as platform, routingRequests as routing, secretBundleRequests as secretbundle, secretGroupRequests as secretgroup, serverRequests as server, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, };
|
|
36
37
|
export * from './inform.js';
|
|
37
38
|
export * from './hostedapp.js';
|
|
38
39
|
export * from './mail.js';
|
|
39
|
-
|
|
40
|
+
export * from './webpush.js';
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9yZXF1ZXN0cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQztBQUV6QyxPQUFPLEtBQUssYUFBYSxNQUFNLFlBQVksQ0FBQztBQUM1QyxPQUFPLEtBQUssZ0JBQWdCLE1BQU0sZUFBZSxDQUFDO0FBQ2xELE9BQU8sS0FBSyxpQkFBaUIsTUFBTSxnQkFBZ0IsQ0FBQztBQUNwRCxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssbUJBQW1CLE1BQU0sa0JBQWtCLENBQUM7QUFDeEQsT0FBTyxLQUFLLGVBQWUsTUFBTSxjQUFjLENBQUM7QUFDaEQsT0FBTyxLQUFLLGNBQWMsTUFBTSxhQUFhLENBQUM7QUFDOUMsT0FBTyxLQUFLLGlCQUFpQixNQUFNLGdCQUFnQix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SxPQUFPLEVBQzFCLGdCQUFnQixJQUFJLFFBQVEsRUFDNUIsY0FBYyxJQUFJLE1BQU0sRUFDeEIsWUFBWSxJQUFJLElBQUksRUFDcEIsZUFBZSxJQUFJLE9BQU8sRUFDMUIsZUFBZSxJQUFJLE9BQU8sR0FDM0IsQ0FBQztBQUVGLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxjQUFjLENBQUMifQ==
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import type { IIdentity } from '../data/user.js';
|
|
3
|
+
import type { IWebPushBinding, IWebPushCredentialOneTimeSecret, IWebPushDeliveryStatus, IWebPushNotificationPayload, IWebPushResourceOwner, IWebPushServiceStatus, IWebPushSubscription, TWebPushCancellationTarget, TWebPushUrgency } from '../data/webpush.js';
|
|
4
|
+
/** Control-plane authentication. Never accepted by application delivery RPCs. */
|
|
5
|
+
export interface IWebPushControlRequestAuth {
|
|
6
|
+
identity?: IIdentity;
|
|
7
|
+
apiToken?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Required service credential. Owner scope is resolved exclusively from it. */
|
|
10
|
+
export interface IWebPushAppCredentialAuth {
|
|
11
|
+
credentialId: string;
|
|
12
|
+
credentialSecret: string;
|
|
13
|
+
identity?: never;
|
|
14
|
+
apiToken?: never;
|
|
15
|
+
}
|
|
16
|
+
export type TWebPushBindingSync = Omit<IWebPushBinding, 'id' | 'status' | 'credential' | 'vapidKeys' | 'createdAt' | 'updatedAt' | 'createdBy'> & {
|
|
17
|
+
id?: string;
|
|
18
|
+
};
|
|
19
|
+
export interface IReq_ListWebPushBindings extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_ListWebPushBindings> {
|
|
20
|
+
method: 'listWebPushBindings';
|
|
21
|
+
request: {
|
|
22
|
+
auth: IWebPushControlRequestAuth;
|
|
23
|
+
owner?: Partial<IWebPushResourceOwner>;
|
|
24
|
+
};
|
|
25
|
+
response: {
|
|
26
|
+
bindings: IWebPushBinding[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface IReq_SyncWebPushBinding extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_SyncWebPushBinding> {
|
|
30
|
+
method: 'syncWebPushBinding';
|
|
31
|
+
request: {
|
|
32
|
+
auth: IWebPushControlRequestAuth;
|
|
33
|
+
binding: TWebPushBindingSync;
|
|
34
|
+
};
|
|
35
|
+
response: {
|
|
36
|
+
success: boolean;
|
|
37
|
+
binding?: IWebPushBinding;
|
|
38
|
+
credential?: IWebPushCredentialOneTimeSecret;
|
|
39
|
+
message?: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface IReq_DeleteWebPushBinding extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_DeleteWebPushBinding> {
|
|
43
|
+
method: 'deleteWebPushBinding';
|
|
44
|
+
request: {
|
|
45
|
+
auth: IWebPushControlRequestAuth;
|
|
46
|
+
id: string;
|
|
47
|
+
};
|
|
48
|
+
response: {
|
|
49
|
+
success: boolean;
|
|
50
|
+
message?: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface IReq_RotateWebPushCredential extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RotateWebPushCredential> {
|
|
54
|
+
method: 'rotateWebPushCredential';
|
|
55
|
+
request: {
|
|
56
|
+
auth: IWebPushControlRequestAuth;
|
|
57
|
+
credentialId: string;
|
|
58
|
+
};
|
|
59
|
+
response: {
|
|
60
|
+
success: boolean;
|
|
61
|
+
credential?: IWebPushCredentialOneTimeSecret;
|
|
62
|
+
message?: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface IReq_RotateWebPushVapidKey extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RotateWebPushVapidKey> {
|
|
66
|
+
method: 'rotateWebPushVapidKey';
|
|
67
|
+
request: {
|
|
68
|
+
auth: IWebPushControlRequestAuth;
|
|
69
|
+
bindingId: string;
|
|
70
|
+
};
|
|
71
|
+
response: {
|
|
72
|
+
success: boolean;
|
|
73
|
+
binding?: IWebPushBinding;
|
|
74
|
+
message?: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface IReq_GetWebPushServiceStatus extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_GetWebPushServiceStatus> {
|
|
78
|
+
method: 'getWebPushServiceStatus';
|
|
79
|
+
request: {
|
|
80
|
+
auth: IWebPushAppCredentialAuth;
|
|
81
|
+
owner?: never;
|
|
82
|
+
};
|
|
83
|
+
response: IWebPushServiceStatus;
|
|
84
|
+
}
|
|
85
|
+
export interface IReq_EnqueueWebPush extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_EnqueueWebPush> {
|
|
86
|
+
method: 'enqueueWebPush';
|
|
87
|
+
request: {
|
|
88
|
+
auth: IWebPushAppCredentialAuth;
|
|
89
|
+
/** Required credential-scoped replay key. */
|
|
90
|
+
idempotencyKey: string;
|
|
91
|
+
/** Opaque application identity; never a raw endpoint. */
|
|
92
|
+
subscriptionId: string;
|
|
93
|
+
subscription: IWebPushSubscription;
|
|
94
|
+
vapidKeyId: string;
|
|
95
|
+
payload: IWebPushNotificationPayload;
|
|
96
|
+
ttlSeconds?: number;
|
|
97
|
+
urgency?: TWebPushUrgency;
|
|
98
|
+
/** Provider derives an opaque RFC Topic HMAC; this value is never sent raw. */
|
|
99
|
+
collapseKey?: string;
|
|
100
|
+
owner?: never;
|
|
101
|
+
};
|
|
102
|
+
response: {
|
|
103
|
+
accepted: boolean;
|
|
104
|
+
spoolItemId?: string;
|
|
105
|
+
message?: string;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export interface IReq_CancelWebPush extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_CancelWebPush> {
|
|
109
|
+
method: 'cancelWebPush';
|
|
110
|
+
request: {
|
|
111
|
+
auth: IWebPushAppCredentialAuth;
|
|
112
|
+
target: TWebPushCancellationTarget;
|
|
113
|
+
owner?: never;
|
|
114
|
+
};
|
|
115
|
+
response: {
|
|
116
|
+
success: boolean;
|
|
117
|
+
cancelledCount: number;
|
|
118
|
+
alreadyTerminalCount: number;
|
|
119
|
+
message?: string;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export interface IReq_GetWebPushDeliveryStatus extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_GetWebPushDeliveryStatus> {
|
|
123
|
+
method: 'getWebPushDeliveryStatus';
|
|
124
|
+
request: {
|
|
125
|
+
auth: IWebPushAppCredentialAuth;
|
|
126
|
+
spoolItemId: string;
|
|
127
|
+
owner?: never;
|
|
128
|
+
};
|
|
129
|
+
response: {
|
|
130
|
+
delivery?: IWebPushDeliveryStatus;
|
|
131
|
+
};
|
|
132
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2VicHVzaC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL3JlcXVlc3RzL3dlYnB1c2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxlQUFlLENBQUMifQ==
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -30,6 +30,96 @@ import { appstore, data, platform, platformservice, requests } from '@serve.zone
|
|
|
30
30
|
|
|
31
31
|
This package intentionally has no service implementation logic. It is a stable vocabulary for services that need to agree on payload shape, method names, and response types.
|
|
32
32
|
|
|
33
|
+
## Portable Storage Contracts
|
|
34
|
+
|
|
35
|
+
App Store templates can declare logical, template-local `storageClasses` and
|
|
36
|
+
stable named `storageRequests`. The same manifest is fulfilled by Onebox or
|
|
37
|
+
Cloudly without exposing a physical provider:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
const storageConfig: appstore.IAppStoreVersionConfig = {
|
|
41
|
+
image: 'example/database:1.0.0',
|
|
42
|
+
port: 5432,
|
|
43
|
+
storageClasses: {
|
|
44
|
+
databaseFast: {
|
|
45
|
+
kind: 'filesystem',
|
|
46
|
+
purpose: 'database',
|
|
47
|
+
required: {
|
|
48
|
+
performanceTier: 'highIops',
|
|
49
|
+
durability: 'persistent',
|
|
50
|
+
hardQuota: true,
|
|
51
|
+
snapshots: 'native',
|
|
52
|
+
encryptedInTransit: true,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
backupCapacity: {
|
|
56
|
+
kind: 'objectStorage',
|
|
57
|
+
purpose: 'backup',
|
|
58
|
+
required: {
|
|
59
|
+
performanceTier: 'capacity',
|
|
60
|
+
durability: 'persistent',
|
|
61
|
+
hardQuota: true,
|
|
62
|
+
encryptedInTransit: true,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
storageRequests: [
|
|
67
|
+
{
|
|
68
|
+
id: 'database-data',
|
|
69
|
+
kind: 'filesystem',
|
|
70
|
+
storageClass: 'databaseFast',
|
|
71
|
+
mountPath: '/var/lib/example',
|
|
72
|
+
accessMode: 'ReadWriteOnce',
|
|
73
|
+
capacity: { request: '20GiB', limit: '40GiB' },
|
|
74
|
+
reclaimPolicy: 'retain',
|
|
75
|
+
protection: { backup: 'required', snapshots: 'native' },
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
id: 'backup-archive',
|
|
79
|
+
kind: 'objectStorage',
|
|
80
|
+
storageClass: 'backupCapacity',
|
|
81
|
+
accessMode: 'readWrite',
|
|
82
|
+
capacity: { request: '100GiB', limit: '1TiB' },
|
|
83
|
+
reclaimPolicy: 'retain',
|
|
84
|
+
delivery: {
|
|
85
|
+
type: 'secretFile',
|
|
86
|
+
targetPath: '/run/secrets/backup-archive.json',
|
|
87
|
+
format: 'servezone-object-storage-v1',
|
|
88
|
+
},
|
|
89
|
+
protection: { versioning: 'required', retentionDays: 30 },
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
requiresFeatures: [
|
|
93
|
+
appstore.appStoreStorageFeatureIds.bindingsV1,
|
|
94
|
+
appstore.appStoreStorageFeatureIds.filesystemV1,
|
|
95
|
+
appstore.appStoreStorageFeatureIds.objectStorageV1,
|
|
96
|
+
appstore.appStoreStorageFeatureIds.objectStorageSecretFileV1,
|
|
97
|
+
],
|
|
98
|
+
};
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Capacity quantities are positive integers followed by `KiB`, `MiB`, `GiB`, or
|
|
102
|
+
`TiB`. Storage request IDs survive upgrades and restores. Logical class keys
|
|
103
|
+
express requirements and preferences only; Onebox and Cloudly map them to
|
|
104
|
+
operator policy independently.
|
|
105
|
+
|
|
106
|
+
An app may declare multiple `objectStorage` requests. Each request resolves to
|
|
107
|
+
its own endpoint, bucket, and credential reference. Environment delivery uses
|
|
108
|
+
an explicit key map and secret-file delivery uses a unique target path, so two
|
|
109
|
+
bindings cannot share credential destinations accidentally.
|
|
110
|
+
|
|
111
|
+
`platform.storage` contains separate capability advertisements and resolved
|
|
112
|
+
binding/status contracts. Resolved object-storage bindings expose connection
|
|
113
|
+
metadata plus credential references, never credential values. Filesystem
|
|
114
|
+
bindings expose the container mount and access mode, never a host path.
|
|
115
|
+
|
|
116
|
+
Portable manifests and resolved bindings intentionally have no fields for
|
|
117
|
+
Synology, NFS, Kerberos, Corestore, Kubernetes, Docker drivers, servers,
|
|
118
|
+
exports, mount options, provider credential values, or local fallback paths. Runtimes
|
|
119
|
+
must reject unknown manifest fields and unsupported required feature IDs before
|
|
120
|
+
provisioning. Legacy `volumes` and `platformRequirements.s3` remain deprecated
|
|
121
|
+
inputs for strict resolver normalization only.
|
|
122
|
+
|
|
33
123
|
## Data Contracts
|
|
34
124
|
|
|
35
125
|
Use `data` when you need object shapes that are persisted, exchanged between services, or exposed through the Cloudly API.
|
|
@@ -99,6 +189,8 @@ Common data contracts include:
|
|
|
99
189
|
- `ISecretBundle` and `ISecretGroup` for secret ownership and shared secret groups.
|
|
100
190
|
- Mail gateway contracts for domain authorities, address bindings, WorkApp bindings, managed SMTP/API credentials, spool items, delivery journals, and inbound/outbound message payloads.
|
|
101
191
|
- Service-level mail configuration through `IService.data.mail`, including per-address inbound `smtpForward` settings and outbound credential metadata. Cloudly settings include dcrouter gateway, SMTP submission, and inbound forward-target keys for reconciling those bindings.
|
|
192
|
+
- Web Push contracts for environment-specific service bindings, public credential state, public VAPID key rotation metadata, privacy-minimal notification signals, and redacted delivery state. Subscription endpoints, browser key material, provider ciphertext, VAPID private keys, and credential secrets are intentionally absent from public binding and status DTOs.
|
|
193
|
+
- Service-level Web Push declaration through `IService.data.webPush`. Immutable deployment declarations can require the `pushnotification` platform capability alongside database and object-storage capabilities; this does not turn Web Push into a Corestore resource or volume capability.
|
|
102
194
|
- `IUser`, JWT-only `IIdentityCredential`, full `IIdentity`, and token-related contracts for authentication context. `IIdentity` extends `IIdentityCredential` with server-issued user metadata.
|
|
103
195
|
- `ICloudlyConfig`, `ICloudlySettings`, status, server, bare-metal, BaseOS, backup, and task execution interfaces for control-plane state.
|
|
104
196
|
|
|
@@ -156,6 +248,24 @@ The immutable deployment workflow is:
|
|
|
156
248
|
|
|
157
249
|
Gateway request contracts include `getGatewayClientRoutes` (`requests.gateway.IReq_GetGatewayClientRoutes`) for listing owned `IGatewayClientRoute[]` route views, and `syncGatewayClientRoute` for idempotently syncing or deleting hostname-owned, routeRef-owned, and combined hostname-plus-routeRef routes. A client can label canonical intent with `managedRouteKind: 'letsencrypt-http01-forward'` and set a higher `priority` for a path-specific HTTP-01 route while retaining a separate normal route for the same hostname. Mail request contracts include `syncMailAddressBinding`, `deleteMailAddressBinding`, `rotateMailCredential`, and `getMailDeliveryStatus`. `IReq_GetMailDeliveryStatus` looks up a delivery spool item by `spoolItemId`, returns `data.IMailDeliveryStatus`, and accepts `IMailSubmissionRequestAuth` so service-mail credentials can query their own accepted, queued, deferred, delivered, or failed status. `TMailAddressBindingSync.outboundEnabled` explicitly controls whether a gateway should maintain a managed outbound SMTP credential for an address binding. Binding credential metadata is public; `rotateMailCredential` returns the new secret only in its one-time `IMailCredentialOneTimeSecret` response.
|
|
158
250
|
|
|
251
|
+
### Web Push Contracts
|
|
252
|
+
|
|
253
|
+
New Web Push integrations use `requests.webpush`. Control-plane methods and application delivery methods deliberately use different, non-overlapping authentication types:
|
|
254
|
+
|
|
255
|
+
- `listWebPushBindings`, `syncWebPushBinding`, `deleteWebPushBinding`, `rotateWebPushCredential`, and `rotateWebPushVapidKey` use control-plane identity or gateway API-token authentication.
|
|
256
|
+
- `getWebPushServiceStatus`, `enqueueWebPush`, `cancelWebPush`, and `getWebPushDeliveryStatus` require a Web Push application credential. The gateway derives the owner exclusively from that credential; application requests cannot submit owner identity.
|
|
257
|
+
|
|
258
|
+
`syncWebPushBinding` may return the initial application credential secret once, and `rotateWebPushCredential` may return its replacement once. Binding and status DTOs contain only public credential and VAPID metadata. `enqueueWebPush` requires a credential-scoped idempotency key, an opaque application subscription ID, the browser Push API subscription, the VAPID key ID used for that browser subscription, and a privacy-minimal `notificationAvailable` signal.
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
import { requests } from '@serve.zone/interfaces';
|
|
262
|
+
|
|
263
|
+
type EnqueueWebPush = requests.webpush.IReq_EnqueueWebPush;
|
|
264
|
+
type WebPushStatus = requests.webpush.IReq_GetWebPushDeliveryStatus;
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
A delivery state of `pushServiceAccepted` means only that the remote push service accepted the encrypted request. It does not prove browser receipt, notification display, or user interaction.
|
|
268
|
+
|
|
159
269
|
### Gateway Client Lifecycle and DNS
|
|
160
270
|
|
|
161
271
|
`syncGatewayClientRoute` accepts an optional `dnsMode`. Omission means `skip` for older clients. `observe` reports DNS without changing it. `reconcile` makes the gateway authoritative for the exact route hostname: it claims or replaces manual A, AAAA, and CNAME records, including already-correct manual values. Its optional `dns` result contains a closed status, retryability, the desired A/AAAA target, overwritten-record evidence, `checkedAt`, and `authoritativeVerifiedAt` once the provider or authoritative server confirms the state. Consumers can carry that evidence while retrying public propagation instead of treating an immediate recursive lookup miss as permanent.
|
|
@@ -231,6 +341,7 @@ Request groups are exported by product area:
|
|
|
231
341
|
- `requests.status`
|
|
232
342
|
- `requests.task`
|
|
233
343
|
- `requests.version`
|
|
344
|
+
- `requests.webpush`
|
|
234
345
|
|
|
235
346
|
## Platform Contracts
|
|
236
347
|
|
|
@@ -249,7 +360,7 @@ Available platform modules:
|
|
|
249
360
|
|
|
250
361
|
- `platform.email` for transactional email, recipient registration, email status, and email stats.
|
|
251
362
|
- `platform.sms` for SMS delivery and verification-code delivery.
|
|
252
|
-
- `platform.pushnotification`
|
|
363
|
+
- `platform.pushnotification` is the deprecated legacy device-token push contract. New browser Web Push integrations use `requests.webpush`.
|
|
253
364
|
- `platform.letter` for physical letter workflows.
|
|
254
365
|
- `platform.ai`, `platform.database`, `platform.objectstorage`, `platform.logging`, `platform.backup`, and `platform.sip` for infrastructure and application capabilities.
|
|
255
366
|
- `platform.types` plus root re-exports for shared capability, provider, binding, credential, and endpoint metadata.
|