@verentis/cli 0.2.25 → 0.2.26

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/README.md CHANGED
@@ -109,6 +109,25 @@ If `--expected-revision` is omitted, the CLI exports the current revision first
109
109
  = revision `0`) and sends that revision with the apply request. A `409` means the policy changed:
110
110
  export again, reapply your edits, and retry. Dry runs require `fabric.policy.read`; real applies
111
111
  require `fabric.policy.update`.
112
+ ## Native collaboration declarations
113
+
114
+ An Application may request the versioned native scene mode separately from WOPI:
115
+
116
+ ```yaml
117
+ spec:
118
+ collaboration:
119
+ mode: native-scene-v1
120
+ capabilities: [file:read, file:write]
121
+ permissions: [node.file.read, node.node.create]
122
+ ```
123
+
124
+ Development validation and packing reject unknown modes, extra declaration keys,
125
+ non-Application declarations and combined native/WOPI declarations. The signed
126
+ declaration is a capability request, not authority: the platform must verify the
127
+ installed manifest and explicit administrator consent, select the document in the
128
+ host, and authorize every operation. It does not enable a native backend by itself;
129
+ the corresponding platform admission and fenced persistence prerequisites must
130
+ be delivered before installation can activate native editing.
112
131
 
113
132
  ## Sign in
114
133
 
@@ -141,6 +160,13 @@ verentis context # show current defaults
141
160
  verentis whoami # identity, account, publisher
142
161
  ```
143
162
 
163
+ Workspace/account flags and defaults use Security's generalized `resourceId`
164
+ token target; the CLI does not send the legacy `workspaceId`/`accountId` selectors
165
+ to token exchange. Explicit Node targets also specify `resourceType: Node` and,
166
+ when available, the workspace as `parentResourceId`. These context selectors do
167
+ not grant permissions: Security resolves the registered resource and authorizes
168
+ the requested scopes.
169
+
144
170
  ## Admin
145
171
 
146
172
  ```bash
package/dist/index.js CHANGED
@@ -303,9 +303,8 @@ async function createApiClient(overrides) {
303
303
  body: JSON.stringify({
304
304
  audience: AUDIENCE,
305
305
  scopes: options.scopes,
306
- ...options.workspaceId ? { workspaceId: options.workspaceId } : {},
307
- ...options.accountId ? { accountId: options.accountId } : {},
308
- ...options.resourceId ? { resourceId: options.resourceId, resourceKind: options.resourceKind ?? "Node" } : {}
306
+ ...options.resourceId ?? options.workspaceId ?? options.accountId ? { resourceId: options.resourceId ?? options.workspaceId ?? options.accountId } : {},
307
+ ...options.resourceId && (options.resourceKind ?? "Node") === "Node" ? { resourceType: "Node", ...options.workspaceId ? { parentResourceId: options.workspaceId } : {} } : {}
309
308
  }),
310
309
  ...insecureFetchOptions(insecure)
311
310
  });
@@ -1073,6 +1072,10 @@ async function loadManifest(path) {
1073
1072
  }
1074
1073
  const launchKindError = validateLaunchManifestKind(kind, manifest.spec);
1075
1074
  if (launchKindError) throw new Error(`Invalid manifest at ${path}: ${launchKindError}.`);
1075
+ const collaborationErrors = validateNativeCollaborationSection(kind, manifest.spec);
1076
+ if (collaborationErrors.length > 0) {
1077
+ throw new Error(`Invalid manifest at ${path}: ${collaborationErrors.join(" ")}`);
1078
+ }
1076
1079
  const operationErrors = validateWopiOperationsSection(manifest.spec);
1077
1080
  if (operationErrors.length > 0) {
1078
1081
  throw new Error(`Invalid manifest at ${path}: ${operationErrors.join(" ")}`);
@@ -1139,6 +1142,19 @@ function validateHostedBackendDeclaration(kind, spec) {
1139
1142
  }
1140
1143
  return [];
1141
1144
  }
1145
+ function validateNativeCollaborationSection(kind, spec) {
1146
+ if (!spec || typeof spec !== "object" || Array.isArray(spec) || !Object.prototype.hasOwnProperty.call(spec, "collaboration")) return [];
1147
+ if (kind !== "Application") return ["spec.collaboration is only supported for Application manifests."];
1148
+ const applicationSpec = spec;
1149
+ const declaration = applicationSpec.collaboration;
1150
+ if (!declaration || typeof declaration !== "object" || Array.isArray(declaration) || Object.keys(declaration).length !== 1 || !Object.prototype.hasOwnProperty.call(declaration, "mode") || declaration.mode !== "native-scene-v1") {
1151
+ return ["spec.collaboration must be exactly { mode: native-scene-v1 }."];
1152
+ }
1153
+ if (Object.prototype.hasOwnProperty.call(applicationSpec, "wopi") || Array.isArray(applicationSpec.capabilities) && applicationSpec.capabilities.includes("wopi")) {
1154
+ return ["Native collaboration and WOPI must use separate application declarations."];
1155
+ }
1156
+ return [];
1157
+ }
1142
1158
  function validateWopiOperationsSection(spec) {
1143
1159
  if (!spec || typeof spec !== "object" || Array.isArray(spec)) return [];
1144
1160
  const wopi = spec.wopi;
@@ -1337,6 +1353,7 @@ function validateManifest(manifest) {
1337
1353
  for (const message of validateWopiOperationsSection(spec)) error(message);
1338
1354
  for (const message of validateHostedBackendDeclaration(kind, spec)) error(message);
1339
1355
  for (const message of validateDependencies(spec)) error(message);
1356
+ for (const message of validateNativeCollaborationSection(kind, spec)) error(message);
1340
1357
  if (kind === "ExecutionEngine") {
1341
1358
  const runtimes = spec.runtimes ?? {};
1342
1359
  if (Object.keys(runtimes).length === 0) {