euclid-ndk 0.2.0 → 0.3.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.
- package/README.md +52 -3
- package/dist/dto/ens.d.ts +40 -1
- package/dist/dto/ens.d.ts.map +1 -1
- package/dist/dto/ens.js +15 -0
- package/dist/dto/ens.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/modules/ens.d.ts +63 -2
- package/dist/modules/ens.d.ts.map +1 -1
- package/dist/modules/ens.js +72 -2
- package/dist/modules/ens.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -325,6 +325,8 @@ instrumentation says so rather than leaving the server to guess from a rate.
|
|
|
325
325
|
| --- | --- |
|
|
326
326
|
| `createTopic`, `listTopics`, `getTopicErn`, `getTopicMetadata`, `purgeTopic`, `purgeAllTopics`, `deleteTopic` | topics |
|
|
327
327
|
| `addTopicTag`, `setTopicTag`, `deleteTopicTag` | topic tags |
|
|
328
|
+
| `stopTopic`, `startTopic` | holding delivery, and handing over what was held |
|
|
329
|
+
| `setTopicRetention` | how long a published message is kept at all |
|
|
328
330
|
| `publishMessage`, `listMessages`, `getMessageCount` | messages |
|
|
329
331
|
| `getMessageAttribute`, `setMessageAttribute` | one published message at a time |
|
|
330
332
|
| `subscribe`, `listSubscriptions`, `unsubscribe` | delivery onward to a queue |
|
|
@@ -347,6 +349,48 @@ not withdrawn when the subscription goes. Subscribing is not idempotent, as in E
|
|
|
347
349
|
A topic's counters are not a queue's: `available`, `send` and `resend` count delivery rather than a
|
|
348
350
|
backlog, since a topic does not hold one.
|
|
349
351
|
|
|
352
|
+
### Holding delivery
|
|
353
|
+
|
|
354
|
+
`stopTopic` stops a topic delivering without stopping it accepting - what is published while it is stopped
|
|
355
|
+
is stored and fanned out when `startTopic` runs, oldest first:
|
|
356
|
+
|
|
357
|
+
```ts
|
|
358
|
+
await ens.stopTopic(topic.ern); // subscribers are being redeployed
|
|
359
|
+
// ... publishers carry on, and nothing is lost
|
|
360
|
+
const started = await ens.startTopic(topic.ern);
|
|
361
|
+
console.log(`${started.released} held message(s) delivered`);
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
So a subscriber being redeployed, or a downstream system taken down for the evening, is a reason to hold
|
|
365
|
+
delivery rather than to lose what arrives meanwhile. `released` is delivery rather than a promise of it: the
|
|
366
|
+
fan-out happens inside that call, so starting a topic that collected a fortnight of traffic is a fortnight of
|
|
367
|
+
fan-out here. The server works a page at a time and marks each message as it goes, so an interrupted start has
|
|
368
|
+
delivered a prefix rather than nothing and running it again picks up where it stopped. Starting a topic that
|
|
369
|
+
was never stopped is not an error - nothing is held, nothing is released.
|
|
370
|
+
|
|
371
|
+
`getTopicMetadata` is where to look before starting one: `held` says how much has piled up, and `status` reads
|
|
372
|
+
`TOPIC_RUNNING` or `TOPIC_STOPPED`. Both also appear on every topic a listing returns. Nothing already
|
|
373
|
+
delivered is affected by either call - a message on a subscriber's queue belongs to that queue.
|
|
374
|
+
|
|
375
|
+
### Retention
|
|
376
|
+
|
|
377
|
+
A topic is fanned out at publish time, so nothing ever consumes its messages and nothing else removes them:
|
|
378
|
+
without a retention period the collection only grows, and because every topic shares it, one busy topic is
|
|
379
|
+
paid for by every publish in the installation. `setTopicRetention` is what bounds that:
|
|
380
|
+
|
|
381
|
+
```ts
|
|
382
|
+
import { INSTALLATION_RETENTION } from "euclid-ndk";
|
|
383
|
+
|
|
384
|
+
await ens.setTopicRetention(topic.ern, 7 * 24 * 60 * 60); // seconds: keep a week
|
|
385
|
+
await ens.setTopicRetention(topic.ern, INSTALLATION_RETENTION); // or follow the installation's own
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
`INSTALLATION_RETENTION` (zero) means this topic has never been told what it wants and follows
|
|
389
|
+
`euclid.modules.ens.retention-period` as that changes, rather than freezing a copy of what it says today. A
|
|
390
|
+
negative period is refused here before the round trip, as the server would refuse it anyway. The change
|
|
391
|
+
applies to messages published afterwards: the expiry is stamped on each message when it is stored and
|
|
392
|
+
enforced by a TTL index, so the ones already there keep the expiry they were given.
|
|
393
|
+
|
|
350
394
|
One wire asymmetry is reproduced rather than papered over: an attribute's name travels as `name` in
|
|
351
395
|
most of EQS and as `key` throughout ENS, so a request this SDK builds matches what euclid-cli and
|
|
352
396
|
euclid-jdk send.
|
|
@@ -594,9 +638,14 @@ published. `workflow_dispatch` does the same for whatever `main` says, which is
|
|
|
594
638
|
tag predates this workflow needs; it checks the two files against each other but has no tag to
|
|
595
639
|
compare.
|
|
596
640
|
|
|
597
|
-
Publishing authenticates
|
|
598
|
-
|
|
599
|
-
|
|
641
|
+
Publishing authenticates as this repository rather than as somebody: npm is configured with a trusted
|
|
642
|
+
publisher for `jensvogt/euclid-ndk` and `publish.yml`, and mints a short-lived token from the
|
|
643
|
+
workflow's own OIDC identity - the same identity that signs the provenance attestation. The
|
|
644
|
+
`NPM_TOKEN` secret remains as a fallback for a run where that exchange is unavailable, and can be
|
|
645
|
+
deleted once a release has published without it. A token that npm refuses fails with
|
|
646
|
+
`E403 ... You may not perform that action with these credentials`, which is the same answer for a
|
|
647
|
+
read-only token, a granular token not scoped to this package, and a token npm no longer accepts for
|
|
648
|
+
direct publishing - the registry does not say which.
|
|
600
649
|
|
|
601
650
|
## Licence
|
|
602
651
|
|
package/dist/dto/ens.d.ts
CHANGED
|
@@ -19,6 +19,16 @@ export interface Topic {
|
|
|
19
19
|
size: number;
|
|
20
20
|
messages: number;
|
|
21
21
|
maxMessageLength: number;
|
|
22
|
+
/**
|
|
23
|
+
* `RUNNING` or `STOPPED` - see {@link import("../modules/ens.js").EuclidEns.stopTopic}. A stopped topic
|
|
24
|
+
* still accepts what is published to it; it holds it rather than fanning it out.
|
|
25
|
+
*/
|
|
26
|
+
status: string;
|
|
27
|
+
/**
|
|
28
|
+
* How long a published message is kept, in seconds. Zero means this topic has never been told what it
|
|
29
|
+
* wants and follows the installation's default as that changes.
|
|
30
|
+
*/
|
|
31
|
+
retentionPeriod: number;
|
|
22
32
|
created: string;
|
|
23
33
|
modified: string;
|
|
24
34
|
}
|
|
@@ -52,7 +62,7 @@ export interface CreateTopicResult {
|
|
|
52
62
|
name: string;
|
|
53
63
|
ern: string;
|
|
54
64
|
}
|
|
55
|
-
/** Where a topic lives
|
|
65
|
+
/** Where a topic lives, how much has been published to it, and whether it is delivering. */
|
|
56
66
|
export interface TopicMetadata {
|
|
57
67
|
region: string;
|
|
58
68
|
accountId: string;
|
|
@@ -62,6 +72,33 @@ export interface TopicMetadata {
|
|
|
62
72
|
ern: string;
|
|
63
73
|
size: number;
|
|
64
74
|
messages: number;
|
|
75
|
+
/** `RUNNING` or `STOPPED`. */
|
|
76
|
+
status: string;
|
|
77
|
+
/** How long a published message is kept, in seconds; zero follows the installation's default. */
|
|
78
|
+
retentionPeriod: number;
|
|
79
|
+
/**
|
|
80
|
+
* How many messages are waiting for this topic to be started again. Nothing but a stopped topic - or one
|
|
81
|
+
* that was stopped - has any, and the server only counts them for a topic that is stopped.
|
|
82
|
+
*/
|
|
83
|
+
held: number;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A topic after being started or stopped, and what starting it let go.
|
|
87
|
+
*
|
|
88
|
+
* `released` is how many held messages were delivered to the topic's subscriptions on the way - zero for a
|
|
89
|
+
* stop, and zero for a start of a topic that was never stopped. It is delivery rather than a promise of it:
|
|
90
|
+
* the messages went to the subscriptions as they went out.
|
|
91
|
+
*/
|
|
92
|
+
export interface TopicStateResult {
|
|
93
|
+
ern: string;
|
|
94
|
+
/** `RUNNING` or `STOPPED`, as it now stands. */
|
|
95
|
+
status: string;
|
|
96
|
+
released: number;
|
|
97
|
+
}
|
|
98
|
+
/** A topic's retention period after setting it, in seconds. Zero means the installation's own. */
|
|
99
|
+
export interface TopicRetentionResult {
|
|
100
|
+
ern: string;
|
|
101
|
+
retentionPeriod: number;
|
|
65
102
|
}
|
|
66
103
|
/**
|
|
67
104
|
* A topic's message counters - the server's own three, which are not a queue's.
|
|
@@ -80,5 +117,7 @@ export declare function toTopicMessage(document: unknown): TopicMessage;
|
|
|
80
117
|
export declare function toTopicMessageAttribute(document: unknown): TopicMessageAttribute;
|
|
81
118
|
export declare function toCreateTopicResult(document: unknown): CreateTopicResult;
|
|
82
119
|
export declare function toTopicMetadata(document: unknown): TopicMetadata;
|
|
120
|
+
export declare function toTopicStateResult(document: unknown): TopicStateResult;
|
|
121
|
+
export declare function toTopicRetentionResult(document: unknown): TopicRetentionResult;
|
|
83
122
|
export declare function toTopicMessageCount(document: unknown): TopicMessageCount;
|
|
84
123
|
//# sourceMappingURL=ens.d.ts.map
|
package/dist/dto/ens.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ens.d.ts","sourceRoot":"","sources":["../../src/dto/ens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAA2B,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAKjE,+EAA+E;AAC/E,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wCAAwC;AACxC,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,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EAAE,OAAO,GAAG,KAAK,CAchD;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,YAAY,CAa9D;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,GAAG,qBAAqB,CAMhF;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,GAAG,iBAAiB,CAExE;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,aAAa,CAchE;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,gBAAgB,CAMtE;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,oBAAoB,CAE9E;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,OAAO,GAAG,iBAAiB,CAOxE"}
|
package/dist/dto/ens.js
CHANGED
|
@@ -21,6 +21,8 @@ export function toTopic(document) {
|
|
|
21
21
|
size: number(document, "size"),
|
|
22
22
|
messages: number(document, "messages"),
|
|
23
23
|
maxMessageLength: number(document, "maxMessageLength"),
|
|
24
|
+
status: text(document, "status"),
|
|
25
|
+
retentionPeriod: number(document, "retentionPeriod"),
|
|
24
26
|
created: text(document, "created"),
|
|
25
27
|
modified: text(document, "modified"),
|
|
26
28
|
};
|
|
@@ -59,8 +61,21 @@ export function toTopicMetadata(document) {
|
|
|
59
61
|
ern: text(document, "ern"),
|
|
60
62
|
size: number(document, "size"),
|
|
61
63
|
messages: number(document, "messages"),
|
|
64
|
+
status: text(document, "status"),
|
|
65
|
+
retentionPeriod: number(document, "retentionPeriod"),
|
|
66
|
+
held: number(document, "held"),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export function toTopicStateResult(document) {
|
|
70
|
+
return {
|
|
71
|
+
ern: text(document, "ern"),
|
|
72
|
+
status: text(document, "status"),
|
|
73
|
+
released: number(document, "released"),
|
|
62
74
|
};
|
|
63
75
|
}
|
|
76
|
+
export function toTopicRetentionResult(document) {
|
|
77
|
+
return { ern: text(document, "ern"), retentionPeriod: number(document, "retentionPeriod") };
|
|
78
|
+
}
|
|
64
79
|
export function toTopicMessageCount(document) {
|
|
65
80
|
return {
|
|
66
81
|
ern: text(document, "ern"),
|
package/dist/dto/ens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ens.js","sourceRoot":"","sources":["../../src/dto/ens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAgB,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ens.js","sourceRoot":"","sources":["../../src/dto/ens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAgB,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAoH5D,qGAAqG;AAErG,MAAM,UAAU,OAAO,CAAC,QAAiB;IACvC,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC5B,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC9B,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC;QAC1B,IAAI,EAAE,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC;QACjC,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC9B,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC;QACtC,gBAAgB,EAAE,MAAM,CAAC,QAAQ,EAAE,kBAAkB,CAAC;QACtD,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAChC,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,i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AAQ,EAAE,KAAK,CAAC;QAC1B,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC;QACxC,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC9B,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC;KACnC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export type { ListListenersResult, Listener, ListenerCertificate, Route, } from
|
|
|
38
38
|
export type { Application, Endpoint, LogLevelResult } from "./dto/eap.js";
|
|
39
39
|
export { CREATED_ATTRIBUTE, MODIFIED_ATTRIBUTE, type Item, type QueryResult, type ScanResult, type TableDescription, } from "./dto/ekv.js";
|
|
40
40
|
export type { Certificate, CreateKeyResult, DeleteCertificateResult, DeleteKeyResult, Key, KeyDescriptionResult, RevokeKeyResult, } from "./dto/ekm.js";
|
|
41
|
-
export type { CreateTopicResult, Topic, TopicMessage, TopicMessageAttribute, TopicMessageCount, TopicMetadata, } from "./dto/ens.js";
|
|
41
|
+
export type { CreateTopicResult, Topic, TopicMessage, TopicMessageAttribute, TopicMessageCount, TopicMetadata, TopicRetentionResult, TopicStateResult, } from "./dto/ens.js";
|
|
42
42
|
export type { DeleteSecretResult, Secret, SecretValue } from "./dto/ess.js";
|
|
43
43
|
export type { CreateQueueResult, Queue, QueueMessage, QueueMessageAttribute, QueueMessageCount, QueueMessageMetadata, QueueMetadata, QueueStatusResult, RedriveDlqResult, RedriveTarget, } from "./dto/eqs.js";
|
|
44
44
|
export type { Bucket, BucketEvent, CreateBucketResult, CreateDownloadResult, CreateUploadResult, DeleteObjectsResult, DisableEncryptionResult, EnableEncryptionResult, EsmObject, ObjectAttribute, PurgeBucketResult, RenameBucketResult, SetBucketInternalResult, StoredObject, TouchObjectResult, } from "./dto/esm.js";
|
|
@@ -50,12 +50,12 @@ export { EuclidEag, PROTOCOL_HTTP, PROTOCOL_HTTPS, ROUTE_AUTH_BASIC, ROUTE_AUTH_
|
|
|
50
50
|
export { DEFAULT_MAX_INSTANCES, DEFAULT_MIN_INSTANCES, DEFAULT_READY_TIMEOUT_MS, EuclidEap, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_OFF, LOG_TRACE, LOG_WARNING, RUNTIME_BINARY, RUNTIME_JAVA, RUNTIME_NODEJS, RUNTIME_PYTHON, STATE_RUNNING, STATE_STOPPED, type CreateApplicationOptions, type UpdateApplicationChanges, } from "./modules/eap.js";
|
|
51
51
|
export { EuclidEkv, KEY_BINARY, KEY_NUMBER, KEY_STRING, SORT_BEGINS_WITH, SORT_BETWEEN, SORT_EQ, SORT_GE, SORT_GT, SORT_LE, SORT_LT, WHOLE_PARTITION, type CreateTableOptions, type QueryOptions, type ScanOptions, } from "./modules/ekv.js";
|
|
52
52
|
export { AES, DEFAULT_KEY_LENGTH, DEFAULT_PENDING_WINDOW_DAYS, EuclidEkm, type CreateCertificateOptions, type CreateKeyOptions, } from "./modules/ekm.js";
|
|
53
|
-
export { EuclidEns, type PublishMessageOptions, type PurgeAllTopicsOptions, } from "./modules/ens.js";
|
|
53
|
+
export { EuclidEns, INSTALLATION_RETENTION, TOPIC_RUNNING, TOPIC_STOPPED, type PublishMessageOptions, type PurgeAllTopicsOptions, } from "./modules/ens.js";
|
|
54
54
|
export { DEFAULT_MAX_RETRIES, DEFAULT_VISIBILITY, EuclidEqs, type CreateQueueOptions, type ListQueuesOptions, type PurgeAllQueuesOptions, type ReceiveMessagesOptions, type SendMessageOptions, } from "./modules/eqs.js";
|
|
55
55
|
export { EuclidEss, type CreateSecretOptions, type UpdateSecretChanges, } from "./modules/ess.js";
|
|
56
56
|
export { DEFAULT_CONCURRENCY, DEFAULT_PART_SIZE, EuclidEsm, OBJECT_CREATED, OBJECT_DELETED, OBJECT_UPDATED, parseBucketEvent, type AttributeOptions, type DownloadOptions, type ListBucketsOptions, type ListObjectsOptions, type SubscribeOptions, type TouchObjectOptions, type UploadOptions, } from "./modules/esm.js";
|
|
57
57
|
/** The version this package was published as. */
|
|
58
|
-
export declare const VERSION = "0.
|
|
58
|
+
export declare const VERSION = "0.3.0";
|
|
59
59
|
/** Options {@link Euclid.login} passes through to the builder, for the case that needs no builder. */
|
|
60
60
|
export interface LoginOptions {
|
|
61
61
|
email?: string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EACL,OAAO,EACP,KAAK,EACL,eAAe,EACf,eAAe,EACf,KAAK,aAAa,EAClB,OAAO,EACP,KAAK,GACN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,KAAK,EACL,KAAK,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,SAAS,EACT,OAAO,EACP,YAAY,EACZ,qBAAqB,EACrB,WAAW,EACX,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,EACnB,KAAK,GACN,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,IAAI,EACT,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,WAAW,EACX,eAAe,EACf,uBAAuB,EACvB,eAAe,EACf,GAAG,EACH,oBAAoB,EACpB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,iBAAiB,EACjB,KAAK,EACL,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EACL,OAAO,EACP,KAAK,EACL,eAAe,EACf,eAAe,EACf,KAAK,aAAa,EAClB,OAAO,EACP,KAAK,GACN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,KAAK,EACL,KAAK,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,SAAS,EACT,OAAO,EACP,YAAY,EACZ,qBAAqB,EACrB,WAAW,EACX,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,SAAS,GACV,MAAM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AAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;CAetG"}
|
package/dist/index.js
CHANGED
|
@@ -42,12 +42,12 @@ export { EuclidEag, PROTOCOL_HTTP, PROTOCOL_HTTPS, ROUTE_AUTH_BASIC, ROUTE_AUTH_
|
|
|
42
42
|
export { DEFAULT_MAX_INSTANCES, DEFAULT_MIN_INSTANCES, DEFAULT_READY_TIMEOUT_MS, EuclidEap, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_OFF, LOG_TRACE, LOG_WARNING, RUNTIME_BINARY, RUNTIME_JAVA, RUNTIME_NODEJS, RUNTIME_PYTHON, STATE_RUNNING, STATE_STOPPED, } from "./modules/eap.js";
|
|
43
43
|
export { EuclidEkv, KEY_BINARY, KEY_NUMBER, KEY_STRING, SORT_BEGINS_WITH, SORT_BETWEEN, SORT_EQ, SORT_GE, SORT_GT, SORT_LE, SORT_LT, WHOLE_PARTITION, } from "./modules/ekv.js";
|
|
44
44
|
export { AES, DEFAULT_KEY_LENGTH, DEFAULT_PENDING_WINDOW_DAYS, EuclidEkm, } from "./modules/ekm.js";
|
|
45
|
-
export { EuclidEns, } from "./modules/ens.js";
|
|
45
|
+
export { EuclidEns, INSTALLATION_RETENTION, TOPIC_RUNNING, TOPIC_STOPPED, } from "./modules/ens.js";
|
|
46
46
|
export { DEFAULT_MAX_RETRIES, DEFAULT_VISIBILITY, EuclidEqs, } from "./modules/eqs.js";
|
|
47
47
|
export { EuclidEss, } from "./modules/ess.js";
|
|
48
48
|
export { DEFAULT_CONCURRENCY, DEFAULT_PART_SIZE, EuclidEsm, OBJECT_CREATED, OBJECT_DELETED, OBJECT_UPDATED, parseBucketEvent, } from "./modules/esm.js";
|
|
49
49
|
/** The version this package was published as. */
|
|
50
|
-
export const VERSION = "0.
|
|
50
|
+
export const VERSION = "0.3.0";
|
|
51
51
|
/**
|
|
52
52
|
* Entry point: names a server, and hands out the module clients for it.
|
|
53
53
|
*
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EACL,OAAO,EACP,KAAK,EACL,eAAe,EACf,eAAe,EAEf,OAAO,EACP,KAAK,GACN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EACf,YAAY,GAEb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,KAAK,EACL,KAAK,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,aAAa,GAKd,MAAM,cAAc,CAAC;AAoBtB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,GAKnB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EACL,OAAO,EACP,KAAK,EACL,eAAe,EACf,eAAe,EAEf,OAAO,EACP,KAAK,GACN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,eAAe,EACf,YAAY,GAEb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,eAAe,EACf,KAAK,EACL,KAAK,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,EACZ,cAAc,EACd,iBAAiB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AAC,CAAC;QAC9D,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1E,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS;YAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS;YAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACjE,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACxE,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS;YAAE,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;QACtF,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3D,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS;YAAE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACvE,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;YAAE,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1E,OAAO,OAAO,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;CACF"}
|
package/dist/modules/ens.d.ts
CHANGED
|
@@ -16,15 +16,30 @@
|
|
|
16
16
|
* a consumer takes it; a topic hands each message to every subscriber and keeps it as a record of having
|
|
17
17
|
* done so. So there is no receive here, and no receipt handle: a subscriber consumes from its own queue,
|
|
18
18
|
* which is where the message was delivered.
|
|
19
|
+
*
|
|
20
|
+
* Two things about a topic can be changed while it is in service. {@link EuclidEns.stopTopic} holds delivery
|
|
21
|
+
* without refusing publishers - what arrives meanwhile is kept and fanned out when the topic is started
|
|
22
|
+
* again - which is what a subscriber being redeployed asks for. And {@link EuclidEns.setTopicRetention} says
|
|
23
|
+
* how long a published message is kept at all, since a topic is fanned out at publish time and nothing else
|
|
24
|
+
* would ever remove it.
|
|
19
25
|
*/
|
|
20
26
|
import { type SubscribeResult, type Subscription, type VariantInput } from "../dto/com.js";
|
|
21
27
|
import { type Page } from "../dto/eam.js";
|
|
22
|
-
import { type CreateTopicResult, type Topic, type TopicMessage, type TopicMessageAttribute, type TopicMessageCount, type TopicMetadata } from "../dto/ens.js";
|
|
28
|
+
import { type CreateTopicResult, type Topic, type TopicMessage, type TopicMessageAttribute, type TopicMessageCount, type TopicMetadata, type TopicRetentionResult, type TopicStateResult } from "../dto/ens.js";
|
|
23
29
|
import { ModuleClient, type ListOptions, type PageOptions } from "./base.js";
|
|
24
30
|
import type { EuclidSession } from "./eam.js";
|
|
25
31
|
export declare const TARGET = "ens";
|
|
26
32
|
/** The largest message a topic accepts, in bytes. */
|
|
27
33
|
export declare const DEFAULT_MAX_MESSAGE_LENGTH: number;
|
|
34
|
+
/** What a topic's `status` reads as: delivering what is published to it... */
|
|
35
|
+
export declare const TOPIC_RUNNING = "RUNNING";
|
|
36
|
+
/** ...or holding it until somebody starts the topic again. */
|
|
37
|
+
export declare const TOPIC_STOPPED = "STOPPED";
|
|
38
|
+
/**
|
|
39
|
+
* The retention period that means "whatever the installation says", rather than a number of seconds of this
|
|
40
|
+
* topic's own - see {@link EuclidEns.setTopicRetention}.
|
|
41
|
+
*/
|
|
42
|
+
export declare const INSTALLATION_RETENTION = 0;
|
|
28
43
|
/** What a published message carries besides its body. */
|
|
29
44
|
export interface PublishMessageOptions {
|
|
30
45
|
/** The publisher's own attributes, which travel onto the queues the message is delivered to. */
|
|
@@ -54,8 +69,54 @@ export declare class EuclidEns extends ModuleClient {
|
|
|
54
69
|
listTopics(options?: ListOptions): Promise<Page<Topic>>;
|
|
55
70
|
/** The ERN of the topic of this name, in the session's account and namespace. */
|
|
56
71
|
getTopicErn(name: string): Promise<string>;
|
|
57
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Where a topic lives, how much has been published to it, and whether it is delivering.
|
|
74
|
+
*
|
|
75
|
+
* `held` is the useful half of a stopped topic: it says how much has piled up waiting for
|
|
76
|
+
* {@link startTopic}, which is what decides whether starting it is a moment's work or a fan-out of a
|
|
77
|
+
* fortnight's traffic.
|
|
78
|
+
*/
|
|
58
79
|
getTopicMetadata(ern: string): Promise<TopicMetadata>;
|
|
80
|
+
/**
|
|
81
|
+
* Stops a topic delivering, without stopping it accepting.
|
|
82
|
+
*
|
|
83
|
+
* A stopped topic still takes what is published to it and stores it - it simply does not fan it out. That
|
|
84
|
+
* is the point: a subscriber being redeployed, or a downstream system taken down for the evening, is a
|
|
85
|
+
* reason to hold delivery rather than to lose what arrives meanwhile. Those messages are kept and
|
|
86
|
+
* delivered oldest first when {@link startTopic} runs.
|
|
87
|
+
*
|
|
88
|
+
* Nothing already delivered is affected: a message on a subscriber's queue belongs to that queue, and this
|
|
89
|
+
* is about what happens next.
|
|
90
|
+
*/
|
|
91
|
+
stopTopic(ern: string): Promise<TopicStateResult>;
|
|
92
|
+
/**
|
|
93
|
+
* Starts a topic delivering again, and hands its subscribers everything it held.
|
|
94
|
+
*
|
|
95
|
+
* The backlog goes out oldest first as part of this call, so a topic that collected a fortnight of traffic
|
|
96
|
+
* is a fortnight of fan-out here - the result's `released` says how many messages went. The server works a
|
|
97
|
+
* page at a time and marks each message as it goes, so a start that is interrupted has delivered a prefix
|
|
98
|
+
* rather than nothing, and running it again picks up where it stopped.
|
|
99
|
+
*
|
|
100
|
+
* Starting a topic that was never stopped is not an error: there is nothing held, nothing is released, and
|
|
101
|
+
* the status simply reads {@link TOPIC_RUNNING}.
|
|
102
|
+
*/
|
|
103
|
+
startTopic(ern: string): Promise<TopicStateResult>;
|
|
104
|
+
/**
|
|
105
|
+
* Sets how long a message published to this topic is kept, in seconds.
|
|
106
|
+
*
|
|
107
|
+
* Worth setting. A topic is fanned out at publish time, so nothing ever consumes its messages and nothing
|
|
108
|
+
* else removes them: without a retention period the collection only grows, and because every topic shares
|
|
109
|
+
* it, one busy topic is paid for by every publish in the installation.
|
|
110
|
+
*
|
|
111
|
+
* The change applies to messages published afterwards; the ones already stored keep the expiry they were
|
|
112
|
+
* given, since that is stamped on each message rather than looked up when it is read.
|
|
113
|
+
*
|
|
114
|
+
* @param retentionPeriod seconds, or {@link INSTALLATION_RETENTION} to follow
|
|
115
|
+
* `euclid.modules.ens.retention-period` as it changes rather than freezing a copy of what it says today.
|
|
116
|
+
* @throws {Error} if the period is negative, which the server refuses anyway - this just says so before the
|
|
117
|
+
* round trip.
|
|
118
|
+
*/
|
|
119
|
+
setTopicRetention(ern: string, retentionPeriod: number): Promise<TopicRetentionResult>;
|
|
59
120
|
/**
|
|
60
121
|
* Deletes every message a topic has kept, leaving the topic and its subscriptions in place.
|
|
61
122
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ens.d.ts","sourceRoot":"","sources":["../../src/modules/ens.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ens.d.ts","sourceRoot":"","sources":["../../src/modules/ens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAU,KAAK,IAAI,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EASL,KAAK,iBAAiB,EACtB,KAAK,KAAK,EACV,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAe,YAAY,EAAe,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACvG,OAAO,KAAK,EAAE,aAAa,EAAE,MA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CACvB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,qBAAqB,CAAC;IAOjC;;;;;;;;OAQG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,SAAQ,GAAG,OAAO,CAAC,eAAe,CAAC;IAMlG;;;OAGG;IACG,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7C,0DAA0D;IACpD,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAQlE;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAGlD"}
|
package/dist/modules/ens.js
CHANGED
|
@@ -16,14 +16,29 @@
|
|
|
16
16
|
* a consumer takes it; a topic hands each message to every subscriber and keeps it as a record of having
|
|
17
17
|
* done so. So there is no receive here, and no receipt handle: a subscriber consumes from its own queue,
|
|
18
18
|
* which is where the message was delivered.
|
|
19
|
+
*
|
|
20
|
+
* Two things about a topic can be changed while it is in service. {@link EuclidEns.stopTopic} holds delivery
|
|
21
|
+
* without refusing publishers - what arrives meanwhile is kept and fanned out when the topic is started
|
|
22
|
+
* again - which is what a subscriber being redeployed asks for. And {@link EuclidEns.setTopicRetention} says
|
|
23
|
+
* how long a published message is kept at all, since a topic is fanned out at publish time and nothing else
|
|
24
|
+
* would ever remove it.
|
|
19
25
|
*/
|
|
20
26
|
import { QUEUE, toSubscribeResult, toSubscription, variantMapToJson, variantOf, variantToJson, } from "../dto/com.js";
|
|
21
27
|
import { toPage } from "../dto/eam.js";
|
|
22
|
-
import { toCreateTopicResult, toTopic, toTopicMessage, toTopicMessageAttribute, toTopicMessageCount, toTopicMetadata, } from "../dto/ens.js";
|
|
28
|
+
import { toCreateTopicResult, toTopic, toTopicMessage, toTopicMessageAttribute, toTopicMessageCount, toTopicMetadata, toTopicRetentionResult, toTopicStateResult, } from "../dto/ens.js";
|
|
23
29
|
import { listPayload, ModuleClient, pagePayload } from "./base.js";
|
|
24
30
|
export const TARGET = "ens";
|
|
25
31
|
/** The largest message a topic accepts, in bytes. */
|
|
26
32
|
export const DEFAULT_MAX_MESSAGE_LENGTH = 1024 * 1024;
|
|
33
|
+
/** What a topic's `status` reads as: delivering what is published to it... */
|
|
34
|
+
export const TOPIC_RUNNING = "RUNNING";
|
|
35
|
+
/** ...or holding it until somebody starts the topic again. */
|
|
36
|
+
export const TOPIC_STOPPED = "STOPPED";
|
|
37
|
+
/**
|
|
38
|
+
* The retention period that means "whatever the installation says", rather than a number of seconds of this
|
|
39
|
+
* topic's own - see {@link EuclidEns.setTopicRetention}.
|
|
40
|
+
*/
|
|
41
|
+
export const INSTALLATION_RETENTION = 0;
|
|
27
42
|
/**
|
|
28
43
|
* ENS's operations, on the credentials of the session that created it.
|
|
29
44
|
*
|
|
@@ -51,10 +66,65 @@ export class EuclidEns extends ModuleClient {
|
|
|
51
66
|
async getTopicErn(name) {
|
|
52
67
|
return this.textOf("get-topic-ern", { name }, "ern");
|
|
53
68
|
}
|
|
54
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Where a topic lives, how much has been published to it, and whether it is delivering.
|
|
71
|
+
*
|
|
72
|
+
* `held` is the useful half of a stopped topic: it says how much has piled up waiting for
|
|
73
|
+
* {@link startTopic}, which is what decides whether starting it is a moment's work or a fan-out of a
|
|
74
|
+
* fortnight's traffic.
|
|
75
|
+
*/
|
|
55
76
|
async getTopicMetadata(ern) {
|
|
56
77
|
return toTopicMetadata(await this.call("get-topic-metadata", { ern }));
|
|
57
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Stops a topic delivering, without stopping it accepting.
|
|
81
|
+
*
|
|
82
|
+
* A stopped topic still takes what is published to it and stores it - it simply does not fan it out. That
|
|
83
|
+
* is the point: a subscriber being redeployed, or a downstream system taken down for the evening, is a
|
|
84
|
+
* reason to hold delivery rather than to lose what arrives meanwhile. Those messages are kept and
|
|
85
|
+
* delivered oldest first when {@link startTopic} runs.
|
|
86
|
+
*
|
|
87
|
+
* Nothing already delivered is affected: a message on a subscriber's queue belongs to that queue, and this
|
|
88
|
+
* is about what happens next.
|
|
89
|
+
*/
|
|
90
|
+
async stopTopic(ern) {
|
|
91
|
+
return toTopicStateResult(await this.call("stop-topic", { ern }));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Starts a topic delivering again, and hands its subscribers everything it held.
|
|
95
|
+
*
|
|
96
|
+
* The backlog goes out oldest first as part of this call, so a topic that collected a fortnight of traffic
|
|
97
|
+
* is a fortnight of fan-out here - the result's `released` says how many messages went. The server works a
|
|
98
|
+
* page at a time and marks each message as it goes, so a start that is interrupted has delivered a prefix
|
|
99
|
+
* rather than nothing, and running it again picks up where it stopped.
|
|
100
|
+
*
|
|
101
|
+
* Starting a topic that was never stopped is not an error: there is nothing held, nothing is released, and
|
|
102
|
+
* the status simply reads {@link TOPIC_RUNNING}.
|
|
103
|
+
*/
|
|
104
|
+
async startTopic(ern) {
|
|
105
|
+
return toTopicStateResult(await this.call("start-topic", { ern }));
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Sets how long a message published to this topic is kept, in seconds.
|
|
109
|
+
*
|
|
110
|
+
* Worth setting. A topic is fanned out at publish time, so nothing ever consumes its messages and nothing
|
|
111
|
+
* else removes them: without a retention period the collection only grows, and because every topic shares
|
|
112
|
+
* it, one busy topic is paid for by every publish in the installation.
|
|
113
|
+
*
|
|
114
|
+
* The change applies to messages published afterwards; the ones already stored keep the expiry they were
|
|
115
|
+
* given, since that is stamped on each message rather than looked up when it is read.
|
|
116
|
+
*
|
|
117
|
+
* @param retentionPeriod seconds, or {@link INSTALLATION_RETENTION} to follow
|
|
118
|
+
* `euclid.modules.ens.retention-period` as it changes rather than freezing a copy of what it says today.
|
|
119
|
+
* @throws {Error} if the period is negative, which the server refuses anyway - this just says so before the
|
|
120
|
+
* round trip.
|
|
121
|
+
*/
|
|
122
|
+
async setTopicRetention(ern, retentionPeriod) {
|
|
123
|
+
if (retentionPeriod < 0) {
|
|
124
|
+
throw new Error("retentionPeriod cannot be negative; zero follows the installation default");
|
|
125
|
+
}
|
|
126
|
+
return toTopicRetentionResult(await this.call("set-topic-retention", { ern, retentionPeriod }));
|
|
127
|
+
}
|
|
58
128
|
/**
|
|
59
129
|
* Deletes every message a topic has kept, leaving the topic and its subscriptions in place.
|
|
60
130
|
*
|
package/dist/modules/ens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ens.js","sourceRoot":"","sources":["../../src/modules/ens.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ens.js","sourceRoot":"","sources":["../../src/modules/ens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EACL,KAAK,EACL,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,aAAa,GAId,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAa,MAAM,eAAe,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,OAAO,EACP,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,GASnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAsC,MAAM,WAAW,CAAC;AAGvG,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC;AAE5B,qDAAqD;AACrD,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AACvC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AAEvC;;;GAGG;AACH,MAAM,CAAC,MAAM,s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