@wildix/xbees-users-client 4.4.0-wms29809.1 → 4.4.0-wms29809.2

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.
@@ -78,11 +78,11 @@ exports.AccountWorkspaceChangeOperation = {
78
78
  MAKE_DEFAULT: "makeDefault",
79
79
  };
80
80
  exports.AccountWorkspaceRefusalCode = {
81
+ COMPANY_WORKSPACE_TAKEN: "company_workspace_taken",
81
82
  DELETED_WORKSPACE: "deleted_workspace",
82
83
  EXPECTED_INCOMPLETE: "expected_incomplete",
83
84
  FOREIGN_STREAM_EMAIL: "foreign_stream_email",
84
85
  NO_DEFAULT: "no_default",
85
- PBX_OTHER_COMPANY: "pbx_other_company",
86
86
  TOO_MANY_WRITES: "too_many_writes",
87
87
  WORKSPACE_ALREADY_IN_ACCOUNT: "workspace_already_in_account",
88
88
  WORKSPACE_HAS_ACCOUNT: "workspace_has_account",
@@ -90,6 +90,7 @@ exports.AccountWorkspaceRefusalCode = {
90
90
  WORKSPACE_NOT_IN_SOURCE_ACCOUNT: "workspace_not_in_source_account",
91
91
  };
92
92
  exports.AccountWorkspaceCheckCode = {
93
+ COMPANY_WORKSPACE_TAKEN: "company_workspace_taken",
93
94
  CONFLICT: "conflict",
94
95
  DELETED_WORKSPACE: "deleted_workspace",
95
96
  EMAIL_ROUTING_CHANGES: "email_routing_changes",
@@ -98,9 +99,6 @@ exports.AccountWorkspaceCheckCode = {
98
99
  NO_DEFAULT: "no_default",
99
100
  ORPHAN_DEFAULT_MOVED: "orphan_default_moved",
100
101
  ORPHAN_PERSONAL_WORKSPACE_CREATED: "orphan_personal_workspace_created",
101
- PBX_LINK_MOVES: "pbx_link_moves",
102
- PBX_LINK_STAYS: "pbx_link_stays",
103
- PBX_OTHER_COMPANY: "pbx_other_company",
104
102
  TOO_MANY_WRITES: "too_many_writes",
105
103
  WORKSPACE_ALREADY_IN_ACCOUNT: "workspace_already_in_account",
106
104
  WORKSPACE_HAS_ACCOUNT: "workspace_has_account",
@@ -110,8 +108,6 @@ exports.AccountWorkspaceCheckCode = {
110
108
  exports.AccountWorkspaceEffectName = {
111
109
  CACHE: "cache",
112
110
  COGNITO: "cognito",
113
- JOB: "job",
114
- STREAM: "stream",
115
111
  };
116
112
  exports.AccountWorkspaceEffectStatus = {
117
113
  FAILED: "failed",
@@ -122,7 +118,6 @@ exports.AccountWorkspaceRowEntity = {
122
118
  ACCOUNT_SETTINGS: "accountSettings",
123
119
  MEMBERSHIP: "membership",
124
120
  PBX: "pbx",
125
- PBX_USER: "pbxUser",
126
121
  STREAM: "stream",
127
122
  };
128
123
  exports.WorkspaceType = {
@@ -131,7 +126,6 @@ exports.WorkspaceType = {
131
126
  WORK: "work",
132
127
  };
133
128
  exports.AccountWorkspaceWriteKind = {
134
- APPEND: "append",
135
129
  DELETE: "delete",
136
130
  PUT: "put",
137
131
  UPDATE: "update",
@@ -75,11 +75,11 @@ export const AccountWorkspaceChangeOperation = {
75
75
  MAKE_DEFAULT: "makeDefault",
76
76
  };
77
77
  export const AccountWorkspaceRefusalCode = {
78
+ COMPANY_WORKSPACE_TAKEN: "company_workspace_taken",
78
79
  DELETED_WORKSPACE: "deleted_workspace",
79
80
  EXPECTED_INCOMPLETE: "expected_incomplete",
80
81
  FOREIGN_STREAM_EMAIL: "foreign_stream_email",
81
82
  NO_DEFAULT: "no_default",
82
- PBX_OTHER_COMPANY: "pbx_other_company",
83
83
  TOO_MANY_WRITES: "too_many_writes",
84
84
  WORKSPACE_ALREADY_IN_ACCOUNT: "workspace_already_in_account",
85
85
  WORKSPACE_HAS_ACCOUNT: "workspace_has_account",
@@ -87,6 +87,7 @@ export const AccountWorkspaceRefusalCode = {
87
87
  WORKSPACE_NOT_IN_SOURCE_ACCOUNT: "workspace_not_in_source_account",
88
88
  };
89
89
  export const AccountWorkspaceCheckCode = {
90
+ COMPANY_WORKSPACE_TAKEN: "company_workspace_taken",
90
91
  CONFLICT: "conflict",
91
92
  DELETED_WORKSPACE: "deleted_workspace",
92
93
  EMAIL_ROUTING_CHANGES: "email_routing_changes",
@@ -95,9 +96,6 @@ export const AccountWorkspaceCheckCode = {
95
96
  NO_DEFAULT: "no_default",
96
97
  ORPHAN_DEFAULT_MOVED: "orphan_default_moved",
97
98
  ORPHAN_PERSONAL_WORKSPACE_CREATED: "orphan_personal_workspace_created",
98
- PBX_LINK_MOVES: "pbx_link_moves",
99
- PBX_LINK_STAYS: "pbx_link_stays",
100
- PBX_OTHER_COMPANY: "pbx_other_company",
101
99
  TOO_MANY_WRITES: "too_many_writes",
102
100
  WORKSPACE_ALREADY_IN_ACCOUNT: "workspace_already_in_account",
103
101
  WORKSPACE_HAS_ACCOUNT: "workspace_has_account",
@@ -107,8 +105,6 @@ export const AccountWorkspaceCheckCode = {
107
105
  export const AccountWorkspaceEffectName = {
108
106
  CACHE: "cache",
109
107
  COGNITO: "cognito",
110
- JOB: "job",
111
- STREAM: "stream",
112
108
  };
113
109
  export const AccountWorkspaceEffectStatus = {
114
110
  FAILED: "failed",
@@ -119,7 +115,6 @@ export const AccountWorkspaceRowEntity = {
119
115
  ACCOUNT_SETTINGS: "accountSettings",
120
116
  MEMBERSHIP: "membership",
121
117
  PBX: "pbx",
122
- PBX_USER: "pbxUser",
123
118
  STREAM: "stream",
124
119
  };
125
120
  export const WorkspaceType = {
@@ -128,7 +123,6 @@ export const WorkspaceType = {
128
123
  WORK: "work",
129
124
  };
130
125
  export const AccountWorkspaceWriteKind = {
131
- APPEND: "append",
132
126
  DELETE: "delete",
133
127
  PUT: "put",
134
128
  UPDATE: "update",
@@ -41,16 +41,17 @@ declare const ApplyAccountWorkspaceChangesCommand_base: {
41
41
  * - attach with `fromAccountId` moves the membership of `workspaceId` from the account `fromAccountId` to the change's `accountId`, keeping its `type`. The workspace must be a membership of `fromAccountId` (`workspace_not_in_source_account`) and not yet of `accountId` (`workspace_already_in_account`).
42
42
  * - attach without `fromAccountId` attaches a workspace that has no membership in any account (the board's Detached column, or one just detached in an earlier call). The owner checks that through the `AccountsByWorkspace` index and refuses with `workspace_has_account` when the workspace is a member of any account (the index is eventually consistent, so the check is best effort; concurrent attaches of one workspace are serialized by its stream-link lock); `fromAccountId` is required when it is a member of another account.
43
43
  * - detach removes only the membership of `workspaceId` from the change's `accountId` (`workspace_not_in_account` when it has none); the Stream and Pbx rows of the workspace and its channels stay.
44
- * - makeDefault sets `Settings.defaultWorkspace` of the change's `accountId` to `workspaceId` (`workspace_not_in_account` when it is not a membership of that account; the current default is a no-op). The PBX link moves with the default: a workspace of the same company, or a personal workspace without a link, takes the link (a personal one becomes work, `pbx_link_moves`); a workspace of another company with its own link keeps it and only the default changes (`pbx_link_stays`); a workspace of another company without a link is refused (`pbx_other_company`: the PBX link does not move there).
45
- * - Default of an orphaned account (an account with no identity left) that loses its default workspace, by detach or because attach takes it away: the default moves to its remaining active workspace with the latest `lastUsedAt` (`orphan_default_moved`; the candidates are its active workspaces after all the changes of the call, and the PBX link does not move to an automatically chosen default); when none is left a new personal workspace is created and becomes the default (`orphan_personal_workspace_created`). A login account (one that still has an identity) never gets an automatic default: leaving it without one is refused (`no_default`).
44
+ * - makeDefault sets `Settings.defaultWorkspace` of the change's `accountId` to `workspaceId` (`workspace_not_in_account` when it is not a membership of that account; the current default is a no-op). Only the default changes: the PBX link stays on the workspace that holds it, no `Pbx`, `Stream` or membership row is written for it.
45
+ * - One workspace per company and address type: after the changes an account holds at most one email workspace and one phone workspace of a company, and at most one workspace without a company, counting active memberships (`company_workspace_taken`, blocking, on the attach that brings the extra workspace in; the exact definition of address type and company is in the refusal's documentation). An account that already breaks the rule is not blocked as a whole: only a draft that makes a group worse is refused, so detaching one of the conflicting workspaces or changing the default stays possible.
46
+ * - Default of an orphaned account (an account with no identity left) that loses its default workspace, by detach or because attach takes it away: the default moves to its remaining active workspace with the latest `lastUsedAt` (`orphan_default_moved`; the candidates are its active workspaces after all the changes of the call); when none is left a new personal workspace is created and becomes the default (`orphan_personal_workspace_created`). A login account (one that still has an identity) never gets an automatic default: leaving it without one is refused (`no_default`).
46
47
  * - Refused as well: a workspace whose Stream email belongs to another person (`foreign_stream_email`); a deleted workspace (`deleted_workspace`); a plan larger than one DynamoDB transaction (`too_many_writes`).
47
48
  *
48
49
  * - The owner adds condition checks to the same transaction on the rows it picks or relies on by itself (the orphan's chosen fallback membership, its identity-less state), so `expected` need not name them.
49
50
  * - A new default re-routes email resolution (direct messages, invites, call messages) to it (`email_routing_changes`, not blocking).
50
51
  *
51
- * Inverse and backup: the output is enough to record a backup and to build the inverse plan as `changes` of this same operation: detach is undone by attach without `fromAccountId`, attach from an account by attach back to that account (with `fromAccountId` the account it went to), makeDefault by makeDefault of the previous default (see `before` of the `Settings` write). The one exception is the new personal workspace of an orphaned account, which has no inverse change. Pbx rows in `writes` never carry `sipPassword` or `xmppPassword`, so a Pbx row restored from the backup lacks them: a restored PBX link needs a re-link or refresh from the PBX.
52
+ * Inverse and backup: the output is enough to record a backup and to build the inverse plan as `changes` of this same operation: detach is undone by attach without `fromAccountId`, attach from an account by attach back to that account (with `fromAccountId` the account it went to), makeDefault by makeDefault of the previous default (see `before` of the `Settings` write). The one exception is the new personal workspace of an orphaned account, which has no inverse change.
52
53
  *
53
- * Side effects after the commit (see `effects`): `custom:wid` set to the new default on every Cognito user of every identity of the account (all users of one address: native and federated; a phone identity by its sign-in address `<E.164 without +>@phone.wildix.com`), applied at the user's next token refresh without revoking sessions; the workspaces cache invalidated for every touched account; the GetStream PBX fields moved; the external-flag job scheduled for the workspaces the PBX link left and reached.
54
+ * Side effects after the commit (see `effects`): `custom:wid` set to the new default on every Cognito user of every identity of the account (all users of one address: native and federated; a phone identity by its sign-in address `<E.164 without +>@phone.wildix.com`), applied at the user's next token refresh without revoking sessions; the workspaces cache invalidated for every touched account.
54
55
  *
55
56
  * @example
56
57
  * Use a bare-bones client and the command you need to make an API call.
@@ -93,8 +94,8 @@ declare const ApplyAccountWorkspaceChangesCommand_base: {
93
94
  * // { // AccountWorkspaceWrite
94
95
  * // pk: "STRING_VALUE", // required
95
96
  * // sk: "STRING_VALUE", // required
96
- * // kind: "put" || "update" || "delete" || "append", // required
97
- * // entity: "membership" || "accountSettings" || "pbx" || "stream" || "pbxUser", // required
97
+ * // kind: "put" || "update" || "delete", // required
98
+ * // entity: "membership" || "accountSettings" || "pbx" || "stream", // required
98
99
  * // before: { // AccountWorkspaceRowFields
99
100
  * // "<keys>": "DOCUMENT_VALUE",
100
101
  * // },
@@ -128,7 +129,7 @@ declare const ApplyAccountWorkspaceChangesCommand_base: {
128
129
  * // ],
129
130
  * // checks: [ // AccountWorkspaceCheckList // required
130
131
  * // { // AccountWorkspaceCheck
131
- * // code: "conflict" || "expected_incomplete" || "workspace_not_in_source_account" || "workspace_has_account" || "workspace_already_in_account" || "workspace_not_in_account" || "foreign_stream_email" || "deleted_workspace" || "no_default" || "pbx_other_company" || "too_many_writes" || "pbx_link_moves" || "pbx_link_stays" || "orphan_default_moved" || "orphan_personal_workspace_created" || "email_routing_changes", // required
132
+ * // code: "conflict" || "expected_incomplete" || "workspace_not_in_source_account" || "workspace_has_account" || "workspace_already_in_account" || "workspace_not_in_account" || "foreign_stream_email" || "deleted_workspace" || "no_default" || "company_workspace_taken" || "too_many_writes" || "orphan_default_moved" || "orphan_personal_workspace_created" || "email_routing_changes", // required
132
133
  * // blocking: true || false, // required
133
134
  * // row: { // AccountWorkspaceRowKey
134
135
  * // pk: "STRING_VALUE", // required
@@ -142,7 +143,7 @@ declare const ApplyAccountWorkspaceChangesCommand_base: {
142
143
  * // ],
143
144
  * // effects: [ // AccountWorkspaceEffectList // required
144
145
  * // { // AccountWorkspaceEffect
145
- * // name: "cognito" || "cache" || "stream" || "job", // required
146
+ * // name: "cognito" || "cache", // required
146
147
  * // status: "ok" || "failed" || "skipped", // required
147
148
  * // target: "STRING_VALUE",
148
149
  * // detail: "STRING_VALUE",
@@ -154,7 +154,7 @@ export declare const AccountWorkspaceChangeOperation: {
154
154
  */
155
155
  readonly DETACH: "detach";
156
156
  /**
157
- * Make the workspace the account's default (the one sign-in opens). The PBX link moves with the default, see ApplyAccountWorkspaceChanges.
157
+ * Make the workspace the account's default (the one sign-in opens). Only the default changes: the PBX link stays on the workspace that holds it.
158
158
  */
159
159
  readonly MAKE_DEFAULT: "makeDefault";
160
160
  };
@@ -167,6 +167,10 @@ export type AccountWorkspaceChangeOperation = (typeof AccountWorkspaceChangeOper
167
167
  * @enum
168
168
  */
169
169
  export declare const AccountWorkspaceRefusalCode: {
170
+ /**
171
+ * attach: the account would hold two workspaces of one company and one address type, or two workspaces without a company. Address type: `phone` when the workspace's effective Stream email (`Workspace#<ws>/Stream`, else the legacy `User#<ws>/Stream`) is `<8 to 15 digits>@phone.wildix.com`, otherwise `email` (no Stream row or no email counts as `email`). Company: the `company` of the effective Stream row, else of the effective Pbx row; none when both lack it. The rule counts the active memberships of the account after all the changes of the call (a deleted workspace is still a member and counts): at most one email workspace and one phone workspace per company, and at most one workspace without a company, whatever its address type. Accounts that already break the rule are not blocked as a whole: a change is refused only when the draft makes a group worse, that is, a group that holds more than one workspace after the changes and whose workspaces are not all in the same group before them (so a detach, a makeDefault, or a draft that touches only other accounts passes). `accountId` is the account and `workspaceId` the incoming workspace; the message names the company (or no company), the address type and the workspace already in the account.
172
+ */
173
+ readonly COMPANY_WORKSPACE_TAKEN: "company_workspace_taken";
170
174
  /**
171
175
  * The workspace is deleted.
172
176
  */
@@ -183,10 +187,6 @@ export declare const AccountWorkspaceRefusalCode: {
183
187
  * A login account (one that still has an identity) would be left without a default workspace. It never gets an automatic default.
184
188
  */
185
189
  readonly NO_DEFAULT: "no_default";
186
- /**
187
- * makeDefault onto a workspace of another company that has no PBX link of its own: the PBX link does not move there.
188
- */
189
- readonly PBX_OTHER_COMPANY: "pbx_other_company";
190
190
  /**
191
191
  * The plan needs more row writes than one DynamoDB transaction holds (100).
192
192
  */
@@ -217,6 +217,10 @@ export type AccountWorkspaceRefusalCode = (typeof AccountWorkspaceRefusalCode)[k
217
217
  * @enum
218
218
  */
219
219
  export declare const AccountWorkspaceCheckCode: {
220
+ /**
221
+ * Blocking, see AccountWorkspaceRefusalCode.
222
+ */
223
+ readonly COMPANY_WORKSPACE_TAKEN: "company_workspace_taken";
220
224
  /**
221
225
  * Blocking. A row differs from `expected`: `row` names it, and `field` the differing attribute when the row exists as expected. On apply: AccountWorkspaceConflictException.
222
226
  */
@@ -249,18 +253,6 @@ export declare const AccountWorkspaceCheckCode: {
249
253
  * Not blocking. An orphaned account is left with no active workspace: a new personal workspace is created and becomes its default.
250
254
  */
251
255
  readonly ORPHAN_PERSONAL_WORKSPACE_CREATED: "orphan_personal_workspace_created";
252
- /**
253
- * Not blocking. makeDefault: the PBX link moves to the new default (a personal workspace becomes work).
254
- */
255
- readonly PBX_LINK_MOVES: "pbx_link_moves";
256
- /**
257
- * Not blocking. makeDefault onto a workspace of another company with its own PBX link: only the default changes, each workspace keeps its PBX link.
258
- */
259
- readonly PBX_LINK_STAYS: "pbx_link_stays";
260
- /**
261
- * Blocking, see AccountWorkspaceRefusalCode.
262
- */
263
- readonly PBX_OTHER_COMPANY: "pbx_other_company";
264
256
  /**
265
257
  * Blocking, see AccountWorkspaceRefusalCode.
266
258
  */
@@ -299,14 +291,6 @@ export declare const AccountWorkspaceEffectName: {
299
291
  * `custom:wid` set to the new default on the Cognito users of the account's identities. Applies at the next token refresh.
300
292
  */
301
293
  readonly COGNITO: "cognito";
302
- /**
303
- * External-flag job scheduled for a workspace.
304
- */
305
- readonly JOB: "job";
306
- /**
307
- * GetStream user PBX fields moved between workspaces.
308
- */
309
- readonly STREAM: "stream";
310
294
  };
311
295
  /**
312
296
  * @public
@@ -351,10 +335,6 @@ export declare const AccountWorkspaceRowEntity: {
351
335
  * PBX link of a workspace: `Workspace#<ws>/Pbx`.
352
336
  */
353
337
  readonly PBX: "pbx";
354
- /**
355
- * PBX user record with its `linkHistory`: `PbxUser#…`.
356
- */
357
- readonly PBX_USER: "pbxUser";
358
338
  /**
359
339
  * Stream link of a workspace: `Workspace#<ws>/Stream`.
360
340
  */
@@ -391,10 +371,6 @@ export type WorkspaceType = (typeof WorkspaceType)[keyof typeof WorkspaceType];
391
371
  * @enum
392
372
  */
393
373
  export declare const AccountWorkspaceWriteKind: {
394
- /**
395
- * Entries are appended to list attributes of a row (`linkHistory`, entries with `source: 'stream-console'`): `after` holds the appended entries only, `before` is absent.
396
- */
397
- readonly APPEND: "append";
398
374
  /**
399
375
  * The row is deleted: `before` is the whole deleted row, `after` is absent.
400
376
  */
@@ -571,7 +571,7 @@ export interface ApplyAccountWorkspaceChangesInput {
571
571
  */
572
572
  changes: AccountWorkspaceChange[];
573
573
  /**
574
- * The rows the caller read, with the values it read, for every row the changes touch: the membership rows (`Account#<acc>/Workspace#<ws>`) and the `Settings` rows (`defaultWorkspace`) of every account touched, that is every `accountId` and every `fromAccountId` of the changes (for an attach without `fromAccountId` the destination membership row of the workspace, sent without `fields`: expected absent), and the `Pbx` and `Stream` rows (`Workspace#<ws>/Pbx`, `Workspace#<ws>/Stream`) of the touched workspaces, including the workspace the PBX link leaves. Rows the owner creates with a new id (an orphaned account's new personal workspace) and `PbxUser#…` link-history rows are not part of it. Stream Console passes the `observed` rows of its board read through unchanged.
574
+ * The rows the caller read, with the values it read, for every row the changes touch: the membership rows (`Account#<acc>/Workspace#<ws>`) and the `Settings` rows (`defaultWorkspace`) of every account touched, that is every `accountId` and every `fromAccountId` of the changes (for an attach without `fromAccountId` the destination membership row of the workspace, sent without `fields`: expected absent), and the `Pbx` and `Stream` rows (`Workspace#<ws>/Pbx`, `Workspace#<ws>/Stream`) of the workspaces an attach names (makeDefault and detach need only the membership and `Settings` rows). Rows the owner creates with a new id (an orphaned account's new personal workspace) are not part of it. Stream Console passes the `observed` rows of its board read through unchanged.
575
575
  * @public
576
576
  */
577
577
  expected: AccountWorkspaceExpectedRow[];
@@ -596,7 +596,7 @@ export interface ApplyAccountWorkspaceChangesInput {
596
596
  */
597
597
  export interface ApplyAccountWorkspaceChangesOutput {
598
598
  /**
599
- * The row writes of the change: planned (dry run) or done (apply), in the order of the transaction. Enough to show a diff and to keep a backup; how to build the inverse plan and what a restored Pbx row lacks: see the Inverse and backup paragraph of the operation documentation.
599
+ * The row writes of the change: planned (dry run) or done (apply), in the order of the transaction. Enough to show a diff and to keep a backup; how to build the inverse plan: see the Inverse and backup paragraph of the operation documentation.
600
600
  * @public
601
601
  */
602
602
  writes: AccountWorkspaceWrite[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/xbees-users-client",
3
3
  "description": "@wildix/xbees-users-client client",
4
- "version": "4.4.0-wms29809.1",
4
+ "version": "4.4.0-wms29809.2",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",