@whooshbang/contract-mock 1.0.0-rc.34 → 1.0.0-rc.35
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 +12 -0
- package/README.md +17 -13
- package/dist/core.d.ts +1 -1
- package/dist/core.js +184 -184
- package/dist/core.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +21 -21
- package/package.json +3 -3
- package/scenarios/v1/manifest.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ recorded here.
|
|
|
5
5
|
|
|
6
6
|
## Unreleased
|
|
7
7
|
|
|
8
|
+
## 1.0.0-rc.35
|
|
9
|
+
|
|
10
|
+
### Breaking
|
|
11
|
+
|
|
12
|
+
- Exercise the organization contract from `@whooshbang/contracts@1.0.0-rc.23`
|
|
13
|
+
with `@whooshbang/sdk@1.0.0-rc.32` (FXO-2337). Mock administration routes,
|
|
14
|
+
response fields, fixture authorities and closure confirmation now use
|
|
15
|
+
organization terminology, including `/v1/organization`, `organization_id`
|
|
16
|
+
and `close-organization`.
|
|
17
|
+
- Remove the former tenant route and field spellings without aliases. Update
|
|
18
|
+
consumer fixtures and SDK validators together with the integration.
|
|
19
|
+
|
|
8
20
|
## 1.0.0-rc.34
|
|
9
21
|
|
|
10
22
|
- Upgrade the Hono runtime to 4.13.7 so consumers do not inherit the security
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Deterministic, in-memory WhooshBang V1 mock for local contract tests.
|
|
4
4
|
It implements the WhooshBang-owned release candidate without a cloud
|
|
5
|
-
|
|
5
|
+
organization, network service, database, or production provider.
|
|
6
6
|
|
|
7
7
|
Run the current release candidate directly from the public npm registry:
|
|
8
8
|
|
|
@@ -31,9 +31,13 @@ const response = await mock.fetch(
|
|
|
31
31
|
);
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
The
|
|
34
|
+
The organization contract batch pairs mock `1.0.0-rc.35` with contracts
|
|
35
|
+
`1.0.0-rc.23` and SDK `1.0.0-rc.32`. Install that batch together after
|
|
36
|
+
publication; the tenant rename has no old-route or old-field aliases.
|
|
37
|
+
|
|
38
|
+
The mock also executes the organization-scoped administration contract. Use
|
|
35
39
|
`humanSession` (or `otherHumanSession` for isolation tests) with
|
|
36
|
-
`GET /v1/
|
|
40
|
+
`GET /v1/organization`, `GET/POST /v1/projects`, and
|
|
37
41
|
`GET /v1/projects/{project_id}`. Project creation atomically returns synthetic
|
|
38
42
|
`test` and `live` environments and one `Default` notifier for each.
|
|
39
43
|
|
|
@@ -54,7 +58,7 @@ unavailable, and unsubscribe copy is rejected just as it is by the service.
|
|
|
54
58
|
|
|
55
59
|
Subscriber data exports are available at
|
|
56
60
|
`GET /v1/projects/{project_id}/subscribers/{subscriber_id}/data-export` through
|
|
57
|
-
an
|
|
61
|
+
an organization grant, organization credential, or human session. The project-wide operation refuses a
|
|
58
62
|
one-environment project credential, requires `subscriptions:read`,
|
|
59
63
|
`messages:read`, and `machine-clients:read`, and returns a JSON attachment with
|
|
60
64
|
caching disabled.
|
|
@@ -63,11 +67,11 @@ synthetic recipient-response and delivery records to exercise all three
|
|
|
63
67
|
provenance sections; it does not reconstruct a complete activity history.
|
|
64
68
|
WhooshBang-controller audit and service-log data are listed as exclusions.
|
|
65
69
|
|
|
66
|
-
The same
|
|
70
|
+
The same organization authorities erase a subscriber through
|
|
67
71
|
`DELETE /v1/projects/{project_id}/subscribers/{subscriber_id}` when they carry
|
|
68
72
|
all three corresponding write scopes. Repeats return the same empty `204`.
|
|
69
|
-
`POST /v1/
|
|
70
|
-
exact `close-
|
|
73
|
+
`POST /v1/organization/close` accepts only an administrator human session and the
|
|
74
|
+
exact `close-organization` confirmation; its repeat-safe result names any synthetic
|
|
71
75
|
customer-managed provider resource that still needs manual retirement.
|
|
72
76
|
|
|
73
77
|
Project credentials also execute the customer-endpoint lifecycle under
|
|
@@ -133,16 +137,16 @@ reuses a published code and is told apart by `field_errors[].code`: a rejected
|
|
|
133
137
|
credential is `request_invalid` with `provider_credential_invalid`, an occupied
|
|
134
138
|
webhook is `request_invalid` with `webhook_takeover_required`, a replacement
|
|
135
139
|
for another bot is `request_invalid` with `provider_identity_mismatch`, a bot
|
|
136
|
-
any
|
|
140
|
+
any organization already connected is `idempotency_conflict` with
|
|
137
141
|
`provider_identity_claimed`, and rotating a WhooshBang-operated credential is
|
|
138
142
|
`idempotency_conflict` with `credential_not_customer_owned`. The identity claim
|
|
139
|
-
is global on purpose — a bot connected by one
|
|
143
|
+
is global on purpose — a bot connected by one organization is refused to every
|
|
140
144
|
other — and archiving or purging releases it, so a customer can always
|
|
141
145
|
reconnect a bot it owns. Purge is repeat-safe and destroys custody; the mock
|
|
142
146
|
does not drive the `provider_outcome_unknown` and `provider_retryable` arms.
|
|
143
147
|
|
|
144
148
|
A `customer_managed` create has Telegram make a brand new bot on the
|
|
145
|
-
administrator's own account. It carries no credential field at all, because the
|
|
149
|
+
administrator's own Telegram account. It carries no credential field at all, because the
|
|
146
150
|
new bot's token travels provider to service and never through a browser, a
|
|
147
151
|
clipboard, this request, or any response. The connection comes back `pending`
|
|
148
152
|
carrying a `setup`: a link the administrator opens, the moment it stops
|
|
@@ -234,9 +238,9 @@ All credentials are synthetic local fixtures:
|
|
|
234
238
|
|
|
235
239
|
| Exported key | Bearer token | Identity |
|
|
236
240
|
| --- | --- | --- |
|
|
237
|
-
| `humanSession` | `human-session-token` | default
|
|
238
|
-
| `otherHumanSession` | `human-other-session-token` | isolated
|
|
239
|
-
| `
|
|
241
|
+
| `humanSession` | `human-session-token` | default organization administrator |
|
|
242
|
+
| `otherHumanSession` | `human-other-session-token` | isolated organization administrator |
|
|
243
|
+
| `organization` | `organization-credential-token` | default organization API credential |
|
|
240
244
|
| `projectTest` | `project-test-token` | default test project |
|
|
241
245
|
| `liveProject` | `project-live-token` | default live project |
|
|
242
246
|
| `projectA` | `project-a-token` | isolated test project A |
|
package/dist/core.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare const CONTRACT_MOCK_FIXTURE_ENVIRONMENTS: Readonly<{
|
|
|
17
17
|
readonly testEnvironmentId: "environment_project_synthetic_test";
|
|
18
18
|
}>;
|
|
19
19
|
export declare const CONTRACT_MOCK_FIXTURE_CREDENTIALS: Readonly<{
|
|
20
|
-
readonly
|
|
20
|
+
readonly organization: "organization-credential-token";
|
|
21
21
|
readonly grant: "oauth-grant-token";
|
|
22
22
|
readonly humanSession: "human-session-token";
|
|
23
23
|
readonly otherGrant: "oauth-grant-other-token";
|