@kensio/yulin 1.16.0 → 1.16.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.
- package/README.md +44 -46
- package/dist/service/aws/factory/sim-aws-account-region-service-builder.js +2 -2
- package/dist/service/aws/factory/sim-aws-account-region-service-builder.js.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.d.ts +3 -2
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.d.ts.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.js.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-signer.d.ts +5 -2
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-signer.d.ts.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-signer.js +38 -2
- package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-signer.js.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.d.ts.map +1 -1
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.js +5 -2
- package/dist/service/cloudfront/origin/custom/sim-cf-function-url-origin-template.factory.js.map +1 -1
- package/dist/service/cognito/command/hosted/hosted-auth.command.d.ts +10 -0
- package/dist/service/cognito/command/hosted/hosted-auth.command.d.ts.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-endpoint.d.ts +14 -13
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-endpoint.d.ts.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-endpoint.js +14 -18
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-endpoint.js.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-request.d.ts +15 -6
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-request.d.ts.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-request.js +26 -19
- package/dist/service/cognito/command/hosted/sim-cognito-authorize-request.js.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-commands.d.ts.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-commands.js +5 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-commands.js.map +1 -1
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.d.ts +41 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.d.ts.map +1 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.js +71 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.js.map +1 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-sign-in.d.ts +32 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-sign-in.d.ts.map +1 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-sign-in.js +36 -0
- package/dist/service/cognito/command/hosted/sim-cognito-hosted-sign-in.js.map +1 -0
- package/dist/service/cognito/error/sim-cognito-managed-login.error.d.ts +22 -0
- package/dist/service/cognito/error/sim-cognito-managed-login.error.d.ts.map +1 -0
- package/dist/service/cognito/error/sim-cognito-managed-login.error.js +32 -0
- package/dist/service/cognito/error/sim-cognito-managed-login.error.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-confirm-page.d.ts +29 -0
- package/dist/service/cognito/serve/page/sim-cognito-confirm-page.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-confirm-page.js +90 -0
- package/dist/service/cognito/serve/page/sim-cognito-confirm-page.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.d.ts +38 -0
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.js +62 -0
- package/dist/service/cognito/serve/page/sim-cognito-managed-login.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-form.d.ts +47 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-form.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-form.js +76 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-form.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-markup.d.ts +69 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-markup.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-markup.js +111 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-markup.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.d.ts +39 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.js +59 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-paths.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-request.d.ts +22 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-request.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-request.js +30 -0
- package/dist/service/cognito/serve/page/sim-cognito-page-request.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.d.ts +28 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.js +45 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.js.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-up-page.d.ts +35 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-up-page.d.ts.map +1 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-up-page.js +85 -0
- package/dist/service/cognito/serve/page/sim-cognito-sign-up-page.js.map +1 -0
- package/dist/service/cognito/serve/sim-cognito-domain-endpoints.d.ts +20 -23
- package/dist/service/cognito/serve/sim-cognito-domain-endpoints.d.ts.map +1 -1
- package/dist/service/cognito/serve/sim-cognito-domain-endpoints.js +40 -19
- package/dist/service/cognito/serve/sim-cognito-domain-endpoints.js.map +1 -1
- package/dist/service/cognito/serve/sim-cognito-domain-request.d.ts +14 -0
- package/dist/service/cognito/serve/sim-cognito-domain-request.d.ts.map +1 -0
- package/dist/service/cognito/serve/sim-cognito-domain-request.js +2 -0
- package/dist/service/cognito/serve/sim-cognito-domain-request.js.map +1 -0
- package/dist/service/iam/sigv4/canonical/sim-iam-sigv4-payload-hash.d.ts +8 -0
- package/dist/service/iam/sigv4/canonical/sim-iam-sigv4-payload-hash.d.ts.map +1 -1
- package/dist/service/iam/sigv4/canonical/sim-iam-sigv4-payload-hash.js +14 -6
- package/dist/service/iam/sigv4/canonical/sim-iam-sigv4-payload-hash.js.map +1 -1
- package/dist/service/lambda/serve/auth/sim-lambda-url-payload-hash.d.ts +28 -0
- package/dist/service/lambda/serve/auth/sim-lambda-url-payload-hash.d.ts.map +1 -0
- package/dist/service/lambda/serve/auth/sim-lambda-url-payload-hash.js +56 -0
- package/dist/service/lambda/serve/auth/sim-lambda-url-payload-hash.js.map +1 -0
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.d.ts +16 -0
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.d.ts.map +1 -1
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.js +24 -0
- package/dist/service/lambda/serve/response/sim-lambda-url-error-response.js.map +1 -1
- package/dist/service/lambda/serve/sim-lambda-controller.d.ts +6 -0
- package/dist/service/lambda/serve/sim-lambda-controller.d.ts.map +1 -1
- package/dist/service/lambda/serve/sim-lambda-controller.js +11 -0
- package/dist/service/lambda/serve/sim-lambda-controller.js.map +1 -1
- package/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-properties.d.ts +4 -3
- package/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-properties.d.ts.map +1 -1
- package/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-properties.js +4 -3
- package/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-properties.js.map +1 -1
- package/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-property-names.d.ts +2 -2
- package/dist/service/sns/cfn/subscription/sim-cfn-sns-subscription-property-names.js +2 -2
- package/dist/service/sns/command/publish/sim-sns-publish-commands.d.ts +3 -0
- package/dist/service/sns/command/publish/sim-sns-publish-commands.d.ts.map +1 -1
- package/dist/service/sns/command/publish/sim-sns-publish-commands.js +4 -2
- package/dist/service/sns/command/publish/sim-sns-publish-commands.js.map +1 -1
- package/dist/service/sns/command/publish/sim-sns-publish-dispatch.d.ts +39 -0
- package/dist/service/sns/command/publish/sim-sns-publish-dispatch.d.ts.map +1 -0
- package/dist/service/sns/command/publish/sim-sns-publish-dispatch.js +42 -0
- package/dist/service/sns/command/publish/sim-sns-publish-dispatch.js.map +1 -0
- package/dist/service/sns/command/publish/sim-sns-publish-input.d.ts +3 -3
- package/dist/service/sns/command/publish/sim-sns-publish-input.d.ts.map +1 -1
- package/dist/service/sns/command/publish/sim-sns-publish-input.js +8 -8
- package/dist/service/sns/command/publish/sim-sns-publish-input.js.map +1 -1
- package/dist/service/sns/command/publish/sim-sns-publish-sms.d.ts +38 -0
- package/dist/service/sns/command/publish/sim-sns-publish-sms.d.ts.map +1 -0
- package/dist/service/sns/command/publish/sim-sns-publish-sms.js +53 -0
- package/dist/service/sns/command/publish/sim-sns-publish-sms.js.map +1 -0
- package/dist/service/sns/command/sim-sns-command.types.d.ts +1 -0
- package/dist/service/sns/command/sim-sns-command.types.d.ts.map +1 -1
- package/dist/service/sns/command/sim-sns-commands.d.ts +12 -4
- package/dist/service/sns/command/sim-sns-commands.d.ts.map +1 -1
- package/dist/service/sns/command/sim-sns-commands.js +39 -4
- package/dist/service/sns/command/sim-sns-commands.js.map +1 -1
- package/dist/service/sns/command/sms/sim-sns-opt-out-commands.d.ts +41 -0
- package/dist/service/sns/command/sms/sim-sns-opt-out-commands.d.ts.map +1 -0
- package/dist/service/sns/command/sms/sim-sns-opt-out-commands.js +56 -0
- package/dist/service/sns/command/sms/sim-sns-opt-out-commands.js.map +1 -0
- package/dist/service/sns/command/sms/sms.command.d.ts +50 -0
- package/dist/service/sns/command/sms/sms.command.d.ts.map +1 -0
- package/dist/service/sns/command/sms/sms.command.js +2 -0
- package/dist/service/sns/command/sms/sms.command.js.map +1 -0
- package/dist/service/sns/delivery/sim-aws-sns-delivery-endpoints.d.ts +5 -6
- package/dist/service/sns/delivery/sim-aws-sns-delivery-endpoints.d.ts.map +1 -1
- package/dist/service/sns/delivery/sim-aws-sns-delivery-endpoints.js +8 -12
- package/dist/service/sns/delivery/sim-aws-sns-delivery-endpoints.js.map +1 -1
- package/dist/service/sns/delivery/sim-sns-no-delivery-endpoints.d.ts +6 -13
- package/dist/service/sns/delivery/sim-sns-no-delivery-endpoints.d.ts.map +1 -1
- package/dist/service/sns/delivery/sim-sns-no-delivery-endpoints.js +13 -2
- package/dist/service/sns/delivery/sim-sns-no-delivery-endpoints.js.map +1 -1
- package/dist/service/sns/delivery/sim-sns-protocol-delivery-endpoints.d.ts +10 -1
- package/dist/service/sns/delivery/sim-sns-protocol-delivery-endpoints.d.ts.map +1 -1
- package/dist/service/sns/delivery/sim-sns-protocol-delivery-endpoints.js.map +1 -1
- package/dist/service/sns/delivery/sms/sim-sns-delivery-sms.d.ts +34 -0
- package/dist/service/sns/delivery/sms/sim-sns-delivery-sms.d.ts.map +1 -0
- package/dist/service/sns/delivery/sms/sim-sns-delivery-sms.js +46 -0
- package/dist/service/sns/delivery/sms/sim-sns-delivery-sms.js.map +1 -0
- package/dist/service/sns/index.d.ts +5 -1
- package/dist/service/sns/index.d.ts.map +1 -1
- package/dist/service/sns/index.js +4 -1
- package/dist/service/sns/index.js.map +1 -1
- package/dist/service/sns/message/sim-sns-message-attribute-rules.d.ts.map +1 -1
- package/dist/service/sns/message/sim-sns-message-attribute-rules.js +9 -1
- package/dist/service/sns/message/sim-sns-message-attribute-rules.js.map +1 -1
- package/dist/service/sns/message/sim-sns-message-attributes.d.ts +8 -0
- package/dist/service/sns/message/sim-sns-message-attributes.d.ts.map +1 -1
- package/dist/service/sns/message/sim-sns-message-attributes.js +10 -0
- package/dist/service/sns/message/sim-sns-message-attributes.js.map +1 -1
- package/dist/service/sns/message/sim-sns-sms-attributes.d.ts +25 -0
- package/dist/service/sns/message/sim-sns-sms-attributes.d.ts.map +1 -0
- package/dist/service/sns/message/sim-sns-sms-attributes.js +46 -0
- package/dist/service/sns/message/sim-sns-sms-attributes.js.map +1 -0
- package/dist/service/sns/sdk/sim-sns-sdk-command-router.d.ts.map +1 -1
- package/dist/service/sns/sdk/sim-sns-sdk-command-router.js +12 -0
- package/dist/service/sns/sdk/sim-sns-sdk-command-router.js.map +1 -1
- package/dist/service/sns/sim-sns-sms.d.ts +63 -0
- package/dist/service/sns/sim-sns-sms.d.ts.map +1 -0
- package/dist/service/sns/sim-sns-sms.js +76 -0
- package/dist/service/sns/sim-sns-sms.js.map +1 -0
- package/dist/service/sns/sim-sns.d.ts +7 -15
- package/dist/service/sns/sim-sns.d.ts.map +1 -1
- package/dist/service/sns/sim-sns.js +23 -30
- package/dist/service/sns/sim-sns.js.map +1 -1
- package/dist/service/sns/sms/sim-sns-opt-out-list.d.ts +40 -0
- package/dist/service/sns/sms/sim-sns-opt-out-list.d.ts.map +1 -0
- package/dist/service/sns/sms/sim-sns-opt-out-list.js +47 -0
- package/dist/service/sns/sms/sim-sns-opt-out-list.js.map +1 -0
- package/dist/service/sns/sms/sim-sns-phone-number.d.ts +21 -0
- package/dist/service/sns/sms/sim-sns-phone-number.d.ts.map +1 -0
- package/dist/service/sns/sms/sim-sns-phone-number.js +41 -0
- package/dist/service/sns/sms/sim-sns-phone-number.js.map +1 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-message.d.ts +69 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-message.d.ts.map +1 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-message.js +71 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-message.js.map +1 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-store.d.ts +25 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-store.d.ts.map +1 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-store.js +28 -0
- package/dist/service/sns/sms/sim-sns-sent-sms-store.js.map +1 -0
- package/dist/service/sns/subscription/sim-sns-subscription-endpoint.d.ts +9 -7
- package/dist/service/sns/subscription/sim-sns-subscription-endpoint.d.ts.map +1 -1
- package/dist/service/sns/subscription/sim-sns-subscription-endpoint.js +7 -2
- package/dist/service/sns/subscription/sim-sns-subscription-endpoint.js.map +1 -1
- package/dist/service/sns/subscription/sim-sns-subscription-protocol.d.ts +19 -1
- package/dist/service/sns/subscription/sim-sns-subscription-protocol.d.ts.map +1 -1
- package/dist/service/sns/subscription/sim-sns-subscription-protocol.js +26 -5
- package/dist/service/sns/subscription/sim-sns-subscription-protocol.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { SimSnsMessageAttributes } from "../message/sim-sns-message-attributes.js";
|
|
2
|
+
interface SimSnsSentSmsMessageProperties {
|
|
3
|
+
readonly messageId: string;
|
|
4
|
+
readonly phoneNumber: string;
|
|
5
|
+
readonly message: string;
|
|
6
|
+
readonly attributes: SimSnsMessageAttributes;
|
|
7
|
+
readonly suppressed: boolean;
|
|
8
|
+
readonly sentDate: Date;
|
|
9
|
+
readonly topicArn?: string;
|
|
10
|
+
readonly subscriptionArn?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* One SMS a simulated SNS would have sent.
|
|
14
|
+
*
|
|
15
|
+
* Delivery stops at the simulator boundary, and this record is the whole of
|
|
16
|
+
* what an SMS is here. Simulated SNS keeps it itself, the way a simulated
|
|
17
|
+
* Cognito user pool keeps the verification and MFA messages it would have
|
|
18
|
+
* texted.
|
|
19
|
+
*
|
|
20
|
+
* There is no subject. Real SNS uses `Subject` for email and leaves it off an
|
|
21
|
+
* SMS. A publish that carries one to a phone number has it ignored.
|
|
22
|
+
*/
|
|
23
|
+
export declare class SimSnsSentSmsMessage {
|
|
24
|
+
readonly messageId: string;
|
|
25
|
+
/** The E.164 number this would have gone to. */
|
|
26
|
+
readonly phoneNumber: string;
|
|
27
|
+
/** The body, which arrives on a handset as the whole of the message. */
|
|
28
|
+
readonly message: string;
|
|
29
|
+
/**
|
|
30
|
+
* The message attributes the publish carried, including the `AWS.SNS.SMS.`
|
|
31
|
+
* ones real SNS reads for the sender id, the message type and the price cap.
|
|
32
|
+
*/
|
|
33
|
+
readonly attributes: SimSnsMessageAttributes;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the opt-out list stopped this one.
|
|
36
|
+
*
|
|
37
|
+
* A publish to an opted-out number succeeds and answers with a message id,
|
|
38
|
+
* and nothing arrives. The record is kept either way, and this flag tells
|
|
39
|
+
* the two apart. A test about a code reaching a handset asserts on a
|
|
40
|
+
* delivered message, and a test about the opt-out list has something to
|
|
41
|
+
* read.
|
|
42
|
+
*/
|
|
43
|
+
readonly suppressed: boolean;
|
|
44
|
+
readonly sentDate: Date;
|
|
45
|
+
/**
|
|
46
|
+
* The topic that fanned this one out, where a topic did.
|
|
47
|
+
*
|
|
48
|
+
* A publish naming a phone number reaches no topic, so both this and the
|
|
49
|
+
* subscription ARN are absent for one. A test asserting on the SMS a topic
|
|
50
|
+
* sent has them to assert on.
|
|
51
|
+
*/
|
|
52
|
+
readonly topicArn: string | undefined;
|
|
53
|
+
/** The `sms` subscription that took this message, where one did. */
|
|
54
|
+
readonly subscriptionArn: string | undefined;
|
|
55
|
+
constructor(properties: SimSnsSentSmsMessageProperties);
|
|
56
|
+
/**
|
|
57
|
+
* The name this SMS appears to come from, where the publish set one.
|
|
58
|
+
*/
|
|
59
|
+
get senderId(): string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* `Transactional` or `Promotional`, where the publish set one.
|
|
62
|
+
*
|
|
63
|
+
* Real SNS reads this to decide how it routes and prices a message. Routing
|
|
64
|
+
* and pricing are absent here, and the value is recorded and left alone.
|
|
65
|
+
*/
|
|
66
|
+
get smsType(): string | undefined;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=sim-sns-sent-sms-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-sns-sent-sms-message.d.ts","sourceRoot":"","sources":["../../../../src/service/sns/sms/sim-sns-sent-sms-message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAMxF,UAAU,8BAA8B;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;;;;;;;;;GAUG;AACH,qBAAa,oBAAoB;IAC/B,SAAgB,SAAS,EAAE,MAAM,CAAC;IAElC,gDAAgD;IAChD,SAAgB,WAAW,EAAE,MAAM,CAAC;IAEpC,wEAAwE;IACxE,SAAgB,OAAO,EAAE,MAAM,CAAC;IAEhC;;;OAGG;IACH,SAAgB,UAAU,EAAE,uBAAuB,CAAC;IAEpD;;;;;;;;OAQG;IACH,SAAgB,UAAU,EAAE,OAAO,CAAC;IAEpC,SAAgB,QAAQ,EAAE,IAAI,CAAC;IAE/B;;;;;;OAMG;IACH,SAAgB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7C,oEAAoE;IACpE,SAAgB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAEpD,YAAY,UAAU,EAAE,8BAA8B,EASrD;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,GAAG,SAAS,CAEjC;IAED;;;;;OAKG;IACH,IAAI,OAAO,IAAI,MAAM,GAAG,SAAS,CAEhC;CACF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { simSnsSenderIdAttribute, simSnsSmsTypeAttribute, } from "../message/sim-sns-sms-attributes.js";
|
|
2
|
+
/**
|
|
3
|
+
* One SMS a simulated SNS would have sent.
|
|
4
|
+
*
|
|
5
|
+
* Delivery stops at the simulator boundary, and this record is the whole of
|
|
6
|
+
* what an SMS is here. Simulated SNS keeps it itself, the way a simulated
|
|
7
|
+
* Cognito user pool keeps the verification and MFA messages it would have
|
|
8
|
+
* texted.
|
|
9
|
+
*
|
|
10
|
+
* There is no subject. Real SNS uses `Subject` for email and leaves it off an
|
|
11
|
+
* SMS. A publish that carries one to a phone number has it ignored.
|
|
12
|
+
*/
|
|
13
|
+
export class SimSnsSentSmsMessage {
|
|
14
|
+
messageId;
|
|
15
|
+
/** The E.164 number this would have gone to. */
|
|
16
|
+
phoneNumber;
|
|
17
|
+
/** The body, which arrives on a handset as the whole of the message. */
|
|
18
|
+
message;
|
|
19
|
+
/**
|
|
20
|
+
* The message attributes the publish carried, including the `AWS.SNS.SMS.`
|
|
21
|
+
* ones real SNS reads for the sender id, the message type and the price cap.
|
|
22
|
+
*/
|
|
23
|
+
attributes;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the opt-out list stopped this one.
|
|
26
|
+
*
|
|
27
|
+
* A publish to an opted-out number succeeds and answers with a message id,
|
|
28
|
+
* and nothing arrives. The record is kept either way, and this flag tells
|
|
29
|
+
* the two apart. A test about a code reaching a handset asserts on a
|
|
30
|
+
* delivered message, and a test about the opt-out list has something to
|
|
31
|
+
* read.
|
|
32
|
+
*/
|
|
33
|
+
suppressed;
|
|
34
|
+
sentDate;
|
|
35
|
+
/**
|
|
36
|
+
* The topic that fanned this one out, where a topic did.
|
|
37
|
+
*
|
|
38
|
+
* A publish naming a phone number reaches no topic, so both this and the
|
|
39
|
+
* subscription ARN are absent for one. A test asserting on the SMS a topic
|
|
40
|
+
* sent has them to assert on.
|
|
41
|
+
*/
|
|
42
|
+
topicArn;
|
|
43
|
+
/** The `sms` subscription that took this message, where one did. */
|
|
44
|
+
subscriptionArn;
|
|
45
|
+
constructor(properties) {
|
|
46
|
+
this.messageId = properties.messageId;
|
|
47
|
+
this.phoneNumber = properties.phoneNumber;
|
|
48
|
+
this.message = properties.message;
|
|
49
|
+
this.attributes = properties.attributes;
|
|
50
|
+
this.suppressed = properties.suppressed;
|
|
51
|
+
this.sentDate = properties.sentDate;
|
|
52
|
+
this.topicArn = properties.topicArn;
|
|
53
|
+
this.subscriptionArn = properties.subscriptionArn;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The name this SMS appears to come from, where the publish set one.
|
|
57
|
+
*/
|
|
58
|
+
get senderId() {
|
|
59
|
+
return this.attributes.find(simSnsSenderIdAttribute)?.envelopeValue;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* `Transactional` or `Promotional`, where the publish set one.
|
|
63
|
+
*
|
|
64
|
+
* Real SNS reads this to decide how it routes and prices a message. Routing
|
|
65
|
+
* and pricing are absent here, and the value is recorded and left alone.
|
|
66
|
+
*/
|
|
67
|
+
get smsType() {
|
|
68
|
+
return this.attributes.find(simSnsSmsTypeAttribute)?.envelopeValue;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=sim-sns-sent-sms-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-sns-sent-sms-message.js","sourceRoot":"","sources":["../../../../src/service/sns/sms/sim-sns-sent-sms-message.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,sCAAsC,CAAC;AAa9C;;;;;;;;;;GAUG;AACH,MAAM,OAAO,oBAAoB;IACf,SAAS,CAAS;IAElC,gDAAgD;IAChC,WAAW,CAAS;IAEpC,wEAAwE;IACxD,OAAO,CAAS;IAEhC;;;OAGG;IACa,UAAU,CAA0B;IAEpD;;;;;;;;OAQG;IACa,UAAU,CAAU;IAEpB,QAAQ,CAAO;IAE/B;;;;;;OAMG;IACa,QAAQ,CAAqB;IAE7C,oEAAoE;IACpD,eAAe,CAAqB;IAEpD,YAAY,UAA0C;QACpD,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;IACpD,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,uBAAuB,CAAC,EAAE,aAAa,CAAC;IACtE,CAAC;IAED;;;;;OAKG;IACH,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,sBAAsB,CAAC,EAAE,aAAa,CAAC;IACrE,CAAC;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SimSnsSentSmsMessage } from "./sim-sns-sent-sms-message.js";
|
|
2
|
+
/**
|
|
3
|
+
* The SMS messages one simulated SNS scope has accepted.
|
|
4
|
+
*
|
|
5
|
+
* They are kept in the order they were published, because the assertion a test
|
|
6
|
+
* usually wants is about the first message of a flow. A one-time code is sent
|
|
7
|
+
* once, and whatever else the flow texts afterwards is not what the test is
|
|
8
|
+
* looking at.
|
|
9
|
+
*
|
|
10
|
+
* Nothing here is ever discarded. Real SNS keeps no such record at all, so
|
|
11
|
+
* there is no retention behaviour to reproduce, and a test process is short
|
|
12
|
+
* enough that keeping every message costs nothing.
|
|
13
|
+
*/
|
|
14
|
+
export declare class SimSnsSentSmsStore {
|
|
15
|
+
#private;
|
|
16
|
+
/**
|
|
17
|
+
* Every SMS this scope has accepted, oldest first.
|
|
18
|
+
*/
|
|
19
|
+
get all(): readonly SimSnsSentSmsMessage[];
|
|
20
|
+
/**
|
|
21
|
+
* Keep an SMS simulated SNS has accepted.
|
|
22
|
+
*/
|
|
23
|
+
add(message: SimSnsSentSmsMessage): void;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=sim-sns-sent-sms-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-sns-sent-sms-store.d.ts","sourceRoot":"","sources":["../../../../src/service/sns/sms/sim-sns-sent-sms-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,qBAAa,kBAAkB;;IAG7B;;OAEG;IACH,IAAI,GAAG,IAAI,SAAS,oBAAoB,EAAE,CAEzC;IAED;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAEvC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The SMS messages one simulated SNS scope has accepted.
|
|
3
|
+
*
|
|
4
|
+
* They are kept in the order they were published, because the assertion a test
|
|
5
|
+
* usually wants is about the first message of a flow. A one-time code is sent
|
|
6
|
+
* once, and whatever else the flow texts afterwards is not what the test is
|
|
7
|
+
* looking at.
|
|
8
|
+
*
|
|
9
|
+
* Nothing here is ever discarded. Real SNS keeps no such record at all, so
|
|
10
|
+
* there is no retention behaviour to reproduce, and a test process is short
|
|
11
|
+
* enough that keeping every message costs nothing.
|
|
12
|
+
*/
|
|
13
|
+
export class SimSnsSentSmsStore {
|
|
14
|
+
#sent = [];
|
|
15
|
+
/**
|
|
16
|
+
* Every SMS this scope has accepted, oldest first.
|
|
17
|
+
*/
|
|
18
|
+
get all() {
|
|
19
|
+
return [...this.#sent];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Keep an SMS simulated SNS has accepted.
|
|
23
|
+
*/
|
|
24
|
+
add(message) {
|
|
25
|
+
this.#sent.push(message);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=sim-sns-sent-sms-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sim-sns-sent-sms-store.js","sourceRoot":"","sources":["../../../../src/service/sns/sms/sim-sns-sent-sms-store.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,kBAAkB;IACpB,KAAK,GAA2B,EAAE,CAAC;IAE5C;;OAEG;IACH,IAAI,GAAG;QACL,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,OAA6B;QAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -5,22 +5,24 @@ import { type SimSnsSubscriptionProtocol } from "./sim-sns-subscription-protocol
|
|
|
5
5
|
* Where a subscription delivers, whichever kind of endpoint its protocol
|
|
6
6
|
* implies.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* The Account and Region are there for a protocol whose endpoint is an ARN,
|
|
9
|
+
* because a delivery resolves the endpoint in the scope that ARN gives rather
|
|
10
|
+
* than in the topic's. An `sms` endpoint is a phone number and names neither,
|
|
11
|
+
* which is why both are optional. What kind of resource an endpoint is belongs
|
|
12
|
+
* to the protocol's own endpoint type.
|
|
12
13
|
*/
|
|
13
14
|
export interface SimSnsSubscriptionEndpoint {
|
|
14
15
|
readonly value: string;
|
|
15
|
-
readonly regionName
|
|
16
|
-
readonly accountId
|
|
16
|
+
readonly regionName?: AwsRegionName;
|
|
17
|
+
readonly accountId?: SimAwsAccountId;
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* Read the endpoint a Subscribe request names, for the protocol it named.
|
|
20
21
|
*
|
|
21
22
|
* The protocol decides what the endpoint has to be, so an SQS queue ARN over
|
|
22
23
|
* the `lambda` protocol is refused here rather than at delivery time. Real SNS
|
|
23
|
-
* validates the endpoint against the protocol at `Subscribe` time too
|
|
24
|
+
* validates the endpoint against the protocol at `Subscribe` time too, which is
|
|
25
|
+
* where a phone number outside E.164 is refused.
|
|
24
26
|
*/
|
|
25
27
|
export declare function requireSimSnsSubscriptionEndpoint(protocol: SimSnsSubscriptionProtocol, endpoint: string | undefined): SimSnsSubscriptionEndpoint;
|
|
26
28
|
//# sourceMappingURL=sim-sns-subscription-endpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-sns-subscription-endpoint.d.ts","sourceRoot":"","sources":["../../../../src/service/sns/subscription/sim-sns-subscription-endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-sns-subscription-endpoint.d.ts","sourceRoot":"","sources":["../../../../src/service/sns/subscription/sim-sns-subscription-endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAIjE,OAAO,EAIL,KAAK,0BAA0B,EAChC,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;;GASG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC;CACtC;AAED;;;;;;;GAOG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,0BAA0B,EACpC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,0BAA0B,CAY5B"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { SimSnsPhoneNumber } from "../sms/sim-sns-phone-number.js";
|
|
1
2
|
import { SimSnsFunctionEndpointArn } from "./sim-sns-function-endpoint-arn.js";
|
|
2
3
|
import { SimSnsQueueEndpointArn } from "./sim-sns-queue-endpoint-arn.js";
|
|
3
|
-
import { simSnsLambdaProtocol, simSnsSqsProtocol, } from "./sim-sns-subscription-protocol.js";
|
|
4
|
+
import { simSnsLambdaProtocol, simSnsSmsProtocol, simSnsSqsProtocol, } from "./sim-sns-subscription-protocol.js";
|
|
4
5
|
/**
|
|
5
6
|
* Read the endpoint a Subscribe request names, for the protocol it named.
|
|
6
7
|
*
|
|
7
8
|
* The protocol decides what the endpoint has to be, so an SQS queue ARN over
|
|
8
9
|
* the `lambda` protocol is refused here rather than at delivery time. Real SNS
|
|
9
|
-
* validates the endpoint against the protocol at `Subscribe` time too
|
|
10
|
+
* validates the endpoint against the protocol at `Subscribe` time too, which is
|
|
11
|
+
* where a phone number outside E.164 is refused.
|
|
10
12
|
*/
|
|
11
13
|
export function requireSimSnsSubscriptionEndpoint(protocol, endpoint) {
|
|
12
14
|
switch (protocol) {
|
|
@@ -16,6 +18,9 @@ export function requireSimSnsSubscriptionEndpoint(protocol, endpoint) {
|
|
|
16
18
|
case simSnsLambdaProtocol: {
|
|
17
19
|
return SimSnsFunctionEndpointArn.parse(endpoint ?? "");
|
|
18
20
|
}
|
|
21
|
+
case simSnsSmsProtocol: {
|
|
22
|
+
return SimSnsPhoneNumber.of(endpoint);
|
|
23
|
+
}
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
//# sourceMappingURL=sim-sns-subscription-endpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-sns-subscription-endpoint.js","sourceRoot":"","sources":["../../../../src/service/sns/subscription/sim-sns-subscription-endpoint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,GAElB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-sns-subscription-endpoint.js","sourceRoot":"","sources":["../../../../src/service/sns/subscription/sim-sns-subscription-endpoint.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GAElB,MAAM,oCAAoC,CAAC;AAkB5C;;;;;;;GAOG;AACH,MAAM,UAAU,iCAAiC,CAC/C,QAAoC,EACpC,QAA4B;IAE5B,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,iBAAiB,EAAE,CAAC;YACvB,OAAO,sBAAsB,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QACtD,CAAC;QACD,KAAK,oBAAoB,EAAE,CAAC;YAC1B,OAAO,yBAAyB,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;QACzD,CAAC;QACD,KAAK,iBAAiB,EAAE,CAAC;YACvB,OAAO,iBAAiB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -15,10 +15,28 @@ export declare const simSnsSqsProtocol = "sqs";
|
|
|
15
15
|
* an event carrying the published message.
|
|
16
16
|
*/
|
|
17
17
|
export declare const simSnsLambdaProtocol = "lambda";
|
|
18
|
+
/**
|
|
19
|
+
* Delivery by texting a phone number.
|
|
20
|
+
*
|
|
21
|
+
* Real SNS confirms this one itself as well, since the number is the endpoint
|
|
22
|
+
* and there is nothing to confirm. The endpoint is an E.164 phone number rather
|
|
23
|
+
* than an ARN, and a message reaching it is recorded as a sent SMS rather than
|
|
24
|
+
* handed to a carrier.
|
|
25
|
+
*/
|
|
26
|
+
export declare const simSnsSmsProtocol = "sms";
|
|
18
27
|
/**
|
|
19
28
|
* A protocol a simulated subscription can be created with.
|
|
20
29
|
*/
|
|
21
|
-
export type SimSnsSubscriptionProtocol = typeof simSnsSqsProtocol | typeof simSnsLambdaProtocol;
|
|
30
|
+
export type SimSnsSubscriptionProtocol = typeof simSnsSqsProtocol | typeof simSnsLambdaProtocol | typeof simSnsSmsProtocol;
|
|
31
|
+
/**
|
|
32
|
+
* The protocols whose delivery leaves simulated SNS.
|
|
33
|
+
*
|
|
34
|
+
* A queue and a function are other simulated services, only reachable through
|
|
35
|
+
* `SimAws`, so where they deliver is supplied to `SimSns` from outside. An SMS
|
|
36
|
+
* goes nowhere but simulated SNS's own record, which is why `sms` is not one of
|
|
37
|
+
* these.
|
|
38
|
+
*/
|
|
39
|
+
export type SimSnsOutwardProtocol = typeof simSnsSqsProtocol | typeof simSnsLambdaProtocol;
|
|
22
40
|
/**
|
|
23
41
|
* Read the protocol a Subscribe request names, refusing one that delivers
|
|
24
42
|
* nowhere.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-sns-subscription-protocol.d.ts","sourceRoot":"","sources":["../../../../src/service/sns/subscription/sim-sns-subscription-protocol.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAClC,OAAO,iBAAiB,GACxB,OAAO,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-sns-subscription-protocol.d.ts","sourceRoot":"","sources":["../../../../src/service/sns/subscription/sim-sns-subscription-protocol.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAClC,OAAO,iBAAiB,GACxB,OAAO,oBAAoB,GAC3B,OAAO,iBAAiB,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAC7B,OAAO,iBAAiB,GACxB,OAAO,oBAAoB,CAAC;AAmChC;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,0BAA0B,CAsB5B"}
|
|
@@ -16,6 +16,27 @@ export const simSnsSqsProtocol = "sqs";
|
|
|
16
16
|
* an event carrying the published message.
|
|
17
17
|
*/
|
|
18
18
|
export const simSnsLambdaProtocol = "lambda";
|
|
19
|
+
/**
|
|
20
|
+
* Delivery by texting a phone number.
|
|
21
|
+
*
|
|
22
|
+
* Real SNS confirms this one itself as well, since the number is the endpoint
|
|
23
|
+
* and there is nothing to confirm. The endpoint is an E.164 phone number rather
|
|
24
|
+
* than an ARN, and a message reaching it is recorded as a sent SMS rather than
|
|
25
|
+
* handed to a carrier.
|
|
26
|
+
*/
|
|
27
|
+
export const simSnsSmsProtocol = "sms";
|
|
28
|
+
/**
|
|
29
|
+
* Every protocol delivery is simulated over.
|
|
30
|
+
*
|
|
31
|
+
* A Subscribe request's protocol is read against this set. The refusal for a
|
|
32
|
+
* protocol that is missing writes each of them out itself, so the order here
|
|
33
|
+
* changes nothing.
|
|
34
|
+
*/
|
|
35
|
+
const simulatedProtocols = [
|
|
36
|
+
simSnsSqsProtocol,
|
|
37
|
+
simSnsLambdaProtocol,
|
|
38
|
+
simSnsSmsProtocol,
|
|
39
|
+
];
|
|
19
40
|
/**
|
|
20
41
|
* The protocols real SNS has that this simulation does not deliver over.
|
|
21
42
|
*
|
|
@@ -29,7 +50,6 @@ const unsimulatedProtocols = new Map([
|
|
|
29
50
|
["https", "Delivery over HTTPS would leave the simulation."],
|
|
30
51
|
["email", "Sending email is not simulated."],
|
|
31
52
|
["email-json", "Sending email is not simulated."],
|
|
32
|
-
["sms", "Sending SMS is not simulated."],
|
|
33
53
|
[
|
|
34
54
|
"application",
|
|
35
55
|
"Mobile application endpoints and push notifications are not simulated.",
|
|
@@ -47,15 +67,16 @@ const unsimulatedProtocols = new Map([
|
|
|
47
67
|
* the request.
|
|
48
68
|
*/
|
|
49
69
|
export function requireSimSnsProtocol(value) {
|
|
50
|
-
|
|
51
|
-
|
|
70
|
+
const simulated = simulatedProtocols.find((protocol) => protocol === value);
|
|
71
|
+
if (simulated !== undefined) {
|
|
72
|
+
return simulated;
|
|
52
73
|
}
|
|
53
74
|
const named = value ?? "(none)";
|
|
54
75
|
const reason = unsimulatedProtocols.get(named);
|
|
55
76
|
if (reason !== undefined) {
|
|
56
77
|
throw new SimSnsUnsimulatedInputException(`The ${named} subscription protocol is not simulated. ${reason} ` +
|
|
57
|
-
`Subscribe with the ${simSnsSqsProtocol} or ` +
|
|
58
|
-
`${
|
|
78
|
+
`Subscribe with the ${simSnsSqsProtocol}, ${simSnsLambdaProtocol} or ` +
|
|
79
|
+
`${simSnsSmsProtocol} protocol instead.`);
|
|
59
80
|
}
|
|
60
81
|
throw new SimSnsInvalidParameterException(`Invalid parameter: Protocol Reason: ${named} is not a subscription ` +
|
|
61
82
|
`protocol`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim-sns-subscription-protocol.js","sourceRoot":"","sources":["../../../../src/service/sns/subscription/sim-sns-subscription-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"sim-sns-subscription-protocol.js","sourceRoot":"","sources":["../../../../src/service/sns/subscription/sim-sns-subscription-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAE7C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAsBvC;;;;;;GAMG;AACH,MAAM,kBAAkB,GAAG;IACzB,iBAAiB;IACjB,oBAAoB;IACpB,iBAAiB;CACT,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAiB;IACnD,CAAC,MAAM,EAAE,gDAAgD,CAAC;IAC1D,CAAC,OAAO,EAAE,iDAAiD,CAAC;IAC5D,CAAC,OAAO,EAAE,iCAAiC,CAAC;IAC5C,CAAC,YAAY,EAAE,iCAAiC,CAAC;IACjD;QACE,aAAa;QACb,wEAAwE;KACzE;IACD,CAAC,UAAU,EAAE,wCAAwC,CAAC;CACvD,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAyB;IAEzB,MAAM,SAAS,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC;IAE5E,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,IAAI,QAAQ,CAAC;IAChC,MAAM,MAAM,GAAG,oBAAoB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAE/C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,+BAA+B,CACvC,OAAO,KAAK,4CAA4C,MAAM,GAAG;YAC/D,sBAAsB,iBAAiB,KAAK,oBAAoB,MAAM;YACtE,GAAG,iBAAiB,oBAAoB,CAC3C,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,+BAA+B,CACvC,uCAAuC,KAAK,yBAAyB;QACnE,UAAU,CACb,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED