@open-workspace/create 0.5.0 → 0.5.1

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.
@@ -190,7 +190,16 @@ async function applyAction(action: Action, context: ApplyContext) {
190
190
  // The invitation may be saved with its answer lost (the request
191
191
  // tried again then finds the address taken): someone here under
192
192
  // the address, still invited, gets a new link in its place.
193
- const saved = await savedInvitationLink(workspace, action.email);
193
+ // A failed lookup clears the marker too, or every later invitation
194
+ // in this run would find it; a rerun asks again.
195
+ let saved: Awaited<ReturnType<typeof savedInvitationLink>>;
196
+
197
+ try {
198
+ saved = await savedInvitationLink(workspace, action.email);
199
+ } catch (lookupError) {
200
+ invites.clear();
201
+ throw lookupError;
202
+ }
194
203
 
195
204
  if (!saved) {
196
205
  invites.clear();
@@ -229,7 +229,7 @@ export function googleAccessToken(options: GoogleCredentialsOptions) {
229
229
 
230
230
  return Promise.reject(
231
231
  new Error(
232
- "The Google credentials are neither a service account key nor a Desktop app OAuth client (see https://openworkspace.dev/docs/migration)"
232
+ "The Google credentials are neither a service account key nor a Desktop app OAuth client (see https://openworkspace.dev/docs/migration-google)"
233
233
  )
234
234
  );
235
235
  }
@@ -19,6 +19,10 @@ const HELP = `bunx @open-workspace/create import idp <source> --workspace <url>
19
19
  csv --file <directory.csv> (header: type,name,email,groups)
20
20
  saml --file <service provider metadata XML>
21
21
 
22
+ --groups <list|inbox> What groups with an address become (default list)
23
+ --include-suspended Also import suspended or disabled users
24
+ --invites <file.csv> Where invitation links go (default openworkspace-invitations.csv)
25
+
22
26
  Invites people, creates teams and imports supported SSO apps disabled. Existing apps are skipped.
23
27
  See https://openworkspace.dev/docs/migration for source permissions and the SSO cutover.`;
24
28
 
@@ -40,6 +44,8 @@ export async function idpCommand(args: string[], deps: CliDeps) {
40
44
  tenant: { type: "string" },
41
45
  "client-id": { type: "string" },
42
46
  invites: { type: "string" },
47
+ groups: { type: "string" },
48
+ "include-suspended": { type: "boolean" },
43
49
  },
44
50
  });
45
51
 
@@ -92,7 +92,9 @@ export async function readOkta(org: string, token: string, fetchImpl: Fetch) {
92
92
  person(
93
93
  u.profile.email,
94
94
  [u.profile.firstName, u.profile.lastName].filter(Boolean).join(" "),
95
- u.status !== "ACTIVE"
95
+ // Locked out, a password expired or being recovered: still people
96
+ // who work here.
97
+ ["SUSPENDED", "DEPROVISIONED"].includes(u.status)
96
98
  )
97
99
  );
98
100
  }
package/import/mbox.ts CHANGED
@@ -163,7 +163,8 @@ const MONTHS = [
163
163
  /**
164
164
  * The date on an mbox "From " line, in ms: Gmail's Takeout writes when the
165
165
  * message arrived there ("From 1781…@xxx Tue Mar 03 10:00:00 +0000 2026").
166
- * Classic ctime dates without a zone are read as UTC.
166
+ * A classic ctime date has no zone and, from Thunderbird, is when the
167
+ * message was copied there: undefined, so the Date header counts instead.
167
168
  */
168
169
  export function fromLineDate(fromLine: string) {
169
170
  const match =
@@ -171,7 +172,7 @@ export function fromLineDate(fromLine: string) {
171
172
  fromLine
172
173
  );
173
174
 
174
- if (!match) return undefined;
175
+ if (!match?.[6]) return undefined;
175
176
  const [, monthName = ""] = match;
176
177
  const month = MONTHS.indexOf(monthName.toLowerCase());
177
178
 
@@ -188,11 +189,10 @@ export function fromLineDate(fromLine: string) {
188
189
 
189
190
  const zone = match[6];
190
191
 
191
- const offset = zone
192
- ? (zone[0] === "-" ? -1 : 1) *
193
- (Number(zone.slice(1, 3)) * 60 + Number(zone.slice(3, 5))) *
194
- 60_000
195
- : 0;
192
+ const offset =
193
+ (zone[0] === "-" ? -1 : 1) *
194
+ (Number(zone.slice(1, 3)) * 60 + Number(zone.slice(3, 5))) *
195
+ 60_000;
196
196
 
197
197
  return utc - offset;
198
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-workspace/create",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Create an OpenWorkspace deployment (`bun create @open-workspace`), and import people, teams, SSO apps and mail.",
5
5
  "homepage": "https://openworkspace.dev",
6
6
  "license": "Apache-2.0",
package/templates.ts CHANGED
@@ -14,7 +14,7 @@ export type ProjectAnswers = {
14
14
  };
15
15
 
16
16
  export const versions = {
17
- openWorkspace: "0.5.0",
17
+ openWorkspace: "0.5.1",
18
18
  alchemy: "2.0.0-beta.85",
19
19
  effect: "4.1.3",
20
20
  typescript: "7.0.2",