@keetanetwork/anchor 0.0.45 → 0.0.48
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/LICENSE +163 -34
- package/lib/asset.d.ts +30 -0
- package/lib/asset.d.ts.map +1 -0
- package/lib/asset.js +78 -0
- package/lib/asset.js.map +1 -0
- package/lib/certificates.d.ts +11 -38
- package/lib/certificates.d.ts.map +1 -1
- package/lib/certificates.js +33 -336
- package/lib/certificates.js.map +1 -1
- package/lib/resolver.d.ts +9 -2
- package/lib/resolver.d.ts.map +1 -1
- package/lib/resolver.js +195 -159
- package/lib/resolver.js.map +1 -1
- package/lib/sensitive-attribute.d.ts +87 -0
- package/lib/sensitive-attribute.d.ts.map +1 -0
- package/lib/sensitive-attribute.js +419 -0
- package/lib/sensitive-attribute.js.map +1 -0
- package/lib/token-metadata.d.ts +21 -0
- package/lib/token-metadata.d.ts.map +1 -0
- package/lib/token-metadata.generated.d.ts +5 -0
- package/lib/token-metadata.generated.d.ts.map +1 -0
- package/lib/token-metadata.generated.js +70 -0
- package/lib/token-metadata.generated.js.map +1 -0
- package/lib/token-metadata.js +57 -0
- package/lib/token-metadata.js.map +1 -0
- package/lib/utils/pii.d.ts +128 -0
- package/lib/utils/pii.d.ts.map +1 -0
- package/lib/utils/pii.js +198 -0
- package/lib/utils/pii.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/services/asset-movement/common.d.ts +7 -29
- package/services/asset-movement/common.d.ts.map +1 -1
- package/services/asset-movement/common.js +5223 -2660
- package/services/asset-movement/common.js.map +1 -1
- package/services/asset-movement/lib/data/addresses/bank-account/iban-swift.d.ts.map +1 -1
- package/services/asset-movement/lib/data/addresses/bank-account/iban-swift.js +22 -1
- package/services/asset-movement/lib/data/addresses/bank-account/iban-swift.js.map +1 -1
- package/services/asset-movement/lib/data/addresses/bank-account/interac.d.ts +1 -1
- package/services/asset-movement/lib/data/addresses/bank-account/interac.d.ts.map +1 -1
- package/services/asset-movement/lib/data/addresses/bank-account/interac.js +13 -3
- package/services/asset-movement/lib/data/addresses/bank-account/interac.js.map +1 -1
- package/services/asset-movement/lib/data/addresses/bank-account/pix.d.ts +1 -1
- package/services/asset-movement/lib/data/addresses/bank-account/pix.d.ts.map +1 -1
- package/services/asset-movement/lib/data/addresses/bank-account/pix.js +11 -1
- package/services/asset-movement/lib/data/addresses/bank-account/pix.js.map +1 -1
- package/services/asset-movement/lib/data/addresses/types.generated.d.ts +116 -33
- package/services/asset-movement/lib/data/addresses/types.generated.d.ts.map +1 -1
- package/services/asset-movement/lib/data/addresses/types.generated.js +102 -26
- package/services/asset-movement/lib/data/addresses/types.generated.js.map +1 -1
- package/services/asset-movement/lib/data/types.d.ts.map +1 -1
- package/services/asset-movement/lib/data/types.js +15 -10
- package/services/asset-movement/lib/data/types.js.map +1 -1
- package/services/fx/client.d.ts.map +1 -1
- package/services/fx/client.js +6 -2
- package/services/fx/client.js.map +1 -1
- package/services/fx/common.d.ts +14 -6
- package/services/fx/common.d.ts.map +1 -1
- package/services/fx/common.js +34 -8
- package/services/fx/common.js.map +1 -1
- package/services/fx/server.d.ts +6 -0
- package/services/fx/server.d.ts.map +1 -1
- package/services/fx/server.js +52 -10
- package/services/fx/server.js.map +1 -1
- package/services/kyc/common.d.ts +7 -0
- package/services/kyc/common.d.ts.map +1 -1
- package/services/kyc/common.generated.js +6 -1
- package/services/kyc/common.generated.js.map +1 -1
- package/services/kyc/common.js.map +1 -1
- package/services/notification/client.d.ts +1 -1
- package/services/notification/client.d.ts.map +1 -1
- package/services/notification/client.js +65 -2
- package/services/notification/client.js.map +1 -1
- package/services/notification/common.d.ts +1 -0
- package/services/notification/common.d.ts.map +1 -1
- package/services/notification/common.js.map +1 -1
- package/services/storage/clients/contacts.generated.js +506 -233
- package/services/storage/clients/contacts.generated.js.map +1 -1
- package/services/storage/server.d.ts +8 -1
- package/services/storage/server.d.ts.map +1 -1
- package/services/storage/server.js +9 -1
- package/services/storage/server.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/services/notification/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAE5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG1D,cAAc,uBAAuB,CAAC;AAEtC,UAAU,gCAAgC,CAAC,CAAC,SAAS,MAAM;IAC1D,IAAI,EAAE,CAAC,CAAC;CACR;AAED,UAAU,+BAAgC,SAAQ,gCAAgC,CAAC,KAAK,CAAC;IACxF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,4BAA4B,GAAG,+BAA+B,CAAC;AAE3E,MAAM,MAAM,uBAAuB,GAAG,4BAA4B,CAAC,MAAM,CAAC,CAAC;AAE3E,UAAU,kCAAkC;IAC3C,GAAG,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,CAAA;CACD;AAED,UAAU,qCAAqC,CAAC,CAAC,SAAS,MAAM;IAC/D,IAAI,EAAE,CAAC,CAAC;IAGR,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC;IAErB,MAAM,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAE9B,GAAG,EAAE,MAAM,EAAE,CAAC;KACd,CAAA;CACD;AAED,UAAU,6CAA8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CAAC,KAAK,EAAE,4DAA4D,EAAE,8CAA8C,CAAC,0DAA0D,CAAC,CAAC,CAAC;IAC/M,CAAC;IAED,MAAM;QACL,OAAM,CAAC;YACN,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;SACvC,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAc;QACnC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEpE,IAAI,gBAA0D,CAAC;QAC/D,IAAI,QAAQ,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YACrD,gBAAgB,GAAG,kCAAkC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAC/E,CAAC;QAED,IAAI,WAAgD,CAAC;QACrD,IAAI,aAAa,IAAI,KAAK,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YAC/D,WAAW,GAAG,6BAA6B,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAChE,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;QACnE,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAM,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;;AAGF,MAAM,CAAC,MAAM,MAAM,GAEf;IACH,kBAAkB,EAAE,8CAA8C;CAClE,CAAC","sourcesContent":["import type { ToJSONSerializable } from '../../lib/utils/json.js';\nimport type { HTTPSignedField } from '../../lib/http-server/common.js';\nimport type { Signable } from '../../lib/utils/signing.js';\nimport type { Account, GenericAccount } from '@keetanetwork/keetanet-client/lib/account.js';\nimport { assertNever } from '../../lib/utils/never.js';\nimport { KeetaAnchorUserError } from '../../lib/error.js';\nimport { assertNotificationChannelType, assertNotificationSubscriptionType } from './common.generated.js';\nimport { KeetaNet } from '../../client/index.js';\nexport * from './common.generated.js';\n\ninterface BaseNotificationChannelArguments<T extends string> {\n\ttype: T;\n}\n\ninterface FCMNotificationChannelArguments extends BaseNotificationChannelArguments<'FCM'> {\n\tappId: string;\n\tfcmToken: string;\n}\n\nexport type NotificationChannelArguments = FCMNotificationChannelArguments;\n\nexport type NotificationChannelType = NotificationChannelArguments['type'];\n\ninterface NotificationChannelServiceMetadata {\n\tFCM: {\n\t\tprojectId: string;\n\t\tmessagingSenderId: string;\n\t\tappId: string;\n\t\tapiKey: string;\n\t\tvapidKey?: string;\n\t}\n}\n\ninterface BaseNotificationSubscriptionArguments<T extends string> {\n\ttype: T;\n\n\t// The preferred locale to receive notifications in, if supported by the channel and provider\n\tlocale?: Intl.Locale;\n\n\ttarget: {\n\t\tprovider?: string | undefined;\n\n\t\tids: string[];\n\t}\n}\n\ninterface ReceiveFundsNotificationSubscriptionArguments extends BaseNotificationSubscriptionArguments<'RECEIVE_FUNDS'> {\n\t// Address to listen to incoming transactions for, if omitted will use the requestors address\n\ttoAddress?: GenericAccount;\n}\n\nexport type NotificationSubscriptionArguments = ReceiveFundsNotificationSubscriptionArguments;\nexport type NotificationSubscriptionArgumentsJSON = ToJSONSerializable<Omit<NotificationSubscriptionArguments, 'locale'>> & {\n\tlocale?: string | undefined;\n};\nexport type NotificationSubscriptionType = NotificationSubscriptionArguments['type'];\n\nexport type SupportedChannelConfigurationMetadata = {\n\tFCM: NotificationChannelServiceMetadata['FCM'][];\n}\n\n// API types\n\nexport interface NotificationTargetWithIDResponse {\n\tid: string;\n\tchannel: NotificationChannelArguments;\n}\n\nconst notificationNamespace = '75ed4792-333f-4a50-832f-b9fcc5663d1f';\n\nexport interface KeetaNotificationAnchorRegisterTargetClientRequest {\n\taccount?: Account;\n\tchannel: NotificationChannelArguments;\n}\nexport interface KeetaNotificationAnchorRegisterTargetRequest extends KeetaNotificationAnchorRegisterTargetClientRequest {\n\taccount: Account;\n\tsigned: HTTPSignedField;\n}\nexport type KeetaNotificationAnchorRegisterTargetRequestJSON = ToJSONSerializable<KeetaNotificationAnchorRegisterTargetRequest>;\n\nexport type KeetaNotificationAnchorRegisterTargetResponseJSON = ({\n\tok: true;\n\tid: string;\n}) | ({\n\tok: false;\n\terror: string;\n});\n\nexport function getNotificationRegisterTargetRequestSignable(request: Pick<KeetaNotificationAnchorRegisterTargetClientRequest, 'channel'>): Signable {\n\tconst parts: Signable = [\n\t\tnotificationNamespace,\n\t\t'REGISTER_TARGET',\n\t\trequest.channel.type\n\t];\n\n\tif (request.channel.type === 'FCM') {\n\t\tparts.push(request.channel.fcmToken, request.channel.appId);\n\t} else {\n\t\tassertNever(request.channel.type);\n\t}\n\n\treturn(parts);\n}\n\nexport interface KeetaNotificationAnchorListTargetsClientRequest { account?: Account; }\ninterface KeetaNotificationAnchorListTargetsRequest extends KeetaNotificationAnchorListTargetsClientRequest {\n\taccount: Account;\n\tsigned: HTTPSignedField;\n}\nexport type KeetaNotificationAnchorListTargetsRequestJSON = ToJSONSerializable<KeetaNotificationAnchorListTargetsRequest>;\n\nexport type KeetaNotificationAnchorListTargetsResponse = ({\n\tok: true;\n\ttargets: NotificationTargetWithIDResponse[];\n}) | ({\n\tok: false;\n\terror: string;\n});\nexport type KeetaNotificationAnchorListTargetsResponseJSON = ToJSONSerializable<KeetaNotificationAnchorListTargetsResponse>;\n\nexport function getNotificationListTargetsRequestSignable(_ignore_request?: KeetaNotificationAnchorListTargetsClientRequest): Signable {\n\treturn([\n\t\tnotificationNamespace,\n\t\t'LIST_TARGETS'\n\t]);\n}\n\n\nexport interface KeetaNotificationAnchorDeleteTargetClientRequest {\n\taccount?: Account;\n\tid: string;\n}\nexport interface KeetaNotificationAnchorDeleteTargetRequest extends KeetaNotificationAnchorDeleteTargetClientRequest {\n\taccount: Account;\n\tsigned: HTTPSignedField;\n}\nexport type KeetaNotificationAnchorDeleteTargetRequestJSON = ToJSONSerializable<KeetaNotificationAnchorDeleteTargetRequest>;\n\nexport type KeetaNotificationAnchorDeleteTargetResponse = ({\n\tok: true;\n}) | ({\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaNotificationAnchorDeleteTargetResponseJSON = ToJSONSerializable<KeetaNotificationAnchorDeleteTargetResponse>;\n\nexport function getNotificationDeleteTargetRequestSignable(request: Pick<KeetaNotificationAnchorDeleteTargetClientRequest, 'id'>): Signable {\n\treturn([\n\t\tnotificationNamespace,\n\t\t'DELETE_TARGET',\n\t\trequest.id\n\t]);\n}\n\nexport interface KeetaNotificationAnchorCreateSubscriptionClientRequest {\n\taccount?: Account;\n\tsubscription: NotificationSubscriptionArguments;\n}\n\nexport type KeetaNotificationAnchorCreateSubscriptionRequestJSON = {\n\tsubscription: NotificationSubscriptionArgumentsJSON;\n\taccount: string;\n\tsigned: HTTPSignedField;\n}\n\nexport type KeetaNotificationAnchorCreateSubscriptionResponse = ({\n\tok: true;\n\tid: string;\n}) | ({\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaNotificationAnchorCreateSubscriptionResponseJSON = ToJSONSerializable<KeetaNotificationAnchorCreateSubscriptionResponse>;\n\nexport function getNotificationCreateSubscriptionRequestSignable(request: Pick<KeetaNotificationAnchorCreateSubscriptionClientRequest, 'subscription'>): Signable {\n\tconst parts: Signable = [\n\t\tnotificationNamespace,\n\t\t'CREATE_SUBSCRIPTION',\n\t\trequest.subscription.type\n\t];\n\n\tparts.push(request.subscription.locale?.toString() ?? 'NO_LOCALE');\n\n\tif (request.subscription.type === 'RECEIVE_FUNDS') {\n\t\tparts.push(request.subscription.toAddress ?? 'NO_ADDRESS');\n\t} else {\n\t\tassertNever(request.subscription.type);\n\t}\n\n\tparts.push(request.subscription.target.provider ?? 'NO_PROVIDER');\n\n\tparts.push('BEGIN_TARGETS');\n\tfor (const target of request.subscription.target.ids) {\n\t\tparts.push(target);\n\t}\n\tparts.push('END_TARGETS');\n\n\treturn(parts);\n}\n\nexport interface KeetaNotificationAnchorDeleteSubscriptionClientRequest {\n\taccount?: Account;\n\tid: string;\n}\nexport interface KeetaNotificationAnchorDeleteSubscriptionRequest extends KeetaNotificationAnchorDeleteSubscriptionClientRequest {\n\taccount: Account;\n\tsigned: HTTPSignedField;\n}\nexport type KeetaNotificationAnchorDeleteSubscriptionRequestJSON = ToJSONSerializable<KeetaNotificationAnchorDeleteSubscriptionRequest>;\n\nexport type KeetaNotificationAnchorDeleteSubscriptionResponse = ({\n\tok: true;\n}) | ({\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaNotificationAnchorDeleteSubscriptionResponseJSON = ToJSONSerializable<KeetaNotificationAnchorDeleteSubscriptionResponse>;\n\nexport function getNotificationDeleteSubscriptionRequestSignable(request: Pick<KeetaNotificationAnchorDeleteSubscriptionClientRequest, 'id'>): Signable {\n\treturn([\n\t\tnotificationNamespace,\n\t\t'DELETE_SUBSCRIPTION',\n\t\trequest.id\n\t]);\n}\n\nexport interface SubscriptionDetails {\n\tid: string;\n\tsubscription: NotificationSubscriptionArguments;\n}\n\nexport type SubscriptionDetailsJSON = ToJSONSerializable<Omit<SubscriptionDetails, 'subscription'>> & {\n\tsubscription: NotificationSubscriptionArgumentsJSON;\n}\n\nexport function parseSubscriptionDetailsWithID(input: SubscriptionDetailsJSON | SubscriptionDetails): SubscriptionDetails {\n\tlet subscription: NotificationSubscriptionArguments;\n\tif (input.subscription.type === 'RECEIVE_FUNDS') {\n\t\tlet locale;\n\t\tif (input.subscription.locale) {\n\t\t\tif (typeof input.subscription.locale === 'string') {\n\t\t\t\tlocale = new Intl.Locale(input.subscription.locale);\n\t\t\t} else {\n\t\t\t\tlocale = input.subscription.locale;\n\t\t\t}\n\t\t}\n\n\t\tsubscription = {\n\t\t\ttype: 'RECEIVE_FUNDS',\n\t\t\ttarget: input.subscription.target,\n\t\t\t...(locale ? { locale } : {}),\n\t\t\t...(input.subscription.toAddress\n\t\t\t\t? { toAddress: KeetaNet.lib.Account.toAccount(input.subscription.toAddress) }\n\t\t\t\t: {})\n\t\t};\n\t} else {\n\t\tassertNever(input.subscription.type);\n\t}\n\n\treturn({ id: input.id, subscription });\n}\n\nexport interface KeetaNotificationAnchorListSubscriptionsClientRequest { account?: Account; }\ninterface KeetaNotificationAnchorListSubscriptionsRequest extends KeetaNotificationAnchorListSubscriptionsClientRequest {\n\taccount: Account;\n\tsigned: HTTPSignedField;\n}\nexport type KeetaNotificationAnchorListSubscriptionsRequestJSON = ToJSONSerializable<KeetaNotificationAnchorListSubscriptionsRequest>;\n\nexport type KeetaNotificationAnchorListSubscriptionsResponse = ({\n\tok: true;\n\tsubscriptions: SubscriptionDetailsJSON[];\n}) | ({\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaNotificationAnchorListSubscriptionsResponseJSON = ToJSONSerializable<KeetaNotificationAnchorListSubscriptionsResponse>;\n\nexport function getNotificationListSubscriptionsRequestSignable(_ignore_request?: KeetaNotificationAnchorListSubscriptionsClientRequest): Signable {\n\treturn([\n\t\tnotificationNamespace,\n\t\t'LIST_SUBSCRIPTIONS'\n\t]);\n}\n\ninterface KeetaNotificationAnchorMethodNotSupportedErrorProperties {\n\tchannelType?: NotificationChannelType | undefined;\n\tsubscriptionType?: NotificationSubscriptionType | undefined;\n}\n\ntype KeetaNotificationAnchorMethodNotSupportedErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaNotificationAnchorMethodNotSupportedErrorProperties;\n\nclass KeetaNotificationAnchorMethodNotSupportedError extends KeetaAnchorUserError implements KeetaNotificationAnchorMethodNotSupportedErrorProperties {\n\tstatic override readonly name: string = 'KeetaNotificationAnchorMethodNotSupportedError';\n\tprivate readonly KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID!: string;\n\tprivate static readonly KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID = '95268e45-2305-4a75-92af-417feb57fdd6';\n\toverride readonly logLevel = 'INFO';\n\treadonly channelType?: NotificationChannelType | undefined;\n\treadonly subscriptionType?: NotificationSubscriptionType | undefined;\n\n\tconstructor(properties: KeetaNotificationAnchorMethodNotSupportedErrorProperties, message?: string) {\n\t\tsuper(message ?? `Request failed: ${properties.channelType ? `channel type ${properties.channelType}` : `subscription type ${properties.subscriptionType}`} not supported`);\n\t\tthis.statusCode = 400;\n\n\t\tObject.defineProperty(this, 'KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID', {\n\t\t\tvalue: KeetaNotificationAnchorMethodNotSupportedError.KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\n\t\tthis.channelType = properties.channelType;\n\t\tthis.subscriptionType = properties.subscriptionType;\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaNotificationAnchorMethodNotSupportedError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID', KeetaNotificationAnchorMethodNotSupportedError.KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID));\n\t}\n\n\ttoJSON(): KeetaNotificationAnchorMethodNotSupportedErrorJSON {\n\t\treturn({\n\t\t\t...super.toJSON(),\n\t\t\tchannelType: this.channelType,\n\t\t\tsubscriptionType: this.subscriptionType\n\t\t});\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<KeetaNotificationAnchorMethodNotSupportedError> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\n\t\tlet subscriptionType: NotificationSubscriptionType | undefined;\n\t\tif ('intent' in other && other.intent !== undefined) {\n\t\t\tsubscriptionType = assertNotificationSubscriptionType(other.subscriptionType);\n\t\t}\n\n\t\tlet channelType: NotificationChannelType | undefined;\n\t\tif ('channelType' in other && other.channelType !== undefined) {\n\t\t\tchannelType = assertNotificationChannelType(other.channelType);\n\t\t}\n\n\t\tconst error = new this({ subscriptionType, channelType }, message);\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\nexport const Errors: {\n\tMethodNotSupported: typeof KeetaNotificationAnchorMethodNotSupportedError;\n} = {\n\tMethodNotSupported: KeetaNotificationAnchorMethodNotSupportedError\n};\n"]}
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/services/notification/common.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,kCAAkC,EAAE,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,cAAc,uBAAuB,CAAC;AA6DtC,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAoBrE,MAAM,UAAU,4CAA4C,CAAC,OAA4E;IACxI,MAAM,KAAK,GAAa;QACvB,qBAAqB;QACrB,iBAAiB;QACjB,OAAO,CAAC,OAAO,CAAC,IAAI;KACpB,CAAC;IAEF,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;SAAM,CAAC;QACP,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,OAAM,CAAC,KAAK,CAAC,CAAC;AACf,CAAC;AAkBD,MAAM,UAAU,yCAAyC,CAAC,eAAiE;IAC1H,OAAM,CAAC;QACN,qBAAqB;QACrB,cAAc;KACd,CAAC,CAAC;AACJ,CAAC;AAsBD,MAAM,UAAU,0CAA0C,CAAC,OAAqE;IAC/H,OAAM,CAAC;QACN,qBAAqB;QACrB,eAAe;QACf,OAAO,CAAC,EAAE;KACV,CAAC,CAAC;AACJ,CAAC;AAuBD,MAAM,UAAU,gDAAgD,CAAC,OAAqF;IACrJ,MAAM,KAAK,GAAa;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AK,CAAC,WAAW,CAAC,CAAC;QAChE,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,EAAE,gBAAgB,EAAE,WAAW,EAAE,EAAE,OAAO,CAAC,CAAC;QACnE,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAM,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;;AAGF,MAAM,CAAC,MAAM,MAAM,GAEf;IACH,kBAAkB,EAAE,8CAA8C;CAClE,CAAC","sourcesContent":["import type { ToJSONSerializable } from '../../lib/utils/json.js';\nimport type { HTTPSignedField } from '../../lib/http-server/common.js';\nimport type { Signable } from '../../lib/utils/signing.js';\nimport type { Account, GenericAccount } from '@keetanetwork/keetanet-client/lib/account.js';\nimport { assertNever } from '../../lib/utils/never.js';\nimport { KeetaAnchorUserError } from '../../lib/error.js';\nimport { assertNotificationChannelType, assertNotificationSubscriptionType } from './common.generated.js';\nimport { KeetaNet } from '../../client/index.js';\nexport * from './common.generated.js';\n\ninterface BaseNotificationChannelArguments<T extends string> {\n\ttype: T;\n}\n\ninterface FCMNotificationChannelArguments extends BaseNotificationChannelArguments<'FCM'> {\n\tappId: string;\n\tfcmToken: string;\n}\n\nexport type NotificationChannelArguments = FCMNotificationChannelArguments;\n\nexport type NotificationChannelType = NotificationChannelArguments['type'];\n\ninterface NotificationChannelServiceMetadata {\n\tFCM: {\n\t\tprojectId: string;\n\t\tmessagingSenderId: string;\n\t\tappId: string;\n\t\tapiKey: string;\n\t\tvapidKey?: string;\n\t\tbundleId?: string;\n\t}\n}\n\ninterface BaseNotificationSubscriptionArguments<T extends string> {\n\ttype: T;\n\n\t// The preferred locale to receive notifications in, if supported by the channel and provider\n\tlocale?: Intl.Locale;\n\n\ttarget: {\n\t\tprovider?: string | undefined;\n\n\t\tids: string[];\n\t}\n}\n\ninterface ReceiveFundsNotificationSubscriptionArguments extends BaseNotificationSubscriptionArguments<'RECEIVE_FUNDS'> {\n\t// Address to listen to incoming transactions for, if omitted will use the requestors address\n\ttoAddress?: GenericAccount;\n}\n\nexport type NotificationSubscriptionArguments = ReceiveFundsNotificationSubscriptionArguments;\nexport type NotificationSubscriptionArgumentsJSON = ToJSONSerializable<Omit<NotificationSubscriptionArguments, 'locale'>> & {\n\tlocale?: string | undefined;\n};\nexport type NotificationSubscriptionType = NotificationSubscriptionArguments['type'];\n\nexport type SupportedChannelConfigurationMetadata = {\n\tFCM: NotificationChannelServiceMetadata['FCM'][];\n}\n\n// API types\n\nexport interface NotificationTargetWithIDResponse {\n\tid: string;\n\tchannel: NotificationChannelArguments;\n}\n\nconst notificationNamespace = '75ed4792-333f-4a50-832f-b9fcc5663d1f';\n\nexport interface KeetaNotificationAnchorRegisterTargetClientRequest {\n\taccount?: Account;\n\tchannel: NotificationChannelArguments;\n}\nexport interface KeetaNotificationAnchorRegisterTargetRequest extends KeetaNotificationAnchorRegisterTargetClientRequest {\n\taccount: Account;\n\tsigned: HTTPSignedField;\n}\nexport type KeetaNotificationAnchorRegisterTargetRequestJSON = ToJSONSerializable<KeetaNotificationAnchorRegisterTargetRequest>;\n\nexport type KeetaNotificationAnchorRegisterTargetResponseJSON = ({\n\tok: true;\n\tid: string;\n}) | ({\n\tok: false;\n\terror: string;\n});\n\nexport function getNotificationRegisterTargetRequestSignable(request: Pick<KeetaNotificationAnchorRegisterTargetClientRequest, 'channel'>): Signable {\n\tconst parts: Signable = [\n\t\tnotificationNamespace,\n\t\t'REGISTER_TARGET',\n\t\trequest.channel.type\n\t];\n\n\tif (request.channel.type === 'FCM') {\n\t\tparts.push(request.channel.fcmToken, request.channel.appId);\n\t} else {\n\t\tassertNever(request.channel.type);\n\t}\n\n\treturn(parts);\n}\n\nexport interface KeetaNotificationAnchorListTargetsClientRequest { account?: Account; }\ninterface KeetaNotificationAnchorListTargetsRequest extends KeetaNotificationAnchorListTargetsClientRequest {\n\taccount: Account;\n\tsigned: HTTPSignedField;\n}\nexport type KeetaNotificationAnchorListTargetsRequestJSON = ToJSONSerializable<KeetaNotificationAnchorListTargetsRequest>;\n\nexport type KeetaNotificationAnchorListTargetsResponse = ({\n\tok: true;\n\ttargets: NotificationTargetWithIDResponse[];\n}) | ({\n\tok: false;\n\terror: string;\n});\nexport type KeetaNotificationAnchorListTargetsResponseJSON = ToJSONSerializable<KeetaNotificationAnchorListTargetsResponse>;\n\nexport function getNotificationListTargetsRequestSignable(_ignore_request?: KeetaNotificationAnchorListTargetsClientRequest): Signable {\n\treturn([\n\t\tnotificationNamespace,\n\t\t'LIST_TARGETS'\n\t]);\n}\n\n\nexport interface KeetaNotificationAnchorDeleteTargetClientRequest {\n\taccount?: Account;\n\tid: string;\n}\nexport interface KeetaNotificationAnchorDeleteTargetRequest extends KeetaNotificationAnchorDeleteTargetClientRequest {\n\taccount: Account;\n\tsigned: HTTPSignedField;\n}\nexport type KeetaNotificationAnchorDeleteTargetRequestJSON = ToJSONSerializable<KeetaNotificationAnchorDeleteTargetRequest>;\n\nexport type KeetaNotificationAnchorDeleteTargetResponse = ({\n\tok: true;\n}) | ({\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaNotificationAnchorDeleteTargetResponseJSON = ToJSONSerializable<KeetaNotificationAnchorDeleteTargetResponse>;\n\nexport function getNotificationDeleteTargetRequestSignable(request: Pick<KeetaNotificationAnchorDeleteTargetClientRequest, 'id'>): Signable {\n\treturn([\n\t\tnotificationNamespace,\n\t\t'DELETE_TARGET',\n\t\trequest.id\n\t]);\n}\n\nexport interface KeetaNotificationAnchorCreateSubscriptionClientRequest {\n\taccount?: Account;\n\tsubscription: NotificationSubscriptionArguments;\n}\n\nexport type KeetaNotificationAnchorCreateSubscriptionRequestJSON = {\n\tsubscription: NotificationSubscriptionArgumentsJSON;\n\taccount: string;\n\tsigned: HTTPSignedField;\n}\n\nexport type KeetaNotificationAnchorCreateSubscriptionResponse = ({\n\tok: true;\n\tid: string;\n}) | ({\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaNotificationAnchorCreateSubscriptionResponseJSON = ToJSONSerializable<KeetaNotificationAnchorCreateSubscriptionResponse>;\n\nexport function getNotificationCreateSubscriptionRequestSignable(request: Pick<KeetaNotificationAnchorCreateSubscriptionClientRequest, 'subscription'>): Signable {\n\tconst parts: Signable = [\n\t\tnotificationNamespace,\n\t\t'CREATE_SUBSCRIPTION',\n\t\trequest.subscription.type\n\t];\n\n\tparts.push(request.subscription.locale?.toString() ?? 'NO_LOCALE');\n\n\tif (request.subscription.type === 'RECEIVE_FUNDS') {\n\t\tparts.push(request.subscription.toAddress ?? 'NO_ADDRESS');\n\t} else {\n\t\tassertNever(request.subscription.type);\n\t}\n\n\tparts.push(request.subscription.target.provider ?? 'NO_PROVIDER');\n\n\tparts.push('BEGIN_TARGETS');\n\tfor (const target of request.subscription.target.ids) {\n\t\tparts.push(target);\n\t}\n\tparts.push('END_TARGETS');\n\n\treturn(parts);\n}\n\nexport interface KeetaNotificationAnchorDeleteSubscriptionClientRequest {\n\taccount?: Account;\n\tid: string;\n}\nexport interface KeetaNotificationAnchorDeleteSubscriptionRequest extends KeetaNotificationAnchorDeleteSubscriptionClientRequest {\n\taccount: Account;\n\tsigned: HTTPSignedField;\n}\nexport type KeetaNotificationAnchorDeleteSubscriptionRequestJSON = ToJSONSerializable<KeetaNotificationAnchorDeleteSubscriptionRequest>;\n\nexport type KeetaNotificationAnchorDeleteSubscriptionResponse = ({\n\tok: true;\n}) | ({\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaNotificationAnchorDeleteSubscriptionResponseJSON = ToJSONSerializable<KeetaNotificationAnchorDeleteSubscriptionResponse>;\n\nexport function getNotificationDeleteSubscriptionRequestSignable(request: Pick<KeetaNotificationAnchorDeleteSubscriptionClientRequest, 'id'>): Signable {\n\treturn([\n\t\tnotificationNamespace,\n\t\t'DELETE_SUBSCRIPTION',\n\t\trequest.id\n\t]);\n}\n\nexport interface SubscriptionDetails {\n\tid: string;\n\tsubscription: NotificationSubscriptionArguments;\n}\n\nexport type SubscriptionDetailsJSON = ToJSONSerializable<Omit<SubscriptionDetails, 'subscription'>> & {\n\tsubscription: NotificationSubscriptionArgumentsJSON;\n}\n\nexport function parseSubscriptionDetailsWithID(input: SubscriptionDetailsJSON | SubscriptionDetails): SubscriptionDetails {\n\tlet subscription: NotificationSubscriptionArguments;\n\tif (input.subscription.type === 'RECEIVE_FUNDS') {\n\t\tlet locale;\n\t\tif (input.subscription.locale) {\n\t\t\tif (typeof input.subscription.locale === 'string') {\n\t\t\t\tlocale = new Intl.Locale(input.subscription.locale);\n\t\t\t} else {\n\t\t\t\tlocale = input.subscription.locale;\n\t\t\t}\n\t\t}\n\n\t\tsubscription = {\n\t\t\ttype: 'RECEIVE_FUNDS',\n\t\t\ttarget: input.subscription.target,\n\t\t\t...(locale ? { locale } : {}),\n\t\t\t...(input.subscription.toAddress\n\t\t\t\t? { toAddress: KeetaNet.lib.Account.toAccount(input.subscription.toAddress) }\n\t\t\t\t: {})\n\t\t};\n\t} else {\n\t\tassertNever(input.subscription.type);\n\t}\n\n\treturn({ id: input.id, subscription });\n}\n\nexport interface KeetaNotificationAnchorListSubscriptionsClientRequest { account?: Account; }\ninterface KeetaNotificationAnchorListSubscriptionsRequest extends KeetaNotificationAnchorListSubscriptionsClientRequest {\n\taccount: Account;\n\tsigned: HTTPSignedField;\n}\nexport type KeetaNotificationAnchorListSubscriptionsRequestJSON = ToJSONSerializable<KeetaNotificationAnchorListSubscriptionsRequest>;\n\nexport type KeetaNotificationAnchorListSubscriptionsResponse = ({\n\tok: true;\n\tsubscriptions: SubscriptionDetailsJSON[];\n}) | ({\n\tok: false;\n\terror: string;\n});\n\nexport type KeetaNotificationAnchorListSubscriptionsResponseJSON = ToJSONSerializable<KeetaNotificationAnchorListSubscriptionsResponse>;\n\nexport function getNotificationListSubscriptionsRequestSignable(_ignore_request?: KeetaNotificationAnchorListSubscriptionsClientRequest): Signable {\n\treturn([\n\t\tnotificationNamespace,\n\t\t'LIST_SUBSCRIPTIONS'\n\t]);\n}\n\ninterface KeetaNotificationAnchorMethodNotSupportedErrorProperties {\n\tchannelType?: NotificationChannelType | undefined;\n\tsubscriptionType?: NotificationSubscriptionType | undefined;\n}\n\ntype KeetaNotificationAnchorMethodNotSupportedErrorJSON = ReturnType<KeetaAnchorUserError['toJSON']> & KeetaNotificationAnchorMethodNotSupportedErrorProperties;\n\nclass KeetaNotificationAnchorMethodNotSupportedError extends KeetaAnchorUserError implements KeetaNotificationAnchorMethodNotSupportedErrorProperties {\n\tstatic override readonly name: string = 'KeetaNotificationAnchorMethodNotSupportedError';\n\tprivate readonly KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID!: string;\n\tprivate static readonly KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID = '95268e45-2305-4a75-92af-417feb57fdd6';\n\toverride readonly logLevel = 'INFO';\n\treadonly channelType?: NotificationChannelType | undefined;\n\treadonly subscriptionType?: NotificationSubscriptionType | undefined;\n\n\tconstructor(properties: KeetaNotificationAnchorMethodNotSupportedErrorProperties, message?: string) {\n\t\tsuper(message ?? `Request failed: ${properties.channelType ? `channel type ${properties.channelType}` : `subscription type ${properties.subscriptionType}`} not supported`);\n\t\tthis.statusCode = 400;\n\n\t\tObject.defineProperty(this, 'KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID', {\n\t\t\tvalue: KeetaNotificationAnchorMethodNotSupportedError.KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID,\n\t\t\tenumerable: false\n\t\t});\n\n\t\tthis.channelType = properties.channelType;\n\t\tthis.subscriptionType = properties.subscriptionType;\n\t}\n\n\tstatic isInstance(input: unknown): input is KeetaNotificationAnchorMethodNotSupportedError {\n\t\treturn(this.hasPropWithValue(input, 'KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID', KeetaNotificationAnchorMethodNotSupportedError.KeetaNotificationAnchorMethodNotSupportedErrorObjectTypeID));\n\t}\n\n\ttoJSON(): KeetaNotificationAnchorMethodNotSupportedErrorJSON {\n\t\treturn({\n\t\t\t...super.toJSON(),\n\t\t\tchannelType: this.channelType,\n\t\t\tsubscriptionType: this.subscriptionType\n\t\t});\n\t}\n\n\tstatic async fromJSON(input: unknown): Promise<KeetaNotificationAnchorMethodNotSupportedError> {\n\t\tconst { message, other } = this.extractErrorProperties(input, this);\n\n\t\tlet subscriptionType: NotificationSubscriptionType | undefined;\n\t\tif ('intent' in other && other.intent !== undefined) {\n\t\t\tsubscriptionType = assertNotificationSubscriptionType(other.subscriptionType);\n\t\t}\n\n\t\tlet channelType: NotificationChannelType | undefined;\n\t\tif ('channelType' in other && other.channelType !== undefined) {\n\t\t\tchannelType = assertNotificationChannelType(other.channelType);\n\t\t}\n\n\t\tconst error = new this({ subscriptionType, channelType }, message);\n\t\terror.restoreFromJSON(other);\n\t\treturn(error);\n\t}\n}\n\nexport const Errors: {\n\tMethodNotSupported: typeof KeetaNotificationAnchorMethodNotSupportedError;\n} = {\n\tMethodNotSupported: KeetaNotificationAnchorMethodNotSupportedError\n};\n"]}
|