@wildix/xbees-users-client 4.4.0-wms29809.1 → 4.6.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/dist-cjs/Users.js +1 -9
  2. package/dist-cjs/auth/httpAuthSchemeProvider.js +0 -12
  3. package/dist-cjs/commands/index.js +0 -2
  4. package/dist-cjs/index.js +0 -1
  5. package/dist-cjs/models/enums.js +6 -73
  6. package/dist-cjs/models/errors.js +1 -39
  7. package/dist-cjs/schemas/schemas_0.js +106 -294
  8. package/dist-es/Users.js +1 -9
  9. package/dist-es/auth/httpAuthSchemeProvider.js +0 -12
  10. package/dist-es/commands/index.js +0 -2
  11. package/dist-es/index.js +0 -1
  12. package/dist-es/models/enums.js +5 -72
  13. package/dist-es/models/errors.js +0 -36
  14. package/dist-es/schemas/schemas_0.js +102 -290
  15. package/dist-types/Users.d.ts +1 -22
  16. package/dist-types/UsersClient.d.ts +2 -4
  17. package/dist-types/commands/QueryColleaguesCommand.d.ts +1 -0
  18. package/dist-types/commands/index.d.ts +0 -2
  19. package/dist-types/index.d.ts +0 -1
  20. package/dist-types/models/enums.d.ts +22 -288
  21. package/dist-types/models/errors.d.ts +0 -56
  22. package/dist-types/models/models_0.d.ts +12 -417
  23. package/dist-types/schemas/schemas_0.d.ts +0 -19
  24. package/package.json +1 -1
  25. package/dist-cjs/commands/ApplyAccountWorkspaceChangesCommand.js +0 -20
  26. package/dist-cjs/commands/ListAccountEmailChangesCommand.js +0 -20
  27. package/dist-cjs/pagination/Interfaces.js +0 -2
  28. package/dist-cjs/pagination/ListAccountEmailChangesPaginator.js +0 -7
  29. package/dist-cjs/pagination/index.js +0 -5
  30. package/dist-es/commands/ApplyAccountWorkspaceChangesCommand.js +0 -16
  31. package/dist-es/commands/ListAccountEmailChangesCommand.js +0 -16
  32. package/dist-es/pagination/Interfaces.js +0 -1
  33. package/dist-es/pagination/ListAccountEmailChangesPaginator.js +0 -4
  34. package/dist-es/pagination/index.js +0 -2
  35. package/dist-types/commands/ApplyAccountWorkspaceChangesCommand.d.ts +0 -193
  36. package/dist-types/commands/ListAccountEmailChangesCommand.d.ts +0 -101
  37. package/dist-types/pagination/Interfaces.d.ts +0 -8
  38. package/dist-types/pagination/ListAccountEmailChangesPaginator.d.ts +0 -7
  39. package/dist-types/pagination/index.d.ts +0 -2
