@shipfox/api-integration-slack-dto 4.0.0 → 6.0.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.
@@ -1,2 +1,2 @@
1
1
  $ shipfox-swc
2
- Successfully compiled: 2 files with swc (143.04ms)
2
+ Successfully compiled: 2 files with swc (264.94ms)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @shipfox/api-integration-slack-dto
2
2
 
3
+ ## 6.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [0bb82a4]
8
+ - Updated dependencies [f262539]
9
+ - Updated dependencies [3bb4e26]
10
+ - Updated dependencies [4604a06]
11
+ - @shipfox/api-integration-core-dto@6.0.0
12
+
13
+ ## 5.0.0
14
+
15
+ ### Minor Changes
16
+
17
+ - 2875241: Adds deduplicated Slack installation revocation for app uninstall and bot token-revocation events.
18
+
19
+ ### Patch Changes
20
+
21
+ - bb037af: Resolves workspace packages from source during development while published consumers continue to use compiled output.
22
+ - Updated dependencies [2875241]
23
+ - Updated dependencies [bb037af]
24
+ - Updated dependencies [fb70438]
25
+ - @shipfox/api-integration-core-dto@5.0.0
26
+
3
27
  ## 4.0.0
4
28
 
5
29
  ### Patch Changes
@@ -3,8 +3,12 @@ export declare const SLACK_PROVIDER = "slack";
3
3
  export type SlackProvider = typeof SLACK_PROVIDER;
4
4
  export declare const slackApiEventTypes: readonly ["app_mention", "message", "reaction_added"];
5
5
  export declare const SLACK_SLASH_COMMAND_EVENT: "slash_command";
6
+ export declare const SLACK_APP_UNINSTALLED_EVENT: "app_uninstalled";
7
+ export declare const SLACK_TOKENS_REVOKED_EVENT: "tokens_revoked";
8
+ export declare const slackLifecycleEventTypes: readonly ["app_uninstalled", "tokens_revoked"];
6
9
  export declare const slackEventNames: readonly ["app_mention", "message", "reaction_added", "slash_command"];
7
10
  export type SlackApiEventType = (typeof slackApiEventTypes)[number];
11
+ export type SlackLifecycleEventType = (typeof slackLifecycleEventTypes)[number];
8
12
  export type SlackEventName = (typeof slackEventNames)[number];
9
13
  export declare const slackInnerEventBaseSchema: z.ZodObject<{
10
14
  type: z.ZodString;
@@ -16,6 +20,14 @@ export declare const slackInnerEventSchema: z.ZodObject<{
16
20
  reaction_added: "reaction_added";
17
21
  }>;
18
22
  }, z.core.$loose>;
