@washingtonpost/subs-de-inputs 0.1.1 → 0.2.0-canary.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.
@@ -1,10 +1,5 @@
1
1
  import React from 'react';
2
2
  import { Attribute, AttributeValue } from '../../interfaces';
3
- import { SubsWindow } from '@washingtonpost/subs-sdk';
4
- declare global {
5
- interface Window extends SubsWindow {
6
- }
7
- }
8
3
  interface DESelectProps {
9
4
  source: string;
10
5
  fieldName: string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './interfaces/index';
2
+ export * from './interfaces/twpdeu';
2
3
  export * from './utils/hasRequiredPrivacyCookies';
3
4
  export * from './services/dataEnrichment';
4
5
  export * from './components/DESelect';
@@ -23,6 +23,10 @@ export declare type Attribute = {
23
23
  export declare const AttributesState: {
24
24
  readonly SUCCESS: "100";
25
25
  };
26
+ export declare const IngestType: {
27
+ readonly EXPLICIT: "explicit";
28
+ readonly IMPLICIT: "implicit";
29
+ };
26
30
  export declare const IngestResponseState: {
27
31
  readonly SUCCESS: "100";
28
32
  readonly SYSTEM_ERROR: "101";
@@ -31,4 +35,6 @@ export declare const IngestResponseState: {
31
35
  readonly INVALID_DATA: "104";
32
36
  readonly INVALID_ATTRIBUTE_DEFINITION: "105";
33
37
  readonly INVALID_META_DEFINITION: "106";
38
+ readonly UNAUTHENTICATED: "107";
39
+ readonly MISMATCHED_IDENTIFIER: "108";
34
40
  };
@@ -0,0 +1,11 @@
1
+ import { getAttributes, ingest } from '../services/dataEnrichment';
2
+ export declare type TWPDEU = {
3
+ getFieldConfigs: typeof getAttributes;
4
+ push: typeof ingest;
5
+ version?: string;
6
+ };
7
+ declare global {
8
+ interface Window {
9
+ __twpdeu?: TWPDEU;
10
+ }
11
+ }
@@ -1,3 +1,18 @@
1
- export declare const getAttributes: ({ fieldName }: {
1
+ import { ResponseStatus } from '@washingtonpost/subs-sdk';
2
+ import { Attribute, IngestResponseState, IngestType } from '../interfaces';
3
+ export declare const getAttributes: GetAttributesType;
4
+ declare type GetAttributesType = ({ fieldName, }: {
2
5
  fieldName: string;
3
- }) => Promise<any>;
6
+ }) => Promise<Attribute[]>;
7
+ export declare const ingest: IngestType;
8
+ declare type IngestType = ({ submitData: { fieldName, value }, source, }: {
9
+ submitData: {
10
+ fieldName: string;
11
+ value: string;
12
+ };
13
+ source: string;
14
+ }) => Promise<{
15
+ status: ResponseStatus;
16
+ state: (typeof IngestResponseState)[keyof typeof IngestResponseState];
17
+ } | null>;
18
+ export {};