@@ -1,193 +0,0 @@
1
- import { Command as $Command } from "@smithy/core/client";
2
- import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
3
- import type { ApplyAccountWorkspaceChangesInput, ApplyAccountWorkspaceChangesOutput } from "../models/models_0";
4
- import type { ServiceInputTypes, ServiceOutputTypes, UsersClientResolvedConfig } from "../UsersClient";
5
- /**
6
- * @public
7
- */
8
- export type { __MetadataBearer };
9
- export { $Command };
10
- /**
11
- * @public
12
- *
13
- * The input for {@link ApplyAccountWorkspaceChangesCommand}.
14
- */
15
- export interface ApplyAccountWorkspaceChangesCommandInput extends ApplyAccountWorkspaceChangesInput {
16
- }
17
- /**
18
- * @public
19
- *
20
- * The output of {@link ApplyAccountWorkspaceChangesCommand}.
21
- */
22
- export interface ApplyAccountWorkspaceChangesCommandOutput extends ApplyAccountWorkspaceChangesOutput, __MetadataBearer {
23
- }
24
- declare const ApplyAccountWorkspaceChangesCommand_base: {
25
- new (input: ApplyAccountWorkspaceChangesCommandInput): import("@smithy/core/client").CommandImpl<ApplyAccountWorkspaceChangesCommandInput, ApplyAccountWorkspaceChangesCommandOutput, UsersClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
- new (input: ApplyAccountWorkspaceChangesCommandInput): import("@smithy/core/client").CommandImpl<ApplyAccountWorkspaceChangesCommandInput, ApplyAccountWorkspaceChangesCommandOutput, UsersClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
- getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
28
- };
29
- /**
30
- * Previews or applies a set of changes to the workspaces of one or several x-bees accounts as one plan and one transaction: attach a workspace (taken from another account, or a detached one that belongs to no account), detach a workspace, make a workspace the default one. Every change names the account it acts on, so a whole board draft (for example a detach on an orphaned account plus a make-default on the login account) is applied atomically or not at all. Built for Stream Console; the owner (x-bees users service) is the only place the rules live.
31
- *
32
- * Callers: s2s (service-to-service) only, and only the service clients allowed to change account workspaces; any other caller gets ForbiddenException. x-bees tokens and API keys are refused.
33
- *
34
- * `dryRun: true` (preview) never writes anything: no DynamoDB write, no lock, no side effect. It always answers 200 with the planned `writes`, the `after` state and every `checks` entry, including the blocking ones (a stale `expected` is a blocking check `conflict`, a refusal is a blocking check with its code); it does not throw for them. Only malformed requests (ValidationException), an unknown `accountId` of a change (AccountNotFoundException) and a refused caller (ForbiddenException) throw in a dry run. Dry-run timestamps in `after` (e.g. `domainLinkedAt`) are those of the dry run: a backup must be built from the output of the apply call, not from the dry run's.
35
- *
36
- * `dryRun: false` (apply) re-runs every check against freshly read rows. When any check is blocking it writes nothing and throws: AccountWorkspaceConflictException for a stale `expected` (the row and the field that differ), AccountWorkspaceChangeRefusedException with the refusal `code` otherwise. When no check is blocking it takes the stream-link locks of the touched workspaces, writes every row of every touched account in one DynamoDB transaction conditional on `expected` (a row that changed in the meantime still ends in AccountWorkspaceConflictException with nothing written), then runs the post-commit side effects and reports each in `effects`. A failed side effect does not undo the committed change.
37
- *
38
- * Rules the checks enforce (dry run and apply alike):
39
- * - The per-account rules below run per account inside the one plan: an account's default, orphan state and `no_default` are judged on its state after all the changes of the call.
40
- * - Optimistic concurrency: every row the change touches must be in `expected` with the values the caller read (`expected_incomplete` when a row is missing, `conflict` when a value differs). `lastUsedAt` is never part of `expected`: a sign-in is not a conflict.
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
- * - 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
- * - 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`).
46
- * - 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
- * - 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
- * - A new default re-routes email resolution (direct messages, invites, call messages) to it (`email_routing_changes`, not blocking).
50
- *
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
- *
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
- *
55
- * @example
56
- * Use a bare-bones client and the command you need to make an API call.
57
- * ```javascript
58
- * import { UsersClient, ApplyAccountWorkspaceChangesCommand } from "@wildix/xbees-users-client"; // ES Modules import
59
- * // const { UsersClient, ApplyAccountWorkspaceChangesCommand } = require("@wildix/xbees-users-client"); // CommonJS import
60
- * // import type { UsersClientConfig } from "@wildix/xbees-users-client";
61
- * const config = {}; // type is UsersClientConfig
62
- * const client = new UsersClient(config);
63
- * const input = { // ApplyAccountWorkspaceChangesInput
64
- * changes: [ // AccountWorkspaceChangeList // required
65
- * { // AccountWorkspaceChange
66
- * accountId: "STRING_VALUE", // required
67
- * op: "attach" || "detach" || "makeDefault", // required
68
- * workspaceId: "STRING_VALUE", // required
69
- * fromAccountId: "STRING_VALUE",
70
- * },
71
- * ],
72
- * expected: [ // AccountWorkspaceExpectedRowList // required
73
- * { // AccountWorkspaceExpectedRow
74
- * pk: "STRING_VALUE", // required
75
- * sk: "STRING_VALUE", // required
76
- * fields: { // AccountWorkspaceRowFields
77
- * "<keys>": "DOCUMENT_VALUE",
78
- * },
79
- * },
80
- * ],
81
- * dryRun: true || false, // required
82
- * operator: { // AccountWorkspaceChangeOperator
83
- * email: "STRING_VALUE", // required
84
- * id: "STRING_VALUE",
85
- * name: "STRING_VALUE",
86
- * },
87
- * reason: "STRING_VALUE", // required
88
- * };
89
- * const command = new ApplyAccountWorkspaceChangesCommand(input);
90
- * const response = await client.send(command);
91
- * // { // ApplyAccountWorkspaceChangesOutput
92
- * // writes: [ // AccountWorkspaceWriteList // required
93
- * // { // AccountWorkspaceWrite
94
- * // pk: "STRING_VALUE", // required
95
- * // sk: "STRING_VALUE", // required
96
- * // kind: "put" || "update" || "delete" || "append", // required
97
- * // entity: "membership" || "accountSettings" || "pbx" || "stream" || "pbxUser", // required
98
- * // before: { // AccountWorkspaceRowFields
99
- * // "<keys>": "DOCUMENT_VALUE",
100
- * // },
101
- * // after: {
102
- * // "<keys>": "DOCUMENT_VALUE",
103
- * // },
104
- * // },
105
- * // ],
106
- * // after: [ // AccountWorkspacesStateList // required
107
- * // { // AccountWorkspacesState
108
- * // accountId: "STRING_VALUE", // required
109
- * // defaultWorkspace: "STRING_VALUE",
110
- * // workspaces: [ // AccountWorkspaceStateList // required
111
- * // { // AccountWorkspaceState
112
- * // id: "STRING_VALUE", // required
113
- * // type: "personal" || "work" || "support",
114
- * // active: true || false, // required
115
- * // isDefault: true || false, // required
116
- * // companyId: "STRING_VALUE",
117
- * // pbxLink: { // AccountWorkspacePbxLink
118
- * // companyId: "STRING_VALUE", // required
119
- * // domain: "STRING_VALUE", // required
120
- * // serial: "STRING_VALUE", // required
121
- * // pbxUserId: "STRING_VALUE",
122
- * // extension: "STRING_VALUE",
123
- * // },
124
- * // created: true || false,
125
- * // },
126
- * // ],
127
- * // },
128
- * // ],
129
- * // checks: [ // AccountWorkspaceCheckList // required
130
- * // { // 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
- * // blocking: true || false, // required
133
- * // row: { // AccountWorkspaceRowKey
134
- * // pk: "STRING_VALUE", // required
135
- * // sk: "STRING_VALUE", // required
136
- * // },
137
- * // field: "STRING_VALUE",
138
- * // accountId: "STRING_VALUE",
139
- * // workspaceId: "STRING_VALUE",
140
- * // message: "STRING_VALUE", // required
141
- * // },
142
- * // ],
143
- * // effects: [ // AccountWorkspaceEffectList // required
144
- * // { // AccountWorkspaceEffect
145
- * // name: "cognito" || "cache" || "stream" || "job", // required
146
- * // status: "ok" || "failed" || "skipped", // required
147
- * // target: "STRING_VALUE",
148
- * // detail: "STRING_VALUE",
149
- * // },
150
- * // ],
151
- * // };
152
- *
153
- * ```
154
- *
155
- * @param ApplyAccountWorkspaceChangesCommandInput - {@link ApplyAccountWorkspaceChangesCommandInput}
156
- * @returns {@link ApplyAccountWorkspaceChangesCommandOutput}
157
- * @see {@link ApplyAccountWorkspaceChangesCommandInput} for command's `input` shape.
158
- * @see {@link ApplyAccountWorkspaceChangesCommandOutput} for command's `response` shape.
159
- * @see {@link UsersClientResolvedConfig | config} for UsersClient's `config` shape.
160
- *
161
- * @throws {@link AccountNotFoundException} (client fault)
162
- *
163
- * @throws {@link AccountWorkspaceConflictException} (client fault)
164
- * A row the change touches no longer holds the values in `expected` (another writer changed it after the caller read it). Nothing was written. When several rows differ, the first one found is named; a dry run lists every one as a `conflict` check. Read the rows again and retry with fresh `expected`.
165
- *
166
- * @throws {@link AccountWorkspaceChangeRefusedException} (client fault)
167
- * The change breaks a rule of the owner and is refused (an apply whose checks hold a blocking refusal). Nothing was written. When several refusals apply, the first one found is named; a dry run lists every one as a blocking check.
168
- *
169
- * @throws {@link ValidationException} (client fault)
170
- *
171
- * @throws {@link ForbiddenException} (client fault)
172
- *
173
- * @throws {@link RateLimitExceededException} (client fault)
174
- *
175
- * @throws {@link UsersServiceException}
176
- * <p>Base exception class for all service exceptions from Users service.</p>
177
- *
178
- *
179
- * @public
180
- */
181
- export declare class ApplyAccountWorkspaceChangesCommand extends ApplyAccountWorkspaceChangesCommand_base {
182
- /** @internal type navigation helper, not in runtime. */
183
- protected static __types: {
184
- api: {
185
- input: ApplyAccountWorkspaceChangesInput;
186
- output: ApplyAccountWorkspaceChangesOutput;
187
- };
188
- sdk: {
189
- input: ApplyAccountWorkspaceChangesCommandInput;
190
- output: ApplyAccountWorkspaceChangesCommandOutput;
191
- };
192
- };
193
- }
@@ -1,101 +0,0 @@
1
- import { Command as $Command } from "@smithy/core/client";
2
- import type { MetadataBearer as __MetadataBearer } from "@smithy/types";
3
- import type { ListAccountEmailChangesInput, ListAccountEmailChangesOutput } from "../models/models_0";
4
- import type { ServiceInputTypes, ServiceOutputTypes, UsersClientResolvedConfig } from "../UsersClient";
5
- /**
6
- * @public
7
- */
8
- export type { __MetadataBearer };
9
- export { $Command };
10
- /**
11
- * @public
12
- *
13
- * The input for {@link ListAccountEmailChangesCommand}.
14
- */
15
- export interface ListAccountEmailChangesCommandInput extends ListAccountEmailChangesInput {
16
- }
17
- /**
18
- * @public
19
- *
20
- * The output of {@link ListAccountEmailChangesCommand}.
21
- */
22
- export interface ListAccountEmailChangesCommandOutput extends ListAccountEmailChangesOutput, __MetadataBearer {
23
- }
24
- declare const ListAccountEmailChangesCommand_base: {
25
- new (input: ListAccountEmailChangesCommandInput): import("@smithy/core/client").CommandImpl<ListAccountEmailChangesCommandInput, ListAccountEmailChangesCommandOutput, UsersClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
- new (input: ListAccountEmailChangesCommandInput): import("@smithy/core/client").CommandImpl<ListAccountEmailChangesCommandInput, ListAccountEmailChangesCommandOutput, UsersClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
- getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
28
- };
29
- /**
30
- * Lists the executions of the change-email state machine (the one ChangeUserEmail starts) whose old or new email is one of `emails`, newest first by `startedAt`. Read-only: it starts, stops and changes nothing (POST only to keep the emails out of URLs and access logs).
31
- *
32
- * Callers: s2s (service-to-service) only, and only the service clients allowed to read account history; any other caller gets ForbiddenException. x-bees tokens and API keys are refused.
33
- *
34
- * Step Functions keeps an execution for 90 days after it closes; older email changes are not returned. Emails are compared case-insensitively. The owner examines a bounded number of executions per call, so a page can hold fewer than `limit` executions, even none, while `nextToken` is present: continue until `nextToken` is absent or the caller has enough. The execution input holds no account id, so executions carry none.
35
- *
36
- * @example
37
- * Use a bare-bones client and the command you need to make an API call.
38
- * ```javascript
39
- * import { UsersClient, ListAccountEmailChangesCommand } from "@wildix/xbees-users-client"; // ES Modules import
40
- * // const { UsersClient, ListAccountEmailChangesCommand } = require("@wildix/xbees-users-client"); // CommonJS import
41
- * // import type { UsersClientConfig } from "@wildix/xbees-users-client";
42
- * const config = {}; // type is UsersClientConfig
43
- * const client = new UsersClient(config);
44
- * const input = { // ListAccountEmailChangesInput
45
- * emails: [ // AccountEmailChangeEmailList // required
46
- * "STRING_VALUE",
47
- * ],
48
- * limit: Number("int"),
49
- * nextToken: "STRING_VALUE",
50
- * };
51
- * const command = new ListAccountEmailChangesCommand(input);
52
- * const response = await client.send(command);
53
- * // { // ListAccountEmailChangesOutput
54
- * // executions: [ // AccountEmailChangeList // required
55
- * // { // AccountEmailChange
56
- * // executionArn: "STRING_VALUE", // required
57
- * // status: "RUNNING" || "SUCCEEDED" || "FAILED" || "TIMED_OUT" || "ABORTED" || "PENDING_REDRIVE", // required
58
- * // startedAt: "STRING_VALUE", // required
59
- * // stoppedAt: "STRING_VALUE",
60
- * // oldEmail: "STRING_VALUE", // required
61
- * // newEmail: "STRING_VALUE", // required
62
- * // oldCompanyId: "STRING_VALUE",
63
- * // newCompanyId: "STRING_VALUE",
64
- * // },
65
- * // ],
66
- * // nextToken: "STRING_VALUE",
67
- * // };
68
- *
69
- * ```
70
- *
71
- * @param ListAccountEmailChangesCommandInput - {@link ListAccountEmailChangesCommandInput}
72
- * @returns {@link ListAccountEmailChangesCommandOutput}
73
- * @see {@link ListAccountEmailChangesCommandInput} for command's `input` shape.
74
- * @see {@link ListAccountEmailChangesCommandOutput} for command's `response` shape.
75
- * @see {@link UsersClientResolvedConfig | config} for UsersClient's `config` shape.
76
- *
77
- * @throws {@link ValidationException} (client fault)
78
- *
79
- * @throws {@link ForbiddenException} (client fault)
80
- *
81
- * @throws {@link RateLimitExceededException} (client fault)
82
- *
83
- * @throws {@link UsersServiceException}
84
- * <p>Base exception class for all service exceptions from Users service.</p>
85
- *
86
- *
87
- * @public
88
- */
89
- export declare class ListAccountEmailChangesCommand extends ListAccountEmailChangesCommand_base {
90
- /** @internal type navigation helper, not in runtime. */
91
- protected static __types: {
92
- api: {
93
- input: ListAccountEmailChangesInput;
94
- output: ListAccountEmailChangesOutput;
95
- };
96
- sdk: {
97
- input: ListAccountEmailChangesCommandInput;
98
- output: ListAccountEmailChangesCommandOutput;
99
- };
100
- };
101
- }
@@ -1,8 +0,0 @@
1
- import type { PaginationConfiguration } from "@smithy/types";
2
- import { UsersClient } from "../UsersClient";
3
- /**
4
- * @public
5
- */
6
- export interface UsersPaginationConfiguration extends PaginationConfiguration {
7
- client: UsersClient;
8
- }
@@ -1,7 +0,0 @@
1
- import type { Paginator } from "@smithy/types";
2
- import { ListAccountEmailChangesCommandInput, ListAccountEmailChangesCommandOutput } from "../commands/ListAccountEmailChangesCommand";
3
- import type { UsersPaginationConfiguration } from "./Interfaces";
4
- /**
5
- * @public
6
- */
7
- export declare const paginateListAccountEmailChanges: (config: UsersPaginationConfiguration, input: ListAccountEmailChangesCommandInput, ...rest: any[]) => Paginator<ListAccountEmailChangesCommandOutput>;
@@ -1,2 +0,0 @@
1
- export * from "./Interfaces";
2
- export * from "./ListAccountEmailChangesPaginator";