23
+ export declare const slackTokensRevokedEventSchema: z.ZodObject<{
24
+ type: z.ZodLiteral<"tokens_revoked">;
25
+ tokens: z.ZodOptional<z.ZodObject<{
26
+ oauth: z.ZodOptional<z.ZodArray<z.ZodString>>;
27
+ bot: z.ZodOptional<z.ZodArray<z.ZodString>>;
28
+ }, z.core.$strip>>;
29
+ }, z.core.$loose>;
30
+ export type SlackTokensRevokedEventDto = z.infer<typeof slackTokensRevokedEventSchema>;
19
31
  export declare const slackEventBaseEnvelopeSchema: z.ZodObject<{
20
32
  type: z.ZodLiteral<"event_callback">;
21
33
  team_id: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,cAAc,UAAU,CAAC;AACtC,MAAM,MAAM,aAAa,GAAG,OAAO,cAAc,CAAC;AAElD,eAAO,MAAM,kBAAkB,uDAAwD,CAAC;AACxF,eAAO,MAAM,yBAAyB,EAAG,eAAwB,CAAC;AAClE,eAAO,MAAM,eAAe,wEAA8D,CAAC;AAE3F,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AACpE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,eAAO,MAAM,yBAAyB;;iBAItB,CAAC;AAEjB,eAAO,MAAM,qBAAqB;;;;;;iBAIlB,CAAC;AAEjB,eAAO,MAAM,4BAA4B;;;;;;;;;;iBAQvC,CAAC;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BAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAErF,eAAO,MAAM,gCAAgC;;iBAE3C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE7F,eAAO,MAAM,wBAAwB;;;;;;;mBAUnC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE7E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;iBAAiC,CAAC;AAC1E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEnF,eAAO,MAAM,kCAAkC;;;;;;;;iBAQ7C,CAAC;AACH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAEjG,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;iBAAiC,CAAC;AACrF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,sCAAsC,CAC9C,CAAC"}
@@ -7,6 +7,12 @@ export const slackApiEventTypes = [
7
7
  'reaction_added'
8
8
  ];
9
9
  export const SLACK_SLASH_COMMAND_EVENT = 'slash_command';
10
+ export const SLACK_APP_UNINSTALLED_EVENT = 'app_uninstalled';
11
+ export const SLACK_TOKENS_REVOKED_EVENT = 'tokens_revoked';
12
+ export const slackLifecycleEventTypes = [
13
+ SLACK_APP_UNINSTALLED_EVENT,
14
+ SLACK_TOKENS_REVOKED_EVENT
15
+ ];
10
16
  export const slackEventNames = [
11
17
  ...slackApiEventTypes,
12
18
  SLACK_SLASH_COMMAND_EVENT
@@ -17,6 +23,13 @@ export const slackInnerEventBaseSchema = z.object({
17
23
  export const slackInnerEventSchema = z.object({
18
24
  type: z.enum(slackApiEventTypes)
19
25
  }).passthrough();
26
+ export const slackTokensRevokedEventSchema = z.object({
27
+ type: z.literal(SLACK_TOKENS_REVOKED_EVENT),
28
+ tokens: z.object({
29
+ oauth: z.array(z.string()).optional(),
30
+ bot: z.array(z.string()).optional()
31
+ }).optional()
32
+ }).passthrough();
20
33
  export const slackEventBaseEnvelopeSchema = z.object({
21
34
  type: z.literal('event_callback'),
22
35
  team_id: z.string().min(1),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/schemas/index.ts"],"sourcesContent":["import {integrationConnectionDtoSchema} from '@shipfox/api-integration-core-dto';\nimport {z} from 'zod';\n\nexport const SLACK_PROVIDER = 'slack';\nexport type SlackProvider = typeof SLACK_PROVIDER;\n\nexport const slackApiEventTypes = ['app_mention', 'message', 'reaction_added'] as const;\nexport const SLACK_SLASH_COMMAND_EVENT = 'slash_command' as const;\nexport const slackEventNames = [...slackApiEventTypes, SLACK_SLASH_COMMAND_EVENT] as const;\n\nexport type SlackApiEventType = (typeof slackApiEventTypes)[number];\nexport type SlackEventName = (typeof slackEventNames)[number];\n\nexport const slackInnerEventBaseSchema = z\n .object({\n type: z.string().min(1),\n })\n .passthrough();\n\nexport const slackInnerEventSchema = z\n .object({\n type: z.enum(slackApiEventTypes),\n })\n .passthrough();\n\nexport const slackEventBaseEnvelopeSchema = z.object({\n type: z.literal('event_callback'),\n team_id: z.string().min(1),\n api_app_id: z.string().min(1),\n event: slackInnerEventBaseSchema,\n event_id: z.string().min(1),\n event_time: z.number().int(),\n authorizations: z.array(z.unknown()).optional(),\n});\nexport type SlackEventBaseEnvelopeDto = z.infer<typeof slackEventBaseEnvelopeSchema>;\n\nexport const slackEventEnvelopeSchema = slackEventBaseEnvelopeSchema.extend({\n event: slackInnerEventSchema,\n});\nexport type SlackEventEnvelopeDto = z.infer<typeof slackEventEnvelopeSchema>;\n\nexport const slackUrlVerificationSchema = z.object({\n type: z.literal('url_verification'),\n token: z.string().min(1),\n challenge: z.string().min(1),\n});\nexport type SlackUrlVerificationDto = z.infer<typeof slackUrlVerificationSchema>;\n\nexport const slackEventsRequestSchema = z.discriminatedUnion('type', [\n slackUrlVerificationSchema,\n slackEventBaseEnvelopeSchema,\n]);\nexport type SlackEventsRequestDto = z.infer<typeof slackEventsRequestSchema>;\n\nexport const slackSlashCommandSchema = z.object({\n token: z.string().min(1),\n command: z.string().min(1),\n team_id: z.string().min(1),\n channel_id: z.string().min(1),\n user_id: z.string().min(1),\n response_url: z.string().url(),\n trigger_id: z.string().min(1),\n text: z.string().default(''),\n team_domain: z.string().min(1).optional(),\n channel_name: z.string().min(1).optional(),\n user_name: z.string().min(1).optional(),\n api_app_id: z.string().min(1).optional(),\n is_enterprise_install: z.string().min(1).optional(),\n enterprise_id: z.string().min(1).optional(),\n enterprise_name: z.string().min(1).optional(),\n});\nexport type SlackSlashCommandDto = z.infer<typeof slackSlashCommandSchema>;\n\nexport const slackSlashCommandPayloadSchema = slackSlashCommandSchema.omit({token: true});\nexport type SlackSlashCommandPayloadDto = z.infer<typeof slackSlashCommandPayloadSchema>;\n\nexport const slackEventPayloadSchema = z\n .object({\n type: z.enum(slackApiEventTypes),\n team_id: z.string().min(1),\n api_app_id: z.string().min(1),\n event_id: z.string().min(1),\n event_time: z.number().int(),\n channel: z.string().min(1).optional(),\n channel_type: z.string().min(1).optional(),\n user: z.string().min(1).optional(),\n ts: z.string().min(1).optional(),\n thread_ts: z.string().min(1).optional(),\n text: z.string().optional(),\n bot_id: z.string().min(1).optional(),\n reaction: z.string().min(1).optional(),\n })\n .passthrough();\nexport type SlackEventPayloadDto = z.infer<typeof slackEventPayloadSchema>;\n\nexport const createSlackInstallBodySchema = z.object({\n workspace_id: z.string().uuid(),\n});\nexport type CreateSlackInstallBodyDto = z.infer<typeof createSlackInstallBodySchema>;\n\nexport const createSlackInstallResponseSchema = z.object({\n install_url: z.string().url(),\n});\nexport type CreateSlackInstallResponseDto = z.infer<typeof createSlackInstallResponseSchema>;\n\nexport const slackCallbackQuerySchema = z.union([\n z.object({\n code: z.string().min(1),\n state: z.string().min(1),\n }),\n z.object({\n error: z.string().min(1),\n error_description: z.string().min(1).optional(),\n state: z.string().min(1),\n }),\n]);\nexport type SlackCallbackQueryDto = z.infer<typeof slackCallbackQuerySchema>;\n\nexport const slackCallbackResponseSchema = integrationConnectionDtoSchema;\nexport type SlackCallbackResponseDto = z.infer<typeof slackCallbackResponseSchema>;\n\nexport const createE2eSlackConnectionBodySchema = z.object({\n workspace_id: z.string().uuid(),\n team_id: z.string().min(1),\n team_name: z.string().min(1),\n app_id: z.string().min(1),\n bot_user_id: z.string().min(1),\n bot_token: z.string().min(1),\n scopes: z.array(z.string().min(1)).min(1).default(['app_mentions:read', 'chat:write']),\n});\nexport type CreateE2eSlackConnectionBodyDto = z.infer<typeof createE2eSlackConnectionBodySchema>;\n\nexport const createE2eSlackConnectionResponseSchema = integrationConnectionDtoSchema;\nexport type CreateE2eSlackConnectionResponseDto = z.infer<\n typeof createE2eSlackConnectionResponseSchema\n>;\n"],"names":["integrationConnectionDtoSchema","z","SLACK_PROVIDER","slackApiEventTypes","SLACK_SLASH_COMMAND_EVENT","slackEventNames","slackInnerEventBaseSchema","object","type","string","min","passthrough","slackInnerEventSchema","enum","slackEventBaseEnvelopeSchema","literal","team_id","api_app_id","event","event_id","event_time","number","int","authorizations","array","unknown","optional","slackEventEnvelopeSchema","extend","slackUrlVerificationSchema","token","challenge","slackEventsRequestSchema","discriminatedUnion","slackSlashCommandSchema","command","channel_id","user_id","response_url","url","trigger_id","text","default","team_domain","channel_name","user_name","is_enterprise_install","enterprise_id","enterprise_name","slackSlashCommandPayloadSchema","omit","slackEventPayloadSchema","channel","channel_type","user","ts","thread_ts","bot_id","reaction","createSlackInstallBodySchema","workspace_id","uuid","createSlackInstallResponseSchema","install_url","slackCallbackQuerySchema","union","code","state","error","error_description","slackCallbackResponseSchema","createE2eSlackConnectionBodySchema","team_name","app_id","bot_user_id","bot_token","scopes","createE2eSlackConnectionResponseSchema"],"mappings":"AAAA,SAAQA,8BAA8B,Q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M,MAAM,CAAC;IACzDqD,cAAc3D,EAAEQ,MAAM,GAAGoD,IAAI;IAC7B7C,SAASf,EAAEQ,MAAM,GAAGC,GAAG,CAAC;IACxB8D,WAAWvE,EAAEQ,MAAM,GAAGC,GAAG,CAAC;IAC1B+D,QAAQxE,EAAEQ,MAAM,GAAGC,GAAG,CAAC;IACvBgE,aAAazE,EAAEQ,MAAM,GAAGC,GAAG,CAAC;IAC5BiE,WAAW1E,EAAEQ,MAAM,GAAGC,GAAG,CAAC;IAC1BkE,QAAQ3E,EAAEuB,KAAK,CAACvB,EAAEQ,MAAM,GAAGC,GAAG,CAAC,IAAIA,GAAG,CAAC,GAAGgC,OAAO,CAAC;QAAC;QAAqB;KAAa;AACvF,GAAG;AAGH,OAAO,MAAMmC,yCAAyC7E,+BAA+B"}
1
+ {"version":3,"sources":["../../src/schemas/index.ts"],"sourcesContent":["import {integrationConnectionDtoSchema} from '@shipfox/api-integration-core-dto';\nimport {z} from 'zod';\n\nexport const SLACK_PROVIDER = 'slack';\nexport type SlackProvider = typeof SLACK_PROVIDER;\n\nexport const slackApiEventTypes = ['app_mention', 'message', 'reaction_added'] as const;\nexport const SLACK_SLASH_COMMAND_EVENT = 'slash_command' as const;\nexport const SLACK_APP_UNINSTALLED_EVENT = 'app_uninstalled' as const;\nexport const SLACK_TOKENS_REVOKED_EVENT = 'tokens_revoked' as const;\nexport const slackLifecycleEventTypes = [\n SLACK_APP_UNINSTALLED_EVENT,\n SLACK_TOKENS_REVOKED_EVENT,\n] as const;\nexport const slackEventNames = [...slackApiEventTypes, SLACK_SLASH_COMMAND_EVENT] as const;\n\nexport type SlackApiEventType = (typeof slackApiEventTypes)[number];\nexport type SlackLifecycleEventType = (typeof slackLifecycleEventTypes)[number];\nexport type SlackEventName = (typeof slackEventNames)[number];\n\nexport const slackInnerEventBaseSchema = z\n .object({\n type: z.string().min(1),\n })\n .passthrough();\n\nexport const slackInnerEventSchema = z\n .object({\n type: z.enum(slackApiEventTypes),\n })\n .passthrough();\n\nexport const slackTokensRevokedEventSchema = z\n .object({\n type: z.literal(SLACK_TOKENS_REVOKED_EVENT),\n tokens: z\n .object({\n oauth: z.array(z.string()).optional(),\n bot: z.array(z.string()).optional(),\n })\n .optional(),\n })\n .passthrough();\nexport type SlackTokensRevokedEventDto = z.infer<typeof slackTokensRevokedEventSchema>;\n\nexport const slackEventBaseEnvelopeSchema = z.object({\n type: z.literal('event_callback'),\n team_id: z.string().min(1),\n api_app_id: z.string().min(1),\n event: slackInnerEventBaseSchema,\n event_id: z.string().min(1),\n event_time: z.number().int(),\n authorizations: z.array(z.unknown()).optional(),\n});\nexport type SlackEventBaseEnvelopeDto = z.infer<typeof slackEventBaseEnvelopeSchema>;\n\nexport const slackEventEnvelopeSchema = slackEventBaseEnvelopeSchema.extend({\n event: slackInnerEventSchema,\n});\nexport type SlackEventEnvelopeDto = z.infer<typeof slackEventEnvelopeSchema>;\n\nexport const slackUrlVerificationSchema = z.object({\n type: z.literal('url_verification'),\n token: z.string().min(1),\n challenge: z.string().min(1),\n});\nexport type SlackUrlVerificationDto = z.infer<typeof slackUrlVerificationSchema>;\n\nexport const slackEventsRequestSchema = z.discriminatedUnion('type', [\n slackUrlVerificationSchema,\n slackEventBaseEnvelopeSchema,\n]);\nexport type SlackEventsRequestDto = z.infer<typeof slackEventsRequestSchema>;\n\nexport const slackSlashCommandSchema = z.object({\n token: z.string().min(1),\n command: z.string().min(1),\n team_id: z.string().min(1),\n channel_id: z.string().min(1),\n user_id: z.string().min(1),\n response_url: z.string().url(),\n trigger_id: z.string().min(1),\n text: z.string().default(''),\n team_domain: z.string().min(1).optional(),\n channel_name: z.string().min(1).optional(),\n user_name: z.string().min(1).optional(),\n api_app_id: z.string().min(1).optional(),\n is_enterprise_install: z.string().min(1).optional(),\n enterprise_id: z.string().min(1).optional(),\n enterprise_name: z.string().min(1).optional(),\n});\nexport type SlackSlashCommandDto = z.infer<typeof slackSlashCommandSchema>;\n\nexport const slackSlashCommandPayloadSchema = slackSlashCommandSchema.omit({token: true});\nexport type SlackSlashCommandPayloadDto = z.infer<typeof slackSlashCommandPayloadSchema>;\n\nexport const slackEventPayloadSchema = z\n .object({\n type: z.enum(slackApiEventTypes),\n team_id: z.string().min(1),\n api_app_id: z.string().min(1),\n event_id: z.string().min(1),\n event_time: z.number().int(),\n channel: z.string().min(1).optional(),\n channel_type: z.string().min(1).optional(),\n user: z.string().min(1).optional(),\n ts: z.string().min(1).optional(),\n thread_ts: z.string().min(1).optional(),\n text: z.string().optional(),\n bot_id: z.string().min(1).optional(),\n reaction: z.string().min(1).optional(),\n })\n .passthrough();\nexport type SlackEventPayloadDto = z.infer<typeof slackEventPayloadSchema>;\n\nexport const createSlackInstallBodySchema = z.object({\n workspace_id: z.string().uuid(),\n});\nexport type CreateSlackInstallBodyDto = z.infer<typeof createSlackInstallBodySchema>;\n\nexport const createSlackInstallResponseSchema = z.object({\n install_url: z.string().url(),\n});\nexport type CreateSlackInstallResponseDto = z.infer<typeof createSlackInstallResponseSchema>;\n\nexport const slackCallbackQuerySchema = z.union([\n z.object({\n code: z.string().min(1),\n state: z.string().min(1),\n }),\n z.object({\n error: z.string().min(1),\n error_description: z.string().min(1).optional(),\n state: z.string().min(1),\n }),\n]);\nexport type SlackCallbackQueryDto = z.infer<typeof slackCallbackQuerySchema>;\n\nexport const slackCallbackResponseSchema = integrationConnectionDtoSchema;\nexport type SlackCallbackResponseDto = z.infer<typeof slackCallbackResponseSchema>;\n\nexport const createE2eSlackConnectionBodySchema = z.object({\n workspace_id: z.string().uuid(),\n team_id: z.string().min(1),\n team_name: z.string().min(1),\n app_id: z.string().min(1),\n bot_user_id: z.string().min(1),\n bot_token: z.string().min(1),\n scopes: z.array(z.string().min(1)).min(1).default(['app_mentions:read', 'chat:write']),\n});\nexport type CreateE2eSlackConnectionBodyDto = z.infer<typeof createE2eSlackConnectionBodySchema>;\n\nexport const createE2eSlackConnectionResponseSchema = integrationConnectionDtoSchema;\nexport type CreateE2eSlackConnectionResponseDto = z.infer<\n typeof createE2eSlackConnectionResponseSchema\n>;\n"],"names":["integrationConnectionDtoSchema","z","SLACK_PROVIDER","slackApiEventTypes","SLACK_SLASH_COMMAND_EVENT","SLACK_APP_UNINSTALLED_EVENT","SLACK_TOKENS_REVOKED_EVENT","slackLifecycleEventTypes","slackEventNames","slackInnerEventBaseSchema","object","type","string","min","passthrough","slackInnerEventSchema","enum","slackTokensRevokedEventSchema","literal","tokens","oauth","array","optional","bot","slackEventBaseEnvelopeSchema","team_id","api_app_id","event","event_id","event_time","number","int","authorizations","unknown","slackEventEnvelopeSchema","extend","slackUrlVerificationSchema","token","challenge","slackEventsRequestSchema","discriminatedUnion","slackSlashCommandSchema","command","channel_id","user_id","response_url","url","trigger_id","text","default","team_domain","channel_name","user_name","is_enterprise_install","enterprise_id","enterprise_name","slackSlashCommandPayloadSchema","omit","slackEventPayloadSchema","channel","channel_type","user","ts","thread_ts","bot_id","reaction","createSlackInstallBodySchema","workspace_id","uuid","createSlackInstallResponseSchema","install_url","slackCallbackQuerySchema","union","code","state","error","error_description","slackCallbackResponseSchema","createE2eSlackConnectionBodySchema","team_name","app_id","bot_user_id","bot_token","scopes","createE2eSlackConnectionResponseSchema"],"mappings":"AAAA,SAAQA,8BAA8B,QAAO,oCAAoC;AACjF,SAAQC,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,iBAAiB,QAAQ;AAGtC,OAAO,MAAMC,qBAAqB;IAAC;IAAe;IAAW;CAAiB,CAAU;AACxF,OAAO,MAAMC,4BAA4B,gBAAyB;AAClE,OAAO,MAAMC,8BAA8B,kBAA2B;AACtE,OAAO,MAAMC,6BAA6B,iBAA0B;AACpE,OAAO,MAAMC,2BAA2B;IACtCF;IACAC;CACD,CAAU;AACX,OAAO,MAAME,kBAAkB;OAAIL;IAAoBC;CAA0B,CAAU;AAM3F,OAAO,MAAMK,4BAA4BR,EACtCS,MAAM,CAAC;IACNC,MAAMV,EAAEW,MAAM,GAAGC,GAAG,CAAC;AACvB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